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 SummaryFields inherited from class org.eclipse.swt.widgets.WidgetnativeZoom
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.booleanReturnstrueif the receiver is visible, andfalseotherwise.booleanReturnstrueif the receiver is visible and all of the receiver's ancestors are visible andfalseotherwise.voidsetBounds(int x, int y, int width, int height) Sets the receiver's size and location to the rectangular area specified by the arguments.voidSets the receiver's size and location to the rectangular area specified by the argument.voidSets 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.voidSets 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 nullvoidsetLocation(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).voidsetLocation(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).voidsetSize(int width, int height) Sets the receiver's size to the point specified by the arguments.voidSets the receiver's size to the point specified by the argument.voidsetVisible(boolean visible) Marks the receiver as visible if the argument istrue, and marks it invisible otherwise.static voidwin32_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.WidgetaddDisposeListener, addListener, addTypedListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData, toString
- 
Constructor Details- 
CaretConstructs 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 SWTwhich 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 thoseSWTstyle 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- 
getBoundsReturns 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
 
 
- 
getFontReturns 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
 
 
- 
getImageReturns 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
 
 
- 
getLocationReturns 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
 
 
- 
getParentReturns 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
 
 
- 
getSizeReturns 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
 
 
- 
getVisiblepublic boolean getVisible()Returnstrueif the receiver is visible, andfalseotherwise.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
 
 
- 
isVisiblepublic boolean isVisible()Returnstrueif the receiver is visible and all of the receiver's ancestors are visible andfalseotherwise.- 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:
 
- 
setBoundspublic 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. Thexandyarguments are relative to the receiver's parent (or its display if its parent is null).- Parameters:
- x- the new x coordinate for the receiver
- y- the new y coordinate for the receiver
- width- the new width for the receiver
- height- 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
 
 
- 
setBoundsSets the receiver's size and location to the rectangular area specified by the argument. Thexandyfields 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
 
 
- 
setFontSets 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
 
 
- 
setImageSets 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
 
 
- 
setLocationpublic 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 receiver
- y- 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
 
 
- 
setLocationSets 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
 
 
- 
setSizepublic 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 receiver
- height- 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
 
 
- 
setSizeSets 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
 
 
- 
setVisiblepublic 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_setHeightIMPORTANT: 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 of
- height- the height of caret to be set in points.
- Restriction:
- This method is not intended to be referenced by clients.
 
 
-