|
Eclipse Platform 2.0 |
||||||||||
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.Caret
Instances of this class provide an i-beam that is typically used as the insertion point for text.
IMPORTANT: This class is intended to be subclassed only within the SWT implementation.
Constructor Summary | |
Caret(Canvas parent,
int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
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 is associated with
the receiver. |
Font |
getFont()
Returns the font that the receiver will use to paint textual information. |
Image |
getImage()
Returns the image that the receiver will use to paint the caret. |
Point |
getLocation()
Returns a point describing the receiver's location relative to its parent (or its display if its parent is null). |
Canvas |
getParent()
Returns the receiver's parent, which must be a Canvas . |
Point |
getSize()
Returns a point describing the receiver's size. |
boolean |
getVisible()
Returns true if the receiver is visible, and
false otherwise. |
boolean |
isVisible()
Returns true if the receiver is visible and all
of the receiver's ancestors are visible and false
otherwise. |
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 |
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 |
setImage(Image image)
Sets the image that the receiver will use to paint the caret to the image specified by the argument, or to the default which is a filled rectangle if the argument is null |
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 |
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 |
setVisible(boolean visible)
Marks the receiver as visible if the argument is true ,
and marks it invisible otherwise. |
Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Caret(Canvas 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 construct
IllegalArgumentException
- SWTException
- SWT
,
Widget.checkSubclass()
,
Widget.getStyle()
Method Detail |
public Rectangle getBounds()
SWTException
- public Display getDisplay()
Widget
Display
that is associated with
the receiver.
A widget's display is either provided when it is created
(for example, top level Shell
s) or is the
same as its parent's display.
getDisplay
in class Widget
public Font getFont()
SWTException
- public Image getImage()
SWTException
- public Point getLocation()
SWTException
- public Canvas getParent()
Canvas
.
SWTException
- public Point getSize()
SWTException
- 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 boolean isVisible()
true
if the receiver is visible and all
of the receiver's ancestors are visible and false
otherwise.
SWTException
- getVisible()
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).
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 receiver
SWTException
- public void setBounds(Rectangle rect)
x
and
y
fields of the rectangle are relative to
the receiver's parent (or its display if its parent is null).
rect
- the new bounds for the receiver
SWTException
- public void setFont(Font font)
font
- the new font (or null)
IllegalArgumentException
- SWTException
- public void setImage(Image image)
IllegalArgumentException
- SWTException
- public void setLocation(int x, int y)
x
- the new x coordinate for the receivery
- the new y coordinate for the receiver
SWTException
- public void setLocation(Point location)
location
- the new location for the receiver
SWTException
- public void setSize(int width, int height)
width
- the new width for the receiverheight
- the new height for the receiver
SWTException
- public void setSize(Point size)
size
- the new extent for the receiver
IllegalArgumentException
- SWTException
- 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 state
SWTException
-
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |