Control (Eclipse Platform API Specification)

Control is the abstract superclass of all windowed user interface classes.

IMPORTANT: This class is intended to be subclassed only
within the SWT implementation.

Method Summary
 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
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
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
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
addMouseMoveListener(MouseMoveListener listener)

          Adds the listener to the collection of listeners who will
be notified when the mouse moves, by sending it one of the
messages defined in the MouseMoveListener
interface.

 void
addMouseTrackListener(MouseTrackListener listener)

          Adds the listener to the collection of listeners who will
be notified when the mouse passes or hovers over controls, by sending
it one of the messages defined in the MouseTrackListener
interface.

 void
addPaintListener(PaintListener listener)

          Adds the listener to the collection of listeners who will
be notified when the receiver needs to be painted, by sending it
one of the messages defined in the PaintListener
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.

 Color
getBackground()

          Returns the receiver’s background color.

 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).

 Display
getDisplay()

          Returns the display that the receiver was created on.

 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.

 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).

 Menu
getMenu()

          Returns the receiver’s pop up menu if it has one, or null
if it does not.

 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.

 String
getToolTipText()

          Returns the receiver’s tool tip text, or null if it has
not been set.

 boolean
getVisible()

          Returns true if the receiver is visible, and
false otherwise.

 void
internal_dispose_GC(int hDC,
GCData data)


          Invokes platform specific functionality to dispose a GC handle.

 int
internal_new_GC(GCData data)

          Invokes platform specific functionality to allocate a new GC handle.

 boolean
isDisposed()

          Returns true if the widget has been disposed,
and false otherwise.

 boolean
isEnabled()

          Returns true if the receiver is enabled and all
of the receiver’s ancestors are enabled, and false
otherwise.

 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
of the receiver’s ancestors are visible and false
otherwise.

 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
removeFocusListener(FocusListener listener)

          Removes the listener from the collection of listeners who will
be notified when the control gains or loses focus.

 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
removeMouseListener(MouseListener listener)

          Removes the listener from the collection of listeners who will
be notified when mouse buttons are pressed and released.

 void
removeMouseMoveListener(MouseMoveListener listener)

          Removes the listener from the collection of listeners who will
be notified when the mouse moves.

 void
removeMouseTrackListener(MouseTrackListener listener)

          Removes the listener from the collection of listeners who will
be notified when the mouse passes or hovers over controls.

 void
removePaintListener(PaintListener listener)

          Removes the listener from the collection of listeners who will
be notified when the receiver needs to be painted.

 void
removeTraverseListener(TraverseListener listener)

          Removes the listener from the collection of listeners who will
be notified when traversal events occur.

 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
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 rect)

          Sets the receiver’s size and location to the rectangular
area specified by the argument.

 void
setCapture(boolean capture)

          If the argument is true, causes the receiver to have
all mouse events delivered to it until the method is called with
false as 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
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(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).

 void
setLocation(Point location)

          Sets the receiver’s location to the point specified by
the argument which is relative to the receiver’s
parent (or its display if its parent is null).

 void
setMenu(Menu menu)

          Sets the receiver’s pop up menu to the argument.

 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(String string)

          Sets the receiver’s tool tip text to the argument, which
may be null indicating that no tool tip text should be shown.

 void
setVisible(boolean visible)

          Marks the receiver as visible if the argument is true,
and marks it invisible otherwise.

 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(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.

 boolean
traverse(int traversal)

          Based on the argument, perform one of the expected platform
traversal action.

 void
update()

          Forces all outstanding paint requests for the widget tree
to be processed before this method returns.