|
iSeries Remote Systems v6.0.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.iseries.core.descriptors.ISeriesDataElementDescriptorType
This class encapsulates a data element descriptor type, which really is just an integer. However, for each type, there is a fair amount of behaviour that needs to be defined. Previously, we had switch statements scattered throughout the code base, and we had to careful find and edit each one every time a new data element type descriptor constant was defined. Now we put all the functionality that all those switch statements were doing here into this one class.
Well, actually we define the methods in this class, but we use subclasses, one per different type, to implement each one. We create a singleton constant object for each subclass, and re-use that singleton when needed.
This is the factory design pattern, and so we also have a static method for deciding on the appropriate subclass to use, and return the appropriate singleton for that subclass.
Field Summary | |
---|---|
protected ISeriesChangeObjAction |
changeObjAction
|
static String |
Copyright
|
protected ISeriesSaveRestoreAction |
restoreAction
|
protected ISeriesSaveRestoreAction |
saveAction
|
Fields inherited from interface com.ibm.etools.iseries.core.descriptors.IISeriesDataElementDescriptorTypes |
---|
DSPF_FILE_TYPE, DTA_FILE_TYPE, FILE_TYPE, LF_FILE_TYPE, LIB_TYPE, MBR_TYPE, MESSAGE_DESCRIPTION_TYPE, MODULE_TYPE, MSG_FILE_TYPE, OBJ_TYPE, PGM_MODULE_TYPE, PGM_TYPE, PROCEDURE_TYPE, QRYDFN_TYPE, SAVF_FILE_TYPE, SRC_FILE_TYPE, SRC_MBR_TYPE, SRVPGM_TYPE, UNKNOWN_TYPE |
Constructor Summary | |
---|---|
ISeriesDataElementDescriptorType(int type)
Constructor. |
Method Summary | |
---|---|
abstract void |
addActions(com.ibm.etools.systems.dstore.core.model.DataElement deElement,
com.ibm.etools.systems.core.ui.SystemMenuManager menu,
IStructuredSelection selection,
Shell shell,
String menuGroup,
Viewer viewer)
Called by SystemView viewer when user right clicks. |
abstract String |
getAbsoluteName(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the fully qualified name, versus just the root name. |
abstract String |
getAbsoluteParentName(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the fully qualified name of the given element's parent. |
String |
getCanonicalNewName(com.ibm.etools.systems.dstore.core.model.DataElement deElement,
String newName)
Return the canonical (unique) new name given the new name root. |
protected IAction |
getChangeAction(Shell shell)
Return the common Change action. |
abstract String |
getChangeCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the iSeries command string needed to change this object. |
abstract String |
getChangeTextCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement,
String newDescription)
Return the iSeries command string needed to change the text of this object on the iSeries. |
String |
getChangeTypeCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement,
String newType)
Return the iSeries command string needed to change the type of this object on the iSeries. |
protected IAction |
getClipboardCopyAction(Shell shell)
Get the common clipboard copy action |
protected IAction |
getClipboardPasteAction(Shell shell)
Get the common clipboard paste action |
String |
getCopyCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the iSeries command string needed to copy this object. |
abstract String |
getDeleteCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the iSeries command string needed to delete this object. |
static int |
getDescriptorType(com.ibm.etools.systems.dstore.core.model.DataElement element)
Return a constant indicating the type of descriptor this data element has. |
static ISeriesDataElementDescriptorType |
getDescriptorTypeObject(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Static factory method to return the appropriate object for the given DataElement. |
abstract String |
getFilterStringForChildren(com.ibm.etools.systems.dstore.core.model.DataElement deElement,
com.ibm.etools.systems.core.ui.view.ISystemViewInputProvider inputProvider)
For expandable types, returns the filter string to resolve to the get the children. |
abstract ImageDescriptor |
getImage(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the image for the given object. |
String |
getMergeCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the iSeries command string needed to merge this object. |
abstract com.ibm.etools.systems.core.ui.validators.ISystemValidator |
getNameValidator(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the name validator for objects of this type. |
String |
getParent(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the parent container for the given element. |
abstract IAction[] |
getPDMActions(Shell shell,
Viewer viewer)
Return the array of actions to show in the PDM cascading menu. |
String |
getRemoteSourceType(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the source type of the selected object. |
String |
getRemoteSubType(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the untranslated subtype of this element. |
abstract String |
getRemoteTypeCategory(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the untranslated type category property for this object. |
abstract String |
getRenameCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement,
String newName)
Return the iSeries command string needed to rename this object. |
protected IAction |
getRestoreAction(Shell shell)
Return the common Restore action. |
String |
getRestoreCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the iSeries command string needed to restore this object. |
protected IAction |
getSaveAction(Shell shell)
Return the common Save action. |
String |
getSaveCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the iSeries command string needed to save this object. |
protected Separator |
getSeparator()
Return a separator for use in a popup menu |
protected IAction |
getShowInTableAction(Shell shell)
Return the show in table action. |
abstract String |
getStatusLineText(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the text to display on the status line, for the given object. |
int |
getTableViewID(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return the type of table view to show for this object if "Show In Table" is selected. |
int |
getType()
Hopefully not needed, but in case it is, this return the integer value |
boolean |
isCachable(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return true if this is a file and the file type supports caching. |
boolean |
isDataFile()
Return true if this is an iSeries database file object, of type *FILE and attribute PF or LF or DDMF. |
boolean |
isDataMember()
Return true if this is an iSeries data member. |
boolean |
isDeviceFile(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
Return true if this is an iSeries device file object (dspf or prtf) |
boolean |
isDisplayFile()
Return true if this is an iSeries display file object |
abstract boolean |
isExpandable(com.ibm.etools.systems.dstore.core.model.DataElement deElement,
com.ibm.etools.systems.core.ui.view.ISystemViewInputProvider inputProvider)
Return true if this type can be expanded to show children |
boolean |
isFile()
Return true if this is an iSeries file object, of type *FILE. |
boolean |
isLibrary()
Return true if this is an iSeries library. |
boolean |
isLogicalFile()
Return true if this is an iSeries logical file object. |
boolean |
isMember()
Return true if this is an iSeries data member or source member. |
boolean |
isMemberFile()
Return true if this is an iSeries file object which has members. |
boolean |
isMessageDescription()
Return true if this is an iSeries message description in a message file. |
boolean |
isMessageFile()
Return true if this is an iSeries message file object. |
boolean |
isModule()
Return true if this is an iSeries module |
boolean |
isObject()
Return true if this is an iSeries object, with a type and attribute. |
boolean |
isPFDataFile()
Return true if this is an iSeries database file object, of type *FILE and attribute PF-DTA |
boolean |
isProcedure()
Return true if this is a procedure inside of a program or service program object. |
boolean |
isProgram()
Return true if this is an iSeries program |
boolean |
isProgramModule()
Return true if this is an iSeries program module (module within a program or service program) |
boolean |
isQueryDefinition()
Return true if this is an iSeries query definition *QRYDFN |
boolean |
isServiceProgram()
Return true if this is an iSeries service program |
boolean |
isSourceFile()
Return true if this is an iSeries database source file object. |
boolean |
isSourceMember()
Return true if this is an iSeries source member. |
boolean |
showRefresh(com.ibm.etools.systems.dstore.core.model.DataElement deElement,
com.ibm.etools.systems.core.ui.view.ISystemViewInputProvider inputProvider)
Return true if objects of this type should show the refresh action in their popup. |
protected static String |
toUpperCase(String name)
Uppercase the given name, but only if it is not quoted. |
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 ISeriesChangeObjAction changeObjAction
protected ISeriesSaveRestoreAction saveAction
protected ISeriesSaveRestoreAction restoreAction
Constructor Detail |
public ISeriesDataElementDescriptorType(int type)
Method Detail |
public static ISeriesDataElementDescriptorType getDescriptorTypeObject(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
deElement
- - the data element whose descriptor type object we wantpublic static int getDescriptorType(com.ibm.etools.systems.dstore.core.model.DataElement element)
IISeriesDataElementDescriptorTypes
#getDescriptorTypeObject(Object)
public int getType()
public boolean isLibrary()
public boolean isObject()
public boolean isFile()
public boolean isDataFile()
public boolean isPFDataFile()
public boolean isSourceFile()
public boolean isMemberFile()
public boolean isLogicalFile()
public boolean isDisplayFile()
public boolean isDeviceFile(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public boolean isMessageFile()
public boolean isSourceMember()
public boolean isDataMember()
public boolean isMember()
public boolean isProgram()
public boolean isServiceProgram()
public boolean isModule()
public boolean isQueryDefinition()
public boolean isProgramModule()
public boolean isProcedure()
public boolean isMessageDescription()
public boolean isCachable(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public abstract void addActions(com.ibm.etools.systems.dstore.core.model.DataElement deElement, com.ibm.etools.systems.core.ui.SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup, Viewer viewer)
deElement
- The last selected data elementmenu
- The context menu to which we can add actions using either add or appendToGroupshell
- The parent shell of the SystemView viewer, for anchoring dialogsmenuGroup
- The default menu group (GROUP_ADAPTERS) we should use for appendToGroup, unless
we wish to add our actions to one of the other groups in ISystemContextMenuConstants.viewer
- The viewer in which the user right-clickedpublic abstract IAction[] getPDMActions(Shell shell, Viewer viewer)
public abstract boolean isExpandable(com.ibm.etools.systems.dstore.core.model.DataElement deElement, com.ibm.etools.systems.core.ui.view.ISystemViewInputProvider inputProvider)
public abstract String getFilterStringForChildren(com.ibm.etools.systems.dstore.core.model.DataElement deElement, com.ibm.etools.systems.core.ui.view.ISystemViewInputProvider inputProvider)
public boolean showRefresh(com.ibm.etools.systems.dstore.core.model.DataElement deElement, com.ibm.etools.systems.core.ui.view.ISystemViewInputProvider inputProvider)
public abstract com.ibm.etools.systems.core.ui.validators.ISystemValidator getNameValidator(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public String getCanonicalNewName(com.ibm.etools.systems.dstore.core.model.DataElement deElement, String newName)
public abstract String getAbsoluteName(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public abstract String getAbsoluteParentName(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
getParent(DataElement)
public abstract ImageDescriptor getImage(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public abstract String getStatusLineText(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public abstract String getRemoteTypeCategory(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
com.ibm.etool.iseries.core.IISeriesRemoteTypes
public String getRemoteSubType(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public String getRemoteSourceType(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
For src members, this is the member type. For others, it is null.
public int getTableViewID(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public String getParent(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
This is similar to getAbsoluteParentName(DataElement)
, but it
doesn't have to be unique, just the qualified parent name. For example,
for most objects, this returns "lib/obj" while getAbsoluteParentName returns
"lib/obj OBJTYPE(type)" in order to make the name unique.
public abstract String getDeleteCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public abstract String getRenameCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement, String newName)
public abstract String getChangeCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public String getChangeTypeCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement, String newType)
public abstract String getChangeTextCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement, String newDescription)
public String getRestoreCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public String getSaveCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public String getMergeCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
public String getCopyCommand(com.ibm.etools.systems.dstore.core.model.DataElement deElement)
protected static String toUpperCase(String name)
protected Separator getSeparator()
protected IAction getShowInTableAction(Shell shell)
protected IAction getChangeAction(Shell shell)
protected IAction getSaveAction(Shell shell)
protected IAction getRestoreAction(Shell shell)
protected IAction getClipboardCopyAction(Shell shell)
protected IAction getClipboardPasteAction(Shell shell)
|
iSeries Remote Systems v6.0.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |