| java.lang.Object org.eclipse.ui.presentations.StackPresentation
All known Subclasses: org.eclipse.ui.internal.presentations.util.TabbedStackPresentation, org.eclipse.ui.internal.presentations.NativeStackPresentation,
StackPresentation | abstract public class StackPresentation implements ISizeProvider(Code) | | This represents an object that can supply trim around a IPresentablePart.
Clients can implement subclasses to provide the appearance for editor workbooks,
view folders, fast views, and detached windows.
StackPresentations do not store any persistent state and cannot
directly make changes to the workbench. They are given an IStackPresentationSite
reference on creation, which allows them to send events and requests to the workbench.
However, the workbench is free to ignore these requests. The workbench will call one
of the public methods on StackPresentation when (and if) the presentation is expected to
change state.
For example, if the user clicks a button that is intended to close a part, the
StackPresentation will send a close request to its site, but should not assume
that the part has been closed until the workbench responds with a call
StackPresentation.remove .
since: 3.0 |
Method Summary | |
abstract public void | addPart(IPresentablePart newPart, Object cookie) Adds the given part to the stack. | public Point | computeMinimumSize() Returns the minimum size for this stack. | public int | computePreferredSize(boolean width, int availableParallel, int availablePerpendicular, int preferredResult) | abstract public void | dispose() Disposes all SWT resources being used by the stack. | abstract public StackDropResult | dragOver(Control currentControl, Point location) This method is invoked whenever a part is dragged over the stack's control. | abstract public Control | getControl() | protected IStackPresentationSite | getSite() Returns the presentation site (not null). | public int | getSizeFlags(boolean width) | abstract public Control[] | getTabList(IPresentablePart part) Returns the tab-key traversal order for the given IPresentablePart . | public void | movePart(IPresentablePart toMove, Object cookie) Moves a part to a new location as the result of a drag/drop
operation within this presentation. | abstract public void | removePart(IPresentablePart oldPart) Removes the given part from the stack. | public void | restoreState(IPresentationSerializer context, IMemento memento) Restores the state of this presentation to a previously saved state. | public void | saveState(IPresentationSerializer context, IMemento memento) Saves the state of this presentation to the given memento. | abstract public void | selectPart(IPresentablePart toSelect) Brings the specified part to the foreground. | abstract public void | setActive(int newState) This is invoked to notify the presentation that its activation
state has changed. | abstract public void | setBounds(Rectangle bounds) Sets the bounding rectangle for this presentation. | abstract public void | setState(int state) Sets the state of the presentation. | abstract public void | setVisible(boolean isVisible) This causes the presentation to become visible or invisible. | abstract public void | showPaneMenu() | public void | showPartList() Instructs the presentation to display a list of all parts in the stack, and
allow the user to change the selection using the keyboard. | abstract public void | showSystemMenu() |
AS_ACTIVE_FOCUS | final public static int AS_ACTIVE_FOCUS(Code) | | Activation state indicating that one of the parts in the presentation currently has focus
|
AS_ACTIVE_NOFOCUS | final public static int AS_ACTIVE_NOFOCUS(Code) | | Activation state indicating that none of the parts in the presentation have focus, but
one of the parts is being used as the context for global menus and toolbars
|
AS_INACTIVE | final public static int AS_INACTIVE(Code) | | Inactive state. This is the default state for deselected presentations.
|
StackPresentation | protected StackPresentation(IStackPresentationSite stackSite)(Code) | | Constructs a new stack presentation with the given site.
Parameters: stackSite - the stack site |
addPart | abstract public void addPart(IPresentablePart newPart, Object cookie)(Code) | | Adds the given part to the stack. The presentation is free to determine
where the part should be inserted. If the part is being inserted as the
result of a drag/drop operation, it will be given a cookie
identifying the drop location. Has no effect if an identical part is
already in the presentation.
Parameters: newPart - the new part to add (not null) Parameters: cookie - an identifier for a drop location, or null. When the presentationattaches a cookie to a StackDropResult, that cookie is passed back intoaddPart when a part is actually dropped in that location. |
computeMinimumSize | public Point computeMinimumSize()(Code) | | Returns the minimum size for this stack. The stack is prevented
from being resized smaller than this amount, and this is used as
the default size for the stack when it is minimized. Typically,
this is the amount of space required to fit the minimize, close,
and maximize buttons and one tab.
the minimum size for this stack (not null) |
computePreferredSize | public int computePreferredSize(boolean width, int availableParallel, int availablePerpendicular, int preferredResult)(Code) | | |
dispose | abstract public void dispose()(Code) | | Disposes all SWT resources being used by the stack. This is the
last method that will be invoked on the stack.
|
dragOver | abstract public StackDropResult dragOver(Control currentControl, Point location)(Code) | | This method is invoked whenever a part is dragged over the stack's control.
It returns a StackDropResult if and only if the part may be dropped in this
location.
Parameters: currentControl - the control being dragged over Parameters: location - cursor location (display coordinates) a StackDropResult or null if the presentation does not havea drop target in this location. |
getControl | abstract public Control getControl()(Code) | | Returns the control for this presentation
the control for this presentation (not null) |
getSizeFlags | public int getSizeFlags(boolean width)(Code) | | |
getTabList | abstract public Control[] getTabList(IPresentablePart part)(Code) | | Returns the tab-key traversal order for the given IPresentablePart .
Parameters: part - the part the tab-key traversal order |
movePart | public void movePart(IPresentablePart toMove, Object cookie)(Code) | | Moves a part to a new location as the result of a drag/drop
operation within this presentation.
Parameters: toMove - a part that already belongs to this presentation Parameters: cookie - a drop cookie returned by StackPresentation#dragOver since: 3.1 |
removePart | abstract public void removePart(IPresentablePart oldPart)(Code) | | Removes the given part from the stack.
Parameters: oldPart - the part to remove (not null) |
restoreState | public void restoreState(IPresentationSerializer context, IMemento memento)(Code) | | Restores the state of this presentation to a previously saved state.
Parameters: context - object that can be used to find IPresentableParts given string IDs (thismay be a temporary object - the presentation should not keep any references to it) Parameters: memento - memento where the data will be saved |
saveState | public void saveState(IPresentationSerializer context, IMemento memento)(Code) | | Saves the state of this presentation to the given memento.
Parameters: context - object that can be used to generate unique IDs for IPresentableParts (thismay be a temporary object - the presentation should not keep any references to it) Parameters: memento - memento where the data will be saved |
selectPart | abstract public void selectPart(IPresentablePart toSelect)(Code) | | Brings the specified part to the foreground. This should not affect
the current focus.
Parameters: toSelect - the new active part (not null) |
setActive | abstract public void setActive(int newState)(Code) | | This is invoked to notify the presentation that its activation
state has changed. StackPresentations can have three possible activation
states (see the AS_* constants above)
Parameters: newState - one of AS_INACTIVE, AS_ACTIVE, or AS_ACTIVE_NOFOCUS |
setBounds | abstract public void setBounds(Rectangle bounds)(Code) | | Sets the bounding rectangle for this presentation.
Parameters: bounds - new bounding rectangle (not null) |
setState | abstract public void setState(int state)(Code) | | Sets the state of the presentation. That is, notifies the presentation
that is has been minimized, maximized, or restored. Note that this method
is the only way that a presentation is allowed to change its state.
If a presentation wishes to minimize itself, it must call setState
on its associated IStackPresentationSite. If the site chooses to respond
to the state change, it will call this method at the correct time.
The presentation should not call this method directly.
Parameters: state - one of the IStackPresentationSite.STATE_* constants. |
setVisible | abstract public void setVisible(boolean isVisible)(Code) | | This causes the presentation to become visible or invisible.
When a presentation is invisible, it must not respond to user
input or modify its parts. For example, a presentations will
be made invisible if it belongs to a perspective and the user
switches to another perspective.
Parameters: isVisible - the state to set visibility to since: 3.0 |
showPaneMenu | abstract public void showPaneMenu()(Code) | | Instructs the presentation to display the pane menu
|
showPartList | public void showPartList()(Code) | | Instructs the presentation to display a list of all parts in the stack, and
allow the user to change the selection using the keyboard.
|
showSystemMenu | abstract public void showSystemMenu()(Code) | | Instructs the presentation to display the system menu
|
|
|