com.tensegrity.skeleton.swt.container
Class AbstractSwtToolContainer

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended bycom.tensegrity.skeleton.swt.container.AbstractSwtToolContainer
All Implemented Interfaces:
Container, org.eclipse.swt.graphics.Drawable, ToolContainer
Direct Known Subclasses:
SwtAttributeTreeContainer, SwtLayoutToolsContainer, SwtNavigatorContainer, SwtRepositoryContainer

public abstract class AbstractSwtToolContainer
extends org.eclipse.swt.widgets.Composite
implements ToolContainer

This is a basic abstract implementation of the ToolContainer interface for the Swt context. It provides all subclasses with useful variables like the ApplicationFrame or the UIManager.

Version:
$Id: AbstractSwtToolContainer.java,v 1.6 2005/07/28 11:09:35 SebastienGuyon Exp $
Author:
S�bastien Guyon

Field Summary
protected  boolean isSelected
          The isSelected field contains the current selection state of this Container.
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
AbstractSwtToolContainer(ApplicationFrame applicationFrame, org.eclipse.swt.widgets.Composite parent, int style)
          Creates the AbstractSwingToolContainer by assigning the parameter ApplicationFrame and the associated UIManager.
 
Method Summary
 ApplicationFrame getApplicationFrame()
          Returns the enclosing ApplicationFrame of this Container.
 int getHeight()
          Returns the width in pixel of this container.
protected  UIManager getUiManager()
          Returns the UiManager.
 int getWidth()
          Returns the width in pixel of this container.
abstract  void init()
          Subclasses implement this method to start their initialization code.
 void repaint()
          This might be called users to trigger a visual update of the ToolContainer.
abstract  void setName(java.lang.String s)
          Sets the name of this container.
 void setSelected(boolean b)
          Sets the selected flag of this container.
protected  void setUiManager(UIManager uiManager)
          Allows subclasses to manually set the UIManager.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.tensegrity.gui.container.Container
getName
 

Field Detail

isSelected

protected boolean isSelected
The isSelected field contains the current selection state of this Container.

Constructor Detail

AbstractSwtToolContainer

public AbstractSwtToolContainer(ApplicationFrame applicationFrame,
                                org.eclipse.swt.widgets.Composite parent,
                                int style)
Creates the AbstractSwingToolContainer by assigning the parameter ApplicationFrame and the associated UIManager. The Constructor implicitly calls the init method to allow subclasses to perform further initialization.

Parameters:
applicationFrame - Enclosing ApplicationFrame
parent - a widget which will be the parent of the new instance (cannot be null)
style - the style of widget to construct
Method Detail

getApplicationFrame

public ApplicationFrame getApplicationFrame()
Description copied from interface: Container
Returns the enclosing ApplicationFrame of this Container.

Specified by:
getApplicationFrame in interface Container
Returns:
the instance of the enclosing ApplicationFrame.

init

public abstract void init()
Subclasses implement this method to start their initialization code. This method is called from within the constructor of this class.


getUiManager

protected UIManager getUiManager()
Returns the UiManager.

Returns:
the UIManager associated with this container.

setUiManager

protected void setUiManager(UIManager uiManager)
Allows subclasses to manually set the UIManager.

Parameters:
uiManager - the UIManager to set.

setSelected

public void setSelected(boolean b)
Description copied from interface: Container
Sets the selected flag of this container.

Specified by:
setSelected in interface Container
Parameters:
b - true to indicate that this container is selected.

getHeight

public int getHeight()
Description copied from interface: ToolContainer
Returns the width in pixel of this container.

Specified by:
getHeight in interface ToolContainer
Returns:
int

getWidth

public int getWidth()
Description copied from interface: ToolContainer
Returns the width in pixel of this container.

Specified by:
getWidth in interface ToolContainer
Returns:
int

repaint

public void repaint()
Description copied from interface: ToolContainer
This might be called users to trigger a visual update of the ToolContainer.

Specified by:
repaint in interface ToolContainer

setName

public abstract void setName(java.lang.String s)
Sets the name of this container.

Specified by:
setName in interface Container
Parameters:
s - the new name for this container.


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