org.formaria.swt
Class Tree

java.lang.Object
  extended by org.eclipse.swt.widgets.Tree
      extended by org.formaria.swt.Tree
All Implemented Interfaces:
ModelHolder, StyleComponent

public class Tree
extends org.eclipse.swt.widgets.Tree
implements StyleComponent, ModelHolder

A tree control, wraps JTree

Copyright (c) Formaria Ltd.,
License: see license.txt $Revision: 2.4 $


Field Summary
protected  DataModel model
           
protected  boolean updateModelSelection
           
protected  boolean usesDatabase
           
 
Constructor Summary
Tree(java.lang.Object parent)
          Create a new Tree component
 
Method Summary
protected  void checkSubclass()
          Suppress the subclassing exception
 void databaseRefill()
          Refill from the database
 DataModel getModel()
          Get the model
 java.lang.String getStyleName()
          Get the style name
 java.lang.String getText(DataModel xmodel, int i)
          Get the appropriate text inside the model
 java.lang.String getToolTip()
          Get the tooltip text
 java.lang.String getValueAt(int rowIndex, int columnIndex)
          Get the value of the indexes
 boolean isShowAttrib()
           
 void setDataModel(DataModel xmodel)
          Set the DataModel which we will be generating the table from
 void setShowAttrib(boolean showAttrib)
           
 void setStyle(java.lang.String style)
          Set the tree style name
 void setToolTip(java.lang.String text)
          Set the tooltip text
 void staticRefill()
          Refill from static elements
 void update()
          Update the tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected DataModel model

updateModelSelection

protected boolean updateModelSelection

usesDatabase

protected boolean usesDatabase
Constructor Detail

Tree

public Tree(java.lang.Object parent)
Create a new Tree component

Parameters:
parent - parent object
Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception


setStyle

public void setStyle(java.lang.String style)
Set the tree style name

Specified by:
setStyle in interface StyleComponent
Parameters:
style - the style name

getStyleName

public java.lang.String getStyleName()
Get the style name

Returns:
the style name

setDataModel

public void setDataModel(DataModel xmodel)
Set the DataModel which we will be generating the table from

Specified by:
setDataModel in interface ModelHolder
Parameters:
xmodel - the DataModel of data

getModel

public DataModel getModel()
Get the model


update

public void update()
Update the tree

Specified by:
update in interface ModelHolder

databaseRefill

public void databaseRefill()
Refill from the database


staticRefill

public void staticRefill()
Refill from static elements


getValueAt

public java.lang.String getValueAt(int rowIndex,
                                   int columnIndex)
Get the value of the indexes

Parameters:
rowIndex - row index
columnIndex - column index
Returns:
the value

getText

public java.lang.String getText(DataModel xmodel,
                                int i)
Get the appropriate text inside the model

Parameters:
xmodel - parent model
i - index of the children
Returns:
the text

isShowAttrib

public boolean isShowAttrib()

setShowAttrib

public void setShowAttrib(boolean showAttrib)

setToolTip

public void setToolTip(java.lang.String text)
Set the tooltip text

Parameters:
text - the new text

getToolTip

public java.lang.String getToolTip()
Get the tooltip text

Returns:
the existing text if any