|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.tssap.util.ui.reuse.chooser.impl.DropDownSelector
Title: Reuseable Drop Down Selector
Description: Component consisting of a combo box (drop down menu) or textField
and a push button.
With an itemsMaxLength (number of elements in combo box) of 0,
you can determine that a textField is shown.
Otherwise the combobox will be displayed.
example usage:
IDropDownSelector dds;
IDisplayableChooser pushButtonChooser =
new FileChooser(FileChooser.DIRECTORY_CHOOSER);
IGridLayoutPane componentsGridpane = gridpane.addGridLayoutPane(
DropDownSelector.NUM_GRID_COLS);
SelectionListener sl = new TestSelectionListener();
String[] historyData = new String[] { "E:\\", "A:\\", "D:\\" };
dds = new DropDownSelector(3);
dds.setSelectorDescription("blabla");
dds.setDescriptionPositionLeft(false);
dds.setReadOnly(false);
dds.setHistory(historyData);
dds.setButtonText("Browse");
dds.setHasPushButton(true);
dds.setPushButtonChooser(pushButtonChooser);
dds.addSelectionListener(sl);
dds.createPartControl(componentsGridpane);
Copyright: Copyright (c) 2002
Company: SAP AG
| Field Summary | |
static int |
NUM_GRID_COLS
|
| Constructor Summary | |
DropDownSelector()
|
|
DropDownSelector(int itemsMaxLength)
|
|
| Method Summary | |
void |
addHistoryEntry(java.lang.String entry)
|
void |
addSelectionToHistory()
|
void |
focusGained(org.eclipse.swt.events.FocusEvent e)
|
void |
focusLost(org.eclipse.swt.events.FocusEvent e)
|
org.eclipse.swt.graphics.Image |
getButtonImage()
|
java.lang.String |
getButtonText()
|
java.lang.String |
getButtonTooltip()
|
org.eclipse.swt.widgets.Control |
getControl()
|
java.lang.String[] |
getHistory()
|
int |
getHistoryLength()
Returns the itemsMaxLength. |
int |
getItemsMaxLength()
|
IChooser |
getPushButtonChooser()
|
java.lang.String |
getSelectorDescription()
|
java.lang.String |
getText()
|
int |
getUserGridNumOfColumns()
Returns number of columns for userArea given to method initContainer(IGridLayoutPane userArea) |
boolean |
hasPushButton()
|
void |
initContainer(IGridLayoutPane userArea)
Initialize component's UI. |
boolean |
isDescriptorPositionLeft()
|
boolean |
isGrabHorizontal()
Returns the isGrabHorizontal. |
boolean |
isReadOnly()
Returns the readOnly. |
boolean |
isSelectionToHistory()
|
boolean |
isUserGridEqualColSize()
Returns true if userArea given to method initContainer(IGridLayoutPane userArea) has to have equal column widths |
void |
setButtonImage(org.eclipse.swt.graphics.Image buttonImage)
calling this method after having called createPartControl(..) will throw an exception! |
void |
setButtonText(java.lang.String buttonText)
calling this method after having called createPartControl(..) will throw an exception! |
void |
setButtonTooltip(java.lang.String buttonTooltip)
calling this method after having called createPartControl(..) will throw an exception! |
void |
setDescriptionPositionLeft(boolean left)
calling this method after having called createPartControl(..) will throw an exception! |
void |
setEnabled(boolean enabled)
Set whether or not the component and all its subcomponents are enabled. |
void |
setHasPushButton(boolean hasPushButton)
calling this method after having called createPartControl(..) will throw an exception! |
void |
setHistory(java.lang.String[] items)
adapts history[] to defined size Case 1: history[] consists of less items than the defined max number of items to be shown in the combo box (itemsMaxLength): history[] will be filled up with Strings until the size of itemsMaxLength is reached Case 2: history[]'s size is greater or equals itemsMaxLength: only a defined number of the latest values remain in history[] |
void |
setIsGrabHorizontal(boolean isGrabHorizontal)
Sets the isGrabHorizontal. |
void |
setItemsMaxLength(int itemsMaxLength)
Sets the itemsMaxLength. |
void |
setPushButtonChooser(IChooser pushButtonChooser)
calling this method after having called createPartControl(..) will throw an exception! |
void |
setReadOnly(boolean readOnly)
Sets the readOnly, that is defines if the combobox/pushButton/textField shall be read-only or editable. |
void |
setSelectionToHistory(boolean selectionToHistory)
calling this method after having called createPartControl(..) will throw an exception! |
void |
setSelectorDescription(java.lang.String description)
calling this method after having called createPartControl(..) will throw an exception! |
void |
setText(java.lang.String text)
|
void |
setTextFieldReadOnly(boolean readOnly)
hacked coding in order to set only the text field of DropDownSelector to read-only |
| Methods inherited from interface com.tssap.util.ui.reuse.IGenericComponent |
addModifyListener, addSelectionListener, createPartControl, createPartControl, getTitle, refresh, removeModifyListener, removeSelectionListener, setTitle |
| Methods inherited from interface com.tssap.util.ui.IEditable |
isEditable, setEditable |
| Methods inherited from interface com.tssap.util.ui.reuse.IReuseable |
createPartControl, isEnabled |
| Field Detail |
public static final int NUM_GRID_COLS
| Constructor Detail |
public DropDownSelector(int itemsMaxLength)
public DropDownSelector()
| Method Detail |
public org.eclipse.swt.widgets.Control getControl()
getControl in interface IDropDownSelectorpublic void initContainer(IGridLayoutPane userArea)
IGridLayoutPaneContainerinitContainer in interface IGridLayoutPaneContainerIGridLayoutPaneContainer.initContainer(IGridLayoutPane)public boolean isUserGridEqualColSize()
IGridLayoutPaneContainerisUserGridEqualColSize in interface IGridLayoutPaneContainerIGridLayoutPaneContainer.isUserGridEqualColSize()public int getUserGridNumOfColumns()
IGridLayoutPaneContainergetUserGridNumOfColumns in interface IGridLayoutPaneContainerIGridLayoutPaneContainer.getUserGridNumOfColumns()public java.lang.String[] getHistory()
getHistory in interface IDropDownSelectorpublic void setHistory(java.lang.String[] items)
setHistory in interface IDropDownSelectoritems - String[] to be added to history[]public void addSelectionToHistory()
addSelectionToHistory in interface IDropDownSelectorpublic void addHistoryEntry(java.lang.String entry)
addHistoryEntry in interface IDropDownSelectorpublic int getHistoryLength()
public void setItemsMaxLength(int itemsMaxLength)
setItemsMaxLength in interface IDropDownSelectoritemsMaxLength - The itemsMaxLength to set. Has to be >= 0.public boolean isReadOnly()
isReadOnly in interface IDropDownSelectorpublic void setTextFieldReadOnly(boolean readOnly)
setTextFieldReadOnly in interface IDropDownSelectorreadOnly - TypeComponent2,
com.tssap.j2ee.ui.ejb.components.fields.PrimaryKeyEditorComponentpublic void setReadOnly(boolean readOnly)
setReadOnly in interface IDropDownSelectorreadOnly - The readOnly to setpublic void focusGained(org.eclipse.swt.events.FocusEvent e)
focusGained in interface IDropDownSelectororg.eclipse.swt.events.FocusListener#focusGained(FocusEvent)public void focusLost(org.eclipse.swt.events.FocusEvent e)
focusLost in interface IDropDownSelectororg.eclipse.swt.events.FocusListener#focusLost(FocusEvent)public org.eclipse.swt.graphics.Image getButtonImage()
getButtonImage in interface IDropDownSelectorIDropDownSelector.getButtonImage()public java.lang.String getButtonText()
getButtonText in interface IDropDownSelectorIDropDownSelector.getButtonText()public java.lang.String getButtonTooltip()
getButtonTooltip in interface IDropDownSelectorIDropDownSelector.getButtonTooltip()public java.lang.String getText()
getText in interface IDropDownSelectorIDropDownSelector.getText()public int getItemsMaxLength()
getItemsMaxLength in interface IDropDownSelectorIDropDownSelector.getItemsMaxLength()public IChooser getPushButtonChooser()
getPushButtonChooser in interface IDropDownSelectorIDropDownSelector.getPushButtonChooser()public java.lang.String getSelectorDescription()
getSelectorDescription in interface IDropDownSelectorIDropDownSelector.getSelectorDescription()public boolean hasPushButton()
hasPushButton in interface IDropDownSelectorIDropDownSelector.hasPushButton()public boolean isSelectionToHistory()
isSelectionToHistory in interface IDropDownSelectorIDropDownSelector.isSelectionToHistory()public void setButtonImage(org.eclipse.swt.graphics.Image buttonImage)
setButtonImage in interface IDropDownSelectorbuttonImage - an image of type org.eclipse.swt.graphics.ImageIDropDownSelector.setButtonImage(Image)public void setButtonText(java.lang.String buttonText)
setButtonText in interface IDropDownSelectorbuttonText - IDropDownSelector.setButtonText(String)public void setButtonTooltip(java.lang.String buttonTooltip)
setButtonTooltip in interface IDropDownSelectorIDropDownSelector.setButtonTooltip(String)public void setHasPushButton(boolean hasPushButton)
setHasPushButton in interface IDropDownSelectorIDropDownSelector.setHasPushButton(boolean)public void setPushButtonChooser(IChooser pushButtonChooser)
setPushButtonChooser in interface IDropDownSelectorpushButtonChooser - chooser that defines what will happen when clicking on the pushButtonIDropDownSelector.setPushButtonChooser(IChooser)public void setSelectionToHistory(boolean selectionToHistory)
setSelectionToHistory in interface IDropDownSelectorselectionToHistory - - adds the selected value to historyIDropDownSelector.setSelectionToHistory(boolean)public void setSelectorDescription(java.lang.String description)
setSelectorDescription in interface IDropDownSelectordescription - - the description of the component as a wholeIDropDownSelector.setSelectorDescription(String)public boolean isDescriptorPositionLeft()
public void setDescriptionPositionLeft(boolean left)
setDescriptionPositionLeft in interface IDropDownSelectorleft - - setting this value to true will arrange description on the left hand side
of the component - otherwise on top of it.public void setText(java.lang.String text)
setText in interface IDropDownSelectortext - - the default text to be displayed in the components textField/combo boxpublic boolean isGrabHorizontal()
public void setIsGrabHorizontal(boolean isGrabHorizontal)
setIsGrabHorizontal in interface IDropDownSelectorisGrabHorizontal - The isGrabHorizontal to setpublic void setEnabled(boolean enabled)
IReuseablesetEnabled in interface IReuseableIReuseable.setEnabled(boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||