public abstract class Control extends Widget implements Drawable
IMPORTANT: This class is intended to be subclassed only within the SWT implementation.
Constructor and Description |
---|
Control(Composite parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
void |
addControlListener(ControlListener listener)
Adds the listener to the collection of listeners who will
be notified when the control is moved or resized, by sending
it one of the messages defined in the
ControlListener
interface. |
void |
addDragDetectListener(DragDetectListener listener)
Adds the listener to the collection of listeners who will
be notified when a drag gesture occurs, by sending it
one of the messages defined in the
DragDetectListener
interface. |
void |
addFocusListener(FocusListener listener)
Adds the listener to the collection of listeners who will
be notified when the control gains or loses focus, by sending
it one of the messages defined in the
FocusListener
interface. |
void |
addGestureListener(GestureListener listener)
Adds the listener to the collection of listeners who will
be notified when gesture events are generated for the control,
by sending it one of the messages defined in the
GestureListener interface. |
void |
addHelpListener(HelpListener listener)
Adds the listener to the collection of listeners who will
be notified when help events are generated for the control,
by sending it one of the messages defined in the
HelpListener interface. |
void |
addKeyListener(KeyListener listener)
Adds the listener to the collection of listeners who will
be notified when keys are pressed and released on the system keyboard, by sending
it one of the messages defined in the
KeyListener
interface. |
void |
addMenuDetectListener(MenuDetectListener listener)
Adds the listener to the collection of listeners who will
be notified when the platform-specific context menu trigger
has occurred, by sending it one of the messages defined in
the
MenuDetectListener interface. |
void |
addMouseListener(MouseListener listener)
Adds the listener to the collection of listeners who will
be notified when mouse buttons are pressed and released, by sending
it one of the messages defined in the
MouseListener
interface. |
void |
addTouchListener(TouchListener listener)
Adds the listener to the collection of listeners who will
be notified when touch events occur, by sending it
one of the messages defined in the
TouchListener
interface. |
void |
addTraverseListener(TraverseListener listener)
Adds the listener to the collection of listeners who will
be notified when traversal events occur, by sending it
one of the messages defined in the
TraverseListener
interface. |
Point |
computeSize(int wHint,
int hHint)
Returns the preferred size of the receiver.
|
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Returns the preferred size of the receiver.
|
boolean |
forceFocus()
Forces the receiver to have the keyboard focus, causing
all keyboard events to be delivered to it.
|
Accessible |
getAccessible()
Returns the accessible object for the receiver.
|
<T> T |
getAdapter(java.lang.Class<T> adapter)
Implementation of the
Adaptable interface. |
Color |
getBackground()
Returns the receiver's background color.
|
Image |
getBackgroundImage()
Returns the receiver's background image.
|
int |
getBorderWidth()
Returns the receiver's border width.
|
Rectangle |
getBounds()
Returns a rectangle describing the receiver's size and location
relative to its parent (or its display if its parent is null),
unless the receiver is a shell.
|
Cursor |
getCursor()
Returns the receiver's cursor, or null if it has not been set.
|
boolean |
getEnabled()
Returns
true if the receiver is enabled, and
false otherwise. |
Font |
getFont()
Returns the font that the receiver will use to paint textual information.
|
Color |
getForeground()
Returns the foreground color that the receiver will use to draw.
|
java.lang.Object |
getLayoutData()
Returns layout data which is associated with the receiver.
|
Point |
getLocation()
Returns a point describing the receiver's location relative
to its parent (or its display if its parent is null), unless
the receiver is a shell.
|
Menu |
getMenu()
Returns the receiver's pop up menu if it has one, or null
if it does not.
|
Monitor |
getMonitor()
Returns the receiver's monitor.
|
int |
getOrientation()
Returns the orientation of the receiver, which will be one of the
constants
SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT . |
Composite |
getParent()
Returns the receiver's parent, which must be a
Composite
or null when the receiver is a shell that was created with null or
a display for a parent. |
Shell |
getShell()
Returns the receiver's shell.
|
Point |
getSize()
Returns a point describing the receiver's size.
|
java.lang.String |
getToolTipText()
Returns the receiver's tool tip text, or null if it has
not been set.
|
boolean |
getTouchEnabled()
Returns
true if this control is receiving OS-level touch events,
otherwise false |
boolean |
getVisible()
Returns
true if the receiver is visible, and
false otherwise. |
boolean |
isEnabled()
Returns
true if the receiver is enabled and all
ancestors up to and including the receiver's nearest ancestor
shell are enabled. |
boolean |
isFocusControl()
Returns
true if the receiver has the user-interface
focus, and false otherwise. |
boolean |
isReparentable()
Returns
true if the underlying operating
system supports this reparenting, otherwise false |
boolean |
isVisible()
Returns
true if the receiver is visible and all
ancestors up to and including the receiver's nearest ancestor
shell are visible. |
void |
moveAbove(Control control)
Moves the receiver above the specified control in the
drawing order.
|
void |
moveBelow(Control control)
Moves the receiver below the specified control in the
drawing order.
|
void |
pack()
Causes the receiver to be resized to its preferred size.
|
void |
pack(boolean changed)
Causes the receiver to be resized to its preferred size.
|
void |
redraw()
Causes the entire bounds of the receiver to be marked
as needing to be redrawn.
|
void |
redraw(int x,
int y,
int width,
int height,
boolean all)
Causes the rectangular area of the receiver specified by
the arguments to be marked as needing to be redrawn.
|
void |
removeControlListener(ControlListener listener)
Removes the listener from the collection of listeners who will
be notified when the control is moved or resized.
|
void |
removeDragDetectListener(DragDetectListener listener)
Removes the listener from the collection of listeners who will
be notified when a drag gesture occurs.
|
void |
removeFocusListener(FocusListener listener)
Removes the listener from the collection of listeners who will
be notified when the control gains or loses focus.
|
void |
removeGestureListener(GestureListener listener)
Removes the listener from the collection of listeners who will
be notified when gesture events are generated for the control.
|
void |
removeHelpListener(HelpListener listener)
Removes the listener from the collection of listeners who will
be notified when the help events are generated for the control.
|
void |
removeKeyListener(KeyListener listener)
Removes the listener from the collection of listeners who will
be notified when keys are pressed and released on the system keyboard.
|
void |
removeMenuDetectListener(MenuDetectListener listener)
Removes the listener from the collection of listeners who will
be notified when the platform-specific context menu trigger has
occurred.
|
void |
removeMouseListener(MouseListener listener)
Removes the listener from the collection of listeners who will
be notified when mouse buttons are pressed and released.
|
void |
removeTouchListener(TouchListener listener)
Removes the listener from the collection of listeners who will
be notified when touch events occur.
|
void |
removeTraverseListener(TraverseListener listener)
Removes the listener from the collection of listeners who will
be notified when traversal events occur.
|
void |
requestLayout()
Requests that this control and all of its ancestors be repositioned
their layouts at the earliest opportunity.
|
void |
setBackground(Color color)
Sets the receiver's background color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setBackgroundImage(Image image)
Sets the receiver's background image to the image specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setBounds(int x,
int y,
int width,
int height)
Sets the receiver's size and location to the rectangular
area specified by the arguments.
|
void |
setBounds(Rectangle bounds)
Sets the receiver's size and location to the rectangular
area specified by the argument.
|
void |
setCursor(Cursor cursor)
Sets the receiver's cursor to the cursor specified by the
argument, or to the default cursor for that kind of control
if the argument is null.
|
void |
setData(java.lang.String key,
java.lang.Object value)
Sets the application defined property of the receiver
with the specified name to the given value.
|
void |
setEnabled(boolean enabled)
Enables the receiver if the argument is
true ,
and disables it otherwise. |
boolean |
setFocus()
Causes the receiver to have the keyboard focus,
such that all keyboard events will be delivered to it.
|
void |
setFont(Font font)
Sets the font that the receiver will use to paint textual information
to the font specified by the argument, or to the default font for that
kind of control if the argument is null.
|
void |
setForeground(Color color)
Sets the receiver's foreground color to the color specified
by the argument, or to the default system color for the control
if the argument is null.
|
void |
setLayoutData(java.lang.Object layoutData)
Sets the layout data associated with the receiver to the argument.
|
void |
setLocation(int x,
int y)
Sets the receiver's location to the point specified by
the arguments which are relative to the receiver's
parent (or its display if its parent is null), unless
the receiver is a shell.
|
void |
setLocation(Point location)
Sets the receiver's location to the point specified by
the arguments which are relative to the receiver's
parent (or its display if its parent is null), unless
the receiver is a shell.
|
void |
setMenu(Menu menu)
Sets the receiver's pop up menu to the argument.
|
void |
setOrientation(int orientation)
Sets the orientation of the receiver, which must be one
of the constants
SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT . |
boolean |
setParent(Composite parent)
Changes the parent of the widget to be the one provided if
the underlying operating system supports this feature.
|
void |
setRedraw(boolean redraw)
If the argument is
false , causes subsequent drawing
operations in the receiver to be ignored. |
void |
setSize(int width,
int height)
Sets the receiver's size to the point specified by the arguments.
|
void |
setSize(Point size)
Sets the receiver's size to the point specified by the argument.
|
void |
setToolTipText(java.lang.String toolTipText)
Sets the receiver's tool tip text to the argument, which
may be null indicating that no tool tip text should be shown.
|
void |
setTouchEnabled(boolean enabled)
Sets whether the receiver should accept touch events.
|
void |
setVisible(boolean visible)
Marks the receiver as visible if the argument is
true ,
and marks it invisible otherwise. |
Point |
toControl(int x,
int y)
Returns a point which is the result of converting the
argument, which is specified in display relative coordinates,
to coordinates relative to the receiver.
|
Point |
toControl(Point point)
Returns a point which is the result of converting the
argument, which is specified in display relative coordinates,
to coordinates relative to the receiver.
|
Point |
toDisplay(int x,
int y)
Returns a point which is the result of converting the
argument, which is specified in coordinates relative to
the receiver, to display relative coordinates.
|
Point |
toDisplay(Point point)
Returns a point which is the result of converting the
argument, which is specified in coordinates relative to
the receiver, to display relative coordinates.
|
void |
update()
Forces all outstanding paint requests for the widget
to be processed before this method returns.
|
addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, toString
public Control(Composite parent, int style)
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 composite control which will be the parent of the new instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- SWT.BORDER
,
Widget.checkSubclass()
,
Widget.getStyle()
public Composite getParent()
Composite
or null when the receiver is a shell that was created with null or
a display for a parent.SWTException
- public Shell getShell()
SWTException
- getParent()
public Monitor getMonitor()
public void setVisible(boolean visible)
true
,
and marks it invisible otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
visible
- the new visibility stateSWTException
- public boolean isVisible()
true
if the receiver is visible and all
ancestors up to and including the receiver's nearest ancestor
shell are visible. Otherwise, false
is returned.SWTException
- getVisible()
public boolean getVisible()
true
if the receiver is visible, and
false
otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.
SWTException
- public void setEnabled(boolean enabled)
true
,
and disables it otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.enabled
- the new enabled stateSWTException
- public boolean getEnabled()
true
if the receiver is enabled, and
false
otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.SWTException
- isEnabled()
public boolean isEnabled()
true
if the receiver is enabled and all
ancestors up to and including the receiver's nearest ancestor
shell are enabled. Otherwise, false
is returned.
A disabled control is typically not selectable from the user
interface and draws with an inactive or "grayed" look.SWTException
- getEnabled()
public void setBackground(Color color)
color
- the new color (or null)java.lang.IllegalArgumentException
- SWTException
- public Color getBackground()
SWTException
- public void setBackgroundImage(Image image)
Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.
image
- the new image (or null)java.lang.IllegalArgumentException
- SWTException
- public Image getBackgroundImage()
SWTException
- public void setForeground(Color color)
color
- the new color (or null)java.lang.IllegalArgumentException
- SWTException
- public Color getForeground()
SWTException
- public void setFont(Font font)
font
- the new font (or null)java.lang.IllegalArgumentException
- SWTException
- public Font getFont()
SWTException
- public void setCursor(Cursor cursor)
When the mouse pointer passes over a control its appearance is changed to match the control's cursor.
cursor
- the new cursor (or null)java.lang.IllegalArgumentException
- SWTException
- public Cursor getCursor()
When the mouse pointer passes over a control its appearance is changed to match the control's cursor.
null
SWTException
- public boolean setFocus()
true
if the control got focus, and false
if it was unable to.SWTException
- forceFocus()
public boolean forceFocus()
true
if the control got focus, and false
if it was unable to.SWTException
- setFocus()
public boolean isFocusControl()
true
if the receiver has the user-interface
focus, and false
otherwise.SWTException
- public Rectangle getBounds()
SWTException
- public void setBounds(Rectangle bounds)
x
and
y
fields of the rectangle are relative to
the receiver's parent (or its display if its parent is null).
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
bounds
- the new bounds for the receiverSWTException
- public void setBounds(int x, int y, int width, int height)
x
and
y
arguments are relative to the receiver's
parent (or its display if its parent is null), unless
the receiver is a shell. In this case, the x
and y
arguments are relative to the display.
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
x
- the new x coordinate for the receivery
- the new y coordinate for the receiverwidth
- the new width for the receiverheight
- the new height for the receiverSWTException
- public void setLocation(Point location)
location
- the new location for the receiverSWTException
- public void setLocation(int x, int y)
x
- the new x coordinate for the receivery
- the new y coordinate for the receiverSWTException
- public Point getLocation()
SWTException
- public void setSize(Point size)
Note: Attempting to set the width or height of the receiver to a negative number will cause them to be set to zero instead.
size
- the new size for the receiverjava.lang.IllegalArgumentException
- SWTException
- public void setSize(int width, int height)
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
width
- the new width for the receiverheight
- the new height for the receiverSWTException
- public Point getSize()
SWTException
- public Point computeSize(int wHint, int hHint)
The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT
is passed for the hint.
wHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)SWTException
- Layout
,
getBorderWidth()
,
getBounds()
,
getSize()
,
pack(boolean)
,
"computeTrim, getClientArea for controls that implement them"public Point computeSize(int wHint, int hHint, boolean changed)
The preferred size of a control is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the control need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT
is passed for the hint.
If the changed flag is true
, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false
, so layout
manager caches can be retained.
wHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)changed
- true
if the control's contents have changed, and false
otherwiseSWTException
- Layout
,
getBorderWidth()
,
getBounds()
,
getSize()
,
pack(boolean)
,
"computeTrim, getClientArea for controls that implement them"public void pack()
SWTException
- computeSize(int, int, boolean)
public void pack(boolean changed)
If the changed flag is true
, it indicates that the receiver's
contents have changed, therefore any caches that a layout manager
containing the control may have been keeping need to be flushed. When the
control is resized, the changed flag will be false
, so layout
manager caches can be retained.
changed
- whether or not the receiver's contents have changedSWTException
- computeSize(int, int, boolean)
public int getBorderWidth()
SWTException
- public Point toControl(int x, int y)
x
- the x coordinate to be translatedy
- the y coordinate to be translatedSWTException
- public Point toControl(Point point)
point
- the point to be translated (must not be null)java.lang.IllegalArgumentException
- SWTException
- public Point toDisplay(int x, int y)
x
- the x coordinate to be translatedy
- the y coordinate to be translatedSWTException
- public Point toDisplay(Point point)
point
- the point to be translated (must not be null)java.lang.IllegalArgumentException
- SWTException
- public java.lang.Object getLayoutData()
SWTException
- public void setLayoutData(java.lang.Object layoutData)
layoutData
- the new layout data for the receiver.SWTException
- public void setToolTipText(java.lang.String toolTipText)
toolTipText
- the new tool tip text (or null)SWTException
- public java.lang.String getToolTipText()
SWTException
- public void setMenu(Menu menu)
Note: Disposing of a control that has a pop up menu will dispose of the menu. To avoid this behavior, set the menu to null before the control is disposed.
menu
- the new pop up menujava.lang.IllegalArgumentException
- SWTException
- public Menu getMenu()
SWTException
- public void moveAbove(Control control)
control
- the sibling control (or null)java.lang.IllegalArgumentException
- SWTException
- moveBelow(org.eclipse.swt.widgets.Control)
,
Composite.getChildren()
public void moveBelow(Control control)
control
- the sibling control (or null)java.lang.IllegalArgumentException
- SWTException
- moveAbove(org.eclipse.swt.widgets.Control)
,
Composite.getChildren()
public <T> T getAdapter(java.lang.Class<T> adapter)
Widget
Adaptable
interface.
IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code.
getAdapter
in interface Adaptable
getAdapter
in class Widget
adapter
- the lookup classnull
if
there is no adapter associated with the given class.public void addControlListener(ControlListener listener)
ControlListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- ControlListener
,
removeControlListener(org.eclipse.swt.events.ControlListener)
public void removeControlListener(ControlListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- ControlListener
,
addControlListener(org.eclipse.swt.events.ControlListener)
public void addMouseListener(MouseListener listener)
MouseListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseListener
,
removeMouseListener(org.eclipse.swt.events.MouseListener)
public void removeMouseListener(MouseListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- MouseListener
,
addMouseListener(org.eclipse.swt.events.MouseListener)
public void addKeyListener(KeyListener listener)
KeyListener
interface.
Note: the key events in RWT are not meant for general purpose.
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- KeyListener
,
removeKeyListener(org.eclipse.swt.events.KeyListener)
public void removeKeyListener(KeyListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- KeyListener
,
addKeyListener(org.eclipse.swt.events.KeyListener)
public void addTraverseListener(TraverseListener listener)
TraverseListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- TraverseListener
,
removeTraverseListener(org.eclipse.swt.events.TraverseListener)
public void removeTraverseListener(TraverseListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- TraverseListener
,
addTraverseListener(org.eclipse.swt.events.TraverseListener)
public void addFocusListener(FocusListener listener)
FocusListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- FocusListener
,
removeFocusListener(org.eclipse.swt.events.FocusListener)
public void removeFocusListener(FocusListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- FocusListener
,
addFocusListener(org.eclipse.swt.events.FocusListener)
public void addHelpListener(HelpListener listener)
HelpListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- HelpListener
,
removeHelpListener(org.eclipse.swt.events.HelpListener)
public void removeHelpListener(HelpListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- HelpListener
,
addHelpListener(org.eclipse.swt.events.HelpListener)
public void addDragDetectListener(DragDetectListener listener)
DragDetectListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- DragDetectListener
,
removeDragDetectListener(org.eclipse.swt.events.DragDetectListener)
public void removeDragDetectListener(DragDetectListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- DragDetectListener
,
addDragDetectListener(org.eclipse.swt.events.DragDetectListener)
public void addMenuDetectListener(MenuDetectListener listener)
MenuDetectListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- MenuDetectListener
,
removeMenuDetectListener(org.eclipse.swt.events.MenuDetectListener)
public void removeMenuDetectListener(MenuDetectListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- MenuDetectListener
,
addMenuDetectListener(org.eclipse.swt.events.MenuDetectListener)
public void requestLayout()
The control will not be repositioned synchronously. This method is fast-running and only marks the control for future participation in a deferred layout.
Invoking this method multiple times before the layout occurs is an inexpensive no-op.
public void setRedraw(boolean redraw)
false
, causes subsequent drawing
operations in the receiver to be ignored. No drawing of any kind
can occur in the receiver until the flag is set to true.
Graphics operations that occurred while the flag was
false
are lost. When the flag is set to true
,
the entire widget is marked as needing to be redrawn. Nested calls
to this method are stacked.
Note: This operation is a hint and may not be supported on some platforms or for some widgets.
Note: With RAP we can't really force a redraw. This is just a fake to enable event notifications that come on OS systems with redraws.
redraw
- the new redraw stateSWTException
- public void redraw()
Note: With RAP we can't really force a redraw. This is just a fake to enable event notifications that come on OS systems with redraws.
SWTException
- public void redraw(int x, int y, int width, int height, boolean all)
all
flag is true
, any
children of the receiver which intersect with the specified
area will also paint their intersecting areas. If the
all
flag is false
, the children
will not be painted.x
- the x coordinate of the area to drawy
- the y coordinate of the area to drawwidth
- the width of the area to drawheight
- the height of the area to drawall
- true
if children should redraw, and false
otherwiseSWTException
- update()
,
PaintListener
,
SWT.NO_BACKGROUND
,
SWT.NO_REDRAW_RESIZE
,
SWT.NO_MERGE_PAINTS
,
SWT.DOUBLE_BUFFERED
public void update()
Note: This method does not cause a redraw.
SWTException
- public boolean setParent(Composite parent)
true
if the parent is successfully changed.parent
- the new parent for the control.true
if the parent is changed and false
otherwise.java.lang.IllegalArgumentException
- null
SWTException
- public boolean isReparentable()
true
if the underlying operating
system supports this reparenting, otherwise false
true
if the widget can be reparented, otherwise false
SWTException
- public void setOrientation(int orientation)
SWT.LEFT_TO_RIGHT
or SWT.RIGHT_TO_LEFT
.orientation
- new orientation styleSWTException
- public int getOrientation()
SWT.LEFT_TO_RIGHT
or SWT.RIGHT_TO_LEFT
.SWTException
- public Accessible getAccessible()
If this is the first time this object is requested, then the object is created and returned. The object returned by getAccessible() does not need to be disposed.
SWTException
- Accessible.addAccessibleListener(org.eclipse.swt.accessibility.AccessibleListener)
,
Accessible.addAccessibleControlListener(org.eclipse.swt.accessibility.AccessibleControlListener)
public void addGestureListener(GestureListener listener)
GestureListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- GestureListener
,
removeGestureListener(org.eclipse.swt.events.GestureListener)
public void removeGestureListener(GestureListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- GestureListener
,
addGestureListener(org.eclipse.swt.events.GestureListener)
public void addTouchListener(TouchListener listener)
TouchListener
interface.
NOTE: You must also call setTouchEnabled
to notify the
windowing toolkit that you want touch events to be generated.
listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- TouchListener
,
removeTouchListener(org.eclipse.swt.events.TouchListener)
public void removeTouchListener(TouchListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- TouchListener
,
addTouchListener(org.eclipse.swt.events.TouchListener)
public void setTouchEnabled(boolean enabled)
enabled
- the new touch-enabled stateSWTException
- public boolean getTouchEnabled()
true
if this control is receiving OS-level touch events,
otherwise false
Note that this method will return false if the current platform does not support touch-based input. If this method does return true, gesture events will not be sent to the control.
true
if the widget is currently receiving touch events; false
otherwise.SWTException
- public void setData(java.lang.String key, java.lang.Object value)
Widget
Applications may associate arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the widget is disposed of, it is the application's responsibility to hook the Dispose event on the widget and do so.
setData
in class Widget
key
- the name of the propertyvalue
- the new value for the propertyWidget.getData(String)
Copyright (c) EclipseSource and others 2002, 2016.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0