|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.systems.core.ui.uda.SystemUDBaseManager
Instances of this class hold the UDA definitions unique to
When used for IMPORT: NO SubSystem instance available. Will be NULL!
This is the base class for both action managers and types managers. Only action managers are actually scoped by profile.
Architecturally, this class and the SystemXMLElementWrapper class encapsulate all knowledge of the fact the underlying store is a xml document.
Field Summary | |
---|---|
protected SystemUDActionSubsystem |
_udas
|
static String |
copyright
|
protected static Object[] |
EMPTY_ARRAY
|
protected IFolder |
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 | |
---|---|
SystemUDBaseManager(SystemUDActionSubsystem udas)
Constructor |
Method Summary | |
---|---|
SystemXMLElementWrapper |
addElement(SystemProfile profile,
int domain,
String name)
Add a new user action or type. |
protected Document |
createAndPrimeDocument(SystemProfile profile)
Create and prime the XML document |
protected Element |
createDomainElement(Document xdoc,
int domain)
Create a new xml domain element. |
protected SystemXMLElementWrapper |
createDomainElementWrapper(Element xmlDomainElementToWrap,
SystemProfile profile,
int domain)
Create a domain element wrapper |
abstract 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 Vector |
createExistingDomainElementWrappers(Vector v,
SystemProfile profile)
Find all existing domain XML elements that are children of the root, and create wrapper objects for them, and add them to the given vector. |
protected void |
dataChanged(SystemProfile profile)
Indicate data has changed for the given profile |
void |
delete(SystemProfile profile,
SystemXMLElementWrapper elementWrapper)
Delete a give user action or type, given its wrapper. |
void |
dispose()
|
static boolean |
domainTypeEquals(Element element,
String domainName)
Given an xml Domain element, return true if it's "type" attribute matches the given untranslated domain name |
protected abstract boolean |
doMigration(SystemProfile profile,
String oldRelease)
Overridable extension point for child classes to do migration of their document. |
boolean |
enablePaste(SystemXMLElementWrapper selectedElementWrapper,
String id)
Test if the given ID, read from the clipboard, matches a node we prepared for the clipboard. |
void |
error(SAXParseException ex)
Error. |
void |
fatalError(SAXParseException ex)
Fatal error. |
SystemXMLElementWrapper |
findByName(SystemProfile profile,
String name,
int domain)
Find a child element of a given name. |
Element |
findChildByName(SystemProfile profile,
String name,
int domain)
Find a child element of a given name. |
protected Element |
findDomainElement(Document xdoc,
int domain)
Given an xml action/type document, try to find a domain element ("Domain" tag) of the given domain type. |
protected Element |
findOrCreateDomainElement(Document xdoc,
int domain)
Given an xml action/type document, try to find a domain element ("Domain" tag) of the given untranslated name ("Type" attribute). |
protected Element |
findOrCreateDomainElement(Document xdoc,
int domain,
boolean create)
Given an xml action/type document, try to find a domain element ("Domain" tag) of the given untranslated name ("Type" attribute). |
SystemUDActionSubsystem |
getActionSubSystem()
Return the action subsystem object |
protected IWorkbenchAdapter |
getAdapter(Object o)
Returns the implementation of IWorkbenchAdapter for the given object. |
Object[] |
getChildren(Object element)
Return all the user actions/types under the given node. |
SystemProfile |
getCurrentProfile()
Get the profile we are currently working with, as set by a call to setCurrentProfile |
Document |
getDocument(SystemProfile profile)
Load document for given SystemProfile only if not already done. |
protected abstract IFolder |
getDocumentFolder(SubSystemFactory subsystemFactory,
SystemProfile profile)
Get the folder containing the xml file used to persist the actions, for the given profile |
String |
getDocumentRelease(SystemProfile profile)
Get the release of the document. |
abstract String |
getDocumentRootTagName()
Get the document root tag name. |
protected SystemXMLElementWrapper |
getDomainWrapper(SystemProfile profile,
int domain)
Given a domain's integer representation, find its element in xml document and return the wrapper for it. |
Object[] |
getElements(Object element)
Method declared on IStructuredContentProvider. |
Object[] |
getElements(SystemProfile[] profiles,
Object input)
Return the root elements. |
Object[] |
getElements(SystemProfile profile,
Object element)
Return root elements for given profile. |
Vector |
getExistingNames(SystemProfile profile,
int domain)
Get a list of existing names, for unique-name checking. |
abstract String |
getFileName()
Return name of the xml file used to persist the actions |
protected String |
getFilePath(SystemProfile profile)
Get the path of the XML document containing the user actions, for the given profile (and current subsystem) |
Image |
getNewImage()
Get the icon to show in the tree views, for the "new" expandable item |
protected String |
getNewNodeLabel()
Overridable method for returning the label for the "New" nodes in the tree view. |
Object |
getParent(Object element)
Method declared on ITreeContentProvider. |
protected SubSystem |
getSubSystem()
Get the current subsystem. |
protected SubSystemFactory |
getSubSystemFactory()
Get the current subsystem. |
abstract String |
getTagName()
Return the tag name for our managed elements. |
Vector |
getXMLWrappers(Vector children,
int domain,
SystemProfile profile)
Retrieve the action/type tags for the given profile and domain, wrapped in appropriate xml wrapper objects |
Vector |
getXMLWrappers(Vector children,
Object parentOrDomain,
SystemProfile profile)
Retrieve the action/type tags for the given profile and domain, wrapped in appropriate xml wrapper objects |
boolean |
hasChildren(Object element)
Method declared on ITreeContentProvider. |
static boolean |
inCurrentTree(Node n)
Checking not deleted. |
Document |
initializeDocument()
Initialize a new document |
void |
inputChanged(Viewer viewer,
Object oldInput,
Object newInput)
Method declared on IContentProvider. |
static boolean |
isDomainElement(Element element)
Given an xml Element object, return true if it is a Domain element. |
static boolean |
isDomainElement(Element element,
String domainName)
Given an xml Element object, return true if it is a Domain element and its "Type" attribute matches the given name. |
protected abstract boolean |
isUserActionsManager()
Return true if this is user actions, false if this is named types. |
protected Document |
loadAndParseXMLFile(String fileName,
SystemProfile profile)
loadAndParseXMLFile: tries to load and parse the specified XML file. |
protected Document |
loadUserData(SystemProfile profile)
Load the user actions from the XML document, for the given profile |
boolean |
moveElementDown(SystemXMLElementWrapper elementWrapper,
SystemXMLElementWrapper nextNextElementWrapper)
Move given element down one in document, save document |
boolean |
moveElementUp(SystemXMLElementWrapper elementWrapper,
SystemXMLElementWrapper previousElementWrapper)
Move given element up one in document, save document |
SystemXMLElementWrapper |
pasteClipboardCopy(SystemXMLElementWrapper selectedElementWrapper,
String id)
After a successful call to enablePaste, this is called to do the paste operation. |
String |
prepareClipboardCopy(SystemXMLElementWrapper elementWrapper)
Prepares a given element for the clipboard. |
SystemXMLElementWrapper[] |
primeDocument(SystemProfile profile)
Prime the given document with any default actions/types Should be overridden! |
void |
processResourceChangeHit(SystemProfile profile)
Force a re-load |
void |
refreshLocal(SystemProfile profile)
Refresh the xml file from disk. |
void |
resetUserData(SystemProfile profile)
Reload the User data for the given profile, from disk if it has been changed in memory |
void |
resourceChanged(IResourceChangeEvent event)
Interface org.eclipse.core.resources. |
void |
saveUserData(SystemProfile profile)
Save user data for the given system profile |
void |
setChanged(SystemProfile profile)
Indicate the data has changed for the document for the given system profile |
void |
setCurrentProfile(SystemProfile profile)
Set the profile we are working with the actions for, until reset. |
abstract 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 abstract boolean |
uppercaseName()
Do we uppercase the value of the "Name" attribute? |
void |
warning(SAXParseException ex)
Warning. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String copyright
protected SystemUDActionSubsystem _udas
protected IFolder importCaseFolder
protected static final Object[] EMPTY_ARRAY
Constructor Detail |
public SystemUDBaseManager(SystemUDActionSubsystem udas)
Method Detail |
public SystemUDActionSubsystem getActionSubSystem()
public Image getNewImage()
public abstract String getTagName()
getTagName
in interface ISystemXMLElementWrapperFactory
public abstract SystemXMLElementWrapper createElementWrapper(Element xmlElementToWrap, SystemProfile profile, int domain)
createElementWrapper
in interface ISystemXMLElementWrapperFactory
protected IWorkbenchAdapter getAdapter(Object o)
public void dispose()
public Object getParent(Object element)
public boolean hasChildren(Object element)
public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
public abstract String getDocumentRootTagName()
protected abstract boolean uppercaseName()
public Vector getXMLWrappers(Vector children, int domain, SystemProfile profile)
domain
- - the integer representation of the domain, or -1 iff domains not supportprofile
- - profile to determine the document to query. If profiles not supported, pass null.public Vector getXMLWrappers(Vector children, Object parentOrDomain, SystemProfile profile)
profile
- - profile to determine the document to query. If profiles not supported, pass null.public boolean supportsProfiles()
public abstract String getFileName()
public Document initializeDocument()
protected SubSystem getSubSystem()
protected SubSystemFactory getSubSystemFactory()
protected String getFilePath(SystemProfile profile)
protected Document loadAndParseXMLFile(String fileName, SystemProfile profile)
public void warning(SAXParseException ex)
warning
in interface ErrorHandler
public void error(SAXParseException ex)
error
in interface ErrorHandler
public void fatalError(SAXParseException ex) throws SAXException
fatalError
in interface ErrorHandler
SAXException
public void resourceChanged(IResourceChangeEvent event)
public void setCurrentProfile(SystemProfile profile)
public SystemProfile getCurrentProfile()
public SystemXMLElementWrapper[] primeDocument(SystemProfile profile)
public String getDocumentRelease(SystemProfile profile)
public Document getDocument(SystemProfile profile)
protected abstract boolean doMigration(SystemProfile profile, String oldRelease)
public void setChanged(SystemProfile profile)
public void resetUserData(SystemProfile profile)
public void processResourceChangeHit(SystemProfile profile)
protected abstract IFolder getDocumentFolder(SubSystemFactory subsystemFactory, SystemProfile profile)
public abstract void setFolder(String profileName, String factoryId)
protected void dataChanged(SystemProfile profile)
protected Document loadUserData(SystemProfile profile)
protected Document createAndPrimeDocument(SystemProfile profile)
public void saveUserData(SystemProfile profile)
public void refreshLocal(SystemProfile profile)
public boolean moveElementDown(SystemXMLElementWrapper elementWrapper, SystemXMLElementWrapper nextNextElementWrapper)
public boolean moveElementUp(SystemXMLElementWrapper elementWrapper, SystemXMLElementWrapper previousElementWrapper)
public String prepareClipboardCopy(SystemXMLElementWrapper elementWrapper)
public boolean enablePaste(SystemXMLElementWrapper selectedElementWrapper, String id)
This decides if the paste action will be enabled or not
public SystemXMLElementWrapper pasteClipboardCopy(SystemXMLElementWrapper selectedElementWrapper, String id)
public Object[] getElements(Object element)
public Object[] getElements(SystemProfile profile, Object element)
public Object[] getElements(SystemProfile[] profiles, Object input)
If domains are supported, returns a root "New" item plus element wrappers for any existing domain tags in the xml If domains are not supported, returns a non-root "New" item plus element wrappers for all action/type xml tags found under the root of the xml document
protected String getNewNodeLabel()
protected abstract boolean isUserActionsManager()
public Object[] getChildren(Object element)
public Element findChildByName(SystemProfile profile, String name, int domain)
public SystemXMLElementWrapper findByName(SystemProfile profile, String name, int domain)
public Vector getExistingNames(SystemProfile profile, int domain)
public SystemXMLElementWrapper addElement(SystemProfile profile, int domain, String name)
public void delete(SystemProfile profile, SystemXMLElementWrapper elementWrapper)
protected SystemXMLElementWrapper getDomainWrapper(SystemProfile profile, int domain)
protected Vector createExistingDomainElementWrappers(Vector v, SystemProfile profile)
It is important to note these are returned in the pre-determined order, not the order they are found in the document!
protected SystemXMLElementWrapper createDomainElementWrapper(Element xmlDomainElementToWrap, SystemProfile profile, int domain)
protected Element findDomainElement(Document xdoc, int domain)
protected Element findOrCreateDomainElement(Document xdoc, int domain)
protected Element findOrCreateDomainElement(Document xdoc, int domain, boolean create)
protected Element createDomainElement(Document xdoc, int domain)
xdoc
- - the document to add it to. Will be added as child of rootpublic static boolean isDomainElement(Element element)
public static boolean isDomainElement(Element element, String domainName)
public static boolean domainTypeEquals(Element element, String domainName)
public static boolean inCurrentTree(Node n)
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |