|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.widgets.Widget org.eclipse.swt.widgets.Control org.eclipse.swt.widgets.Scrollable org.eclipse.swt.widgets.Composite com.ibm.commons.swt.controls.CTreeCombo
public class CTreeCombo
The CTreeCombo class represents a selectable user interface object that combines a text field and a tree and issues notification when an item is selected from the tree.
Note that although this class is a subclass of Composite
, it
does not make sense to add children to it, or set a layout on it.
Nested Class Summary | |
---|---|
static interface |
CTreeCombo.IPathSerializer
An interface that is used internally by the tree control to serialize the path to the item that was selected within the tree. |
Field Summary |
---|
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
CTreeCombo(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String id)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
---|---|
void |
addModifyListener(org.eclipse.swt.events.ModifyListener listener)
Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by sending it one of the messages defined in the ModifyListener interface. |
void |
addTreeFilter(org.eclipse.jface.viewers.ViewerFilter filter)
Adds a filter to the tree control. |
org.eclipse.swt.graphics.Point |
computeSize(int wHint,
int hHint,
boolean changed)
|
void |
expandTreeToLevel(int level)
|
org.eclipse.swt.widgets.Control[] |
getChildren()
|
int |
getCols()
Returns the width of the widget in columns. |
boolean |
getEditable()
Gets the editable state. |
java.lang.String |
getId()
Returns a string identifier associated with the current widget/control |
org.eclipse.jface.viewers.ILabelProvider |
getLabelProvider()
|
CTreeCombo.IPathSerializer |
getPathSerializer()
|
org.eclipse.swt.graphics.Point |
getSelection()
Returns a Point whose x coordinate is the start of the
selection in the receiver's text field, and whose y coordinate is the end
of the selection. |
int |
getStyle()
|
java.lang.String |
getText()
Returns a string containing a copy of the contents of the receiver's text field. |
int |
getTextHeight()
Returns the height of the receivers's text field. |
int |
getTextLimit()
Returns the maximum number of characters that the receiver's text field is capable of holding. |
org.eclipse.jface.viewers.ITreeContentProvider |
getTreeContentProvider()
|
int |
getVisibleItemCount()
Gets the number of items that are visible in the drop down portion of the receiver's list. |
boolean |
isFocusControl()
|
void |
redraw()
|
void |
redraw(int x,
int y,
int width,
int height,
boolean all)
|
void |
removeModifyListener(org.eclipse.swt.events.ModifyListener listener)
Removes the listener from the collection of listeners who will be notified when the receiver's text is modified. |
void |
removeTreeFilter(org.eclipse.jface.viewers.ViewerFilter filter)
Removes the provided filter from the tree control. |
void |
setBackground(org.eclipse.swt.graphics.Color color)
|
void |
setCols(int cols)
Sets the width of the widget in columns. |
void |
setEditable(boolean editable)
Sets the editable state. |
void |
setEnabled(boolean enabled)
|
boolean |
setFocus()
|
void |
setFont(org.eclipse.swt.graphics.Font font)
|
void |
setForeground(org.eclipse.swt.graphics.Color color)
|
void |
setId(java.lang.String id)
Sets a string identifier on the current widget/control. |
void |
setLabelProvider(org.eclipse.jface.viewers.ILabelProvider labelProvider)
|
void |
setLayout(org.eclipse.swt.widgets.Layout layout)
Sets the layout which is associated with the receiver to be the argument which may be null. |
void |
setPathSerializer(CTreeCombo.IPathSerializer pathSerializer)
|
void |
setSelection(org.eclipse.swt.graphics.Point selection)
Sets the selection in the receiver's text field to the range specified by the argument whose x coordinate is the start of the selection and whose y coordinate is the end of the selection. |
void |
setText(java.lang.String string)
Sets the contents of the receiver's text field to the given string. |
void |
setText(java.lang.String string,
boolean setCaretToEnd)
Sets the contents of the receiver's text field to the given string. |
void |
setTextLimit(int limit)
Sets the maximum number of characters that the receiver's text field is capable of holding to be the argument. |
void |
setToolTipText(java.lang.String string)
|
void |
setTreeContent(org.eclipse.jface.viewers.ITreeContentProvider treeContent)
Sets a content provider for the tree control part of the widget. |
void |
setTreeInput(java.lang.Object treeInput)
The TreeViewer invokes inputChanged on the content provider and then the inputChanged hook method. |
void |
setVisible(boolean visible)
|
void |
setVisibleItemCount(int count)
Sets the number of items that are visible in the drop down portion of the receiver's list. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
changed, checkSubclass, drawBackground, getBackgroundMode, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayoutDeferred, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getBorderWidth, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CTreeCombo(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String id)
The style value is either one of the style constants defined in class
SWT
which is applicable to instances of this class, or
must be built by bitwise OR'ing together (that is, using the
int
"|" operator) two or more of those SWT
style constants. The class description lists the style constants that are
applicable to the class. Style bits are also inherited from superclasses.
parent
- a widget which will be the parent of the new instance (cannot
be null)style
- the style of widget to constructid
- a String value that can be used to identify the widget at a later point
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- SWT.BORDER
,
SWT.READ_ONLY
,
SWT.FLAT
,
Widget.getStyle()
Method Detail |
---|
public java.lang.String getId()
ICustomControl
getId
in interface ICustomControl
public void setId(java.lang.String id)
ICustomControl
setId
in interface ICustomControl
public int getCols()
org.eclipse.swt.graphics.FontMetrics}
public void setCols(int cols)
numberOfCols
- An int value, representing the number of columnsorg.eclipse.swt.graphics.FontMetrics}
public void setTreeContent(org.eclipse.jface.viewers.ITreeContentProvider treeContent)
treeContent
- an instance of ITreeContentProvider that will be queried for elements by the tree controlorg.eclipse.jface.viewers.ITreeContentProvider}
public void setTreeInput(java.lang.Object treeInput)
treeInput
- public void addTreeFilter(org.eclipse.jface.viewers.ViewerFilter filter)
filter
- a viewer filter that will be added to the tree control.public void removeTreeFilter(org.eclipse.jface.viewers.ViewerFilter filter)
filter
- public org.eclipse.jface.viewers.ILabelProvider getLabelProvider()
public void setLabelProvider(org.eclipse.jface.viewers.ILabelProvider labelProvider)
public CTreeCombo.IPathSerializer getPathSerializer()
public void setPathSerializer(CTreeCombo.IPathSerializer pathSerializer)
public void addModifyListener(org.eclipse.swt.events.ModifyListener listener)
ModifyListener
interface.
listener
- the listener which should be notified
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- ModifyListener
,
removeModifyListener(org.eclipse.swt.events.ModifyListener)
public org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)
computeSize
in class org.eclipse.swt.widgets.Composite
public org.eclipse.swt.widgets.Control[] getChildren()
getChildren
in class org.eclipse.swt.widgets.Composite
public boolean getEditable()
org.eclipse.swt.SWTException
- public org.eclipse.swt.graphics.Point getSelection()
Point
whose x coordinate is the start of the
selection in the receiver's text field, and whose y coordinate is the end
of the selection. The returned values are zero-relative. An "empty"
selection as indicated by the the x and y coordinates having the same
value.
org.eclipse.swt.SWTException
- public int getStyle()
getStyle
in class org.eclipse.swt.widgets.Widget
public java.lang.String getText()
org.eclipse.swt.SWTException
- public int getTextHeight()
org.eclipse.swt.SWTException
- public int getTextLimit()
setTextLimit()
, it will be the constant
Combo.LIMIT
.
org.eclipse.swt.SWTException
- public int getVisibleItemCount()
org.eclipse.swt.SWTException
- public boolean isFocusControl()
isFocusControl
in class org.eclipse.swt.widgets.Control
public void redraw()
redraw
in class org.eclipse.swt.widgets.Control
public void redraw(int x, int y, int width, int height, boolean all)
redraw
in class org.eclipse.swt.widgets.Control
public void removeModifyListener(org.eclipse.swt.events.ModifyListener listener)
listener
- the listener which should no longer be notified
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- ModifyListener
,
addModifyListener(org.eclipse.swt.events.ModifyListener)
public void setBackground(org.eclipse.swt.graphics.Color color)
setBackground
in class org.eclipse.swt.widgets.Control
public void setEditable(boolean editable)
editable
- the new editable state
org.eclipse.swt.SWTException
- public void setEnabled(boolean enabled)
setEnabled
in class org.eclipse.swt.widgets.Control
public boolean setFocus()
setFocus
in class org.eclipse.swt.widgets.Composite
public void setFont(org.eclipse.swt.graphics.Font font)
setFont
in class org.eclipse.swt.widgets.Control
public void setForeground(org.eclipse.swt.graphics.Color color)
setForeground
in class org.eclipse.swt.widgets.Control
public void setLayout(org.eclipse.swt.widgets.Layout layout)
Note : No Layout can be set on this Control because it already manages the size and position of its children.
setLayout
in class org.eclipse.swt.widgets.Composite
layout
- the receiver's new layout or null
org.eclipse.swt.SWTException
- public void setSelection(org.eclipse.swt.graphics.Point selection)
selection
- a point representing the new selection start and end
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setText(java.lang.String string)
Note: The text field in a Combo
is typically only capable
of displaying a single line of text. Thus, setting the text to a string
containing line breaks or other special characters will probably cause it
to display incorrectly.
string
- the new text
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setText(java.lang.String string, boolean setCaretToEnd)
Note: The text field in a Combo
is typically only capable
of displaying a single line of text. Thus, setting the text to a string
containing line breaks or other special characters will probably cause it
to display incorrectly.
string
- the new textboolean
- Sets whether or not to select all of the text in the control.
If true the caret will be placed at the end of the new text.
If false then this method has the same behavior as:
setText(String)
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setTextLimit(int limit)
limit
- new text limit
java.lang.IllegalArgumentException
- org.eclipse.swt.SWTException
- public void setToolTipText(java.lang.String string)
setToolTipText
in class org.eclipse.swt.widgets.Control
public void setVisible(boolean visible)
setVisible
in class org.eclipse.swt.widgets.Control
public void setVisibleItemCount(int count)
count
- the new number of items to be visible
org.eclipse.swt.SWTException
- public org.eclipse.jface.viewers.ITreeContentProvider getTreeContentProvider()
public void expandTreeToLevel(int level)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |