Eclipse Draw2d
2.1

org.eclipse.draw2d
Class PopUpHelper

java.lang.Object
  |
  +--org.eclipse.draw2d.PopUpHelper
Direct Known Subclasses:
ToolTipHelper

public abstract class PopUpHelper
extends Object

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 Summary
protected  Control control
           
 
Constructor Summary
protected PopUpHelper(Control c)
          Constructs a PopUpHelper to assist with popups on Control c.
 
Method Summary
protected  LightweightSystem createLightweightSystem()
          Creates and returns the LightweightSystem object used by PopUpHelper to draw upon.
protected  Shell createShell()
          Creates a new org.eclipse.swt.widgets.Shell object with the parameters SWT.NO_TRIM | SWT.NO_FOCUS | SWT.ON_TOP.
 void dispose()
          Dispose of this PopUpHelper object.
protected  LightweightSystem getLightweightSystem()
          Returns this PopUpHelper's LightweightSystem.
protected  Shell getShell()
          Returns this PopUpHelper's Shell.
protected  void hide()
          Hides this PopUpHelper's Shell.
protected abstract  void hookShellListeners()
          Desired popup helper behavior is achieved by writing listeners that manipulate the behavior of the PopUpHelper's Shell.
 boolean isShowing()
          Returns true if this PopUpHelper's Shell is visible, false otherwise.
 void setBackgroundColor(Color c)
          Sets the background color of this PopUpHelper's Shell.
 void setForegroundColor(Color c)
          Sets the foreground color of this PopUpHelper's Shell.
protected  void setShellBounds(int x, int y, int width, int height)
          Sets the bounds on this PopUpHelper's Shell to the passed values.
protected  void show()
          Displays this PopUpHelper's Shell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

control

protected Control control
Constructor Detail

PopUpHelper

protected PopUpHelper(Control c)
Constructs a PopUpHelper to assist with popups on Control c.

Parameters:
c - The Control where popup assistance is desired.
Since:
2.0
Method Detail

createLightweightSystem

protected LightweightSystem createLightweightSystem()
Creates and returns the LightweightSystem object used by PopUpHelper to draw upon.

Since:
2.0

createShell

protected Shell createShell()
Creates a new org.eclipse.swt.widgets.Shell object with the parameters SWT.NO_TRIM | SWT.NO_FOCUS | SWT.ON_TOP.

Since:
2.0

dispose

public void dispose()
Dispose of this PopUpHelper object.

Since:
2.0

getShell

protected Shell getShell()
Returns this PopUpHelper's Shell. If no Shell exists for this PopUpHelper, a new Shell is created and hookShellListeners() is called.

Since:
2.0

getLightweightSystem

protected LightweightSystem getLightweightSystem()
Returns this PopUpHelper's LightweightSystem. If no LightweightSystem exists for this PopUpHelper, a new LightweightSystem is created with this PopUpHelper's Shell as its Control.

Since:
2.0

hide

protected void hide()
Hides this PopUpHelper's Shell.

Since:
2.0

hookShellListeners

protected 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

isShowing

public boolean isShowing()
Returns true if this PopUpHelper's Shell is visible, false otherwise.

Since:
2.0

setBackgroundColor

public void setBackgroundColor(Color c)
Sets the background color of this PopUpHelper's Shell.

Parameters:
c - The desired background color of this PopUpHelper's Shell.
Since:
2.0

setForegroundColor

public void setForegroundColor(Color c)
Sets the foreground color of this PopUpHelper's Shell.

Parameters:
c - The desired foreground color of this PopUpHelper's Shell.
Since:
2.0

setShellBounds

protected void setShellBounds(int x,
                              int y,
                              int width,
                              int height)
Sets the bounds on this PopUpHelper's Shell to the passed values.

Parameters:
x - Desired X coordinate of Shell.
y - Desired Y coordinate of Shell.
width - Desired width of Shell.
height - Desired height of Shell.
Since:
2.0

show

protected void show()
Displays this PopUpHelper's Shell.

Since:
2.0

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.