Remote Systems
v6.4.1

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

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.compile.SystemCompileProfile
All Implemented Interfaces:
ISystemCompileXMLConstants
Direct Known Subclasses:
UniversalCompileProfile

public abstract class SystemCompileProfile
extends Object
implements ISystemCompileXMLConstants

A SystemCompileProfile has a one-to-one correspondence with a SystemProfile. There is one for each profile, for each subsystem factory that supports compiles.

The compile profile manages all aspects of the compile framework for this subsystem factory, for this system profile. Underneath, this basically means managing the xml file where the compile information is stored.

At a high level, a SystemCompileProfile manages a list of SystemCompileType objects, of which there is one per compilable source type. Given a raw source type like ".cpp" there is a method getCompileType(String) to return the SystemCompileType object for it. From that, one can get a list of compile commands registered for that type, and the last-used compile command for that type.


Field Summary
static String Copyright
           
 
Fields inherited from interface com.ibm.etools.systems.core.ui.compile.ISystemCompileXMLConstants
COMPILECOMMAND_ELEMENT, COPYRIGHT_ELEMENT, COPYRIGHT_TEXT, CURRENT_ATTRIBUTE, DEFAULT_ATTRIBUTE, FILE_NAME, ID_ATTRIBUTE, JOBENV_ATTRIBUTE, LABEL_ATTRIBUTE, LABEL_EDITABLE_ATTRIBUTE, LASTUSED_ATTRIBUTE, MENU_ATTRIBUTE, MENU_BOTH_VALUE, MENU_NON_PROMPTABLE_VALUE, MENU_NONE_VALUE, MENU_PROMPTABLE_VALUE, NATURE_ATTRIBUTE, NATURE_IBM_VALUE, NATURE_ISV_VALUE, NATURE_USER_VALUE, ORDER_ATTRIBUTE, ROOT_ELEMENT, STRING_EDITABLE_ATTRIBUTE, TYPE_ATTRIBUTE, TYPE_ELEMENT, VERSION_ATTRIBUTE, VERSION_VALUE
 
Constructor Summary
SystemCompileProfile(SystemCompileManager manager, String profileName)
          Constructor for SystemCompileProfile Will automatically read from disk.
 
Method Summary
 void addCompileType(SystemCompileType type)
          Add a compile type
 void addContributions(Object element)
          Add compile contributions made through extension points for the given resource, and save them to disk.
protected  void doPreRead()
          This method is called by the constructor, prior to reading the xml contents from disk.
 Object getAssociatedData()
          Get the associated data set via setAssociatedData
abstract  SystemCompilableSource getCompilableSourceObject(Shell shell, Object selectedObject, SystemCompileCommand compileCmd, boolean isPrompt, Viewer viewer)
          When the time comes to actually run a compile command against a selected source object, this method is called to return the instance of SystemCompilableSource to do that.
 IFolder getCompileFolder()
          Should you require access to the IFolder containing the persisted xml file, call this method.
 IFile getCompileProfileFile()
          Should you require access to the IFile handle to the persisted xml file, call this method.
 File getCompileProfileJavaFile()
          Should you require access to the java.io.File handle to the persisted xml file, call this method.
 SystemCompileType getCompileType(String typeString)
          Get the compile type, given a type
 Vector getCompileTypes()
          Get compile types.
 String[] getCompileTypesArray()
          Get compile types as an array of strings.
 SystemCompileManager getParentManager()
          Return the SystemCompileManager responsible for this profile
 SystemProfile getProfile()
          Return the system profile this is associated with
 String getProfileName()
          Return the name of this profile as given in the constructor
protected  String getSaveFileName()
          Return the name of the xml file we will persist this profile's compile command information to.
protected  SystemCompileCommand migrateCompileCommand(SystemCompileCommand oldCmd, String oldVrm)
          Opportunity for subclasses to do migration of compile commands read from disk, from a document that has an older vrm than the current vrm.
 void printCommandsByType(Vector compileTypes)
          Print the commands to standard out, sorted by source type, for debugging purposes
 void removeCompileType(SystemCompileType type)
          Remote a compile type.
 void setAssociatedData(Object data)
          Set any data you want associated with this profile, while it is in memory
 void setProfileName(String name)
          Reset the profile name, on a profile rename operation, say.
protected  String sub(String string, String subOld, String subNew)
          Do substring substitution.
 void writeToDisk()
          Save this profile to disk.
 
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
Constructor Detail

SystemCompileProfile

public SystemCompileProfile(SystemCompileManager manager,
                            String profileName)
Constructor for SystemCompileProfile Will automatically read from disk.

Parameters:
manager - - the SystemCompileManager which instantiated this
profileName - - the name for this profile.
Method Detail

setProfileName

public void setProfileName(String name)
Reset the profile name, on a profile rename operation, say.


setAssociatedData

public void setAssociatedData(Object data)
Set any data you want associated with this profile, while it is in memory


getAssociatedData

public Object getAssociatedData()
Get the associated data set via setAssociatedData


getProfileName

public String getProfileName()
Return the name of this profile as given in the constructor


getProfile

public SystemProfile getProfile()
Return the system profile this is associated with


getParentManager

public SystemCompileManager getParentManager()
Return the SystemCompileManager responsible for this profile


addCompileType

public void addCompileType(SystemCompileType type)
Add a compile type


removeCompileType

public void removeCompileType(SystemCompileType type)
Remote a compile type. Should only be called if the type is empty of compile commands


getCompileTypes

public Vector getCompileTypes()
Get compile types.

Returns:
a Vector of SystemCompileType objects.

getCompileTypesArray

public String[] getCompileTypesArray()
Get compile types as an array of strings.


getCompileType

public SystemCompileType getCompileType(String typeString)
Get the compile type, given a type


writeToDisk

public void writeToDisk()
Save this profile to disk. It is saved to an xml file that is scoped to a folder named after the subsystem factory, and that in turn is scoped to a folder named "CompileCommands" within this system profile's folder.


getCompileFolder

public IFolder getCompileFolder()
Should you require access to the IFolder containing the persisted xml file, call this method. Note, this folder is only created on first touch, so this call may have the side-effect of creating the folder.

This defers back to the owning SystemCompileManager.


getCompileProfileFile

public IFile getCompileProfileFile()
Should you require access to the IFile handle to the persisted xml file, call this method. Note, this file is only created on first touch, so file may be a handle to something that doesn't exist yet.


getCompileProfileJavaFile

public File getCompileProfileJavaFile()
Should you require access to the java.io.File handle to the persisted xml file, call this method. Note, this file is only created on first touch, so file may be a handle to something that doesn't exist yet.


getCompilableSourceObject

public abstract SystemCompilableSource getCompilableSourceObject(Shell shell,
                                                                 Object selectedObject,
                                                                 SystemCompileCommand compileCmd,
                                                                 boolean isPrompt,
                                                                 Viewer viewer)
When the time comes to actually run a compile command against a selected source object, this method is called to return the instance of SystemCompilableSource to do that.

This method must be implemented to return an instance of your subclass of SystemCompilableSource.


getSaveFileName

protected String getSaveFileName()
Return the name of the xml file we will persist this profile's compile command information to. The default is "compile.xml" and need not be overridden unless you don't like that name :-).


doPreRead

protected void doPreRead()
This method is called by the constructor, prior to reading the xml contents from disk. It is an exit point in case subclasses need to do anything before the read, such as rename or migrate legacy information.


addContributions

public void addContributions(Object element)
Add compile contributions made through extension points for the given resource, and save them to disk.


migrateCompileCommand

protected SystemCompileCommand migrateCompileCommand(SystemCompileCommand oldCmd,
                                                     String oldVrm)
Opportunity for subclasses to do migration of compile commands read from disk, from a document that has an older vrm than the current vrm.


sub

protected String sub(String string,
                     String subOld,
                     String subNew)
Do substring substitution. Using you are replacing &1 (say) with another string.

Parameters:
string - - string containing substring to be substituted.
subOld - - substitution variable. Eg "%1"
subNew - - substitution data. Eg "001"
Returns:
string with all occurrences of subOld substituted with subNew.

printCommandsByType

public void printCommandsByType(Vector compileTypes)
Print the commands to standard out, sorted by source type, for debugging purposes


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.