Class Caret
- Styles:
- (none)
- Events:
- (none)
IMPORTANT: This class is not intended to be subclassed.
- See Also:
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Fields inherited from class org.eclipse.swt.widgets.Widget
nativeZoom
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a rectangle describing the receiver's size and location relative to its parent (or its display if its parent is null).getFont()
Returns the font that the receiver will use to paint textual information.getImage()
Returns the image that the receiver will use to paint the caret.Returns a point describing the receiver's location relative to its parent (or its display if its parent is null).Returns the receiver's parent, which must be aCanvas
.getSize()
Returns a point describing the receiver's size.boolean
Returnstrue
if the receiver is visible, andfalse
otherwise.boolean
Returnstrue
if the receiver is visible and all of the receiver's ancestors are visible andfalse
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
Sets the receiver's size and location to the rectangular area specified by the argument.void
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
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 nullvoid
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
Sets the receiver's size to the point specified by the argument.void
setVisible
(boolean visible) Marks the receiver as visible if the argument istrue
, and marks it invisible otherwise.static void
win32_setHeight
(Caret caret, int height) IMPORTANT: This method is not part of the public API for Image.Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData, toString
-
Constructor Details
-
Caret
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.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 theint
"|" operator) two or more of thoseSWT
style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
parent
- a composite control which will be the parent of the new instance (cannot be null)style
- the style of control to construct- Throws:
IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
SWTException
-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
- See Also:
-
-
Method Details
-
getBounds
Returns a rectangle describing the receiver's size and location relative to its parent (or its display if its parent is null).- Returns:
- the receiver's bounding rectangle
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getFont
Returns the font that the receiver will use to paint textual information.- Returns:
- the receiver's font
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getImage
Returns the image that the receiver will use to paint the caret.- Returns:
- the receiver's image
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getLocation
Returns a point describing the receiver's location relative to its parent (or its display if its parent is null).- Returns:
- the receiver's location
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getParent
Returns the receiver's parent, which must be aCanvas
.- Returns:
- the receiver's parent
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getSize
Returns a point describing the receiver's size.- Returns:
- the receiver's size
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getVisible
public boolean getVisible()Returnstrue
if the receiver is visible, andfalse
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.
- Returns:
- the receiver's visibility state
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
isVisible
public boolean isVisible()Returnstrue
if the receiver is visible and all of the receiver's ancestors are visible andfalse
otherwise.- Returns:
- the receiver's visibility state
- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- See Also:
-
setBounds
public 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. Thex
andy
arguments are relative to the receiver's parent (or its display if its parent is null).- Parameters:
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- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setBounds
Sets the receiver's size and location to the rectangular area specified by the argument. Thex
andy
fields of the rectangle are relative to the receiver's parent (or its display if its parent is null).- Parameters:
rect
- the new bounds for the receiver- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setFont
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.- Parameters:
font
- the new font (or null)- Throws:
IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the font has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setImage
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- Parameters:
image
- the new image (or null)- Throws:
IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the image has been disposed
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setLocation
public 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).- Parameters:
x
- the new x coordinate for the receivery
- the new y coordinate for the receiver- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setLocation
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).- Parameters:
location
- the new location for the receiver- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setSize
public void setSize(int width, int height) Sets the receiver's size to the point specified by the arguments.- Parameters:
width
- the new width for the receiverheight
- the new height for the receiver- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setSize
Sets the receiver's size to the point specified by the argument.- Parameters:
size
- the new extent for the receiver- Throws:
IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the point is null
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setVisible
public void setVisible(boolean visible) Marks the receiver as visible if the argument istrue
, 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.
- Parameters:
visible
- the new visibility state- Throws:
SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
win32_setHeight
IMPORTANT: This method is not part of the public API for Image. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code. Sets the height o the caret in points.- Parameters:
caret
- the caret to set the height ofheight
- the height of caret to be set in points.- Restriction:
- This method is not intended to be referenced by clients.
-