Package com._1c.g5.lwt.controls
Class LightImageCombo
- java.lang.Object
-
- com._1c.g5.lwt.AbstractLightControl
-
- com._1c.g5.lwt.controls.LightImageCombo
-
- All Implemented Interfaces:
IEditable,ILightControl
public class LightImageCombo extends AbstractLightControl implements IEditable
Special Combo with constant label. In this combo user can choose image on the left from label
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLightImageCombo.ItemCombo image item description.
-
Constructor Summary
Constructors Constructor Description LightImageCombo()Instantiates a new light image combo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItem(LightImageCombo.Item item)Appends the item to this combo.voidaddItem(LightImageCombo.Item item, int index)Adds the item to this combo.voidaddSelectionIndexListener(IChangedListener<LightImageCombo,Integer> listener)Adds the selection index listener.org.eclipse.swt.graphics.PointcomputeSize(org.eclipse.swt.graphics.GC gc, int width, int height, boolean flushCache)Computes the size of this control.voiddeselectAll()Clears the item selection.org.eclipse.swt.graphics.ColorgetBackgroundColor()Returns image combo background color.org.eclipse.swt.graphics.ColorgetBorderColor()Returns image combo border color.intgetItemCount()Gets the item count.intgetSelectionIndex()Gets the selection index.StringgetText()Returns image combo text.voidhandleEvent(org.eclipse.swt.widgets.Event event)Handles the SWT event, SWT events are pumped to this method if this control is active.booleanisEditable()Returns control editable state.booleanisGrayed()This image combo grayed state.voidpaint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)Paints the given rectangle of this control.voidremoveAllItems()Removes all items from this combo.voidremoveItem(int index)Removes the item at the specified index.voidremoveSelectionIndexListener(IChangedListener<LightImageCombo,Integer> listener)Removes the selection index listener.voidselectItem(int index)Selects the item at the given index.voidsetBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)Sets the background color.voidsetBorderColor(org.eclipse.swt.graphics.Color borderColor)Sets the border color.voidsetEditable(boolean isEditable)Sets control editable state.booleansetFocus(FocusSource focusSource)Sets the focus to this control.voidsetGrayed(boolean grayed)Sets the grayed state of this image combo.voidsetItem(int index, LightImageCombo.Item item)Sets the item at the specified index.voidsetItems(LightImageCombo.Item[] items)Sets all the items.voidsetText(String text)Sets this image combo text.voidtoggleDropdown(boolean visible)Displays or hides the drop-down list.-
Methods inherited from class com._1c.g5.lwt.AbstractLightControl
addControlListener, dispose, getBounds, getCursor, getData, getLayoutData, getOverlay, getParent, getTooltip, getVisibleBounds, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setBounds, setCursor, setData, setEnabled, setFocusable, setLayoutData, setOverlay, setParent, setTooltip, setVisible
-
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.ILightControl
initialize
-
-
-
-
Method Detail
-
getText
public String getText()
Returns image combo text.- Returns:
- image combo text, cannot be
null.
-
setText
public void setText(String text)
Sets this image combo text.- Parameters:
text- the text to set.
-
isGrayed
public boolean isGrayed()
This image combo grayed state.- Returns:
trueif grayed,falseif not.
-
setGrayed
public void setGrayed(boolean grayed)
Sets the grayed state of this image combo.- Parameters:
grayed-trueif grayed,falseif not.
-
getBorderColor
public org.eclipse.swt.graphics.Color getBorderColor()
Returns image combo border color.- Returns:
- image combo border color, can be
null.
-
getBackgroundColor
public org.eclipse.swt.graphics.Color getBackgroundColor()
Returns image combo background color.- Returns:
- image combo background color, can be
null.
-
setBorderColor
public void setBorderColor(org.eclipse.swt.graphics.Color borderColor)
Sets the border color.- Parameters:
borderColor- the new border color.
-
setBackgroundColor
public void setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)
Sets the background color.- Parameters:
backgroundColor- the new background color.
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.graphics.GC gc, int width, int height, boolean flushCache)Description copied from interface:ILightControlComputes the size of this control.- Specified by:
computeSizein interfaceILightControl- Overrides:
computeSizein classAbstractLightControl- Parameters:
gc- the GC to do measurements with.width- the width hint,SWT.DEFAULTto compute the preferred width.height- the height hint,SWT.DEFAULTto compute the preferred height.flushCache- the flush cache flag, instructs the associated layout to reset all its caches, if any.- Returns:
- the computed size.
-
handleEvent
public void handleEvent(org.eclipse.swt.widgets.Event event)
Description copied from interface:ILightControlHandles the SWT event, SWT events are pumped to this method if this control is active.- Specified by:
handleEventin interfaceILightControl- Overrides:
handleEventin classAbstractLightControl- Parameters:
event- the event to handle.- See Also:
ILightComposite.setActiveControl(ILightControl)
-
paint
public void paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)Description copied from interface:ILightControlPaints the given rectangle of this control.- Specified by:
paintin interfaceILightControl- Parameters:
gc- theGCto paint on.rectangle- the rectangle to paint.
-
setEditable
public void setEditable(boolean isEditable)
Description copied from interface:IEditableSets control editable state.- Specified by:
setEditablein interfaceIEditable- Parameters:
isEditable- -trueif control can be edited.
-
isEditable
public boolean isEditable()
Description copied from interface:IEditableReturns control editable state.- Specified by:
isEditablein interfaceIEditable- Returns:
trueif control can be edited.
-
addItem
public void addItem(LightImageCombo.Item item, int index)
Adds the item to this combo.- Parameters:
item- the item to add, cannot benullindex- the item index.
-
addItem
public void addItem(LightImageCombo.Item item)
Appends the item to this combo.- Parameters:
item- the item to append, cannot benull
-
setItem
public void setItem(int index, LightImageCombo.Item item)Sets the item at the specified index.- Parameters:
index- the index of the item.item- the new item, cannot benull
-
getSelectionIndex
public int getSelectionIndex()
Gets the selection index.- Returns:
- the selection index or
-1if nothing selected.
-
getItemCount
public int getItemCount()
Gets the item count.- Returns:
- the item count.
-
setItems
public void setItems(LightImageCombo.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.
-
addSelectionIndexListener
public void addSelectionIndexListener(IChangedListener<LightImageCombo,Integer> listener)
Adds the selection index listener.- Parameters:
listener- the listener to add, cannot benull
-
removeSelectionIndexListener
public void removeSelectionIndexListener(IChangedListener<LightImageCombo,Integer> listener)
Removes the selection index listener.- Parameters:
listener- the listener to remove, cannot benull
-
toggleDropdown
public void toggleDropdown(boolean visible)
Displays or hides the drop-down list.- Parameters:
visible-trueto show / refresh the drop-down,falseto hide it.
-
setFocus
public boolean setFocus(FocusSource focusSource)
Description copied from interface:ILightControlSets the focus to this control.- Specified by:
setFocusin interfaceILightControl- Overrides:
setFocusin classAbstractLightControl- Parameters:
focusSource- the focus request source.- Returns:
trueif focus was set,falseotherwise.
-
-