net.sourceforge.geeboss.view
Class PatchTree

java.lang.Object
  extended by net.sourceforge.geeboss.view.PatchTree
All Implemented Interfaces:
Translatable

public class PatchTree
extends java.lang.Object
implements Translatable

This is the Tree that holds the bank and patch items.


Field Summary
static java.lang.String BANK_INDENT
          The String to use to seperate banks
 
Constructor Summary
PatchTree(org.eclipse.swt.widgets.Display display, org.eclipse.swt.widgets.Shell shell, org.eclipse.swt.custom.SashForm contentPane, MainView geebossGui, EventManager eventManager)
          Instantiate a new PatchTree
 
Method Summary
 void addBank(java.lang.String name, Effect parentCat)
          Add a new bank to the Tree
 boolean addBank(java.lang.String name, Effect parent, java.lang.String subscriptionUrl)
          Add a new bank to the Tree
 void buildPatchTree()
          Build the complete ptach tree.
 org.eclipse.swt.widgets.Tree getPatchTree()
          Let other objects access this controll (for example to focus on it)
 PatchTreeDnd getPatchTreeDnd()
          Get the DND class that allows drag and drop on this patch tree
 Effect getSelectedBank()
          Get the selected bank
 Effect getSelectedBank(java.lang.String path)
          Get the selected bank from the given path
 java.lang.String getTreePath(boolean skipPatch)
          Return the TreePath of the selected TreeItem
 java.lang.String getTreePath(org.eclipse.swt.widgets.TreeItem selectedTree, boolean skipPatch)
          Return the TreePath of the selected TreeItem
 void handleTreeItemSelect(boolean isSingleClick)
           
 void updateFonts()
           
 void updateHeaderColor()
          Update the color of the header
 void updateI18N()
          Update all controlls text with i18n
 void updateTreeItemIcon(org.eclipse.swt.widgets.TreeItem treeItem, boolean isError)
          Update the icon on a TreeItem in dependance of the "isError" flag.
 void updateTreeReadStatus(org.eclipse.swt.widgets.TreeItem treeItem)
          Recursivly update all parent bank of the given TreeItem to set / unset the unread status, which is indicated by a slightly different bank icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BANK_INDENT

public static final java.lang.String BANK_INDENT
The String to use to seperate banks

See Also:
Constant Field Values
Constructor Detail

PatchTree

public PatchTree(org.eclipse.swt.widgets.Display display,
                 org.eclipse.swt.widgets.Shell shell,
                 org.eclipse.swt.custom.SashForm contentPane,
                 MainView geebossGui,
                 EventManager eventManager)
Instantiate a new PatchTree

Parameters:
display - The display
shell - The shell
contentPane - The Sashform where to add the URL-Tree
geebossGui - Access some methods of the main controller
eventManager - The event manager
Method Detail

addBank

public void addBank(java.lang.String name,
                    Effect parentCat)
Add a new bank to the Tree

Parameters:
name - Name of the bank
parentCat - The parent bank

addBank

public boolean addBank(java.lang.String name,
                       Effect parent,
                       java.lang.String subscriptionUrl)
Add a new bank to the Tree

Parameters:
name - Name of the bank
parent - Parent bank
subscriptionUrl - URL to the subscription
Returns:
true on success

buildPatchTree

public void buildPatchTree()
Build the complete ptach tree.


getPatchTree

public org.eclipse.swt.widgets.Tree getPatchTree()
Let other objects access this controll (for example to focus on it)

Returns:
The URL Tree

getPatchTreeDnd

public PatchTreeDnd getPatchTreeDnd()
Get the DND class that allows drag and drop on this patch tree

Returns:
The dnd class of this patch tree

getSelectedBank

public Effect getSelectedBank()
Get the selected bank

Returns:
selected bank

getSelectedBank

public Effect getSelectedBank(java.lang.String path)
Get the selected bank from the given path

Parameters:
path - Path to the bank (e.g. "Test > Sub1 > Sub2")
Returns:
bank Selected bank

getTreePath

public java.lang.String getTreePath(boolean skipPatch)
Return the TreePath of the selected TreeItem

Parameters:
skipPatch - true if a patch does not count as selection in the path
Returns:
String The TreePath

getTreePath

public java.lang.String getTreePath(org.eclipse.swt.widgets.TreeItem selectedTree,
                                    boolean skipPatch)
Return the TreePath of the selected TreeItem

Parameters:
selectedTree - The selected TreeItem
skipPatch - true if a patch does not count as selection in the path
Returns:
String The TreePath

handleTreeItemSelect

public void handleTreeItemSelect(boolean isSingleClick)
Parameters:
isSingleClick - if true, the selection was made with a single click

updateFonts

public void updateFonts()

updateHeaderColor

public void updateHeaderColor()
Update the color of the header


updateI18N

public void updateI18N()
Update all controlls text with i18n

Specified by:
updateI18N in interface Translatable

updateTreeItemIcon

public void updateTreeItemIcon(org.eclipse.swt.widgets.TreeItem treeItem,
                               boolean isError)
Update the icon on a TreeItem in dependance of the "isError" flag.

Parameters:
treeItem - The TreeItem to update
isError - true if the treeitem should display an warning

updateTreeReadStatus

public void updateTreeReadStatus(org.eclipse.swt.widgets.TreeItem treeItem)
Recursivly update all parent bank of the given TreeItem to set / unset the unread status, which is indicated by a slightly different bank icon.

Parameters:
treeItem - The starting point TreeItem


Copyright (c) 2005 The Geeboss team (http://geeboss.sourceforge.net). All Rights Reserved.