Package org.eclipse.draw2d
Class PopUpHelper
java.lang.Object
org.eclipse.draw2d.PopUpHelper
- Direct Known Subclasses:
- ToolTipHelper
Provides abstract support for classes that manage popups. Popups in Draw2d
 consist of a LightweightSystem object with an SWT shell as its Control.
 Desired popup behavior is attained by adding appropriate listeners to this
 shell.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ControlThe Control this PopUpHelper's tooltip will belong to.protected final intThese style bits should be used when creating the Shell.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructs a PopUpHelper to assist with popups on Control c.protectedPopUpHelper(Control c, int shellStyle) Constructs a PopUpHelper to display the given shell style popup.
- 
Method SummaryModifier and TypeMethodDescriptionprotected LightweightSystemCreates and returns the LightweightSystem object used by PopUpHelper to draw upon.protected ShellCreates a new Shell object with the style specified for this helper.voiddispose()Dispose of this PopUpHelper object.protected LightweightSystemReturns this PopUpHelper's LightweightSystem.protected ShellgetShell()Returns this PopUpHelper's shell.protected DimensionReturns the size needed to display the shell's trim.protected voidhide()Hides this PopUpHelper's Shell.protected abstract voidDesired popup helper behavior is achieved by writing listeners that manipulate the behavior of the PopUpHelper's Shell.booleanReturnstrueif this PopUpHelper's Shell is visible,falseotherwise.voidSets the background color of this PopUpHelper's Shell.voidSets the foreground color of this PopUpHelper's Shell.protected voidsetShellBounds(int x, int y, int width, int height) Sets the bounds on this PopUpHelper's Shell.protected voidshow()Displays this PopUpHelper's Shell.
- 
Field Details- 
controlThe Control this PopUpHelper's tooltip will belong to.
- 
shellStyleprotected final int shellStyleThese style bits should be used when creating the Shell.- See Also:
 
 
- 
- 
Constructor Details- 
PopUpHelperConstructs a PopUpHelper to assist with popups on Control c.- Parameters:
- c- the Control
- Since:
- 2.0
 
- 
PopUpHelperConstructs a PopUpHelper to display the given shell style popup.- Parameters:
- c- the control on which the popup is active.
- shellStyle- the SWT style bits for the shell
- Since:
- 3.1
 
 
- 
- 
Method Details- 
createLightweightSystemCreates and returns the LightweightSystem object used by PopUpHelper to draw upon.- Returns:
- the newly created LightweightSystem
- Since:
- 2.0
 
- 
createShellCreates a new Shell object with the style specified for this helper.- Returns:
- the newly created Shell
- Since:
- 2.0
 
- 
disposepublic void dispose()Dispose of this PopUpHelper object.- Since:
- 2.0
 
- 
getShellReturns this PopUpHelper's shell. If no shell exists for this PopUpHelper, a new shell is created and hookShellListeners() is called.- Returns:
- the Shell
- Since:
- 2.0
 
- 
getShellTrimSizeReturns the size needed to display the shell's trim. This method should not be called until the shell has been created.- Returns:
- the size of the shells trim.
- Since:
- 3.1
 
- 
getLightweightSystemReturns this PopUpHelper's LightweightSystem. If no LightweightSystem exists for this PopUpHelper, a new LightweightSystem is created with this PopUpHelper's Shell as its Control.- Returns:
- the LightweightSystem
- Since:
- 2.0
 
- 
hideprotected void hide()Hides this PopUpHelper's Shell.- Since:
- 2.0
 
- 
hookShellListenersprotected abstract void hookShellListeners()Desired popup helper behavior is achieved by writing listeners that manipulate the behavior of the PopUpHelper's Shell. Override this method and add these listeners here.- Since:
- 2.0
 
- 
isShowingpublic boolean isShowing()Returnstrueif this PopUpHelper's Shell is visible,falseotherwise.- Returns:
- trueif this PopUpHelper's Shell is visible
- Since:
- 2.0
 
- 
setBackgroundColorSets the background color of this PopUpHelper's Shell.- Parameters:
- c- the new background color
- Since:
- 2.0
 
- 
setForegroundColorSets the foreground color of this PopUpHelper's Shell.- Parameters:
- c- the new foreground color
- Since:
- 2.0
 
- 
setShellBoundsprotected void setShellBounds(int x, int y, int width, int height) Sets the bounds on this PopUpHelper's Shell.- Parameters:
- x- the x coordinate
- y- the y coordinate
- width- the width
- height- the height
- Since:
- 2.0
 
- 
showprotected void show()Displays this PopUpHelper's Shell.- Since:
- 2.0
 
 
-