Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.uda
Class SystemUDTypeManager

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.uda.SystemUDBaseManager
      extended bycom.ibm.etools.systems.core.ui.uda.SystemUDTypeManager
All Implemented Interfaces:
ErrorHandler, ISystemUDAConstants, ISystemXMLElementWrapperFactory

public class SystemUDTypeManager
extends SystemUDBaseManager

Instances of this class hold the UDA Type definitions unique to the SubSystem type - according to the SubSystemFactory Note that unlike user actions, types are not scoped by profile. For each subsystem factory there is but a single master list of types. Instances of this class will be linked to a SubSystem instance for now, but should be linked to a subsystem factory instance in the future.


Field Summary
static String ALL_TYPE
           
static String copyright
           
static String UDT_FILENAME
           
static String XE_TYPE
           
 
Fields inherited from class com.ibm.etools.systems.core.ui.uda.SystemUDBaseManager
_udas, EMPTY_ARRAY, importCaseFolder
 
Fields inherited from interface com.ibm.etools.systems.core.ui.uda.ISystemXMLElementWrapperFactory
Copyright
 
Fields inherited from interface com.ibm.etools.systems.core.ui.uda.ISystemUDAConstants
NAME_ATTR, ORIGINAL_NAME_ATTR, RELEASE_ATTR, XE_DOMAIN, XE_DOMNAME, XE_DOMTYPE
 
Constructor Summary
SystemUDTypeManager(SystemUDActionSubsystem udas)
          Constructor
 
Method Summary
 SystemUDTypeElement addType(int domain, String name)
          Add a new user type.
 SystemXMLElementWrapper createElementWrapper(Element xmlElementToWrap, SystemProfile profile, int domain)
          Given an xml element node, create an instance of the appropriate subclass of SystemXMLElementWrapper to represent it.
protected  void dataChanged(SystemProfile profile)
          Indicate data has changed for the given profile
 void delete(SystemUDTypeElement typeElement)
          Delete a give user action or type, given its wrapper.
protected  boolean doMigration(SystemProfile profile, String oldRelease)
          Overridable extension point for child classes to do migration of their document.
protected  boolean exists(IResource resource)
          For some reason the exists() method on IResource is fundamentally not reliable.
protected  IFolder getDocumentFolder(SubSystemFactory subsystemFactory, SystemProfile profile)
          Get the folder containing the xml file used to persist the actions, for the given profile
 String getDocumentRootTagName()
          Get the document root tag name.
 String getFileName()
          Get the name of the file to persist to: udtype.xml
 Image getNewImage()
          Get the icon to show in the tree views, for the "new" expandable item
protected  String getNewNodeLabel()
          Parent method override for returning the "New" icon label for the Work With dialog tree view.
 String getTagName()
          Return the tag name for our managed elements.
 String[] getTypeNames(int domain)
          Return list of names of types in the given domain, or in doc if domain is -1 (which must only happen if supportsDomains() is false!)
 SystemUDTypeElement[] getTypes(Vector v, int domain)
          Return xml element wrapper objects for all types, for the given domain, or for the whole document if domain is -1 (iff domains not supported).
 String getTypesForTypeName(String typeName, int domain)
          Given a type name and domain, find the named type and return its types, or null if not found
protected  boolean isUserActionsManager()
          Return true if this is user actions, false if this is named types.
 SystemXMLElementWrapper[] primeDocument(SystemProfile profile)
          Prime the given document with any default types Calls primeDefaultTypes in action subsystem.
 void saveUserData()
          Save user data
 void setFolder(String profileName, String factoryId)
          Intended for IMPORT actions only, where no Subsystem instance available:
 boolean supportsProfiles()
          Return true if the elements managed by this class are scoped by profile.
protected  boolean uppercaseName()
          Do we uppercase the value of the "Name" attribute?
 
Methods inherited from class com.ibm.etools.systems.core.ui.uda.SystemUDBaseManager
addElement, createAndPrimeDocument, createDomainElement, createDomainElementWrapper, createExistingDomainElementWrappers, delete, dispose, domainTypeEquals, enablePaste, error, fatalError, findByName, findChildByName, findDomainElement, findOrCreateDomainElement, findOrCreateDomainElement, getActionSubSystem, getAdapter, getChildren, getCurrentProfile, getDocument, getDocumentRelease, getDomainWrapper, getElements, getElements, getElements, getExistingNames, getFilePath, getParent, getSubSystem, getSubSystemFactory, getXMLWrappers, getXMLWrappers, hasChildren, inCurrentTree, initializeDocument, inputChanged, isDomainElement, isDomainElement, loadAndParseXMLFile, loadUserData, moveElementDown, moveElementUp, pasteClipboardCopy, prepareClipboardCopy, processResourceChangeHit, refreshLocal, resetUserData, resourceChanged, saveUserData, setChanged, setCurrentProfile, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

XE_TYPE

public static final String XE_TYPE
See Also:
Constant Field Values

ALL_TYPE

public static final String ALL_TYPE
See Also:
Constant Field Values

UDT_FILENAME

public static final String UDT_FILENAME
See Also:
Constant Field Values
Constructor Detail

SystemUDTypeManager

public SystemUDTypeManager(SystemUDActionSubsystem udas)
Constructor

Method Detail

isUserActionsManager

protected boolean isUserActionsManager()
Return true if this is user actions, false if this is named types.

Specified by:
isUserActionsManager in class SystemUDBaseManager

getNewImage

public Image getNewImage()
Get the icon to show in the tree views, for the "new" expandable item

Overrides:
getNewImage in class SystemUDBaseManager

getFileName

public String getFileName()
Get the name of the file to persist to: udtype.xml

Specified by:
getFileName in class SystemUDBaseManager

doMigration

protected boolean doMigration(SystemProfile profile,
                              String oldRelease)
Overridable extension point for child classes to do migration of their document. This is called on first load of a document, which has a release stamp other than the current release

Specified by:
doMigration in class SystemUDBaseManager
Returns:
true if any migration was done

getNewNodeLabel

protected String getNewNodeLabel()
Parent method override for returning the "New" icon label for the Work With dialog tree view. For us, we defer to the getActionSubSystem().getNewNodeTypeLabel(). Do not override this.

Overrides:
getNewNodeLabel in class SystemUDBaseManager
Returns:
translated value for "New" in new icon for WW action and type dialogs. Default is "New"

getTagName

public String getTagName()
Return the tag name for our managed elements. Eg: will be "Action" for user actions, and "Type" for file types.

Specified by:
getTagName in interface ISystemXMLElementWrapperFactory
Specified by:
getTagName in class SystemUDBaseManager

createElementWrapper

public SystemXMLElementWrapper createElementWrapper(Element xmlElementToWrap,
                                                    SystemProfile profile,
                                                    int domain)
Given an xml element node, create an instance of the appropriate subclass of SystemXMLElementWrapper to represent it.

Specified by:
createElementWrapper in interface ISystemXMLElementWrapperFactory
Specified by:
createElementWrapper in class SystemUDBaseManager

getDocumentRootTagName

public String getDocumentRootTagName()
Get the document root tag name. We return "FileTypes"

Specified by:
getDocumentRootTagName in class SystemUDBaseManager

uppercaseName

protected boolean uppercaseName()
Do we uppercase the value of the "Name" attribute? Yes, we do for types

Specified by:
uppercaseName in class SystemUDBaseManager

supportsProfiles

public boolean supportsProfiles()
Return true if the elements managed by this class are scoped by profile. Usually true for actions, false for types

Overrides:
supportsProfiles in class SystemUDBaseManager

primeDocument

public SystemXMLElementWrapper[] primeDocument(SystemProfile profile)
Prime the given document with any default types Calls primeDefaultTypes in action subsystem.

Overrides:
primeDocument in class SystemUDBaseManager

getDocumentFolder

protected IFolder getDocumentFolder(SubSystemFactory subsystemFactory,
                                    SystemProfile profile)
Get the folder containing the xml file used to persist the actions, for the given profile

Specified by:
getDocumentFolder in class SystemUDBaseManager

exists

protected boolean exists(IResource resource)
For some reason the exists() method on IResource is fundamentally not reliable. Because of this, we resort to looking ourselves at the file system.


setFolder

public void setFolder(String profileName,
                      String factoryId)
Intended for IMPORT actions only, where no Subsystem instance available:

Specified by:
setFolder in class SystemUDBaseManager

dataChanged

protected void dataChanged(SystemProfile profile)
Indicate data has changed for the given profile

Overrides:
dataChanged in class SystemUDBaseManager

getTypesForTypeName

public String getTypesForTypeName(String typeName,
                                  int domain)
Given a type name and domain, find the named type and return its types, or null if not found


getTypes

public SystemUDTypeElement[] getTypes(Vector v,
                                      int domain)
Return xml element wrapper objects for all types, for the given domain, or for the whole document if domain is -1 (iff domains not supported).

Parameters:
v - - existing vector to populate. If null passed, it is not populated.
domain - - the integer representation of the given domain, or -1 iff supportsDomains() is false
Returns:
array of type objects

getTypeNames

public String[] getTypeNames(int domain)
Return list of names of types in the given domain, or in doc if domain is -1 (which must only happen if supportsDomains() is false!)


addType

public SystemUDTypeElement addType(int domain,
                                   String name)
Add a new user type. Creates the new XML node in the document, and creates and returns a wrapper object for it.

Optimized flavour of addElement that does not require a profile, and is typed to return SystemUDTypeElement


delete

public void delete(SystemUDTypeElement typeElement)
Delete a give user action or type, given its wrapper. Deletes the xml node from the document.

Optimized flavour of delete that does not require a profile, and is typed to take SystemUDTypeElement


saveUserData

public void saveUserData()
Save user data


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.