Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.compile
Class SystemCompileManager

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.compile.SystemCompileManager
Direct Known Subclasses:
UniversalCompileManager

public abstract class SystemCompileManager
extends Object

This class manages the compile framework for a particular instantiation. It is typically associated with a subsystem factory, but it is designed to be used in other contexts as well.

Here is the model for the compile framework:

See Also:
SystemCompileProfile, SystemCompileType, SystemCompileCommand, SystemWorkWithCompileCommandsDialog

Field Summary
static String copyright
           
protected  SystemCompileCommand currentCompileCommand
          As last set by calling setCurrentCompileCommand.
protected  SubSystemFactory subsystemFactory
           
protected  SystemConnection systemConnection
           
 
Constructor Summary
SystemCompileManager()
          Constructor for SystemCompileManager
 
Method Summary
 void addCompileActions(Shell shell, IStructuredSelection selection, SystemMenuManager menu, String menuGroup)
          Populate main context menu with a menu item for compile.
 void addMultipleSelectionCompileActions(Shell shell, IStructuredSelection selection, SystemMenuManager menu, String menuGroup)
          Adds compile actions for multiple selections.
 void addSingleSelectionCompileActions(Shell shell, IStructuredSelection selection, SystemMenuManager menu, String menuGroup)
          Adds compile actions for single selections.
protected abstract  SystemCompileProfile createCompileProfile(SystemProfile profile)
          Overridable method to instantiate your SystemCompileProfile subclass for the given system profile.
protected abstract  ISystemCompileCommandSubstitutor createSubstitutor(SystemConnection connection)
          Return the substitutor for doing variable substitution.
 SystemCompileProfile[] getAllCompileProfiles()
          Return a list of all SystemCompileProfile objects.
 SystemCompileCommandEditPane getCompileCommandEditPane(Shell shell, ISystemCompileCommandEditPaneHoster hoster, boolean caseSensitive)
          For support of the Work With Compile Commands dialog.
 SystemCompileProfile getCompileProfile(SystemProfile profile)
          Get the singleton compile profile given a SystemProfile.
 IFolder getCompileProfileFolder(SystemCompileProfile compProfile)
          Callback method from SystemCompileProfile to get the folder into which the xml file for this compile profile will be stored.
 SystemCompileCommand getCurrentCompileCommand()
          Return the current compile cmd as set by setCurrentCompileCommand(SystemCompileCommand).
abstract  SystemDefaultCompileCommands getDefaultCompileCommands()
          Return the default (supplied) compile commands to prime the compile commands with.
 SystemDefaultCompileCommand getDefaultSuppliedCommand(String commandName)
          If the command is an default supplied command, returns its SystemDefaultCompileCommand object.
protected  SystemNewCompileSrcTypeDialog getNewSrcTypeDialog(Shell shell, boolean caseSensitive)
          For support of the Work With Compile Commands dialog.
 String getSourceTypePromptMRIKey()
          For support of the Work With Compile Commands dialog.
 ResourceBundle getSourceTypePromptMRIResourceBundle()
          For support of the Work With Compile Commands dialog.
abstract  SystemCmdSubstVarList getSubstitutionVariableList()
          For support of the Work With Compile Commands dialog.
protected  ISystemCompileCommandSubstitutor getSubstitutor()
          Return the substitutor for doing variable substitution.
 SubSystemFactory getSubSystemFactory()
          Return the subsystem factory which instantiated this instance, or as set via setSubSystemFactory(SubSystemFactory).
 SystemConnection getSystemConnection()
          Return the system connection with which this manager instance is associated.
 boolean isCompilable(Object selection)
          Return true if the given remote object is potentially compilable.
 boolean isMultiSelectSupported(SystemCompileCommand compileCmd)
          Return true (default) if multiple-select is supported for the compile action
 void profileRenamed(SystemProfile profile, String oldName)
          The compile manager and related classes is impacted by a profile rename, as we have some in-memory places to be updated.
 void setCurrentCompileCommand(SystemCompileCommand compileCmd)
          Sets the current compile command.
 void setSubSystemFactory(SubSystemFactory ssFactory)
          Sets the subsystemfactory which instantiated this.
 void setSystemConnection(SystemConnection systemConnection)
          Set the current system connection.
 boolean wantToPrimeWithDefaults(SystemCompileProfile profile)
          Callback from SystemProfile to decide, when no xml file is found, if we want to prime the new xml file with defaults.
 
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

systemConnection

protected SystemConnection systemConnection

subsystemFactory

protected SubSystemFactory subsystemFactory

currentCompileCommand

protected SystemCompileCommand currentCompileCommand
As last set by calling setCurrentCompileCommand. Sometimes needed by subclasses.

Constructor Detail

SystemCompileManager

public SystemCompileManager()
Constructor for SystemCompileManager

Method Detail

setSubSystemFactory

public void setSubSystemFactory(SubSystemFactory ssFactory)
Sets the subsystemfactory which instantiated this. Not called if using this framework outside of the world of subsystem factories.


getSubSystemFactory

public SubSystemFactory getSubSystemFactory()
Return the subsystem factory which instantiated this instance, or as set via setSubSystemFactory(SubSystemFactory).


setSystemConnection

public void setSystemConnection(SystemConnection systemConnection)
Set the current system connection. This is set in the work with dialog, and used by the edit pane and other downstream classes.


getSystemConnection

public SystemConnection getSystemConnection()
Return the system connection with which this manager instance is associated.


setCurrentCompileCommand

public void setCurrentCompileCommand(SystemCompileCommand compileCmd)
Sets the current compile command. Called by the framework when running a compile command, prior to calling commands that may be dependent on values in the compile command being processed.


getCurrentCompileCommand

public SystemCompileCommand getCurrentCompileCommand()
Return the current compile cmd as set by setCurrentCompileCommand(SystemCompileCommand).


isMultiSelectSupported

public boolean isMultiSelectSupported(SystemCompileCommand compileCmd)
Return true (default) if multiple-select is supported for the compile action


getCompileProfile

public SystemCompileProfile getCompileProfile(SystemProfile profile)
Get the singleton compile profile given a SystemProfile.

Called in the Work With Compile Commands and the Compile cascading actions.

Do not override this, as the implementation is complete. However, you must override createCompileProfile.

If you are using this outside of the subsystem framework, this method will not be called.

See Also:
createCompileProfile(SystemProfile)

getAllCompileProfiles

public SystemCompileProfile[] getAllCompileProfiles()
Return a list of all SystemCompileProfile objects. By default, returns one per active system profile. If not using the subsystem framework, this must be overridden.


createCompileProfile

protected abstract SystemCompileProfile createCompileProfile(SystemProfile profile)
Overridable method to instantiate your SystemCompileProfile subclass for the given system profile.

It is important you pass the SystemProfile's name to the ctor of SystemCompileProfile.


getCompileProfileFolder

public IFolder getCompileProfileFolder(SystemCompileProfile compProfile)
Callback method from SystemCompileProfile to get the folder into which the xml file for this compile profile will be stored. By default uses the given subsystem factory. If you are using this framework outside of the subsystem factory world, then override this method.


wantToPrimeWithDefaults

public boolean wantToPrimeWithDefaults(SystemCompileProfile profile)
Callback from SystemProfile to decide, when no xml file is found, if we want to prime the new xml file with defaults.

By default, returns true if the SystemProfile the given compile profile is associated with is a user-private profile. If not using the compile framework, override this to use your own criteria.


getDefaultCompileCommands

public abstract SystemDefaultCompileCommands getDefaultCompileCommands()
Return the default (supplied) compile commands to prime the compile commands with.


getDefaultSuppliedCommand

public SystemDefaultCompileCommand getDefaultSuppliedCommand(String commandName)
If the command is an default supplied command, returns its SystemDefaultCompileCommand object. Returns null if not a default supplied command.

Parameters:
commandName - - the name of the command, minus the parameters. This is not the label!

profileRenamed

public void profileRenamed(SystemProfile profile,
                           String oldName)
The compile manager and related classes is impacted by a profile rename, as we have some in-memory places to be updated. This method is called by the subsystem factory on a profile rename operation so we can update ourselves.


isCompilable

public boolean isCompilable(Object selection)
Return true if the given remote object is potentially compilable. This decides the existence of the Compile menu item. It is possible to enable/disable this if there is no current compile command... this is a more course grained decision.

Our default implementation is to query the source type of the input object, and return true only if there is a source type defined for it in any of the currently active system profiles.


addCompileActions

public void addCompileActions(Shell shell,
                              IStructuredSelection selection,
                              SystemMenuManager menu,
                              String menuGroup)
Populate main context menu with a menu item for compile. Allows subclasses the opportunity to add compile actions for single and multiple selections.

This is called by the addCommonRemoteObjectsActions method, if this subsystem supports compiles.


addSingleSelectionCompileActions

public void addSingleSelectionCompileActions(Shell shell,
                                             IStructuredSelection selection,
                                             SystemMenuManager menu,
                                             String menuGroup)
Adds compile actions for single selections. Populates main context menu with a "Compile->" submenu cascade, which will only be populated when the submenu is selected.

This is called by the addCompileActions method for single selections. Subclasses may override.


addMultipleSelectionCompileActions

public void addMultipleSelectionCompileActions(Shell shell,
                                               IStructuredSelection selection,
                                               SystemMenuManager menu,
                                               String menuGroup)
Adds compile actions for multiple selections. By default, does nothing. This is called by the addCompileActions method for multiple selections. Subclasses may override.


getSubstitutionVariableList

public abstract SystemCmdSubstVarList getSubstitutionVariableList()
For support of the Work With Compile Commands dialog.

Return the substitution variables supported by compile commands managed by this manager.


getSubstitutor

protected ISystemCompileCommandSubstitutor getSubstitutor()
Return the substitutor for doing variable substitution.

Override to return a class that implements ISystemCompileCommandSubstitutor, that knows how to substitute the variables found in getSubstitutionVariableList().


createSubstitutor

protected abstract ISystemCompileCommandSubstitutor createSubstitutor(SystemConnection connection)
Return the substitutor for doing variable substitution.

Override to return a class that implements ISystemCompileCommandSubstitutor, that knows how to substitute the variables found in getSubstitutionVariableList().


getCompileCommandEditPane

public SystemCompileCommandEditPane getCompileCommandEditPane(Shell shell,
                                                              ISystemCompileCommandEditPaneHoster hoster,
                                                              boolean caseSensitive)
For support of the Work With Compile Commands dialog.

Return our edit pane. Overriding this is an alternative to calling setEditPane. This is called in createContents


getNewSrcTypeDialog

protected SystemNewCompileSrcTypeDialog getNewSrcTypeDialog(Shell shell,
                                                            boolean caseSensitive)
For support of the Work With Compile Commands dialog.

Return the dialog used to prompt for a new source type when "Add..." is pressed beside the source type combo. This returns an instance of the default SystemNewCompileSrcTypeDialog.

One strategy for subclasses is to call super on this method, then configure the results via the setters in the default dialog. Another is to subclass that dialog and return an instance of the subclass.


getSourceTypePromptMRIResourceBundle

public ResourceBundle getSourceTypePromptMRIResourceBundle()
For support of the Work With Compile Commands dialog.

Get the mri resource bundle for the source type prompt.


getSourceTypePromptMRIKey

public String getSourceTypePromptMRIKey()
For support of the Work With Compile Commands dialog.

Get the mri resource bundle key for the source type prompt. Will add ".label" and ".tooltip" to it.


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.