Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.swt.widgets
Class Decorations  view Decorations download Decorations.java

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.eclipse.swt.widgets.Canvas
                      extended byorg.eclipse.swt.widgets.Decorations
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable
Direct Known Subclasses:
Shell

public class Decorations
extends Canvas

Instances of this class provide the appearance and behavior of Shells, but are not top level shells or dialogs. Class Shell shares a significant amount of code with this class, and is a subclass.

IMPORTANT: This class was intended to be abstract and should never be referenced or instantiated. Instead, the class Shell should be used.

Instances are always displayed in one of the maximized, minimized or normal states:

Note: The styles supported by this class must be treated as HINTs, since the window manager for the desktop on which the instance is visible has ultimate control over the appearance and behavior of decorations. For example, some window managers only support resizable windows and will always assume the RESIZE style, even if it is not set.
Styles:
BORDER, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL
Events:
(none)
Class SWT provides two "convenience constants" for the most commonly required style combinations:
SHELL_TRIM
the result of combining the constants which are required to produce a typical application top level shell: (that is, CLOSE | TITLE | MIN | MAX | RESIZE)
DIALOG_TRIM
the result of combining the constants which are required to produce a typical application dialog shell: (that is, TITLE | CLOSE | BORDER)

IMPORTANT: This class is intended to be subclassed only within the SWT implementation.


Field Summary
(package private)  long accelGroup
           
(package private)  Button defaultButton
           
(package private)  org.eclipse.swt.graphics.Image image
           
(package private)  org.eclipse.swt.graphics.Image[] images
           
(package private)  boolean maximized
           
(package private)  Menu menuBar
           
(package private)  Menu[] menus
           
(package private)  boolean minimized
           
(package private)  Button saveDefault
           
(package private)  Control savedFocus
           
(package private)  java.lang.String text
           
 
Fields inherited from class org.eclipse.swt.widgets.Canvas
caret
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle, imHandle, layout, socketHandle, tabList
 
Fields inherited from class org.eclipse.swt.widgets.Scrollable
horizontalBar, scrolledHandle, verticalBar
 
Fields inherited from class org.eclipse.swt.widgets.Control
accessible, cursor, drawCount, enableWindow, fixedHandle, font, layoutData, menu, parent, redrawWindow, toolTipText
 
Fields inherited from class org.eclipse.swt.widgets.Widget
ACTIVATE, BUTTON_PRESS_EVENT, BUTTON_RELEASE_EVENT, CANVAS, CHANGED, CLICKED, COMMIT, CONFIGURE_EVENT, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_RANGE, DELETE_TEXT, DISABLED, display, DISPOSED, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPOSE_EVENT, FOCUS, FOCUS_IN_EVENT, FOCUS_OUT_EVENT, handle, HANDLE, HIDE, INSERT_TEXT, KEY_PRESS_EVENT, KEY_RELEASE_EVENT, KEYED_DATA, LEAVE_NOTIFY_EVENT, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MOTION_NOTIFY_EVENT, OBSCURED, POPUP_MENU, PREEDIT_CHANGED, REALIZE, ROW_ACTIVATED, SCROLL_CHILD, SELECT, SHOW, SHOW_HELP, SIZE_ALLOCATE, state, style, STYLE_SET, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TOGGLED, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, VISIBILITY_NOTIFY_EVENT, WINDOW_STATE_EVENT
 
Constructor Summary
(package private) Decorations()
           
  Decorations(Composite parent, int style)
          Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
 
Method Summary
(package private)  void _setImages(org.eclipse.swt.graphics.Image[] images)
           
(package private)  void add(Menu menu)
           
(package private) static int checkStyle(int style)
           
(package private)  Control computeTabGroup()
           
(package private)  Control computeTabRoot()
           
(package private)  void createAccelGroup()
           
(package private)  void createWidget(int index)
           
(package private)  void destroyAccelGroup()
           
(package private)  void fixAccelGroup()
           
(package private)  void fixDecorations(Decorations newDecorations, Control control, Menu[] menus)
           
 Button getDefaultButton()
          Returns the receiver's default button if one had previously been set, otherwise returns null.
 org.eclipse.swt.graphics.Image getImage()
          Returns the receiver's image if it had previously been set using setImage().
 org.eclipse.swt.graphics.Image[] getImages()
          Returns the receiver's images if they had previously been set using setImages().
 boolean getMaximized()
          Returns true if the receiver is currently maximized, and false otherwise.
 Menu getMenuBar()
          Returns the receiver's menu bar if one had previously been set, otherwise returns null.
 boolean getMinimized()
          Returns true if the receiver is currently minimized, and false otherwise.
(package private)  java.lang.String getNameText()
           
 java.lang.String getText()
          Returns the receiver's text, which is the string that the window manager will typically display as the receiver's title.
 boolean isReparentable()
          Returns true if the underlying operating system supports this reparenting, otherwise false
(package private)  boolean isTabGroup()
           
(package private)  boolean isTabItem()
           
(package private)  Decorations menuShell()
           
(package private)  void releaseWidget()
           
(package private)  void remove(Menu menu)
           
(package private)  boolean restoreFocus()
           
 void setDefaultButton(Button button)
          If the argument is not null, sets the receiver's default button to the argument, and if the argument is null, sets the receiver's default button to the first button which was set as the receiver's default button (called the saved default button).
 void setImage(org.eclipse.swt.graphics.Image image)
          Sets the receiver's image to the argument, which may be null.
 void setImages(org.eclipse.swt.graphics.Image[] images)
          Sets the receiver's images to the argument, which may be an empty array.
 void setMaximized(boolean maximized)
          Sets the maximized state of the receiver.
 void setMenuBar(Menu menu)
          Sets the receiver's menu bar to the argument, which may be null.
 void setMinimized(boolean minimized)
          Sets the minimized stated of the receiver.
(package private)  void setSavedFocus(Control control)
           
 void setText(java.lang.String string)
          Sets the receiver's text, which is the string that the window manager will typically display as the receiver's title, to the argument, which may not be null.
(package private)  boolean traverseItem(boolean next)
           
(package private)  boolean traverseReturn()
           
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
getCaret, getIMCaretPos, gtk_expose_event, gtk_focus_in_event, gtk_focus_out_event, redrawWidget, scroll, setBounds, setCaret, setFont, updateCaret
 
Methods inherited from class org.eclipse.swt.widgets.Composite
_getChildren, _getTabList, checkSubclass, computeSize, computeTabList, createHandle, createHandle, deregister, enableWidget, findMenus, fixChildren, fixTabList, focusHandle, forceFocus, getChildren, getChildrenCount, getLayout, getTabList, gtk_button_press_event, gtk_focus, gtk_key_press_event, gtk_realize, gtk_scroll_child, gtk_style_set, hasBorder, hookEvents, hooksKeys, imHandle, layout, layout, minimumSize, moveAbove, moveBelow, parentingHandle, register, releaseChildren, removeControl, resizeHandle, setFocus, setLayout, setTabGroupFocus, setTabItemFocus, setTabList, translateMnemonic, translateTraversal, traversalCode
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
clientHandle, computeTrim, createScrollBar, getBorderWidth, getClientArea, getHorizontalBar, getVerticalBar, hScrollBarWidth, releaseHandle, setOrientation, topHandle, vScrollBarWidth
 
Methods inherited from class org.eclipse.swt.widgets.Control
_getShell, addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeNativeSize, computeSize, defaultFont, drawGripper, eventHandle, filterKey, fixFocus, fontHandle, forceFocus, getAccessible, getBackground, getBackgroundColor, getBaseColor, getBgColor, getBounds, getEnabled, getFgColor, getFont, getFontDescription, getForeground, getForegroundColor, getLayoutData, getLocation, getMenu, getMonitor, getParent, getPath, getShell, getSize, getTextColor, getToolTipText, getVisible, gtk_button_release_event, gtk_commit, gtk_enter_notify_event, gtk_event_after, gtk_key_release_event, gtk_leave_notify_event, gtk_mnemonic_activate, gtk_motion_notify_event, gtk_popup_menu, gtk_preedit_changed, gtk_show_help, gtk_unrealize, gtk_visibility_notify_event, hasFocus, hoverProc, internal_dispose_GC, internal_new_GC, isEnabled, isFocusAncestor, isFocusControl, isShowing, isVisible, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, moveHandle, pack, pack, paintHandle, paintWindow, redraw, redraw, releaseChild, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, sendFocusEvent, sendHelpEvent, sendIMKeyEvent, sendKeyEvent, sendMouseEvent, setBackground, setBackgroundColor, setBackgroundColor, setBounds, setBounds, setCapture, setCursor, setCursor, setEnabled, setFontDescription, setForeground, setForegroundColor, setInitialSize, setLayoutData, setLocation, setLocation, setMenu, setParent, setRadioSelection, setRedraw, setSize, setSize, setToolTipText, setVisible, setZOrder, setZOrder, showMenu, sort, toControl, toControl, toDisplay, toDisplay, translateMnemonic, traverse, traverse, traverseEscape, traverseGroup, traverseMnemonic, traversePage, update, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkBits, checkOrientation, checkParent, checkWidget, destroyWidget, dispose, error, filterProc, filters, fixMnemonic, fontHeight, getData, getData, getDisplay, getName, getStyle, gtk_activate, gtk_changed, gtk_clicked, gtk_configure_event, gtk_delete_event, gtk_delete_range, gtk_delete_text, gtk_event, gtk_hide, gtk_insert_text, gtk_map_event, gtk_row_activated, gtk_select, gtk_show, gtk_size_allocate, gtk_switch_page, gtk_test_collapse_row, gtk_test_expand_row, gtk_timer, gtk_toggled, gtk_unmap_event, gtk_value_changed, gtk_window_state_event, hooks, isDisposed, isListening, isValidSubclass, isValidThread, isValidWidget, menuPositionProc, mnemonicHit, mnemonicMatch, notifyListeners, pixbufCellDataProc, postEvent, postEvent, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, shellMapProc, textCellDataProc, timerProc, toString, translateTraversal, treeSelectionProc, windowProc, windowProc, windowProc, windowProc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

text

java.lang.String text

image

org.eclipse.swt.graphics.Image image

images

org.eclipse.swt.graphics.Image[] images

minimized

boolean minimized

maximized

boolean maximized

menuBar

Menu menuBar

menus

Menu[] menus

savedFocus

Control savedFocus

defaultButton

Button defaultButton

saveDefault

Button saveDefault

accelGroup

long accelGroup
Constructor Detail

Decorations

Decorations()

Decorations

public Decorations(Composite parent,
                   int style)
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 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.

Method Detail

checkStyle

static int checkStyle(int style)

_setImages

void _setImages(org.eclipse.swt.graphics.Image[] images)

add

void add(Menu menu)

computeTabGroup

Control computeTabGroup()
Overrides:
computeTabGroup in class Control

computeTabRoot

Control computeTabRoot()
Overrides:
computeTabRoot in class Control

createAccelGroup

void createAccelGroup()

createWidget

void createWidget(int index)
Overrides:
createWidget in class Scrollable

destroyAccelGroup

void destroyAccelGroup()

fixAccelGroup

void fixAccelGroup()

fixDecorations

void fixDecorations(Decorations newDecorations,
                    Control control,
                    Menu[] menus)

getDefaultButton

public Button getDefaultButton()
Returns the receiver's default button if one had previously been set, otherwise returns null.


getImage

public org.eclipse.swt.graphics.Image getImage()
Returns the receiver's image if it had previously been set using setImage(). The image is typically displayed by the window manager when the instance is marked as iconified, and may also be displayed somewhere in the trim when the instance is in normal or maximized states.

Note: This method will return null if called before setImage() is called. It does not provide access to a window manager provided, "default" image even if one exists.


getImages

public org.eclipse.swt.graphics.Image[] getImages()
Returns the receiver's images if they had previously been set using setImages(). Images are typically displayed by the window manager when the instance is marked as iconified, and may also be displayed somewhere in the trim when the instance is in normal or maximized states. Depending where the icon is displayed, the platform chooses the icon with the "best" size. It is expected that the array will contain the same icon rendered at different resolutions.

Note: This method will return an empty array if called before setImages() is called. It does not provide access to a window manager provided, "default" image even if one exists.

Since:
3.0

getMaximized

public boolean getMaximized()
Returns true if the receiver is currently maximized, and false otherwise.


getMenuBar

public Menu getMenuBar()
Returns the receiver's menu bar if one had previously been set, otherwise returns null.


getMinimized

public boolean getMinimized()
Returns true if the receiver is currently minimized, and false otherwise.


getNameText

java.lang.String getNameText()
Overrides:
getNameText in class Widget

getText

public java.lang.String getText()
Returns the receiver's text, which is the string that the window manager will typically display as the receiver's title. If the text has not previously been set, returns an empty string.


isReparentable

public boolean isReparentable()
Description copied from class: Control
Returns true if the underlying operating system supports this reparenting, otherwise false

Overrides:
isReparentable in class Control

isTabGroup

boolean isTabGroup()
Overrides:
isTabGroup in class Composite

isTabItem

boolean isTabItem()
Overrides:
isTabItem in class Control

menuShell

Decorations menuShell()
Overrides:
menuShell in class Control

remove

void remove(Menu menu)

releaseWidget

void releaseWidget()
Overrides:
releaseWidget in class Canvas

restoreFocus

boolean restoreFocus()

setDefaultButton

public void setDefaultButton(Button button)
If the argument is not null, sets the receiver's default button to the argument, and if the argument is null, sets the receiver's default button to the first button which was set as the receiver's default button (called the saved default button). If no default button had previously been set, or the saved default button was disposed, the receiver's default button will be set to null.


setImage

public void setImage(org.eclipse.swt.graphics.Image image)
Sets the receiver's image to the argument, which may be null. The image is typically displayed by the window manager when the instance is marked as iconified, and may also be displayed somewhere in the trim when the instance is in normal or maximized states.


setImages

public void setImages(org.eclipse.swt.graphics.Image[] images)
Sets the receiver's images to the argument, which may be an empty array. Images are typically displayed by the window manager when the instance is marked as iconified, and may also be displayed somewhere in the trim when the instance is in normal or maximized states. Depending where the icon is displayed, the platform chooses the icon with the "best" size. It is expected that the array will contain the same icon rendered at different resolutions.

Since:
3.0

setMaximized

public void setMaximized(boolean maximized)
Sets the maximized state of the receiver. If the argument is true causes the receiver to switch to the maximized state, and if the argument is false and the receiver was previously maximized, causes the receiver to switch back to either the minimized or normal states.

Note: The result of intermixing calls tosetMaximized(true) and setMinimized(true) will vary by platform. Typically, the behavior will match the platform user's expectations, but not always. This should be avoided if possible.


setMenuBar

public void setMenuBar(Menu menu)
Sets the receiver's menu bar to the argument, which may be null.


setMinimized

public void setMinimized(boolean minimized)
Sets the minimized stated of the receiver. If the argument is true causes the receiver to switch to the minimized state, and if the argument is false and the receiver was previously minimized, causes the receiver to switch back to either the maximized or normal states.

Note: The result of intermixing calls tosetMaximized(true) and setMinimized(true) will vary by platform. Typically, the behavior will match the platform user's expectations, but not always. This should be avoided if possible.


setSavedFocus

void setSavedFocus(Control control)

setText

public void setText(java.lang.String string)
Sets the receiver's text, which is the string that the window manager will typically display as the receiver's title, to the argument, which may not be null.


traverseItem

boolean traverseItem(boolean next)
Overrides:
traverseItem in class Control

traverseReturn

boolean traverseReturn()
Overrides:
traverseReturn in class Control