com.ibm.dse.tools.workbench.gui
Class WorkbenchGUtilities

java.lang.Object
  |
  +--com.ibm.dse.tools.workbench.gui.WorkbenchGUtilities

public class WorkbenchGUtilities
extends java.lang.Object
implements TableNames

Collection of various methods, useful for the workbench graphics.


Field Summary
static java.lang.String AWT_QUEUE_NAME
           
protected static java.lang.Thread awtQueue
           
protected static java.util.Hashtable delegates
           
static java.lang.String ENTITIES_EXTERNALIZER
           
protected static java.util.Hashtable externalizers
           
static int INSTANCE_FIELD_TO_SHOW
          the instance field that should be showed in the InstanceUI (name or path)
static java.lang.String INSTANCES_EXTERNALIZER
          The externalizer type
protected static java.lang.String MSG_ROLLBACK_DATABASE_CONFIRMATION
           
protected static java.lang.String MSG_SUBMIT_TO_DATABASE_CONFIRMATION
           
protected static java.lang.String MSG_USER_DELETE_CONFIRMATION
           
protected static java.lang.String MSG_WARNING_TITLE
           
protected static java.util.Hashtable resCache
           
protected static java.lang.String SECTION
           
 
Fields inherited from interface com.ibm.dse.tools.workbench.base.TableNames
ALLOWED_VALUES, ATTRIBUTES, DOMAINS, ENTITIES, ENTITIES_ENTITIES, GROUPS, GROUPS_ENTITIES, GROUPS_GROUPS, GROUPS_INSTANCES, INSTANCE_ERRORS, INSTANCES, PROPERTIES, USERS
 
Constructor Summary
WorkbenchGUtilities()
           
 
Method Summary
static void addExternalizer(Externalizer externalizer, java.lang.String externalizerType)
          This method adds an externalizer to the externalizer list of the given type.
static void arrangeComponentsSize(javax.swing.JComponent[] components)
          This method arranges the given array of components to the same size .
static boolean askForCommit(java.awt.Component parent)
          This method asks the user to commit the changes to the database and continue.
static boolean askForRollback(java.awt.Component parent)
          This method asks the user to roolback the changes to the database and continue.
static boolean askForUserDeleteConfirm(java.awt.Component parent, java.lang.String user)
          This method asks to confirm user deletion
static MenuOption[] constructMenuOptions(java.lang.String toParse)
          This method creates the list of components that should be included into a menu, from a string.
protected static void createDelegates()
          This method create all the list of UIDelegates.
protected static void createExternalizersList()
          This method creates the list of all the externalizers.
protected static MenuOption createMenuOption(java.lang.String toParse)
          This method return a MenuOption from an externlized definition.
protected static ToolBarOption createToolBarButton(java.lang.String toParse)
          This method return a ToolBarButton from an externalized definition.
static void finalizeAWTEventQueue()
          This method finalizes the AWT event queue.
protected static void fireWorkspaceChanged(java.util.Vector listeners, Repository workspace)
          To tell to the listener that a event has occurred.
protected static java.lang.String[] fragment(java.lang.String separator, java.lang.String toFragment)
          This methos fragments the given string into smaller pieces.
static javax.swing.ImageIcon getApplicationIcon(java.lang.String url)
          This method returns an Icon from an URL using the cache, this method is used only for the application.
static java.lang.Thread getAWTEventQueueThread()
          This method returns the AWT event queue thread.
static UIDelegate getDelegateFor(java.lang.String tableName)
          This method returns the UIDelegate for the given table name.
static Externalizer getExternalizer(java.lang.String name, java.lang.String externalizerType)
          This method returns the Externalizer of the given type for the given name of format.
static Externalizer[] getExternalizers(java.lang.String externalizerType)
          This method returns the list of Externalizers of the given type.
static javax.swing.ImageIcon getIcon(java.lang.String url)
          This method returns an icon from an url.
static javax.swing.ImageIcon getIcon(java.lang.String url, boolean cache)
          This method returns an Icon from an URL using the cache or not.
static int getInstanceFieldToShow()
          This method returns the field that should be showed in the InstanceUI (name or path)
static java.lang.String getRelatedInstanceWizard(TableRow entity)
          This method returnsthe specific wizard for the entity.
static TableRow[] getSelectedParentTableRows(javax.swing.JTree tree)
          This method returns the selected rows the tree and if there is one selected inside other, then only returns the parent.
static void loadDrivers()
          This method load all the specified drivers in memory.
static void orderArray(TableRow[] rowArray, int[] columnOrder)
          This method orders an array of TableRows.
protected static void refreshDelegates()
          This method refreshes all the UIDelegates and their components.
static void removeFiles(java.io.File directory)
          This method removes all the files of a directory and his included subdirectories
static void resetCache()
          This method clears the image cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECTION

protected static final java.lang.String SECTION

MSG_WARNING_TITLE

protected static final java.lang.String MSG_WARNING_TITLE

MSG_SUBMIT_TO_DATABASE_CONFIRMATION

protected static final java.lang.String MSG_SUBMIT_TO_DATABASE_CONFIRMATION

MSG_ROLLBACK_DATABASE_CONFIRMATION

protected static final java.lang.String MSG_ROLLBACK_DATABASE_CONFIRMATION

MSG_USER_DELETE_CONFIRMATION

protected static final java.lang.String MSG_USER_DELETE_CONFIRMATION

AWT_QUEUE_NAME

public static final java.lang.String AWT_QUEUE_NAME

resCache

protected static java.util.Hashtable resCache

awtQueue

protected static java.lang.Thread awtQueue

delegates

protected static java.util.Hashtable delegates

externalizers

protected static java.util.Hashtable externalizers

INSTANCES_EXTERNALIZER

public static final java.lang.String INSTANCES_EXTERNALIZER
The externalizer type

ENTITIES_EXTERNALIZER

public static final java.lang.String ENTITIES_EXTERNALIZER

INSTANCE_FIELD_TO_SHOW

public static int INSTANCE_FIELD_TO_SHOW
the instance field that should be showed in the InstanceUI (name or path)
Constructor Detail

WorkbenchGUtilities

public WorkbenchGUtilities()
Method Detail

addExternalizer

public static void addExternalizer(Externalizer externalizer,
                                   java.lang.String externalizerType)
This method adds an externalizer to the externalizer list of the given type.
Parameters:
externalizer - com.ibm.dse.tools.workbench.base.Externalizer The externalizer
externalizerType - java.lang.String The externalizer type

arrangeComponentsSize

public static void arrangeComponentsSize(javax.swing.JComponent[] components)
This method arranges the given array of components to the same size .
Parameters:
components - javax.swing.JComponent[]

askForCommit

public static boolean askForCommit(java.awt.Component parent)
This method asks the user to commit the changes to the database and continue.
Parameters:
parent - java.awt.Component
Returns:
boolean

askForRollback

public static boolean askForRollback(java.awt.Component parent)
This method asks the user to roolback the changes to the database and continue.
Parameters:
parent - java.awt.Component
Returns:
boolean

askForUserDeleteConfirm

public static boolean askForUserDeleteConfirm(java.awt.Component parent,
                                              java.lang.String user)
This method asks to confirm user deletion
Parameters:
parent - java.awt.Component
user - java.lang.String
Returns:
boolean

constructMenuOptions

public static MenuOption[] constructMenuOptions(java.lang.String toParse)
This method creates the list of components that should be included into a menu, from a string.
Parameters:
toParse - java.lang.String
Returns:
com.ibm.dse.tools.gui.MenuOption[]

createDelegates

protected static void createDelegates()
This method create all the list of UIDelegates.

createExternalizersList

protected static void createExternalizersList()
This method creates the list of all the externalizers.

createMenuOption

protected static MenuOption createMenuOption(java.lang.String toParse)
This method return a MenuOption from an externlized definition.
Parameters:
toParse - java.lang.String
Returns:
com.ibm.dse.tools.workbench.gui.MenuOption

createToolBarButton

protected static ToolBarOption createToolBarButton(java.lang.String toParse)
This method return a ToolBarButton from an externalized definition.
Parameters:
toParse - java.lang.String
Returns:
com.ibm.dse.tools.workbench.gui.ToolBarOption

finalizeAWTEventQueue

public static void finalizeAWTEventQueue()
This method finalizes the AWT event queue.

fireWorkspaceChanged

protected static void fireWorkspaceChanged(java.util.Vector listeners,
                                           Repository workspace)
To tell to the listener that a event has occurred. This event is because the workspace has changed
Parameters:
listeners - com.ibm.dse.base.Vectors
workspace - com.ibm.dse.tools.workbench.base.Repository

fragment

protected static java.lang.String[] fragment(java.lang.String separator,
                                             java.lang.String toFragment)
This methos fragments the given string into smaller pieces.
Parameters:
separator - java.lang.String
toFragment - java.lang.String
Returns:
java.lang.String[]

getApplicationIcon

public static javax.swing.ImageIcon getApplicationIcon(java.lang.String url)
This method returns an Icon from an URL using the cache, this method is used only for the application.
Parameters:
url - java.lang.String
Returns:
javax.swing.ImageIcon

getAWTEventQueueThread

public static java.lang.Thread getAWTEventQueueThread()
This method returns the AWT event queue thread.
Returns:
java.lang.Thread

getDelegateFor

public static UIDelegate getDelegateFor(java.lang.String tableName)
This method returns the UIDelegate for the given table name.
Parameters:
tableName - java.lang.String
Returns:
com.ibm.dse.tools.workbench.gui.UIDelegate

getExternalizer

public static Externalizer getExternalizer(java.lang.String name,
                                           java.lang.String externalizerType)
This method returns the Externalizer of the given type for the given name of format.
Parameters:
name - java.lang.String The name of the externalizer
externalizerType - java.lang.String The externalizer type
Returns:
com.ibm.dse.tools.workbench.base.Externalizer

getExternalizers

public static Externalizer[] getExternalizers(java.lang.String externalizerType)
This method returns the list of Externalizers of the given type.
Parameters:
externalizerType - java.lang.String The externalizer type
Returns:
com.ibm.dse.tools.workbench.base.Externalizer[]

getIcon

public static javax.swing.ImageIcon getIcon(java.lang.String url)
This method returns an icon from an url.
Parameters:
url - java.lang.String
Returns:
javax.swing.ImageIcon

getIcon

public static javax.swing.ImageIcon getIcon(java.lang.String url,
                                            boolean cache)
This method returns an Icon from an URL using the cache or not.
Parameters:
url - java.lang.String
cache - boolean
Returns:
javax.swing.ImageIcon

getInstanceFieldToShow

public static int getInstanceFieldToShow()
This method returns the field that should be showed in the InstanceUI (name or path)
Returns:
int

getRelatedInstanceWizard

public static java.lang.String getRelatedInstanceWizard(TableRow entity)
This method returnsthe specific wizard for the entity.
Parameters:
entity - com.ibm.dse.tools.workbench.base.TableRow
Returns:
java.lang.String

getSelectedParentTableRows

public static TableRow[] getSelectedParentTableRows(javax.swing.JTree tree)
This method returns the selected rows the tree and if there is one selected inside other, then only returns the parent.
Parameters:
tree - javax.swing.JTree
Returns:
com.ibm.dse.tools.workbench.base.TableRow[]

loadDrivers

public static void loadDrivers()
This method load all the specified drivers in memory.

orderArray

public static void orderArray(TableRow[] rowArray,
                              int[] columnOrder)
This method orders an array of TableRows.
Parameters:
rowArray - com.ibm.dse.tools.workbench.base.TableRow[]
columnOrder - int[]

refreshDelegates

protected static void refreshDelegates()
This method refreshes all the UIDelegates and their components.

removeFiles

public static void removeFiles(java.io.File directory)
                        throws java.io.IOException
This method removes all the files of a directory and his included subdirectories
Parameters:
directory - java.io.File
Throws:
java.io.IOException -  

resetCache

public static void resetCache()
This method clears the image cache.