Class CoolBar
- All Implemented Interfaces:
Drawable
The item children that may be added to instances of this class
must be of type CoolItem.
Note that although this class is a subclass of Composite,
it does not make sense to add Control children to it,
or set a layout on it.
- Styles:
- FLAT, HORIZONTAL, VERTICAL
- Events:
- (none)
Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
IMPORTANT: This class is not intended to be subclassed.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) Cursor(package private) static final int(package private) static final int(package private) Cursor(package private) CoolItem(package private) Cursor(package private) boolean(package private) boolean(package private) CoolItem[][](package private) int(package private) int(package private) CoolItem[](package private) static final intFields inherited from class Composite
backgroundMode, childrenLowered, embeddedHandle, fixClipHandle, fixClipMap, imHandle, layout, layoutCount, NO_INPUT_METHOD, noChildDrawing, popupChild, socketHandle, tabListFields inherited from class Scrollable
horizontalBar, RESIZE_ON_GETCLIENTAREA, scrolledHandle, verticalBarFields inherited from class Control
accessible, autoScale, backgroundAlpha, backgroundImage, cachedNoBackground, checkScaleFactor, cssBackground, cssForeground, DISABLE_EMOJI, dragDetectionQueue, dragGesture, drawCount, drawRegion, enableWindow, eventRegion, firstFixedHandle, fixedHandle, font, gestureBegin, gestureEnd, gestureRotation, gestureSwipe, gestureZoom, keyController, labelRelation, lastInput, layoutData, menu, mouseDown, panGesture, parent, provider, redrawWindow, region, regionHandle, rotateGesture, toolTipText, zoomGestureFields inherited from class Widget
ACTIVATE, ACTIVATE_INVERSE, AUTO_TEXT_DIRECTION, BACKGROUND, BACKSPACE, BACKSPACE_INVERSE, BUTTON_PRESS_EVENT, BUTTON_PRESS_EVENT_INVERSE, BUTTON_RELEASE_EVENT, BUTTON_RELEASE_EVENT_INVERSE, CANVAS, CHANGE_VALUE, CHANGED, CHECK_SUBWINDOW, CLICKED, CLOSE_REQUEST, COMMIT, COMPUTE_SIZE, CONFIGURE_EVENT, COPY_CLIPBOARD, COPY_CLIPBOARD_INVERSE, CREATE_MENU_PROXY, CUT_CLIPBOARD, CUT_CLIPBOARD_INVERSE, data, DAY_SELECTED, DAY_SELECTED_DOUBLE_CLICK, DECELERATE, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_FROM_CURSOR, DELETE_FROM_CURSOR_INVERSE, DELETE_RANGE, DELETE_TEXT, DIRECTION_CHANGED, DISABLED, display, DISPOSE_SENT, DISPOSED, DPI_CHANGED, DRAG_DETECT, DRAW, ENTER, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPAND_COLLAPSE_CURSOR_ROW, EXPOSE_EVENT, EXPOSE_EVENT_INVERSE, FOCUS, FOCUS_IN, FOCUS_IN_EVENT, FOCUS_OUT, FOCUS_OUT_EVENT, FONT, FOREGROUND, FOREIGN_HANDLE, gdkSeatGrabPrepareFunc, GESTURE_PRESSED, GESTURE_RELEASED, GRAB_FOCUS, handle, HANDLE, HAS_AUTO_DIRECTION, HIDDEN, HIDE, ICON_RELEASE, IM_UPDATE, INPUT, INSERT_TEXT, IS_ACTIVE, KEY_CHECK_SUBWINDOW, KEY_GTK_CSS, KEY_PRESS_EVENT, KEY_PRESSED, KEY_RELEASE_EVENT, KEY_RELEASED, KEYED_DATA, LAST_SIGNAL, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, LEAVE, LEAVE_NOTIFY_EVENT, MAP, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MONTH_CHANGED, MOTION, MOTION_INVERSE, MOTION_NOTIFY_EVENT, MOTION_NOTIFY_EVENT_INVERSE, MOVE_CURSOR, MOVE_CURSOR_INVERSE, MOVE_FOCUS, MOVED, NOTIFY_DEFAULT_HEIGHT, NOTIFY_DEFAULT_WIDTH, NOTIFY_MAXIMIZED, NOTIFY_STATE, OBSCURED, OUTPUT, PARENT_BACKGROUND, PASTE_CLIPBOARD, PASTE_CLIPBOARD_INVERSE, POPPED_UP, POPULATE_POPUP, POPUP_MENU, PREEDIT_CHANGED, REALIZE, RELEASED, RESIZED, ROW_ACTIVATED, ROW_DELETED, ROW_HAS_CHILD_TOGGLED, ROW_INSERTED, SCROLL, SCROLL_BEGIN, SCROLL_CHILD, SCROLL_END, SCROLL_EVENT, SELECT, SELECTION_DONE, SHOW, SHOW_HELP, SIZE_ALLOCATE, SIZE_ALLOCATE_GTK4, SKIN_NEEDED, START_INTERACTIVE_SEARCH, state, STATUS_ICON_POPUP_MENU, style, STYLE_UPDATED, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TEXT_BUFFER_INSERT_TEXT, THEME_BACKGROUND, TOGGLED, UNMAP, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, WINDOW_STATE_EVENT, ZERO_HEIGHT, ZERO_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void_setCursor(Cursor cursor) (package private) static intcheckStyle(int style) protected voidChecks that this class can be subclassed.computeSize(int wHint, int hHint, boolean changed) Returns the preferred size (in points) of the receiver.(package private) voidcreateItem(CoolItem item, int index) (package private) voiddestroyItem(CoolItem item) (package private) Point(package private) void(package private) PointfixPoint(int x, int y) (package private) RectanglefixRectangle(int x, int y, int width, int height) (package private) CoolItemgetGrabbedItem(int x, int y) getItem(int index) Returns the item that is currently displayed at the given, zero-relative index.intReturns the number of items contained in the receiver.int[]Returns an array of zero-relative ints that map the creation order of the receiver's items to the order in which they are currently being displayed.CoolItem[]getItems()Returns an array ofCoolItems in the order in which they are currently being displayed.Point[]Returns an array of points whose x and y coordinates describe the widths and heights (respectively) of the items in the receiver in the order in which they are currently being displayed.booleanReturns whether or not the receiver is 'locked'.(package private) intgetWidth()int[]Returns an array of ints that describe the zero-relative indices of any item(s) in the receiver that will begin on a new row.intSearches the receiver's items in the order they are currently being displayed, starting at the first item (index 0), until an item is found that is equal to the argument, and returns the index of that item.(package private) booleaninsertItemIntoRow(CoolItem item, int rowIndex, int x_root) Insert the item into the row.(package private) voidinternalRedraw(int x, int y, int width, int height) (package private) intReturn the height of the bar after it has been properly laid out for the given width.(package private) void(package private) void(package private) void(package private) void(package private) void(package private) voidonMouseDoubleClick(Event event) (package private) voidonMouseDown(Event event) (package private) void(package private) voidonMouseMove(Event event) (package private) void(package private) void(package private) voidonResize()(package private) voidrelayout()(package private) voidremoveControl(Control control) (package private) booleanremoveItemFromRow(CoolItem item, int rowIndex, boolean disposed) Remove the item from the row.(package private) voidreskinChildren(int flags) voidsetBackground(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.voidSets 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.voidsetItemLayout(int[] itemOrder, int[] wrapIndices, Point[] sizes) Sets the receiver's item order, wrap indices, and item sizes all at once.(package private) voidsetItemOrder(int[] itemOrder) (package private) voidsetItemSizes(Point[] sizes) voidsetLocked(boolean locked) Sets whether or not the receiver is 'locked'.voidsetOrientation(int orientation) Sets the orientation of the receiver, which must be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.voidsetWrapIndices(int[] indices) Sets the indices of all item(s) in the receiver that will begin on a new row.(package private) voidwrapItems(int maxWidth) Methods inherited from class Composite
_getChildren, _getTabList, adjustChildClipping, applyThemeBackground, changed, checkBuffered, checkSubwindow, computeSizeInPixels, computeTabList, connectFixedHandleDraw, createHandle, createHandle, deregister, drawBackground, enableWidget, findDeferredControl, findMenus, fixChildren, fixClippings, fixModal, fixParentGdkResource, fixStyle, fixTabList, fixZOrder, focusHandle, forceFocus, getBackgroundMode, getChildren, getChildrenCount, getClientAreaInPixels, getLayout, getLayoutDeferred, getTabList, gtk_button_press_event, gtk_draw, gtk_focus, gtk_focus_in_event, gtk_focus_out_event, gtk_map, gtk_realize, gtk_scroll_child, gtk_style_updated, gtk3_key_press_event, gtk4_key_press_event, hasBorder, hookEvents, hooksKeys, imHandle, isLayoutDeferred, isTabGroup, layout, layout, layout, layout, layout, markLayout, minimumSize, moveAbove, moveBelow, moveChildren, mustBeVisibleOnInitBounds, parentingHandle, printWidget, propagateDraw, redrawChildren, register, releaseChildren, releaseHandle, releaseWidget, resizeHandle, setBackgroundMode, setBounds, setFocus, setLayout, setLayoutDeferred, setOrientation, setScrollBarVisible, setTabGroupFocus, setTabItemFocus, setTabList, showWidget, toString, translateMnemonic, translateTraversal, traversalCode, updateBackgroundMode, updateLayoutMethods inherited from class Scrollable
clientHandle, computeTrim, computeTrimInPixels, createScrollBar, createWidget, destroyScrollBar, getBorderWidthInPixels, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, gtk_scroll_event, hScrollBarWidth, redrawBackgroundImage, redrawWidget, sendLeaveNotify, setScrollbarsMode, topHandle, updateScrollBarValue, vScrollBarWidthMethods inherited from class Control
_getAccessible, _getShell, addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addRelation, addTouchListener, addTraverseListener, cairoClipRegion, cairoCopyRegion, cairoDisposeRegion, checkBackground, checkBorder, checkMirrored, cleanupEnableWindow, computeNativeSize, computeSize, computeSizeInPixels, computeTabGroup, computeTabRoot, containedInRegion, defaultBackground, defaultFont, destroyWidget, dragDetect, dragDetect, dragDetect, dragDetect, drawBackground, drawGripper, drawWidget, enterExitHandle, eventHandle, eventSurface, eventWindow, filterKey, findBackgroundControl, fixFocus, fixGdkEventTypeValues, fixStyle, flushQueueOnDnd, fontHandle, forceFocus, forceResize, gestureBeginProc, gestureEndProc, gestureHandle, getAccessible, getBackground, getBackgroundGdkRGBA, getBackgroundImage, getBaseGdkRGBA, getBgGdkRGBA, getBorderWidth, getBounds, getBoundsInPixels, getClientWidth, getContextBackgroundGdkRGBA, getContextColorGdkRGBA, getControl, getControlOrigin, getCursor, getDragDetect, getEnabled, getFont, getFontDescription, getForeground, getForegroundGdkRGBA, getIMCaretPos, getLayoutData, getLocation, getLocationInPixels, getMenu, getMonitor, getOrientation, getParent, getPath, getRegion, getShell, getSize, getSizeInPixels, getSurfaceOrigin, getTextDirection, getThickness, getToolTipText, getTouchEnabled, getVisible, getWindowOrigin, gtk_button_press_event, gtk_button_release_event, gtk_commit, gtk_css_provider_load_from_css, gtk_enter_notify_event, gtk_gesture_press_event, gtk_gesture_release_event, gtk_label_set_align, gtk_leave_notify_event, gtk_mnemonic_activate, gtk_motion_notify_event, gtk_preedit_changed, gtk_style_context_get_border, gtk_style_context_get_padding, gtk_unrealize, gtk_widget_reparent, gtk_widget_set_align, gtk3_event_after, gtk3_key_release_event, gtk3_popup_menu, gtk3_show_help, gtk4_draw, gtk4_enter_event, gtk4_focus_enter_event, gtk4_focus_leave_event, gtk4_focus_window_event, gtk4_key_release_event, gtk4_leave_event, gtk4_motion_event, gtk4_scroll_event, hasFocus, hooksPaint, hoverProc, internal_dispose_GC, internal_new_GC, isActive, isAutoScalable, isDescribedByLabel, isEnabled, isFocusAncestor, isFocusControl, isFocusHandle, isReparentable, isShowing, isTabItem, isVisible, magnifyProc, menuShell, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, moveHandle, pack, pack, paintHandle, paintSurface, paintWindow, print, printWindow, redraw, redraw, redraw, release, releaseParent, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeRelation, removeTouchListener, removeTraverseListener, requestLayout, resizeCalculationsGTK3, restackWindow, rotateProc, sendDragEvent, sendFocusEvent, sendGestureEvent, sendGestureEvent, sendGestureEvent, sendHelpEvent, sendMouseEvent, sendMouseEvent, setBackground, setBackgroundGdkRGBA, setBackgroundGdkRGBA, setBackgroundGdkRGBA, setBackgroundImage, setBackgroundSurface, setBounds, setBounds, setBoundsInPixels, setBoundsInPixels, setCapture, setCursor, setDragDetect, setEnabled, setFont, setFontDescription, setForeground, setForegroundGdkRGBA, setForegroundGdkRGBA, setInitialBounds, setLayoutData, setLocation, setLocation, setLocationInPixels, setLocationInPixels, setMenu, setParent, setParentBackground, setParentGdkResource, setRadioSelection, setRedraw, setRegion, setRelations, setSize, setSize, setSizeInPixels, setSizeInPixels, setTextDirection, setToolTipText, setToolTipText, setTouchEnabled, setVisible, setWidgetBackground, setZOrder, setZOrder, showMenu, showMenu, sort, swipeProc, toControl, toControl, toDisplay, toDisplay, toDisplayInPixels, translateMnemonic, traverse, traverse, traverse, traverse, traverse, traverseEscape, traverseGroup, traverseItem, traverseMnemonic, traversePage, traverseReturn, update, update, wantDragDropDetection, windowProcMethods inherited from class Widget
_addListener, addDisposeListener, addListener, addTypedListener, cellDataProc, checkBits, checkOpen, checkOrientation, checkParent, checkWidget, convertPangoFontDescriptionToCss, cssHandle, dispose, dpiChanged, enterMotionProc, error, filterProc, filters, fixMnemonic, fixMnemonic, fixMnemonic, focusProc, fontHeight, gdk_event_free, gdk_event_get_state, gdk_event_get_surface_or_window, gdk_pointer_grab, gdk_pointer_ungrab, gdk_surface_get_size, gdk_window_get_size, GdkSeatGrabPrepareFunc, gesturePressReleaseProc, getData, getData, getDisplay, getListeners, getName, getNameText, getStyle, getTypedListeners, gtk_activate, gtk_adjustment_get, gtk_box_new, gtk_box_pack_end, gtk_box_set_child_packing, gtk_cell_renderer_get_preferred_size, gtk_change_value, gtk_changed, gtk_clicked, gtk_close_request, gtk_configure_event, gtk_container_get_border_width_or_margin, gtk_container_set_border_width, gtk_create_menu_proxy, gtk_day_selected, gtk_day_selected_double_click, gtk_delete_event, gtk_delete_range, gtk_delete_text, gtk_expand_collapse_cursor_row, gtk_grab_focus, gtk_hide, gtk_icon_release, gtk_input, gtk_insert_text, gtk_map_event, gtk_menu_popped_up, gtk_month_changed, gtk_move_focus, gtk_output, gtk_populate_popup, gtk_row_activated, gtk_row_has_child_toggled, gtk_select, gtk_selection_done, gtk_show, gtk_size_allocate, gtk_start_interactive_search, gtk_status_icon_popup_menu, gtk_switch_page, gtk_test_collapse_row, gtk_test_expand_row, gtk_text_buffer_insert_text, gtk_timer, gtk_toggled, gtk_tree_view_column_cell_get_position, gtk_unmap, gtk_unmap_event, gtk_value_changed, gtk_widget_get_preferred_size, gtk_widget_get_surface, gtk_widget_get_window, gtk_widget_hide, gtk_widget_show, gtk_widget_size_allocate, gtk_window_state_event, hooks, isAutoDirection, isDisposed, isListening, isValidSubclass, isValidThread, keyPressReleaseProc, leaveProc, mnemonicHit, mnemonicMatch, notifyCreationTracker, notifyDisposalTracker, notifyListeners, notifyProc, notifyState, postEvent, postEvent, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, rendererGetPreferredWidthProc, rendererRenderProc, rendererSnapshotProc, reskin, reskinWidget, scrollProc, sendEvent, sendEvent, sendEvent, sendEvent, sendIMKeyEvent, sendKeyEvent, sendSelectionEvent, sendSelectionEvent, setButtonState, setData, setData, setFontDescription, setInputState, setKeyState, setLocationState, setToolTipText, shellMapProc, sizeAllocateProc, sizeRequestProc, snapshotToDraw, timerProc, translateTraversal, windowActiveProc, windowProc, windowProc, windowProc, windowProc
-
Field Details
-
items
CoolItem[][] items -
originalItems
CoolItem[] originalItems -
hoverCursor
Cursor hoverCursor -
dragCursor
Cursor dragCursor -
cursor
Cursor cursor -
dragging
CoolItem dragging -
mouseXOffset
int mouseXOffset -
itemXOffset
int itemXOffset -
isLocked
boolean isLocked -
inDispose
boolean inDispose -
ROW_SPACING
static final int ROW_SPACING- See Also:
-
CLICK_DISTANCE
static final int CLICK_DISTANCE- See Also:
-
DEFAULT_COOLBAR_WIDTH
static final int DEFAULT_COOLBAR_WIDTH- See Also:
-
DEFAULT_COOLBAR_HEIGHT
static final int DEFAULT_COOLBAR_HEIGHT- See Also:
-
-
Constructor Details
-
CoolBar
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
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
-
checkStyle
static int checkStyle(int style) -
_setCursor
-
checkSubclass
protected void checkSubclass()Description copied from class:WidgetChecks that this class can be subclassed.The SWT class library is intended to be subclassed only at specific, controlled points (most notably,
CompositeandCanvaswhen implementing new widgets). This method enforces this rule unless it is overridden.IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
- Overrides:
checkSubclassin classComposite
-
computeSize
Description copied from class:ControlReturns the preferred size (in points) of the receiver.The preferred size of a control is the size that it would best be displayed at. The width hint and height hint arguments allow the caller to ask a control questions such as "Given a particular width, how high does the control need to be to show all of the contents?" To indicate that the caller does not wish to constrain a particular dimension, the constant
SWT.DEFAULTis passed for the hint.If the changed flag is
true, it indicates that the receiver's contents have changed, therefore any caches that a layout manager containing the control may have been keeping need to be flushed. When the control is resized, the changed flag will befalse, so layout manager caches can be retained.- Overrides:
computeSizein classControl- Parameters:
wHint- the width hint (can beSWT.DEFAULT)hHint- the height hint (can beSWT.DEFAULT)changed-trueif the control's contents have changed, andfalseotherwise- Returns:
- the preferred size of the control.
- See Also:
-
getGrabbedItem
-
getItem
Returns the item that is currently displayed at the given, zero-relative index. Throws an exception if the index is out of range.- Parameters:
index- the visual index of the item to return- Returns:
- the item at the given visual index
- Throws:
IllegalArgumentException-- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
-
getItemCount
public int getItemCount()Returns the number of items contained in the receiver.- Returns:
- the number of items
- 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
-
getItems
Returns an array ofCoolItems in the order in which they are currently being displayed.Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
- Returns:
- the receiver's items in their current visual order
- 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
-
findItem
-
fixEvent
-
fixRectangle
-
fixPoint
-
indexOf
Searches the receiver's items in the order they are currently being displayed, starting at the first item (index 0), until an item is found that is equal to the argument, and returns the index of that item. If no item is found, returns -1.- Parameters:
item- the search item- Returns:
- the visual order index of the search item, or -1 if the item is not found
- Throws:
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the item is null
- ERROR_INVALID_ARGUMENT - if the item is 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
-
insertItemIntoRow
Insert the item into the row. Adjust the x and width values appropriately. -
internalRedraw
void internalRedraw(int x, int y, int width, int height) -
createItem
-
destroyItem
-
moveDown
-
moveLeft
-
moveRight
-
moveUp
-
onDispose
-
onMouseDown
-
onMouseExit
void onMouseExit() -
onMouseMove
-
onMouseUp
-
onMouseDoubleClick
-
onPaint
-
onResize
void onResize() -
removeControl
- Overrides:
removeControlin classComposite
-
removeItemFromRow
Remove the item from the row. Adjust the x and width values appropriately. -
layoutItems
int layoutItems()Return the height of the bar after it has been properly laid out for the given width. -
relayout
void relayout() -
getItemOrder
public int[] getItemOrder()Returns an array of zero-relative ints that map the creation order of the receiver's items to the order in which they are currently being displayed.Specifically, the indices of the returned array represent the current visual order of the items, and the contents of the array represent the creation order of the items.
Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
- Returns:
- the current visual order of the receiver's items
- 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
-
setBackground
Description copied from class:ControlSets 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.Note: This operation is a hint and may be overridden by the platform.
Note: The background color can be overridden by setting a background image.
- Overrides:
setBackgroundin classControl- Parameters:
color- the new color (or null)
-
setItemOrder
void setItemOrder(int[] itemOrder) -
getItemSizes
Returns an array of points whose x and y coordinates describe the widths and heights (respectively) of the items in the receiver in the order in which they are currently being displayed.- Returns:
- the receiver's item sizes in their current visual order
- 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
-
setItemSizes
-
getLocked
public boolean getLocked()Returns whether or not the receiver is 'locked'. When a coolbar is locked, its items cannot be repositioned.- Returns:
- true if the coolbar is locked, false otherwise
- 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
- Since:
- 2.0
-
getWidth
int getWidth() -
getWrapIndices
public int[] getWrapIndices()Returns an array of ints that describe the zero-relative indices of any item(s) in the receiver that will begin on a new row. The 0th visible item always begins the first row, therefore it does not count as a wrap index.- Returns:
- an array containing the receiver's wrap indices, or an empty array if all items are in one row
- 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
-
setLocked
public void setLocked(boolean locked) Sets whether or not the receiver is 'locked'. When a coolbar is locked, its items cannot be repositioned.- Parameters:
locked- lock the coolbar if true, otherwise unlock the coolbar- 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
- Since:
- 2.0
-
setWrapIndices
public void setWrapIndices(int[] indices) Sets the indices of all item(s) in the receiver that will begin on a new row. The indices are given in the order in which they are currently being displayed. The 0th item always begins the first row, therefore it does not count as a wrap index. If indices is null or empty, the items will be placed on one line.- Parameters:
indices- an array of wrap indices, or null- 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
-
reskinChildren
void reskinChildren(int flags) - Overrides:
reskinChildrenin classComposite
-
setCursor
Description copied from class:ControlSets 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.When the mouse pointer passes over a control its appearance is changed to match the control's cursor.
-
setItemLayout
Sets the receiver's item order, wrap indices, and item sizes all at once. This method is typically used to restore the displayed state of the receiver to a previously stored state.The item order is the order in which the items in the receiver should be displayed, given in terms of the zero-relative ordering of when the items were added.
The wrap indices are the indices of all item(s) in the receiver that will begin on a new row. The indices are given in the order specified by the item order. The 0th item always begins the first row, therefore it does not count as a wrap index. If wrap indices is null or empty, the items will be placed on one line.
The sizes are specified in an array of points whose x and y coordinates describe the new widths and heights (respectively) of the receiver's items in the order specified by the item order.
- Parameters:
itemOrder- an array of indices that describe the new order to display the items inwrapIndices- an array of wrap indices, or nullsizes- an array containing the new sizes for each of the receiver's items in visual order- 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
IllegalArgumentException-- ERROR_NULL_ARGUMENT - if item order or sizes is null
- ERROR_INVALID_ARGUMENT - if item order or sizes is not the same length as the number of items
-
setOrientation
public void setOrientation(int orientation) Description copied from class:ControlSets the orientation of the receiver, which must be one of the constantsSWT.LEFT_TO_RIGHTorSWT.RIGHT_TO_LEFT.- Overrides:
setOrientationin classControl- Parameters:
orientation- new orientation style
-
wrapItems
void wrapItems(int maxWidth)
-