com.tensegrity.gui.swt.control
Class SwtPopupMenu

java.lang.Object
  extended bycom.tensegrity.gui.swt.control.SwtPopupMenu
All Implemented Interfaces:
BasicComponent, Evaluable, PopupMenuMarkup

public class SwtPopupMenu
extends java.lang.Object
implements PopupMenuMarkup

This is the "SWT" implementation of the PopupMenuMarkup interface. Due to "SWT" restrictions this class does not extend the Menu class but instead contains an instance of this class accessible through the getMenuInstance() method.

Version:
$Id: SwtPopupMenu.java,v 1.3 2005/04/05 16:00:52 SebastienGuyon Exp $
Author:
S�bastien Guyon

Constructor Summary
SwtPopupMenu(org.eclipse.swt.widgets.Control parent)
           Initializes the local Menu instance.
SwtPopupMenu(org.eclipse.swt.widgets.Decorations parent, int style)
           Initializes the local Menu instance.
SwtPopupMenu(org.eclipse.swt.widgets.Menu parentMenu)
           Initializes the local Menu instance.
SwtPopupMenu(org.eclipse.swt.widgets.MenuItem parentItem)
           Initializes the local Menu instance.
 
Method Summary
 void applyEvList()
          Tells the component to apply its UIItemEvaluationList.
 void dispose()
           Disposes the local Menu instance.
 int getHeight()
          Returns the height of the component in pixels.
 org.eclipse.swt.widgets.Menu getMenuInstance()
          Returns the local Menu instance.
 BasicComponent getParentComponent()
          Returns the parent Component of this instance.
 int getWidth()
          Returns the width of the component in pixels.
 void installEvList()
          Tells the component to setup its internal state.
 void removeAll()
           Removes all menu items from the Menu instance.
 void repaint()
          Triggers a repaint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwtPopupMenu

public SwtPopupMenu(org.eclipse.swt.widgets.Control parent)

Initializes the local Menu instance.

Parameters:
parent - a control which will be the parent of the local Menu instance (cannot be null)

SwtPopupMenu

public SwtPopupMenu(org.eclipse.swt.widgets.Decorations parent,
                    int style)

Initializes the local Menu instance.

Parameters:
parent - a decorations control which will be the parent of the local Menu instance (cannot be null)
style - the style of menu to construct

SwtPopupMenu

public SwtPopupMenu(org.eclipse.swt.widgets.Menu parentMenu)

Initializes the local Menu instance.

Parameters:
parentMenu - a menu which will be the parent of the local Menu instance (cannot be null)

SwtPopupMenu

public SwtPopupMenu(org.eclipse.swt.widgets.MenuItem parentItem)

Initializes the local Menu instance.

Parameters:
parentItem - a menu item which will be the parent of the local Menu instance (cannot be null)
Method Detail

getMenuInstance

public final org.eclipse.swt.widgets.Menu getMenuInstance()
Returns the local Menu instance.

Returns:
the local Menu instance.

getHeight

public int getHeight()
Description copied from interface: BasicComponent
Returns the height of the component in pixels.

Specified by:
getHeight in interface BasicComponent
Returns:
the height of the component in pixels.
See Also:
BasicComponent.getHeight()

getParentComponent

public BasicComponent getParentComponent()
Description copied from interface: BasicComponent
Returns the parent Component of this instance.

Specified by:
getParentComponent in interface BasicComponent
Returns:
the parent component or null if no parent exists.
See Also:
BasicComponent.getParentComponent()

getWidth

public int getWidth()
Description copied from interface: BasicComponent
Returns the width of the component in pixels.

Specified by:
getWidth in interface BasicComponent
Returns:
the width of the component in pixels.
See Also:
BasicComponent.getWidth()

repaint

public void repaint()
Description copied from interface: BasicComponent
Triggers a repaint.

Specified by:
repaint in interface BasicComponent
See Also:
BasicComponent.repaint()

applyEvList

public void applyEvList()
Description copied from interface: Evaluable
Tells the component to apply its UIItemEvaluationList.

Specified by:
applyEvList in interface Evaluable
See Also:
Evaluable.applyEvList()

installEvList

public void installEvList()
Description copied from interface: Evaluable
Tells the component to setup its internal state.

Specified by:
installEvList in interface Evaluable
See Also:
Evaluable.installEvList()

dispose

public void dispose()

Disposes the local Menu instance. See Widget.dispose().


removeAll

public void removeAll()

Removes all menu items from the Menu instance.



Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.