Class ValueComboChooser
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com._1c.g5.v8.dt.common.ui.controls.ValueChooser
com._1c.g5.v8.dt.common.ui.controls.ValueComboChooser
- All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Extension of
The component allows to add other custom actions to the control expanding its capabilities.
The implementation is based on the
ValueChooser component which includes combo-box behavior
(drop-down list) along with standard ActionBar action button decorated with
combo dropdown arrow.The component allows to add other custom actions to the control expanding its capabilities.
The implementation is based on the
CCombo code base, with the list
is being replaced with the native SWT table.
TODO documentation with samples
TODO full support of parent scrollable components - now there is some minor
glitch in this.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCombo button identifier used to distinguish actions activated via action bar of the component.Fields inherited from class org.eclipse.swt.widgets.Control
handle -
Constructor Summary
ConstructorsConstructorDescriptionValueComboChooser(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.widgets.FormToolkit toolkit, int maxDecorationWidth, int style) Creates a new instance of the combo chooser. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new element to the combo.voidaddCommitListener(ValueComboChooser.CommitListener commitListener) voidClears selection from the text in the content area and popup.voidRemoves selected element from the content area.voiddropDown(boolean drop) Drops the popup down.intGets the number of items in the combo.intGets the index of the current selection in the control.voidremove(int index) Removes element from the combo.voidClears all elements from the combo.voidremoveCommitListener(ValueComboChooser.CommitListener commitListener) voidReplace element from the combo.voidselect(int index) Selects element of the combo.Methods inherited from class com._1c.g5.v8.dt.common.ui.controls.ValueChooser
addActionBarListener, addButton, addDisposeListener, addFocusListener, addListener, addModifyListener, addSpinner, addTraverseListener, addVerifyListener, dispose, getActionBarItems, getImage, getSelection, getSelectionCount, getStyledText, getText, isEditable, removeActionBarListener, removeModifyListener, removeVerifyListener, selectAll, setEditable, setImage, setMultiLine, setSelection, setSelection, setText, setVisibleLineCountMethods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBarMethods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateMethods inherited from class org.eclipse.swt.widgets.Widget
checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Field Details
-
COMBO_BUTTON_ID
Combo button identifier used to distinguish actions activated via action bar of the component.- See Also:
-
-
Constructor Details
-
ValueComboChooser
public ValueComboChooser(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.widgets.FormToolkit toolkit, int maxDecorationWidth, int style) Creates a new instance of the combo chooser.- Parameters:
parent- Parent widget for the chooser.toolkit- Form toolkit reference.maxDecorationWidth- Max width of the decoration in content area.style- The styling of the widget.
-
-
Method Details
-
addCommitListener
-
removeCommitListener
-
add
Adds a new element to the combo.- Parameters:
image- The decorating image to add as a part of the element (optional).value- The text value of the item (mandatory)
-
replace
Replace element from the combo.- Parameters:
index- Index of the element to replaceimage- The decorating image a part of the element (optional).value- The text value of the item (mandatory)
-
clearSelection
public void clearSelection()Clears selection from the text in the content area and popup.- Overrides:
clearSelectionin classValueChooser
-
deselectAll
public void deselectAll()Removes selected element from the content area. -
getArrowButton
- Returns:
- arrow button associated with this value combo chooser.
-
getItemCount
public int getItemCount()Gets the number of items in the combo.- Returns:
- The number of items.
-
getSelectionIndex
public int getSelectionIndex()Gets the index of the current selection in the control.- Returns:
- The index of the selection.
-
remove
public void remove(int index) Removes element from the combo.- Parameters:
index- Index of the element to remove.
-
removeAll
public void removeAll()Clears all elements from the combo. -
select
public void select(int index) Selects element of the combo.- Parameters:
index- Index of the selection.
-
dropDown
public void dropDown(boolean drop) Drops the popup down.- Parameters:
drop- True if the popup should be dropped down; false if it should be collapsed.
-