|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnextapp.echo.AbstractComponent
nextapp.echo.Container
echopoint.EchoPointComponent
public abstract class EchoPointComponent
The EchoPointComponent class is a base class
used on many of the EchoPoint components. It provides base
functionality that is common to many of the components as
well as some common optional functionality that they may
use such as mouse cursor support.
It also provides the richer ToolTipPopUpSupport
to many EchoPoint components
ToolTipPopUpSupport,
ToolTipPopUp,
ToolTipSupport,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
EchoPointComponent.NestedStyleInfo
Nested public static StyleInfo class. |
| Field Summary | |
|---|---|
static java.lang.String |
STYLE_TOOL_TIP_TEXT
A style constant for the ToolTipText property. |
static java.lang.String |
TOOL_TIP_TEXT_CHANGED_PROPERTY
tool tip support for component |
protected ToolTipPopUp |
toolTipPopUp
The ToolTipPopUp used for ToolTipPopUpSupport |
| Fields inherited from interface echopoint.positionable.MouseCursorable |
|---|
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI |
| Constructor Summary | |
|---|---|
EchoPointComponent()
|
|
| Method Summary | |
|---|---|
void |
applyStyle(Style style)
Sets stylistic properties of this component based on a Style
object. |
int |
getMouseCursor()
Returns the current mouse cursor in use. |
java.lang.String |
getMouseCursorURI()
|
ToolTipPopUp |
getToolTipPopUp()
Returns the ToolTipPopUp component used to
configure the rich tool tip support. |
java.lang.String |
getToolTipText()
Returns the default tool tip text. |
static void |
set(java.lang.Object thisObject,
java.lang.String fieldName,
boolean newValue)
|
static void |
set(java.lang.Object thisObject,
java.lang.String fieldName,
byte newValue)
|
static void |
set(java.lang.Object thisObject,
java.lang.String fieldName,
char newValue)
|
static void |
set(java.lang.Object thisObject,
java.lang.String fieldName,
double newValue)
|
static void |
set(java.lang.Object thisObject,
java.lang.String fieldName,
float newValue)
|
static void |
set(java.lang.Object thisObject,
java.lang.String fieldName,
int newValue)
|
static void |
set(java.lang.Object thisObject,
java.lang.String fieldName,
long newValue)
|
static void |
set(java.lang.Object thisObject,
java.lang.String fieldName,
java.lang.Object newValue)
Sets a component property and fires the corresponding property change event of the same name. |
static void |
set(java.lang.Object thisObject,
java.lang.String fieldName,
short newValue)
|
protected void |
setEnabledAllChildren(boolean newValue)
This can be used to override the base Component behaviour
and makes all children of the Component enabled/disabled
as well. |
void |
setMouseCursor(int mouseCursor)
Sets the mouse cursor to use. |
void |
setMouseCursorURI(java.lang.String mouseCursorURI)
Sets the URI to a custom platform mouse cursor. |
void |
setToolTipText(java.lang.String newValue)
Sets the default tool tip text. |
void |
validate()
Validates this component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface echopoint.util.reflect.ReflectionSetter |
|---|
set |
| Field Detail |
|---|
public static final java.lang.String TOOL_TIP_TEXT_CHANGED_PROPERTY
public static final java.lang.String STYLE_TOOL_TIP_TEXT
String
protected ToolTipPopUp toolTipPopUp
| Constructor Detail |
|---|
public EchoPointComponent()
| Method Detail |
|---|
public void applyStyle(Style style)
ComponentStyle
object. The version of this method in Component will set
foreground and background colors and the font from the style if they are
present. Components should override this method if they allow more
properties to be set from a style object, and should call
super.applyStyle() if necessary.
applyStyle in interface MouseCursorableapplyStyle in interface ComponentapplyStyle in class AbstractComponentstyle - The style object from which to retrieve properties for this
Component.Component.applyStyle(nextapp.echo.Style)protected void setEnabledAllChildren(boolean newValue)
Component behaviour
and makes all children of the Component enabled/disabled
as well. It calls super.setEnabled(newValue) before
the children are changed.
Component.setEnabled(boolean)public ToolTipPopUp getToolTipPopUp()
ToolTipPopUpSupportToolTipPopUp component used to
configure the rich tool tip support.
getToolTipPopUp in interface ToolTipPopUpSupportToolTipPopUpSupport.getToolTipPopUp()public java.lang.String getToolTipText()
ToolTipSupport
getToolTipText in interface ToolTipSupportToolTipSupport.getToolTipText()public void setToolTipText(java.lang.String newValue)
ToolTipSupport
setToolTipText in interface ToolTipSupportnewValue - The new tool tip text.ToolTipSupport.setToolTipText(java.lang.String)public int getMouseCursor()
MouseCursorable
getMouseCursor in interface MouseCursorableMouseCursorable.getMouseCursor()public java.lang.String getMouseCursorURI()
getMouseCursorURI in interface MouseCursorableMouseCursorable.getMouseCursorURI()public void setMouseCursor(int mouseCursor)
MouseCursorable
setMouseCursor in interface MouseCursorablemouseCursor - - the mouse cursor to useMouseCursorable.setMouseCursor(int)public void setMouseCursorURI(java.lang.String mouseCursorURI)
MouseCursorable
setMouseCursorURI in interface MouseCursorablemouseCursorURI - the URI to a custom platform mouse cursor.MouseCursorable.setMouseCursorURI(java.lang.String)public void validate()
Componentvalidate() is not inadvisable.
validate in interface Componentvalidate in class AbstractComponentComponent.validate()
public static void set(java.lang.Object thisObject,
java.lang.String fieldName,
java.lang.Object newValue)
So you can now do this :
public void setThingy(String newValue) {
set(this,"thingy",newValue);
}
instead of the much longer :
public void setThingy(String newValue) {
String oldValue = this.thingy;
this.thingy = newValue;
firePropertyChange("thingy",oldValue,newValue);
}
This method will first attempt to get the declared Field named
fieldName. It will then attempt to call
field.setAccessible(true). If this throws a
SecurityException, it will then check to see
if thisObject implements ReflectionSetter. If so it will
use that interface to access and set the underlying field.
This if the object is a Component, it will called firePropertyChange() for the old and new values.
And because this method is public static, you can call it from any component, not just ones derived from EchoPointComponent, as follows :
public void setThingy(String newValue) { EchoPointComponent.set(this,"thingy",newValue); }
- Parameters:
thisObject- - the object to invoke the set onfieldName- - the name of the field to setnewValue- - the new value for the field- Throws:
java.lang.RuntimeException- if the field cannot be set. This would typically only occur if you try to set a field wqhere you get the name wrong.- See Also:
Class.getDeclaredField(java.lang.String),Field.get(java.lang.Object),Field.set(java.lang.Object, java.lang.Object),ReflectionSetter,Component.firePropertyChange(String, Object, Object)
public static void set(java.lang.Object thisObject,
java.lang.String fieldName,
int newValue)
set(Object, String, Object)
public static void set(java.lang.Object thisObject,
java.lang.String fieldName,
long newValue)
set(Object, String, Object)
public static void set(java.lang.Object thisObject,
java.lang.String fieldName,
short newValue)
set(Object, String, Object)
public static void set(java.lang.Object thisObject,
java.lang.String fieldName,
byte newValue)
set(Object, String, Object)
public static void set(java.lang.Object thisObject,
java.lang.String fieldName,
char newValue)
set(Object, String, Object)
public static void set(java.lang.Object thisObject,
java.lang.String fieldName,
boolean newValue)
set(Object, String, Object)
public static void set(java.lang.Object thisObject,
java.lang.String fieldName,
double newValue)
set(Object, String, Object)
public static void set(java.lang.Object thisObject,
java.lang.String fieldName,
float newValue)
set(Object, String, Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||