Eclipse Platform
Release 3.2

org.eclipse.ui
Interface IWindowTrim


public interface IWindowTrim

Interface for trim controls that can be docked to the edge of a Workbench window using drag-and-drop.

Note: This interface is highly experimental, and will probably change between M4 and M5. For example, it will support a "lifecycle" that allows the ITrimManager to update its modifiers (like SWT.TOP or SWT.LEFT) so the IWindowTrim can dispose and re-create its control. This will likely effect methods like dock(int), getControl(), getValidSides(), etc.

Since:
3.2

Method Summary
 void dock(int dropSide)
          Called to notify the trim object that it has been docked on the given side of the layout
 Control getControl()
          Returns the control representing this trim widget, or null if it has not yet been created.
 String getDisplayName()
          Returns the (localized) display name for this trim.
 int getHeightHint()
          Overrides the preferred height of the control (pixels).
 String getId()
          Each piece of window trim must have a unique ID to participate fully as trim.
 int getValidSides()
          Returns the set of sides that this trim can be docked onto.
 int getWidthHint()
          Overrides the preferred width of the control (pixels).
 void handleClose()
          This method is called when the trim UI has closed (hidden) the trim.
 boolean isCloseable()
          Determines whether a particular trim can be 'closed' using the common Trim UI.
 boolean isResizeable()
          If true, the control will be resized with the layout.
 

Method Detail

getControl

public Control getControl()
Returns the control representing this trim widget, or null if it has not yet been created.

Returns:
the control for the trim widget.

getValidSides

public int getValidSides()
Returns the set of sides that this trim can be docked onto.

Returns:
bitwise OR of one or more of SWT.TOP, SWT.BOTTOM, SWT.LEFT, and SWT.RIGHT

dock

public void dock(int dropSide)
Called to notify the trim object that it has been docked on the given side of the layout

Parameters:
dropSide - the trim drop area

getId

public String getId()
Each piece of window trim must have a unique ID to participate fully as trim.

Returns:
The unique id
Since:
3.2

getDisplayName

public String getDisplayName()
Returns the (localized) display name for this trim. This is used, for example, to construct menu items...

Returns:
The display name for this trim
Since:
3.2

isCloseable

public boolean isCloseable()
Determines whether a particular trim can be 'closed' using the common Trim UI.

Returns:
true if the UI should profer the close affordance; false otherwise
Since:
3.2

handleClose

public void handleClose()
This method is called when the trim UI has closed (hidden) the trim. The controls associated with the trim will have already been removed from the trim layout. The implementor should take any necessary clean up actions here.

Since:
3.2

getWidthHint

public int getWidthHint()
Overrides the preferred width of the control (pixels). If SWT.DEFAULT, then the control's preferred width will be used. This has no effect for horizontally resizable controls.

Returns:
pixels, or SWT.DEFAULT
Since:
3.2

getHeightHint

public int getHeightHint()
Overrides the preferred height of the control (pixels). If SWT.DEFAULT, then the control's preferred height will be used. This has no effect for vertically resizable controls.

Returns:
pixels, or SWT.DEFAULT
Since:
3.2

isResizeable

public boolean isResizeable()
If true, the control will be resized with the layout. If there is more than one resizable control on the same side of the layout, the available space will be divided equally among all the resizeable controls.

Returns:
true or false.
Since:
3.2

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.