Package com._1c.g5.lwt.controls
Class LightCombo
-
- All Implemented Interfaces:
IEditable
,ILightComposite
,ILightContentComposite<LightText>
,ILightControl
public class LightCombo extends LightTextEditorBar
Light combo control.Note: The current version relies on GC for computing dropdown line height, so the control must be a child of SwtLightControl in order be able to show the dropdown.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LightCombo.Item
Combo item description.
-
Constructor Summary
Constructors Constructor Description LightCombo()
The default constructor without quick search.LightCombo(boolean quickSearchAllowed)
Instantiates a new light combo.LightCombo(boolean quickSearchAllowed, boolean onlyComboValuesAllowed)
Instantiates a new light combo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItem(LightCombo.Item item)
Appends the item to this combo.void
addItem(LightCombo.Item item, int index)
Adds the item to this combo.void
addSelectionIndexListener(IChangedListener<LightCombo,Integer> listener)
Adds the selection index listener.void
clearSelection()
Clears text selection.void
deselectAll()
Clears the item selection.LightImageButton
getArrowButton()
Gets the arrow button.int
getItemCount()
Gets the item count.int
getSelectionIndex()
Gets the selection index.boolean
isQuickSearchAllowed()
Returnstrue
if quicksearch is allowed.void
removeAllItems()
Removes all items from this combo.void
removeItem(int index)
Removes the item at the specified index.void
removeSelectionIndexListener(IChangedListener<LightCombo,Integer> listener)
Removes the selection index listener.void
selectItem(int index)
Selects the item at the given index.void
setItem(int index, LightCombo.Item item)
Sets the item at the specified index.void
setItems(LightCombo.Item[] items)
Sets all the items.void
setQuickSearchAllowed(boolean quickSearchAllowed)
Sets if quicksearch is allowed.void
toggleDropdown(boolean visible)
Displays or hides the drop-down list.-
Methods inherited from class com._1c.g5.lwt.controls.LightTextEditorBar
addButton, getButtons, isTextEditable, removeButton, setEditable, setEditable, setTextEditable
-
Methods inherited from class com._1c.g5.lwt.controls.LightEditorBar
contentSet, contentUnset, getBackgroundColor, getBorderColor, getImage, getLeftSide, getRightSide, isEditable, paint, setBackgroundColor, setBorderColor, setEnabled, setImage, setVisible
-
Methods inherited from class com._1c.g5.lwt.AbstractLightContentComposite
getContent, setContent
-
Methods inherited from class com._1c.g5.lwt.LightComposite
addChild, addChild, addChildAfter, addLayerAbove, addLayerBehind, computeSize, controlFromPoint, dispose, getActiveControl, getChildCount, getChildren, getLayers, getLayout, layout, layout, removeChild, removeChild, revealRectangle, setActiveControl, setBounds, setFocus, setLayout, translatePointFromControl, translatePointToControl, translateRectangleFromControl, translateRectangleToControl, traverse, traverse
-
Methods inherited from class com._1c.g5.lwt.AbstractLightControl
addControlListener, getBounds, getCursor, getData, getLayoutData, getOverlay, getParent, getTooltip, getVisibleBounds, handleEvent, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setCursor, setData, setFocusable, setLayoutData, setOverlay, setParent, setTooltip
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.lwt.ILightComposite
getMainLayer
-
Methods inherited from interface com._1c.g5.lwt.ILightControl
addControlListener, getBounds, getCursor, getData, getLayoutData, getParent, getTooltip, getVisibleBounds, handleEvent, initialize, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setCursor, setData, setLayoutData, setParent, setTooltip
-
-
-
-
Constructor Detail
-
LightCombo
public LightCombo(boolean quickSearchAllowed, boolean onlyComboValuesAllowed)
Instantiates a new light combo.- Parameters:
quickSearchAllowed
-true
to enable quick searchonlyComboValuesAllowed
-true
to allow only combo values
-
LightCombo
public LightCombo(boolean quickSearchAllowed)
Instantiates a new light combo.- Parameters:
quickSearchAllowed
-true
to enable quick search
-
LightCombo
public LightCombo()
The default constructor without quick search.
-
-
Method Detail
-
setQuickSearchAllowed
public void setQuickSearchAllowed(boolean quickSearchAllowed)
Sets if quicksearch is allowed.- Parameters:
quickSearchAllowed
- -true
if quicksearch should be allowed.
-
isQuickSearchAllowed
public boolean isQuickSearchAllowed()
Returnstrue
if quicksearch is allowed.- Returns:
true
if quicksearch is allowed.
-
getArrowButton
public LightImageButton getArrowButton()
Gets the arrow button.- Returns:
- the arrow button.
-
addItem
public void addItem(LightCombo.Item item, int index)
Adds the item to this combo.- Parameters:
item
- the item to add.index
- the item index.
-
addItem
public void addItem(LightCombo.Item item)
Appends the item to this combo.- Parameters:
item
- the item to append.
-
setItem
public void setItem(int index, LightCombo.Item item)
Sets the item at the specified index.- Parameters:
index
- the index of the item.item
- the new item.
-
getSelectionIndex
public int getSelectionIndex()
Gets the selection index.- Returns:
- the selection index or
-1
if nothing selected.
-
getItemCount
public int getItemCount()
Gets the item count.- Returns:
- the item count.
-
setItems
public void setItems(LightCombo.Item[] items)
Sets all the items.- Parameters:
items
- the new items.
-
removeAllItems
public void removeAllItems()
Removes all items from this combo.
-
removeItem
public void removeItem(int index)
Removes the item at the specified index.- Parameters:
index
- the index.
-
selectItem
public void selectItem(int index)
Selects the item at the given index.- Parameters:
index
- the index of item to select.
-
deselectAll
public void deselectAll()
Clears the item selection.
-
clearSelection
public void clearSelection()
Clears text selection.
-
addSelectionIndexListener
public void addSelectionIndexListener(IChangedListener<LightCombo,Integer> listener)
Adds the selection index listener.- Parameters:
listener
- the listener to add.
-
removeSelectionIndexListener
public void removeSelectionIndexListener(IChangedListener<LightCombo,Integer> listener)
Removes the selection index listener.- Parameters:
listener
- the listener to remove.
-
toggleDropdown
public void toggleDropdown(boolean visible)
Displays or hides the drop-down list.- Parameters:
visible
-true
to show / refresh the drop-down,false
to hide it.
-
-