org.eclipse.gef.internal.ui.palette.editparts
Class DrawerFigure

java.lang.Object
  extended byorg.eclipse.draw2d.Figure
      extended byorg.eclipse.gef.internal.ui.palette.editparts.DrawerFigure
All Implemented Interfaces:
org.eclipse.draw2d.IFigure

public class DrawerFigure
extends org.eclipse.draw2d.Figure


Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch
 
Nested classes inherited from class org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets
 
Field Summary
protected static org.eclipse.draw2d.Border BUTTON_BORDER
          Border constant, toolbar scheme
protected static org.eclipse.swt.graphics.Color FG_COLOR
          Foreground color constant
static org.eclipse.swt.graphics.Image PIN
          Pin image
protected static org.eclipse.draw2d.Border SCROLL_PANE_BORDER
          Scrollpane border constant
protected static org.eclipse.draw2d.Border TITLE_MARGIN_BORDER
          Title margin border constant
protected static org.eclipse.draw2d.Border TOGGLE_BUTTON_BORDER
          Toggle button border constant
protected static org.eclipse.draw2d.Border TOOLTIP_BORDER
          Tooltip border constant
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
DrawerFigure(org.eclipse.swt.widgets.Control control)
          Constructor
 
Method Summary
 org.eclipse.draw2d.Clickable getCollapseToggle()
           
 org.eclipse.draw2d.IFigure getContentPane()
           
 org.eclipse.draw2d.geometry.Dimension getMinimumSize(int wHint, int hHint)
           
 org.eclipse.draw2d.ScrollPane getScrollpane()
          Returns the ScrollPane associated with this DrawerFigure
protected  void handleExpandStateChanged()
           
 boolean isExpanded()
           
 boolean isPinnedOpen()
           
 boolean isPinShowing()
           
 void setAnimating(boolean isAnimating)
           
 void setExpanded(boolean value)
           
 void setLayoutMode(int layoutMode)
           
 void setPinned(boolean pinned)
          Pins or unpins the drawer.
 void setTitle(java.lang.String s)
          Displays the given text in the drawer's header as its title.
 void setTitleIcon(org.eclipse.swt.graphics.Image icon)
          Displays the given image in the header as the drawer's icon.
 void showPin(boolean show)
           
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isEnabled, isFocusTraversable, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeFigureListener, removeFocusListener, removeKeyListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUTTON_BORDER

protected static final org.eclipse.draw2d.Border BUTTON_BORDER
Border constant, toolbar scheme


FG_COLOR

protected static final org.eclipse.swt.graphics.Color FG_COLOR
Foreground color constant


PIN

public static final org.eclipse.swt.graphics.Image PIN
Pin image


SCROLL_PANE_BORDER

protected static final org.eclipse.draw2d.Border SCROLL_PANE_BORDER
Scrollpane border constant


TITLE_MARGIN_BORDER

protected static final org.eclipse.draw2d.Border TITLE_MARGIN_BORDER
Title margin border constant


TOGGLE_BUTTON_BORDER

protected static final org.eclipse.draw2d.Border TOGGLE_BUTTON_BORDER
Toggle button border constant


TOOLTIP_BORDER

protected static final org.eclipse.draw2d.Border TOOLTIP_BORDER
Tooltip border constant

Constructor Detail

DrawerFigure

public DrawerFigure(org.eclipse.swt.widgets.Control control)
Constructor

Parameters:
control - The Control of the LWS to which this Figure belongs (it is used to display the drawer header with an EditPartTipHelper, if the header is not completely visible). It can be null (the tip won't be displayed).
Method Detail

getCollapseToggle

public org.eclipse.draw2d.Clickable getCollapseToggle()
Returns:
The Clickable that is used to expand/collapse the drawer.

getContentPane

public org.eclipse.draw2d.IFigure getContentPane()
Returns:
The content pane for this figure, i.e. the Figure to which children can be added.

getMinimumSize

public org.eclipse.draw2d.geometry.Dimension getMinimumSize(int wHint,
                                                            int hHint)
See Also:
Figure.getMinimumSize()

getScrollpane

public org.eclipse.draw2d.ScrollPane getScrollpane()
Returns the ScrollPane associated with this DrawerFigure

Returns:
the ScrollPane

handleExpandStateChanged

protected void handleExpandStateChanged()

isExpanded

public boolean isExpanded()
Returns:
true if the drawer is expanded

isPinnedOpen

public boolean isPinnedOpen()
Returns:
true if the drawer is expanded and is pinned (i.e., it can't be automatically collapsed)

isPinShowing

public boolean isPinShowing()
Returns:
true if the drawer is expanded and its pin is showing

setAnimating

public void setAnimating(boolean isAnimating)

setExpanded

public void setExpanded(boolean value)

setLayoutMode

public void setLayoutMode(int layoutMode)

setPinned

public void setPinned(boolean pinned)
Pins or unpins the drawer. The drawer can be pinned open only when it is expanded. Attempts to pin it when it is collapsed will do nothing.

Parameters:
pinned - true if the drawer is to be pinned

setTitle

public void setTitle(java.lang.String s)
Displays the given text in the drawer's header as its title.

Parameters:
s - The title of the drawer

setTitleIcon

public void setTitleIcon(org.eclipse.swt.graphics.Image icon)
Displays the given image in the header as the drawer's icon.

Parameters:
icon - The icon for this drawer.

showPin

public void showPin(boolean show)