EchoPoint
1.0

echopoint
Class EchoPointComponent

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Container
          extended byechopoint.EchoPointComponent
All Implemented Interfaces:
MouseCursorable, ReflectionSetter, java.io.Serializable, ToolTipPopUpSupport, nextapp.echo.ToolTipSupport
Direct Known Subclasses:
AbstractMeterComponent, AbstractScrollableComponent, BoxSection, ChartPanel, ColorChooser, DatePicker, EmbeddedObject, ExpandableMenu, FontChooser, GroupBox, ImageIcon, ImageMap, JavaScriptInclude, ListSection, PickList, PopUp, ProgressBar, Separator, TabbedPane, TitleBar, Tree, WizardPane

public abstract class EchoPointComponent
extends nextapp.echo.Container
implements ToolTipPopUpSupport, ReflectionSetter, MouseCursorable

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

See Also:
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 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

TOOL_TIP_TEXT_CHANGED_PROPERTY

public static final java.lang.String TOOL_TIP_TEXT_CHANGED_PROPERTY
tool tip support for component

See Also:
Constant Field Values

STYLE_TOOL_TIP_TEXT

public static final java.lang.String STYLE_TOOL_TIP_TEXT
A style constant for the ToolTipText property. Values of this key must be of type String

See Also:
Constant Field Values

toolTipPopUp

protected ToolTipPopUp toolTipPopUp
The ToolTipPopUp used for ToolTipPopUpSupport

Constructor Detail

EchoPointComponent

public EchoPointComponent()
Method Detail

applyStyle

public void applyStyle(nextapp.echo.Style style)
Specified by:
applyStyle in interface MouseCursorable
See Also:
Component.applyStyle(nextapp.echo.Style)

setEnabledAllChildren

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. It calls super.setEnabled(newValue) before the children are changed.

See Also:
Component.setEnabled(boolean)

getToolTipPopUp

public ToolTipPopUp getToolTipPopUp()
Description copied from interface: ToolTipPopUpSupport
Returns the ToolTipPopUp component used to configure the rich tool tip support.

Specified by:
getToolTipPopUp in interface ToolTipPopUpSupport
Returns:
a ToolTipPopUp component
See Also:
ToolTipPopUpSupport.getToolTipPopUp()

getToolTipText

public java.lang.String getToolTipText()
Specified by:
getToolTipText in interface nextapp.echo.ToolTipSupport
See Also:
ToolTipSupport.getToolTipText()

setToolTipText

public void setToolTipText(java.lang.String newValue)
Specified by:
setToolTipText in interface nextapp.echo.ToolTipSupport
See Also:
ToolTipSupport.setToolTipText(java.lang.String)

getMouseCursor

public int getMouseCursor()
Description copied from interface: MouseCursorable
Returns the current mouse cursor in use. This will be one of the following values.

Specified by:
getMouseCursor in interface MouseCursorable
Returns:
The current mouse cursor in use.
See Also:
MouseCursorable.getMouseCursor()

getMouseCursorURI

public java.lang.String getMouseCursorURI()
Specified by:
getMouseCursorURI in interface MouseCursorable
Returns:
The custom URI for the mouse cursor or null
See Also:
MouseCursorable.getMouseCursorURI()

setMouseCursor

public void setMouseCursor(int mouseCursor)
Description copied from interface: MouseCursorable
Sets the mouse cursor to use. This will be one of the following values.

Specified by:
setMouseCursor in interface MouseCursorable
Parameters:
mouseCursor - - the mouse cursor to use
See Also:
MouseCursorable.setMouseCursor(int)

setMouseCursorURI

public void setMouseCursorURI(java.lang.String mouseCursorURI)
Description copied from interface: MouseCursorable
Sets the URI to a custom platform mouse cursor. This will only be used if the mosue cusor is set to CURSOR_CUSTOM.

Specified by:
setMouseCursorURI in interface MouseCursorable
Parameters:
mouseCursorURI - the URI to a custom platform mouse cursor.
See Also:
MouseCursorable.setMouseCursorURI(java.lang.String)

validate

public void validate()
See Also:
Component.validate()

set

public 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. This allows you to write shorter "property setter" methods. Believe me it gets quite repetitive writting setters that perform ProperyChange support all the time, especially when you have say 20 properties.

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 on
fieldName - - the name of the field to set
newValue - - 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)

set

public static void set(java.lang.Object thisObject,
                       java.lang.String fieldName,
                       int newValue)
See Also:
set(Object, String, Object)

set

public static void set(java.lang.Object thisObject,
                       java.lang.String fieldName,
                       long newValue)
See Also:
set(Object, String, Object)

set

public static void set(java.lang.Object thisObject,
                       java.lang.String fieldName,
                       short newValue)
See Also:
set(Object, String, Object)

set

public static void set(java.lang.Object thisObject,
                       java.lang.String fieldName,
                       byte newValue)
See Also:
set(Object, String, Object)

set

public static void set(java.lang.Object thisObject,
                       java.lang.String fieldName,
                       char newValue)
See Also:
set(Object, String, Object)

set

public static void set(java.lang.Object thisObject,
                       java.lang.String fieldName,
                       boolean newValue)
See Also:
set(Object, String, Object)

set

public static void set(java.lang.Object thisObject,
                       java.lang.String fieldName,
                       double newValue)
See Also:
set(Object, String, Object)

set

public static void set(java.lang.Object thisObject,
                       java.lang.String fieldName,
                       float newValue)
See Also:
set(Object, String, Object)

EchoPoint
1.0