|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.visuals.PropertyEditorHost
public class PropertyEditorHost
PropertyEditorHost provides a user interface for a PropertyEditor. It may provide either a TextField or ComboBox depending on the return codes from getTags and getAsText. It may also provide a paint area for PropertyEditors which return true from isPaintable. It will also provide a "..." button for PropertyEditors which return true from supportsCustomEditor.
The PropertyEditorHost also listens for PropertyChangeEvents coming from the PropertyEditor. When a PropertyChangeEvent is received, the UI controls in the PropertyEditorHost are updated based on information from the PropertyEditor.
Note: It is the containers responsibility to call updateTextValue when the window containing the PropertyEditorHost is closed. Particularly, property sheet's should call it when they receive a windowClosing event since the PEHost is not given a focusLost event in that case. Also, customizer panels which use the PEHost should call updateTextValue when their customizerClosing method is called.
Note: The PropertyEditorHost's serialVersionUID might change in future versions of the class. Do not serialize the PropertyEditorHost.
Field Summary | |
---|---|
protected boolean |
alwaysShowControls
Determines whether the editting controls are always shown or whether they are only shown when the PEHost has focus. |
protected java.lang.Object |
bean
|
protected Choice |
choice
The Choice for user input if getAsText does not return null. |
protected PushButton |
customButton
The Button to allow access to the custom editor if supportsCustomEditor returns true. |
protected java.awt.Window |
customEditorWindow
|
protected boolean |
dontSetFocus
|
protected AutoSizingGridLayout |
editLayout
This is the LayoutManager used by the PEHost when it has focus. |
protected com.sas.visuals.PropertyEditorPaintArea |
editPaintArea
The paintArea for paint space if isPaintable returns true when the PEHost has focus. |
protected java.awt.Panel |
editPanel
|
protected com.sas.visuals.PEHostLabel |
editValueLabel
The Label which displays the value of the property when the PEHost has focus. |
protected boolean |
ignoreFocusLost
|
protected int |
index
|
protected boolean |
indexed
|
protected AutoSizingGridLayout |
layout
This is the LayoutManager used by the PEHost. |
protected boolean |
masked
|
protected int |
maximumValueFieldWidth
|
protected java.lang.String[] |
oldTags
|
protected com.sas.visuals.PropertyEditorPaintArea |
paintArea
The paintArea for paint space if isPaintable returns true. |
protected java.lang.String |
property
|
protected java.beans.PropertyEditor |
propertyEditor
The PropertyEditor to provide a UI for. |
protected java.lang.Class |
propertyType
|
protected java.lang.Object |
propertyValue
|
protected boolean |
readOnly
|
protected com.sas.visuals.PEHostTextField |
textField
The TextField for user input if getAsText does not return null and getTags returns true. |
protected com.sas.visuals.PEHostLabel |
valueLabel
The Label which displays the value of the property. |
protected java.awt.Panel |
viewPanel
|
protected boolean |
writeOnly
|
Fields inherited from class com.sas.awt.Panel |
---|
RB_KEY |
Constructor Summary | |
---|---|
PropertyEditorHost()
The constructor. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed is an event handler for the TextField used to enter the property value and the Button which is used to bring up the custom editor. |
void |
addNotify()
|
void |
componentHidden(java.awt.event.ComponentEvent evt)
|
void |
componentMoved(java.awt.event.ComponentEvent evt)
|
void |
componentResized(java.awt.event.ComponentEvent evt)
|
void |
componentShown(java.awt.event.ComponentEvent evt)
|
protected void |
createControls()
Create the controls for the UI. |
protected void |
createEdittingControls()
Create the controls necessary to change the value of the property. |
protected void |
enableSubcomponents(boolean enabled)
|
void |
focusGained(java.awt.event.FocusEvent evt)
|
void |
focusLost(java.awt.event.FocusEvent evt)
|
protected java.lang.String |
getAsText()
|
protected java.awt.Frame |
getContainingFrame()
Determine the frame containing the PEHost. |
protected java.lang.String |
getLabelAsText()
|
int |
getMaximumValueFieldWidth()
Returns the maximum width of the Label and/or TextField used to display the property value. |
java.beans.PropertyEditor |
getPropertyEditor()
Returns the property editor "displayed" by this PropertyEditorHost. |
void |
handleException(java.lang.Exception e)
Note: this is here to handle old code calling and passing in an Exception. |
void |
handleException(java.lang.Throwable e)
This method puts up a MessageBox when an exception is caught. |
void |
initialize()
Do common setup that should occur after property sets. |
protected void |
inspectProperty()
|
boolean |
isAlwaysShowControls()
Returns whether the editting and ... controls are always visible or are created on an as-needed basis. |
boolean |
isFocusTraversable()
Enable focus traversal if the PEHost is edittable. |
void |
itemStateChanged(java.awt.event.ItemEvent evt)
itemStateChanged is the event handler for the Choice used to display property value tags. |
void |
mouseClicked(java.awt.event.MouseEvent evt)
|
void |
mouseEntered(java.awt.event.MouseEvent evt)
|
void |
mouseExited(java.awt.event.MouseEvent evt)
|
void |
mousePressed(java.awt.event.MouseEvent evt)
|
void |
mouseReleased(java.awt.event.MouseEvent evt)
|
void |
propertyChange(java.beans.PropertyChangeEvent e)
propertyChange is the event handler for PropertyChangeEvents from the PropertyEditor. |
protected void |
readTags(java.lang.String[] tags)
|
protected void |
removeEventHandlers()
|
void |
removeNotify()
|
void |
setAlwaysShowControls(boolean show)
Sets whether the editting and ... controls are always visible or are created on an as-needed basis. |
void |
setEnabled(boolean enabled)
setEnabled() is the set accessor method for the Enabled attribute. |
void |
setMaximumValueFieldWidth(int width)
Sets the maximum width of the Label and/or TextField used to display the property value. |
void |
setProperty(java.lang.Object bean,
java.lang.String property)
|
void |
setProperty(java.lang.Object bean,
java.lang.String property,
int index)
|
void |
setPropertyEditor(java.beans.PropertyEditor propertyEditor)
Sets the PropertyEditor to provide a UI for. |
void |
setPropertyValue(java.lang.Object value)
|
void |
setPropertyValue(java.lang.Object value,
java.lang.Class propertyType)
|
void |
showCustomEditor()
showCustomEditor creates a dialog to display the custom editor if the custom editor is not a subclass of Dialog or Frame. |
void |
updateTextValue()
This method updates the PropertyEditor value based on the entered text. |
void |
updateValue()
This method updates the UI controls based on the new value of the property. |
void |
windowActivated(java.awt.event.WindowEvent evt)
|
void |
windowClosed(java.awt.event.WindowEvent evt)
|
void |
windowClosing(java.awt.event.WindowEvent evt)
|
void |
windowDeactivated(java.awt.event.WindowEvent evt)
|
void |
windowDeiconified(java.awt.event.WindowEvent evt)
|
void |
windowIconified(java.awt.event.WindowEvent evt)
|
void |
windowOpened(java.awt.event.WindowEvent evt)
|
Methods inherited from class com.sas.awt.Panel |
---|
getDefaultHeight, getDefaultWidth, getExtendedBeanInfo, remove, remove, removeAll, setDefaultHeight, setDefaultValues, setDefaultWidth |
Methods inherited from interface com.sas.awt.ContainerInterface |
---|
getComponents, getLayout, invalidate, setLayout, validate |
Field Detail |
---|
protected java.lang.Object bean
protected java.lang.String property
protected int index
protected boolean indexed
protected boolean readOnly
protected boolean writeOnly
protected boolean masked
protected java.lang.Object propertyValue
protected java.lang.Class propertyType
protected java.beans.PropertyEditor propertyEditor
setPropertyEditor(java.beans.PropertyEditor)
protected com.sas.visuals.PEHostLabel valueLabel
protected com.sas.visuals.PEHostLabel editValueLabel
protected com.sas.visuals.PEHostTextField textField
protected Choice choice
protected com.sas.visuals.PropertyEditorPaintArea paintArea
protected com.sas.visuals.PropertyEditorPaintArea editPaintArea
protected PushButton customButton
protected AutoSizingGridLayout layout
protected AutoSizingGridLayout editLayout
protected boolean alwaysShowControls
protected java.awt.Window customEditorWindow
protected java.awt.Panel viewPanel
protected java.awt.Panel editPanel
protected boolean ignoreFocusLost
protected boolean dontSetFocus
protected int maximumValueFieldWidth
protected java.lang.String[] oldTags
Constructor Detail |
---|
public PropertyEditorHost()
Method Detail |
---|
public void initialize()
initialize
in interface com.sas.ComponentInterface
initialize
in class PanelVisualComponent
ComponentInterface.initialize()
public java.beans.PropertyEditor getPropertyEditor()
public int getMaximumValueFieldWidth()
public void setMaximumValueFieldWidth(int width)
public boolean isAlwaysShowControls()
public void setAlwaysShowControls(boolean show)
NOTE: Currently, changing this value after the controls have been created will not work properly.
public void setPropertyEditor(java.beans.PropertyEditor propertyEditor)
createControls()
public void setPropertyValue(java.lang.Object value, java.lang.Class propertyType)
public void setPropertyValue(java.lang.Object value)
public void setProperty(java.lang.Object bean, java.lang.String property)
public void setProperty(java.lang.Object bean, java.lang.String property, int index)
protected void inspectProperty()
protected void removeEventHandlers()
protected void createControls()
protected java.lang.String getLabelAsText()
protected java.lang.String getAsText()
protected void readTags(java.lang.String[] tags)
protected void createEdittingControls()
public void updateValue()
public void handleException(java.lang.Exception e)
public void handleException(java.lang.Throwable e)
Subclasses should override this method if they wish to provide different error handling.
PropertySheets using the PEHost may call this method to get consistent error handling.
public void updateTextValue()
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
public void itemStateChanged(java.awt.event.ItemEvent evt)
itemStateChanged
in interface java.awt.event.ItemListener
public void showCustomEditor()
Subclasses may want to override this method and bring up the custom editor some other way.
protected java.awt.Frame getContainingFrame()
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class PanelVisualComponent
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
public void windowOpened(java.awt.event.WindowEvent evt)
windowOpened
in interface java.awt.event.WindowListener
public void windowClosing(java.awt.event.WindowEvent evt)
windowClosing
in interface java.awt.event.WindowListener
public void windowClosed(java.awt.event.WindowEvent evt)
windowClosed
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent evt)
windowIconified
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent evt)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowActivated(java.awt.event.WindowEvent evt)
windowActivated
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent evt)
windowDeactivated
in interface java.awt.event.WindowListener
public void focusGained(java.awt.event.FocusEvent evt)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent evt)
focusLost
in interface java.awt.event.FocusListener
public void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent evt)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent evt)
mouseExited
in interface java.awt.event.MouseListener
public boolean isFocusTraversable()
isFocusTraversable
in class java.awt.Component
public void addNotify()
addNotify
in interface ContainerInterface
addNotify
in class PanelContainerComponent
public void removeNotify()
removeNotify
in interface ContainerInterface
removeNotify
in class PanelContainerComponent
public void componentResized(java.awt.event.ComponentEvent evt)
componentResized
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent evt)
componentMoved
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent evt)
componentShown
in interface java.awt.event.ComponentListener
public void componentHidden(java.awt.event.ComponentEvent evt)
componentHidden
in interface java.awt.event.ComponentListener
protected void enableSubcomponents(boolean enabled)
public void setEnabled(boolean enabled)
VisualInterface
setEnabled
in interface VisualInterface
setEnabled
in class PanelVisualComponent
enabled
- Whether the component should be enabled.VisualInterface.setEnabled(boolean)
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |