com.tensegrity.gui.swt.control.attributetree
Class CopyOfSwtAttributeTable

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.gui.swt.control.attributetree.CopyOfSwtAttributeTable
All Implemented Interfaces:
AttributableOnSetListener, AttributeEditor, AttributeTable, BasicComponent, org.eclipse.swt.graphics.Drawable, Evaluable, EventListenerTag

public class CopyOfSwtAttributeTable
extends org.eclipse.swt.widgets.Composite
implements Evaluable, AttributeTable, AttributableOnSetListener

This class is a SWT implementation of the AttributeTable definition. It is a Composite and it internally uses an instance of Table in order to display attribute values.

Version:
$Id: CopyOfSwtAttributeTable.java,v 1.3 2005/06/10 09:37:04 BurkhardWick Exp $
Author:
S�bastien Guyon

Nested Class Summary
static class CopyOfSwtAttributeTable.CustomMappedComparator
          Custom attribute comparator.
 
Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Fields inherited from interface com.tensegrity.gui.component.AttributeEditor
hiddenPrefix, SORT_ASCENDING, SORT_DESCENDING, SORT_NONE
 
Constructor Summary
CopyOfSwtAttributeTable(UIManager uiManager, org.eclipse.swt.widgets.Composite parent, int style, boolean editable)
           Constructs an attribute table.
 
Method Summary
 void applyEvList()
          Tells the component to apply its UIItemEvaluationList.
 void attributesChanged(AttributableOnSetEvent attributableOnSetEvent)
          Invoked when an attribute in an AttributableOnSet object has changed.
 void cancelEditing()
          Cancels editing and discards changes.
 void foldCategories()
          Folds the categories
 AttributableOnSet getAttributableOnSet()
          Returns the current AttributableOnSet.
 AttributeSet getCurrentAttributeSet()
          Returns the AttributeSet currently displayed in the table.
 AttributeEditorProperties getEditorProperties()
          This method returns an instance of the currently used AttributeTableProperties instance.
 int getHeight()
          Returns the height of the component in pixels.
 BasicComponent getParentComponent()
          Returns the parent Component of this instance.
 int getWidth()
          Returns the width of the component in pixels.
 void hideAttribute(java.lang.String name)
          Hides the attribute identified by the given name.
 void installEvList()
          Tells the component to setup its internal state.
 boolean isEditable()
          Returns the editable flag
 boolean isTree()
          Returns true, if this editor is displaying an AttributeTree and will call get/setAttributesTree() instead of get/setAttributes().
 void propertiesChanged()
          Called from the AttributeEditorProperties when a setting changed.
 void rehash()
          Reloads the AttributeSet from the AttributableOnSet and refreshes the view.
 void repaint()
          Triggers a repaint.
 void scrollToAttribute(java.lang.String path)
           Makes an attribute visible by scrolling to it.
 void setAttributableOnSet(AttributableOnSet attributable)
          Associates a new attributeset with the attributetable's model.
 void setEditable(boolean editable)
          Sets the editable flag. if false, then table is read-only.
 AttributeEditorProperties setEditorProperties(AttributeEditorProperties editorProperties)
          This method sets an instance of the AttributeTableProperties to be used.
 void showAttribute(java.lang.String name)
          Toggles the hidden flag for an attribute identified by the given name.
 void sort(int mode)
          Sorts the table.
 boolean stopEditing()
          Stops the editing of an Attribute and saves the current value.
 void unfoldCategories()
          Unfolds the categories
 
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
 

Constructor Detail

CopyOfSwtAttributeTable

public CopyOfSwtAttributeTable(UIManager uiManager,
                               org.eclipse.swt.widgets.Composite parent,
                               int style,
                               boolean editable)

Constructs an attribute table.

Parameters:
uiManager - a UIManager instance used for localization of Strings
parent - the parent Composite for this table
style - the SWT style used to create this Composite
editable - flag for editing, if set to true, then the table is editable, otherwise it is not.
Method Detail

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()

attributesChanged

public void attributesChanged(AttributableOnSetEvent attributableOnSetEvent)
Description copied from interface: AttributableOnSetListener
Invoked when an attribute in an AttributableOnSet object has changed.

Specified by:
attributesChanged in interface AttributableOnSetListener
Parameters:
attributableOnSetEvent - the event carrying information.
See Also:
AttributableOnSetListener.attributesChanged(com.tensegrity.generic.attribute.event.AttributableOnSetEvent)

cancelEditing

public void cancelEditing()
Description copied from interface: AttributeEditor
Cancels editing and discards changes.

Specified by:
cancelEditing in interface AttributeEditor
See Also:
AttributeEditor.cancelEditing()

getAttributableOnSet

public AttributableOnSet getAttributableOnSet()
Description copied from interface: AttributeEditor
Returns the current AttributableOnSet. This might be null.

Specified by:
getAttributableOnSet in interface AttributeEditor
Returns:
The AttributableOnSet or null, if the editor is empty.
See Also:
AttributeEditor.getAttributableOnSet()

rehash

public void rehash()
Description copied from interface: AttributeEditor
Reloads the AttributeSet from the AttributableOnSet and refreshes the view.

Specified by:
rehash in interface AttributeEditor
See Also:
AttributeEditor.rehash()

stopEditing

public boolean stopEditing()
Description copied from interface: AttributeEditor
Stops the editing of an Attribute and saves the current value.

Specified by:
stopEditing in interface AttributeEditor
Returns:
true, if editing was active
See Also:
AttributeEditor.stopEditing()

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()

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()

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()

setAttributableOnSet

public void setAttributableOnSet(AttributableOnSet attributable)
Associates a new attributeset with the attributetable's model.

Specified by:
setAttributableOnSet in interface AttributeEditor
Parameters:
attributable - the AttributableOnSet to set.

getCurrentAttributeSet

public AttributeSet getCurrentAttributeSet()
Returns the AttributeSet currently displayed in the table.

Specified by:
getCurrentAttributeSet in interface AttributeEditor
Returns:
AttributeSet the current AttributeSet of the table

sort

public void sort(int mode)
Sorts the table.

Parameters:
mode - one the constants defined in this class.

unfoldCategories

public void unfoldCategories()
Unfolds the categories


foldCategories

public void foldCategories()
Folds the categories


isEditable

public boolean isEditable()
Returns the editable flag

Returns:
boolean true if the table is editable.

setEditable

public void setEditable(boolean editable)
Sets the editable flag. if false, then table is read-only.

Parameters:
editable - The editable to set

scrollToAttribute

public void scrollToAttribute(java.lang.String path)

Makes an attribute visible by scrolling to it.

Parameters:
path - the path of the attribute to show

hideAttribute

public void hideAttribute(java.lang.String name)
Description copied from interface: AttributeEditor
Hides the attribute identified by the given name. Such a name usually describes the full path to that attribute, like: GEOMETRY.X or COMPOSITE.name. This method will just forward the call to AttributeEditorProperties.setVisible(String, boolean)

Specified by:
hideAttribute in interface AttributeEditor
Parameters:
name - the full name of the attribute.
See Also:
AttributeEditor.hideAttribute(String)

showAttribute

public void showAttribute(java.lang.String name)
Description copied from interface: AttributeEditor
Toggles the hidden flag for an attribute identified by the given name. Similar to hideAttribute(String), this name describes the full path to the attribute. This method will just forward the call to AttributeEditorProperties.setVisible(String, boolean)

Specified by:
showAttribute in interface AttributeEditor
Parameters:
name - the full name of the attribute.
See Also:
AttributeEditor.showAttribute(String)

getEditorProperties

public AttributeEditorProperties getEditorProperties()
Description copied from interface: AttributeEditor
This method returns an instance of the currently used AttributeTableProperties instance.

Specified by:
getEditorProperties in interface AttributeEditor
Returns:
The properties instance used by this editor
See Also:
AttributeEditor.getEditorProperties()

propertiesChanged

public void propertiesChanged()
Description copied from interface: AttributeEditor
Called from the AttributeEditorProperties when a setting changed. The editor implementation should rehash the attributes whenever this method is called.

Specified by:
propertiesChanged in interface AttributeEditor

isTree

public boolean isTree()
Description copied from interface: AttributeEditor
Returns true, if this editor is displaying an AttributeTree and will call get/setAttributesTree() instead of get/setAttributes().

Specified by:
isTree in interface AttributeEditor
Returns:
true, if this editor is displaying an AttributeTree

setEditorProperties

public AttributeEditorProperties setEditorProperties(AttributeEditorProperties editorProperties)
Description copied from interface: AttributeEditor
This method sets an instance of the AttributeTableProperties to be used.

Specified by:
setEditorProperties in interface AttributeEditor
Parameters:
editorProperties - The properties instance that should be used by this editor
Returns:
The properties instance that has been used before


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