Class BreadcrumbItem
public class BreadcrumbItem
extends org.eclipse.swt.widgets.Item
- Styles:
- TOGGLE,PUSH,NONE
- Events:
- Selection
-
Constructor Summary
Constructors Constructor Description BreadcrumbItem(Breadcrumb parent)
Constructs a new instance of this class given its parent (which must be aBreadcrumb
) and a style value describing its behavior and appearance.BreadcrumbItem(Breadcrumb parent, int style)
Constructs a new instance of this class given its parent (which must be aBreadcrumb
) and a style value describing its behavior and appearance. -
Method Summary
Modifier and Type Method Description void
addSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in theSelectionListener
interface.void
dispose()
(package private) void
drawButtonAtPosition(int x)
(package private) void
fireSelectionEvent()
int
getAlignment()
Returns a value which describes the position of the text in the receiver.org.eclipse.swt.graphics.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.org.eclipse.swt.graphics.Image
getDisabledImage()
boolean
getEnabled()
Returnstrue
if the receiver is enabled, andfalse
otherwise.int
getHeight()
Returns the whole height of the item.Breadcrumb
getParent()
Returns the receiver's parent, which must be aBreadcrumb
.boolean
getSelection()
Returnstrue
if the receiver is selected, and false otherwise.org.eclipse.swt.graphics.Image
getSelectionImage()
org.eclipse.swt.graphics.Color
getTextColor()
Returns the color of the text when the button is enabled and not selected.org.eclipse.swt.graphics.Color
getTextColorSelected()
Returns the color of the text when the button is not selected.java.lang.String
getTooltipText()
Returns the receiver's tool tip text, or null if it has not been set.int
getWidth()
Returns the whole width of the item.boolean
isEnabled()
Returnstrue
if the receiver is enabled, andfalse
otherwise.void
removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)
Removes the listener from the collection of listeners who will be notified when the control is selected by the user.void
setAlignment(int alignment)
Controls how text will be displayed in the receiver.void
setBounds(org.eclipse.swt.graphics.Rectangle rectangle)
Sets the receiver's size and location to the rectangular area specified by the argument.void
setDisabledImage(org.eclipse.swt.graphics.Image image)
Sets the receiver's image to the argument when this is one is disabled, which may be null indicating that no image should be displayed.void
setEnabled(boolean enabled)
Enables the receiver if the argument istrue
, and disables it otherwise.(package private) BreadcrumbItem
setGc(org.eclipse.swt.graphics.GC gc)
void
setHeight(int height)
Sets the height of the receiver.(package private) BreadcrumbItem
setIsLastItemOfTheBreadCrumb(boolean isLastItemOfTheBreadCrumb)
void
setSelection(boolean selected)
Sets the selection state of the receiver.void
setSelectionImage(org.eclipse.swt.graphics.Image image)
Sets the receiver's image to the argument when this one is selected, which may be null indicating that no image should be displayed.void
setTextColor(org.eclipse.swt.graphics.Color textColor)
Sets the receiver's text color to the argument, which may be null indicating that no image should be displayed.void
setTextColorSelected(org.eclipse.swt.graphics.Color textColor)
Sets the receiver's text color to the argument when this one is selected, which may be null indicating that no image should be displayed.(package private) BreadcrumbItem
setToolbarHeight(int toolbarHeight)
void
setTooltipText(java.lang.String string)
Sets the receiver's tool tip text to the argument, which may be null indicating that the default tool tip for the control will be shown.void
setWidth(int width)
Sets the width of the receiver.Methods inherited from class org.eclipse.swt.widgets.Item
checkSubclass, getImage, getText, setImage, setText
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
Constructor Details
-
BreadcrumbItem
Constructs a new instance of this class given its parent (which must be aBreadcrumb
) and a style value describing its behavior and appearance. The item is added to the end of the items maintained by its parent.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)- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.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:
Widget.getStyle()
-
BreadcrumbItem
Constructs a new instance of this class given its parent (which must be aBreadcrumb
) and a style value describing its behavior and appearance. The item is added to the end of the items maintained by its parent.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:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the parent is null
org.eclipse.swt.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:
Widget.getStyle()
-
-
Method Details
-
addSelectionListener
public void addSelectionListener(org.eclipse.swt.events.SelectionListener listener)Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in theSelectionListener
interface.widgetDefaultSelected
is not called.- Parameters:
listener
- the listener which should be notified when the control is selected by the user,- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the listener is null
org.eclipse.swt.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:
SelectionListener
,removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,SelectionEvent
-
dispose
public void dispose()- Overrides:
dispose
in classorg.eclipse.swt.widgets.Widget
- See Also:
Widget.dispose()
-
getAlignment
public int getAlignment()Returns a value which describes the position of the text in the receiver. The value will be one ofLEFT
,RIGHT
orCENTER
.- Returns:
- the alignment
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getBounds
public org.eclipse.swt.graphics.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. In this case, the location is relative to the display.- Returns:
- the receiver's bounding rectangle
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getDisabledImage
public org.eclipse.swt.graphics.Image getDisabledImage()- Returns:
- the image displayed when the button is disabled
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getEnabled
public boolean getEnabled()Returnstrue
if the receiver is enabled, andfalse
otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.- Returns:
- the receiver's enabled state
- Throws:
org.eclipse.swt.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:
isEnabled()
-
getHeight
public int getHeight()Returns the whole height of the item.- Returns:
- the receiver's height
- Throws:
org.eclipse.swt.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 aBreadcrumb
.- Returns:
- the receiver's parent
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getSelection
public boolean getSelection()Returnstrue
if the receiver is selected, and false otherwise.- Returns:
- the selection state
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getSelectionImage
public org.eclipse.swt.graphics.Image getSelectionImage()- Returns:
- the image displayed when the button is selected
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getTextColor
public org.eclipse.swt.graphics.Color getTextColor()Returns the color of the text when the button is enabled and not selected.- Returns:
- the receiver's text color
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getTextColorSelected
public org.eclipse.swt.graphics.Color getTextColorSelected()Returns the color of the text when the button is not selected.- Returns:
- the receiver's text color
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getTooltipText
public java.lang.String getTooltipText()Returns the receiver's tool tip text, or null if it has not been set.- Returns:
- the receiver's tool tip text
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getWidth
public int getWidth()Returns the whole width of the item.- Returns:
- the receiver's height
- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
isEnabled
public boolean isEnabled()Returnstrue
if the receiver is enabled, andfalse
otherwise. A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.- Returns:
- the receiver's enabled state
- Throws:
org.eclipse.swt.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:
getEnabled()
-
removeSelectionListener
public void removeSelectionListener(org.eclipse.swt.events.SelectionListener listener)Removes the listener from the collection of listeners who will be notified when the control is selected by the user.- Parameters:
listener
- the listener which should no longer be notified- Throws:
java.lang.IllegalArgumentException
-- ERROR_NULL_ARGUMENT - if the listener is null
org.eclipse.swt.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:
SelectionListener
,addSelectionListener(org.eclipse.swt.events.SelectionListener)
-
setAlignment
public void setAlignment(int alignment)Controls how text will be displayed in the receiver. The argument should be one ofLEFT
,RIGHT
orCENTER
.- Parameters:
alignment
- the new alignment- Throws:
org.eclipse.swt.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
public void setBounds(org.eclipse.swt.graphics.Rectangle rectangle)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).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.
- Parameters:
rect
- the new bounds for the receiver- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setDisabledImage
public void setDisabledImage(org.eclipse.swt.graphics.Image image)Sets the receiver's image to the argument when this is one is disabled, which may be null indicating that no image should be displayed.- Parameters:
image
- the image to display on the receiver (may be null)- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the image has been disposed
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setEnabled
public void setEnabled(boolean enabled)Enables the receiver if the argument istrue
, and disables it otherwise.A disabled control is typically not selectable from the user interface and draws with an inactive or "grayed" look.
- Parameters:
enabled
- the new enabled state- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setHeight
public void setHeight(int height)Sets the height of the receiver.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.
- Parameters:
height
- the new width- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setSelection
public void setSelection(boolean selected)Sets the selection state of the receiver.- Parameters:
selected
- the new selection state- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setSelectionImage
public void setSelectionImage(org.eclipse.swt.graphics.Image image)Sets the receiver's image to the argument when this one is selected, which may be null indicating that no image should be displayed.- Parameters:
image
- the image to display on the receiver (may be null)- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the image has been disposed
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setTextColor
public void setTextColor(org.eclipse.swt.graphics.Color textColor)Sets the receiver's text color to the argument, which may be null indicating that no image should be displayed.- Parameters:
textColor
- the text color to display on the receiver (may be null)- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the image has been disposed
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setTextColorSelected
public void setTextColorSelected(org.eclipse.swt.graphics.Color textColor)Sets the receiver's text color to the argument when this one is selected, which may be null indicating that no image should be displayed.- Parameters:
textColor
- the text color to display on the receiver (may be null)- Throws:
java.lang.IllegalArgumentException
-- ERROR_INVALID_ARGUMENT - if the image has been disposed
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setTooltipText
public void setTooltipText(java.lang.String string)Sets the receiver's tool tip text to the argument, which may be null indicating that the default tool tip for the control will be shown. For a control that has a default tool tip, such as the Tree control on Windows, setting the tool tip text to an empty string replaces the default, causing no tool tip text to be shown.The mnemonic indicator (character '&') is not displayed in a tool tip. To display a single '&' in the tool tip, the character '&' can be escaped by doubling it in the string.
- Parameters:
string
- the new tool tip text (or null)- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
setWidth
public void setWidth(int width)Sets the width of the receiver.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.
- Parameters:
width
- the new width- Throws:
org.eclipse.swt.SWTException
-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
fireSelectionEvent
void fireSelectionEvent() -
drawButtonAtPosition
void drawButtonAtPosition(int x) -
setGc
-
setToolbarHeight
-
setIsLastItemOfTheBreadCrumb
-