net.xoetrope.swt
Class XTree

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.swt.widgets.Tree
                      extended by net.xoetrope.swt.XTree
All Implemented Interfaces:
XStyleComponent, XAttributedComponent, XModelHolder, org.eclipse.swt.graphics.Drawable

public class XTree
extends org.eclipse.swt.widgets.Tree
implements XAttributedComponent, XStyleComponent, XModelHolder

A tree control, wraps JTree

Copyright (c) Xoetrope Ltd., 1998-2004
License: see license.txt $Revision: 2.4 $


Field Summary
protected  XModel model
           
protected  boolean showAttrib
           
protected  boolean updateModelSelection
           
protected  boolean usesDatabase
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
XTree(java.lang.Object parent)
          Create a new Tree component
 
Method Summary
protected  void checkSubclass()
          Suppress the subclassing exception
 void databaseRefill()
          Refill from the database
 XModel getModel()
          Get the model
 java.lang.String getStyleName()
          Get the style name
 java.lang.String getText(XModel xmodel, int i)
          Get the appropriate text inside the model
 java.lang.String getValueAt(int rowIndex, int columnIndex)
          Get the value of the indexes
 int setAttribute(java.lang.String attribName, java.lang.Object attribValue)
          Set one or more attributes of the component.
 void setModel(XModel xmodel)
          Set the XModel which we will be generating the table from
 void setStyle(java.lang.String style)
          Set the tree style name
 void staticRefill()
          Refill from static elements
 void update()
          Update the tree
 
Methods inherited from class org.eclipse.swt.widgets.Tree
addSelectionListener, addTreeListener, clear, clearAll, computeSize, deselectAll, getColumn, getColumnCount, getColumnOrder, getColumns, getGridLineWidth, getHeaderHeight, getHeaderVisible, getItem, getItem, getItemCount, getItemHeight, getItems, getLinesVisible, getParentItem, getSelection, getSelectionCount, getSortColumn, getSortDirection, getTopItem, indexOf, indexOf, removeAll, removeSelectionListener, removeTreeListener, selectAll, setColumnOrder, setFont, setHeaderVisible, setInsertMark, setItemCount, setLinesVisible, setRedraw, setSelection, setSelection, setSortColumn, setSortDirection, setTopItem, showColumn, showItem, showSelection
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, 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, getBackgroundImage, 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, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse
 
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
 

Field Detail

model

protected XModel model

updateModelSelection

protected boolean updateModelSelection

usesDatabase

protected boolean usesDatabase

showAttrib

protected boolean showAttrib
Constructor Detail

XTree

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

Parameters:
parent - parent object
Method Detail

checkSubclass

protected void checkSubclass()
Suppress the subclassing exception

Overrides:
checkSubclass in class org.eclipse.swt.widgets.Tree

setAttribute

public int setAttribute(java.lang.String attribName,
                        java.lang.Object attribValue)
Set one or more attributes of the component.

Specified by:
setAttribute in interface XAttributedComponent
Parameters:
attribName - the name of the attribute
attribValue - the value of the attribute
Returns:
0 for success, non zero for failure or to require some further action

setStyle

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

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

getStyleName

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

Returns:
the style name

setModel

public void setModel(XModel xmodel)
Set the XModel which we will be generating the table from

Specified by:
setModel in interface XModelHolder
Parameters:
xmodel - the XModel of data

getModel

public XModel getModel()
Get the model


update

public void update()
Update the tree

Specified by:
update in interface XModelHolder
Overrides:
update in class org.eclipse.swt.widgets.Control

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(XModel xmodel,
                                int i)
Get the appropriate text inside the model

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