Class ValueChooser
- 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
 
 
 
 
 
- 
- All Implemented Interfaces:
- org.eclipse.swt.graphics.Drawable
 - Direct Known Subclasses:
- ValueComboChooser
 
 public class ValueChooser extends org.eclipse.swt.widgets.Composite1C-specific composite widget for displaying/editing the value of the text field in property/scheme editor(s) as well as providing controls for changing the value of the field via actions associated with this field. The widget consists of two major areas:
 - Content area which shows selected value and optional graphical decoration (image)
- And control area holding a set of content management action buttons (like selection from list, cleaning of the current field value, etc
 
- 
- 
Constructor SummaryConstructors Constructor Description ValueChooser(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.widgets.FormToolkit toolkit, int maxDecorationWidth, int style)Constructs new instance of the widget using parent and style as input arguments.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionBarListener(IActionBarListener listener)Adds action bar listener to the embedded action bar.IActionBarItemaddButton(String name, org.eclipse.swt.graphics.Image image, String toolTip, int style)Adds a button to the contained action bar.voidaddDisposeListener(org.eclipse.swt.events.DisposeListener listener)Adds dispose listener to the control.voidaddFocusListener(org.eclipse.swt.events.FocusListener listener)voidaddListener(int eventType, org.eclipse.swt.widgets.Listener listener)Adds a listener to the text field in case of keyUp or keyDown eventvoidaddModifyListener(org.eclipse.swt.events.ModifyListener listener)Adds modification listener to the control.IActionBarItemaddSpinner(String name, int style)voidaddTraverseListener(org.eclipse.swt.events.TraverseListener listener)Adds traverse listener to the controlvoidaddVerifyListener(org.eclipse.swt.events.VerifyListener listener)Adds verification listener to the control.voidclearSelection()Clears selection from the text in the content area.voiddispose()IActionBarItem[]getActionBarItems()org.eclipse.swt.graphics.ImagegetImage()Gets decorating image for the content area of the control.org.eclipse.swt.graphics.PointgetSelection()Returns the selection.intgetSelectionCount()Gets the number of selected characters.org.eclipse.swt.custom.StyledTextgetStyledText()Get current styled textStringgetText()Gets the text entered into the text field.booleanisEditable()Checks if the control is in editable state.voidremoveActionBarListener(IActionBarListener listener)Removes action bar listener from the embedded action bar.voidremoveModifyListener(org.eclipse.swt.events.ModifyListener modifyListener)voidremoveVerifyListener(org.eclipse.swt.events.VerifyListener listener)Removes verification listener from the control.voidselectAll()Selects the whole text within the text control of the widget.voidsetEditable(boolean editable)Sets/resets the read-only mode for the text control.voidsetImage(org.eclipse.swt.graphics.Image image)Sets decorating image for the content area of the control/voidsetMultiLine(boolean multiLine)Sets the multiline mode for the value chooser.voidsetSelection(int start)Sets selection to the text with given offsets.voidsetSelection(int start, int end)Sets selection to the text with given offsets.voidsetText(String text)Sets the text to the text field.voidsetVisibleLineCount(int count)Sets visible line count, activates multiline mode.- 
Methods inherited from class org.eclipse.swt.widgets.Compositechanged, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString
 - 
Methods inherited from class org.eclipse.swt.widgets.ScrollablecomputeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
 - 
Methods inherited from class org.eclipse.swt.widgets.ControladdControlListener, 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, update
 - 
Methods inherited from class org.eclipse.swt.widgets.WidgetcheckWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData
 
- 
 
- 
- 
- 
Constructor Detail- 
ValueChooserpublic ValueChooser(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.forms.widgets.FormToolkit toolkit, int maxDecorationWidth, int style)Constructs new instance of the widget using parent and style as input arguments.- Parameters:
- parent- Parent container.
- toolkit- Form toolkit reference.
- maxDecorationWidth- Maximum width allowed for the control decoration.
- style- The style flag set.
 
 
- 
 - 
Method Detail- 
getActionBarItemspublic IActionBarItem[] getActionBarItems() - Returns:
- array of action items of the action bar associated with this value chooser.
 Never null.
 
 - 
addActionBarListenerpublic void addActionBarListener(IActionBarListener listener) Adds action bar listener to the embedded action bar.- Parameters:
- listener- Listener to add.
 
 - 
addButtonpublic IActionBarItem addButton(String name, org.eclipse.swt.graphics.Image image, String toolTip, int style) Adds a button to the contained action bar.- Parameters:
- name- Name of the button.
- image- Image being shown on the button.
- toolTip- Button tooltip which is shown when hovering over the button/.
- stele- Style modifer of the buttong being added.
- Returns:
- The action bar button instance for further configuration.
 
 - 
addDisposeListenerpublic void addDisposeListener(org.eclipse.swt.events.DisposeListener listener) Adds dispose listener to the control.- Overrides:
- addDisposeListenerin class- org.eclipse.swt.widgets.Widget
- Parameters:
- listener- The listener to add.
 
 - 
addFocusListenerpublic void addFocusListener(org.eclipse.swt.events.FocusListener listener) - Overrides:
- addFocusListenerin class- org.eclipse.swt.widgets.Control
 
 - 
addListenerpublic void addListener(int eventType, org.eclipse.swt.widgets.Listener listener)Adds a listener to the text field in case of keyUp or keyDown event- Overrides:
- addListenerin class- org.eclipse.swt.widgets.Widget
- Parameters:
- eventType- Type of the event
- listener- Listener to add
 
 - 
addModifyListenerpublic void addModifyListener(org.eclipse.swt.events.ModifyListener listener) Adds modification listener to the control.- Parameters:
- listener- The listener to add.
 
 - 
addSpinnerpublic IActionBarItem addSpinner(String name, int style) 
 - 
addTraverseListenerpublic void addTraverseListener(org.eclipse.swt.events.TraverseListener listener) Adds traverse listener to the control- Overrides:
- addTraverseListenerin class- org.eclipse.swt.widgets.Control
- Parameters:
- listner- Ther listener to add.
 
 - 
addVerifyListenerpublic void addVerifyListener(org.eclipse.swt.events.VerifyListener listener) Adds verification listener to the control.- Parameters:
- listener- The listener to add.
 
 - 
clearSelectionpublic void clearSelection() Clears selection from the text in the content area.
 - 
getImagepublic org.eclipse.swt.graphics.Image getImage() Gets decorating image for the content area of the control.- Returns:
- The image (if any) decorating content area.
 
 - 
getSelectionpublic org.eclipse.swt.graphics.Point getSelection() Returns the selection. Text selections are specified in terms of caret positions. In a text widget that contains N characters, there are N+1 caret positions, ranging from 0..N- Returns:
- start and end of the selection, x is the offset of the first selected character, y is the offset after the last selected character. The selection values returned are visual (i.e., x will always always be <= y). To determine if a selection is right-to-left (RtoL) vs. left-to-right (LtoR), compare the caretOffset to the start and end of the selection (e.g., caretOffset == start of selection implies that the selection is RtoL).
 
 - 
getSelectionCountpublic int getSelectionCount() Gets the number of selected characters.- Returns:
- the number of selected characters.
 
 - 
getStyledTextpublic org.eclipse.swt.custom.StyledText getStyledText() Get current styled text- Returns:
- Styled Text
 
 - 
getTextpublic String getText() Gets the text entered into the text field.- Returns:
- The text contained in the text field.
 
 - 
isEditablepublic boolean isEditable() Checks if the control is in editable state.- Returns:
- True if control is editable; false otherwise.
 
 - 
removeActionBarListenerpublic void removeActionBarListener(IActionBarListener listener) Removes action bar listener from the embedded action bar.- Parameters:
- listener- Listener to remove.
 
 - 
removeModifyListenerpublic void removeModifyListener(org.eclipse.swt.events.ModifyListener modifyListener) 
 - 
removeVerifyListenerpublic void removeVerifyListener(org.eclipse.swt.events.VerifyListener listener) Removes verification listener from the control.- Parameters:
- listener- The listener to remove.
 
 - 
selectAllpublic void selectAll() Selects the whole text within the text control of the widget.
 - 
setEditablepublic void setEditable(boolean editable) Sets/resets the read-only mode for the text control.- Parameters:
- readOnly- The editable flag.
 
 - 
setImagepublic void setImage(org.eclipse.swt.graphics.Image image) Sets decorating image for the content area of the control/- Parameters:
- image- Image to set.
 
 - 
setMultiLinepublic void setMultiLine(boolean multiLine) Sets the multiline mode for the value chooser.- Parameters:
- multiline- True if the chooser should be a multiline one; false otherwise.
 
 - 
setVisibleLineCountpublic void setVisibleLineCount(int count) Sets visible line count, activates multiline mode.- Parameters:
- count- number of visible lines.
 
 - 
setSelectionpublic void setSelection(int start) Sets selection to the text with given offsets. Index is zero-based.
 - 
setSelectionpublic void setSelection(int start, int end)Sets selection to the text with given offsets. Index is zero-based.- Parameters:
- start- Start index of the selection.
- end- End index of the seletion.
 
 - 
setTextpublic void setText(String text) Sets the text to the text field.- Parameters:
- text- The text to set.
 
 - 
disposepublic void dispose() - Overrides:
- disposein class- org.eclipse.swt.widgets.Widget
 
 
- 
 
-