net.sf.jzeno.echo.editor
Class ClassNameEditor

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by net.sf.jzeno.echo.components.CustomComponent
          extended by net.sf.jzeno.echo.editor.ClassNameEditor
All Implemented Interfaces:
java.io.Serializable, BindingTarget, PropertyComponent, RebindableComponent, EventSink, EventSource, Precreation, Component, FastComponent, FastComponentContainer

public class ClassNameEditor
extends CustomComponent
implements Precreation

An editor that allows you to enter a fully qualified class name. It is validates that the entered class exists on the classpath. Furthermore it can validate that the entered class is actually a subclass of a given base class or implements a given interface.

See Also:
Serialized Form

Nested Class Summary
 class ClassNameEditor.DefaultValidator
           
 
Field Summary
static int CHARACTER_UNITS
           
static int PERCENT_UNITS
           
static int PIXEL_UNITS
           
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
ClassNameEditor()
           
ClassNameEditor(java.lang.Class beanClass, java.lang.String propertyPath, java.lang.String constructionHints)
           
 
Method Summary
 void applyContext()
           
 void close()
           
 void focusList()
           
 Color getBackground()
          Returns the background color of the component.
 java.lang.String getClassName()
           
 Color getForeground()
          Returns the foreground of the component.
 ImageReference getIcon()
           
 java.lang.String getIconName()
           
 java.lang.String getInvalidMessage()
           
 int getMinimumCharactersForSearch()
           
 java.lang.Class getRequiredBaseClass()
           
 java.lang.Class getRequiredInterface()
           
 CodeCompletionEntry getSelectedEntry()
           
 java.lang.String getToolTipText()
           
 int getWidth()
           Gets the width of the text field.
 int getWidthUnits()
           Gets the units in which width is specified.
 boolean isAllowInterface()
           
 boolean isRequired()
           Query if the editor is required to be filled in.
 void open()
           
 void selectEntry()
           
 void setAllowInterface(boolean allowInterface)
           Allow users to enter the name of an interface ?
 void setBackground(Color color)
          Sets the background color of the component.
 void setClassName(java.lang.String className)
           
 void setForeground(Color color)
          Sets the foreground color of the component.
 void setIcon(ImageReference imageRef)
           
 void setIconName(java.lang.String iconName)
           
 void setInvalidMessage(java.lang.String invalidMessage)
           
 void setMinimumCharactersForSearch(int minimumCharactersForSearch)
           A minimum of the speficied number of characters must be entered before a search is performed.
 void setReadOnly(boolean readOnly)
           Mark this component as read-only.
 void setRequired(boolean required)
           Determine if the editor is required to be filled in.
 void setRequiredBaseClass(java.lang.Class requiredBaseClass)
           
 void setRequiredInterface(java.lang.Class requiredInterface)
           
 void setSelectedEntry(CodeCompletionEntry selectedEntry)
           
 void setToolTipText(java.lang.String toolTipText)
           
 void setWidth(int width)
           Sets the width of the text field.
 void setWidthUnits(int units)
           Sets the units in which width is specified.
 void showEntries()
           
 void showEntries(boolean closeIfOpen)
           
 
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getDecorator, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isReadOnly, isValid, markInvalid, markValid, preRender, rebind, removeValidator, setActionCommand, setBean, setBeanClass, setDecorator, setNullObject, setProperty, setValue, traceValue, validate
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, applyStyle, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setClientId, setEnabled, setFocused, setFont, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERCENT_UNITS

public static final int PERCENT_UNITS
See Also:
Constant Field Values

PIXEL_UNITS

public static final int PIXEL_UNITS
See Also:
Constant Field Values

CHARACTER_UNITS

public static final int CHARACTER_UNITS
See Also:
Constant Field Values
Constructor Detail

ClassNameEditor

public ClassNameEditor()

ClassNameEditor

public ClassNameEditor(java.lang.Class beanClass,
                       java.lang.String propertyPath,
                       java.lang.String constructionHints)
Method Detail

focusList

public void focusList()

open

public void open()

close

public void close()

getClassName

public java.lang.String getClassName()

setClassName

public void setClassName(java.lang.String className)

getRequiredInterface

public java.lang.Class getRequiredInterface()

setRequiredInterface

public void setRequiredInterface(java.lang.Class requiredInterface)

getRequiredBaseClass

public java.lang.Class getRequiredBaseClass()

setRequiredBaseClass

public void setRequiredBaseClass(java.lang.Class requiredBaseClass)

getInvalidMessage

public java.lang.String getInvalidMessage()

setInvalidMessage

public void setInvalidMessage(java.lang.String invalidMessage)

setRequired

public void setRequired(boolean required)
Description copied from interface: PropertyComponent

Determine if the editor is required to be filled in.

Specified by:
setRequired in interface PropertyComponent
Overrides:
setRequired in class CustomComponent

isRequired

public boolean isRequired()
Description copied from interface: PropertyComponent

Query if the editor is required to be filled in.

Specified by:
isRequired in interface PropertyComponent
Overrides:
isRequired in class CustomComponent

showEntries

public void showEntries()

showEntries

public void showEntries(boolean closeIfOpen)

selectEntry

public void selectEntry()

getSelectedEntry

public CodeCompletionEntry getSelectedEntry()

setSelectedEntry

public void setSelectedEntry(CodeCompletionEntry selectedEntry)

setToolTipText

public void setToolTipText(java.lang.String toolTipText)

getToolTipText

public java.lang.String getToolTipText()

isAllowInterface

public boolean isAllowInterface()

setAllowInterface

public void setAllowInterface(boolean allowInterface)

Allow users to enter the name of an interface ? Normally this editor is used for entering concrete classes only.


setIcon

public void setIcon(ImageReference imageRef)

getIcon

public ImageReference getIcon()

setIconName

public void setIconName(java.lang.String iconName)

getIconName

public java.lang.String getIconName()

setBackground

public void setBackground(Color color)
Description copied from interface: Component
Sets the background color of the component.

Specified by:
setBackground in interface Component
Overrides:
setBackground in class AbstractComponent
Parameters:
color - The new background color of the component.

getBackground

public Color getBackground()
Description copied from interface: Component
Returns the background color of the component.

Specified by:
getBackground in interface Component
Overrides:
getBackground in class AbstractComponent
Returns:
The background color of the component.

setForeground

public void setForeground(Color color)
Description copied from interface: Component
Sets the foreground color of the component.

Specified by:
setForeground in interface Component
Overrides:
setForeground in class AbstractComponent
Parameters:
color - The new foreground color of the component.

getForeground

public Color getForeground()
Description copied from interface: Component
Returns the foreground of the component.

Specified by:
getForeground in interface Component
Overrides:
getForeground in class AbstractComponent
Returns:
The foreground of the component.

setWidth

public void setWidth(int width)

Sets the width of the text field.


getWidth

public int getWidth()

Gets the width of the text field.


setWidthUnits

public void setWidthUnits(int units)

Sets the units in which width is specified.


getWidthUnits

public int getWidthUnits()

Gets the units in which width is specified.


setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from interface: PropertyComponent

Mark this component as read-only.

Specified by:
setReadOnly in interface PropertyComponent
Overrides:
setReadOnly in class CustomComponent

getMinimumCharactersForSearch

public int getMinimumCharactersForSearch()

setMinimumCharactersForSearch

public void setMinimumCharactersForSearch(int minimumCharactersForSearch)

A minimum of the speficied number of characters must be entered before a search is performed. This is basically used to avoid gigantic lists of available classes.


applyContext

public void applyContext()
Specified by:
applyContext in interface Precreation