|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectComposite
com.ibm.etools.systems.core.ui.widgets.InheritableEntryField
This is an entry which allows the user to decide whether to inherit a parent value or type in his own local value.
To accomplish this, we create a composite containing a toggle button followed by an entry field.
The toggle button has left and right arrows. Typically, an arrow pointing to the left means to inherit from parent, and pointing to the right means to override locally. However, the control can be used for any binary decision!
Although this control inherits from Composite it does not make sense to set a layout for it or to add children to it.
Field Summary | |
---|---|
static String |
copyright
|
Constructor Summary | |
---|---|
InheritableEntryField(Composite parent,
int style)
Constructor |
|
InheritableEntryField(Composite parent,
int style,
int buttonStyle,
int textStyle)
Constructor when you want to set the style of the toggle button and entry field too. |
|
InheritableEntryField(Composite parent,
int style,
int buttonStyle,
int textStyle,
boolean showToggleButton)
Constructor when you want to hide the toggle button |
Method Summary | |
---|---|
void |
addModifyListener(ModifyListener listener)
Register a listener interested in entry field modify events |
void |
addSelectionListener(SelectionListener listener)
Register a listener interested in when the button is toggled Call isLocal() to determine if left (false) or right (true) was pressed. |
protected void |
createTextField(Composite parent,
int textStyle)
Create our text field and insert it into a GridLayout. |
protected void |
createToggleButton(Composite parent,
int buttonStyle)
|
String |
getInheritedText()
Query the entry field's inherited text value. |
String |
getLocalText()
Query the entry field's local text value. |
String |
getText()
Query the entry field's current contents, regardless of local/inherit state |
Text |
getTextField()
Return a reference to the entry field |
InheritButton |
getToggleButton()
Return the toggle button |
boolean |
isLocal()
Query the inherit/local state |
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
protected Composite |
prepareComposite(int numColumns)
Prepares this composite control and sets the default layout data. |
void |
removeModifyListener(ModifyListener listener)
Remove a previously set entry field listener. |
void |
removeSelectionListener(SelectionListener listener)
Remove a previously set toggle button selection listener. |
void |
setAllowEditingOfInheritedText(boolean allow)
Specify if user is allowed to edit the inherited text. |
void |
setInheritedText(String text)
Set the entry field's inherited text value |
void |
setLocal(boolean local)
Toggle the inherit/local state. |
void |
setLocalText(String text)
Set the entry field's local text value |
void |
setTextFieldFocus()
Set the focus to the entry field |
void |
setTextFieldToolTipText(String tip)
Set the tooltip text for the entry field |
void |
setTextLimit(int limit)
Set the entry field's text limit |
void |
setToggleButtonFocus()
Set the focus to the toggle button |
void |
setToggleButtonHeight(int height)
|
void |
setToggleEnabled(boolean enabled)
Disable the toggle. |
void |
setToggleToolTipText(String tip)
Set the tooltip text for the toggle button |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String copyright
Constructor Detail |
public InheritableEntryField(Composite parent, int style)
parent
- The parent composite to hold this widgetstyle
- the SWT style for this widget (eg, SWT.BORDER or SWT.NULL)public InheritableEntryField(Composite parent, int style, int buttonStyle, int textStyle)
parent
- The parent composite to hold this widgetstyle
- the SWT style for this overall widget (eg, SWT.BORDER or SWT.NULL)public InheritableEntryField(Composite parent, int style, int buttonStyle, int textStyle, boolean showToggleButton)
parent
- The parent composite to hold this widgetstyle
- the SWT style for this overall widget (eg, SWT.BORDER or SWT.NULL)showToggleButton
- true to show the toggle button, false not toMethod Detail |
public void setLocal(boolean local)
public boolean isLocal()
public void setAllowEditingOfInheritedText(boolean allow)
public void setInheritedText(String text)
public String getInheritedText()
public void setLocalText(String text)
public String getLocalText()
public String getText()
public Text getTextField()
public InheritButton getToggleButton()
public void setToggleEnabled(boolean enabled)
public void setToggleToolTipText(String tip)
public void setTextFieldToolTipText(String tip)
public void setTextLimit(int limit)
public void setToggleButtonFocus()
public void setTextFieldFocus()
public void addSelectionListener(SelectionListener listener)
Call isLocal()
to determine if left (false) or right (true) was pressed.
removeSelectionListener(SelectionListener)
public void removeSelectionListener(SelectionListener listener)
addSelectionListener(SelectionListener)
public void addModifyListener(ModifyListener listener)
removeModifyListener(ModifyListener)
public void removeModifyListener(ModifyListener listener)
addModifyListener(ModifyListener)
protected Composite prepareComposite(int numColumns)
protected void createTextField(Composite parent, int textStyle)
protected void createToggleButton(Composite parent, int buttonStyle)
public void setToggleButtonHeight(int height)
public void keyPressed(KeyEvent e)
public void keyReleased(KeyEvent e)
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |