| org.eclipse.ui.internal.layout.TrimCommonUIHandle
TrimCommonUIHandle | public class TrimCommonUIHandle extends Composite (Code) | | This control provides common UI functionality for trim elements. Its
lifecycle is managed by the TrimLayout which automatically
adds a UI handle to all added trim elements. It uses an instance of a
CoolBar to provide the platform-specific drag affordance.
It provides the following features:
Drag affordance and handling:
- Drag affordance is provided in the
paintControl method
- Drag handling is provided to allow rearrangement within a trim side or
to other sides, depending on the values returned by
IWindowTrim.getValidSides
Context Menu:
- A "Dock on" menu item is provided to allow changing the side, depending on the values returned by
IWindowTrim.getValidSides
- A "Close" menu item is provided to allow the User to close (hide) the trim element,
based on the value returned by
IWindowTrim.isCloseable
since: 3.2 since: |
Method Summary | |
public Point | computeSize(int wHint, int hHint, boolean changed) | public void | dispose() | public ContributionItem | getDockingContribution() Construct (if necessary) a context menu contribution item and return it. | public void | insertCoolBar(int orientation) Place a CoolBar / CoolItem / Control inside the current
UI handle. | public void | setup(TrimLayout layout, IWindowTrim trim, int curSide) Set up the trim with its cursor, drag listener, context menu and menu listener. | protected void | startDraggingTrim(Point position) |
TrimCommonUIHandle | public TrimCommonUIHandle(TrimLayout layout, IWindowTrim trim, int curSide)(Code) | | Create a new trim UI handle for a particular IWindowTrim item
Parameters: layout - the TrimLayout we're being used in Parameters: trim - the IWindowTrim we're acting on behalf of Parameters: curSide - the SWT side that the trim is currently on |
computeSize | public Point computeSize(int wHint, int hHint, boolean changed)(Code) | | |
dispose | public void dispose()(Code) | | |
getDockingContribution | public ContributionItem getDockingContribution()(Code) | | Construct (if necessary) a context menu contribution item and return it. This
is explicitly public so that trim elements can retrieve the item
and add it into their own context menus if desired.
The contribution item for the handle's context menu. |
insertCoolBar | public void insertCoolBar(int orientation)(Code) | | Place a CoolBar / CoolItem / Control inside the current
UI handle. These elements will maintain thier size based on
the size of their 'parent' (this).
Parameters: parent - Parameters: orientation - |
setup | public void setup(TrimLayout layout, IWindowTrim trim, int curSide)(Code) | | Set up the trim with its cursor, drag listener, context menu and menu listener.
This method can also be used to 'recycle' a trim handle as long as the new handle
is for trim under the same parent as it was originally used for.
|
startDraggingTrim | protected void startDraggingTrim(Point position)(Code) | | Begins dragging the trim
Parameters: position - initial mouse position |
|
|