|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echo.Component nextapp.echo.Container echopoint.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 FormNested 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 class nextapp.echo.Component |
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY |
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(nextapp.echo.Style style)
|
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()
|
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)
|
void |
validate()
|
Methods inherited from class nextapp.echo.Component |
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update |
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(nextapp.echo.Style style)
applyStyle
in interface MouseCursorable
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()
ToolTipPopUpSupport
ToolTipPopUp
component used to
configure the rich tool tip support.
getToolTipPopUp
in interface ToolTipPopUpSupport
ToolTipPopUpSupport.getToolTipPopUp()
public java.lang.String getToolTipText()
getToolTipText
in interface nextapp.echo.ToolTipSupport
ToolTipSupport.getToolTipText()
public void setToolTipText(java.lang.String newValue)
setToolTipText
in interface nextapp.echo.ToolTipSupport
ToolTipSupport.setToolTipText(java.lang.String)
public int getMouseCursor()
MouseCursorable
getMouseCursor
in interface MouseCursorable
MouseCursorable.getMouseCursor()
public java.lang.String getMouseCursorURI()
getMouseCursorURI
in interface MouseCursorable
MouseCursorable.getMouseCursorURI()
public void setMouseCursor(int mouseCursor)
MouseCursorable
setMouseCursor
in interface MouseCursorable
mouseCursor
- - the mouse cursor to useMouseCursorable.setMouseCursor(int)
public void setMouseCursorURI(java.lang.String mouseCursorURI)
MouseCursorable
setMouseCursorURI
in interface MouseCursorable
mouseCursorURI
- the URI to a custom platform mouse cursor.MouseCursorable.setMouseCursorURI(java.lang.String)
public void validate()
Component.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)
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |