|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.rse.ui.widgets.SystemHistoryCombo
public class SystemHistoryCombo
This re-usable widget is for a combox box that persists its history and allows the user to manipulate that history.
The composite is layed as follows:
______________v...
updateHistory()
Field Summary |
---|
Fields inherited from class org.eclipse.swt.widgets.Composite |
---|
embeddedHandle |
Fields inherited from class org.eclipse.swt.widgets.Widget |
---|
handle |
Constructor Summary | |
---|---|
SystemHistoryCombo(Composite parent,
int style,
String key,
boolean readonly)
Constructor for SystemHistoryCombo |
|
SystemHistoryCombo(Composite parent,
int style,
String key,
int maxComboEntries,
boolean readonly)
Constructor for SystemHistoryCombo |
Method Summary | |
---|---|
void |
addModifyListener(ModifyListener listener)
Register a listener interested in entry field modify events |
protected void |
addOurButtonSelectionListener()
|
void |
addSelectionListener(SelectionListener listener)
Register a listener interested in an item is selected in the combo box |
void |
clearSelection()
Clear the selection of the text in the entry field part of the combo. |
void |
clearTextSelection()
Clear the selection of the text in the entry field part of the combo. |
static Combo |
createCombo(Composite parent,
boolean readonly)
Creates a new combobox instance and sets the default layout data. |
protected Button |
createHistoryButton()
|
Combo |
getCombo()
Return the combo box widget |
String[] |
getHistory()
Return the current history for the directory combo box |
Button |
getHistoryButton()
Return the history button widget |
String[] |
getItems()
Get the items in the combo field |
int |
getSelectionIndex()
Get the index number of the currently selected item. |
String |
getText()
Query the history combo field's current contents |
protected void |
historyButtonPressed()
|
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
void |
keyTraversed(TraverseEvent 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 combo box selection listener. |
void |
select(int selIdx)
Select the combo dropdown list entry at the given index |
int |
select(String itemText)
Select the given text. |
void |
setAutoUpperCase(boolean enable)
Set auto-uppercase. |
void |
setButtonToolTipText(String tip)
Same as #setHistoryButtonToolTipText(String) |
void |
setDefaultHistory(String[] items)
Set the items to default the history to, IF the history is currently empty. |
void |
setEnabled(boolean enabled)
Disable/Enable all the child controls. |
boolean |
setFocus()
Set the focus to the combo field |
void |
setHistory(String[] newHistory)
Set the history to the given array of strings. |
void |
setHistoryButtonHeight(int height)
|
void |
setHistoryButtonToolTipText(String tip)
Set the tooltip text for the history button |
void |
setHistoryKey(String key)
Reset the history key. |
void |
setItems(String[] items)
Set the items in the combo field |
void |
setSelectionIndex(int selIdx)
Same as select(int) |
void |
setText(String text)
Set the combo field's current contents |
void |
setTextLimit(int limit)
Set the combo field's text limit |
void |
setToolTipText(String tip)
Set the tooltip text for the combo field |
void |
setWidthHint(int widthHint)
Set the width hint for the combo box widget (in pixels). |
void |
updateHistory()
Update the history with current entry field setting, but don't refresh contents. |
void |
updateHistory(boolean refresh)
Update the history with current entry field setting, and optionally refresh the list from the new history This is called automatically for you when setText is called. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayout, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SystemHistoryCombo(Composite parent, int style, String key, boolean readonly)
parent
- The owning compositestyle
- The swt style to apply to the overall composite. Typically it is just SWT.NULLkey
- The unique string used as a preferences key to persist the history for this widgetreadonly
- Set to true for a readonly combo vs user-editable combo boxpublic SystemHistoryCombo(Composite parent, int style, String key, int maxComboEntries, boolean readonly)
parent
- The owning compositestyle
- The swt style to apply to the overall composite. Typically it is just SWT.NULLkey
- The unique string used as a preferences key to persist the history for this widgetmaxComboEntries
- The number of history entries to show in the combo box. This only restricts the
combo box not the full history listreadonly
- Set to true for a readonly combo vs user-editable combo boxMethod Detail |
---|
public Combo getCombo()
getCombo
in interface ISystemCombo
public void setWidthHint(int widthHint)
setWidthHint
in interface ISystemCombo
public void setAutoUpperCase(boolean enable)
setAutoUpperCase
in interface ISystemCombo
public Button getHistoryButton()
public void setText(String text)
public String getText()
getText
in interface ISystemCombo
public void setEnabled(boolean enabled)
setEnabled
in interface ISystemCombo
setEnabled
in class Control
public void setToolTipText(String tip)
setToolTipText
in interface ISystemCombo
setToolTipText
in class Control
public void setHistoryButtonToolTipText(String tip)
public void setButtonToolTipText(String tip)
setButtonToolTipText
in interface ISystemCombo
public void setTextLimit(int limit)
public boolean setFocus()
setFocus
in interface ISystemCombo
setFocus
in class Composite
public void setItems(String[] items)
public void setDefaultHistory(String[] items)
public void setHistoryKey(String key)
public String[] getItems()
public void select(int selIdx)
select
in interface ISystemCombo
public int select(String itemText)
public void setSelectionIndex(int selIdx)
select(int)
setSelectionIndex
in interface ISystemCombo
public void clearSelection()
clearSelection
in interface ISystemCombo
public void clearTextSelection()
clearTextSelection
in interface ISystemCombo
public int getSelectionIndex()
getSelectionIndex
in interface ISystemCombo
public void addSelectionListener(SelectionListener listener)
addSelectionListener
in interface ISystemCombo
removeSelectionListener(SelectionListener)
public void removeSelectionListener(SelectionListener listener)
removeSelectionListener
in interface ISystemCombo
addSelectionListener(SelectionListener)
public void addModifyListener(ModifyListener listener)
removeModifyListener(ModifyListener)
public void removeModifyListener(ModifyListener listener)
addModifyListener(ModifyListener)
public String[] getHistory()
public void updateHistory()
This is called automatically for you when setText is called. However, for non-readonly versions, you should still call this yourself when OK is successfully pressed on the dialog box.
public void updateHistory(boolean refresh)
This is called automatically for you when setText is called. However, for non-readonly versions, you should still call this yourself when OK is successfully pressed on the dialog box.
public void setHistory(String[] newHistory)
protected Composite prepareComposite(int numColumns)
numColumns
- Number of columns the new group will contain.public static Combo createCombo(Composite parent, boolean readonly)
Does NOT set the widthHint as that causes problems. Instead the combo will consume what space is available within this composite.
parent
- composite to put the button into.protected void addOurButtonSelectionListener()
protected void historyButtonPressed()
protected Button createHistoryButton()
public void setHistoryButtonHeight(int height)
public void keyTraversed(TraverseEvent e)
keyTraversed
in interface TraverseListener
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |