Remote Systems
v6.4.1

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

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.compile.SystemCompileType
All Implemented Interfaces:
IAdaptable

public class SystemCompileType
extends Object
implements IAdaptable

A SystemCompileType is effectively an index that maps a compilable source type (like ".cpp") to a list of SystemCompileCommand objects that represent the commands that are registered against that source type. It also remembers the last-used such compile command.

There is a one-to-one relationship between a source type like (".cpp") and a SystemCompileType... for each compilable source type there will be one SystemCompileType object. It is a list of these that is effectively persisted to disk via an xml file, one file per system profile. This is what the SystemCompileProfile class manages ... a list of SystemCompileProfile objects.


Field Summary
static String Copyright
           
 
Constructor Summary
SystemCompileType(SystemCompileProfile profile)
          Constructor for SystemCompileType when the source type isn't known yet.
SystemCompileType(SystemCompileProfile profile, String type)
          Constructor for SystemCompileType when you know the source type it represents.
SystemCompileType(SystemCompileProfile profile, String type, SystemCompileCommand lastUsedCompileCmd)
          Constructor for SystemCompileType when you know the source type and last used command
 
Method Summary
 void addCompileCommand(SystemCompileCommand command)
          Add a compile command at the end.
 void addCompileCommandInOrder(SystemCompileCommand compileCommand)
          Add a compile command, into its appropriate order as per its getOrder() value.
 Object getAdapter(Class adapterType)
          This is the method required by the IAdaptable interface.
 SystemCompileCommand getCompileCommand(int index)
          Get the compile command, given its index
 Vector getCompileCommands()
          Get all compile commands associated with this type
 SystemCompileCommand[] getCompileCommandsArray()
          Get all compile commands associated with this type, as an array.
 Vector getCompileId(String id)
          Get compile commands, given the id.
 SystemCompileCommand getCompileLabel(String label)
          Get the compile command, given its label
 Vector getExistingLabels()
          Return a vector of Strings representing the labels for all the compile commands within this type.
 SystemCompileCommand getLastUsedCompileCommand()
          Get the last used compile command
 Vector getNonPromptableCompileCommands()
          Get all non-promptable compile commands associated with this type
 int getNumOfCommands()
          Get the number of compile commands associated with this type
 SystemCompileProfile getParentProfile()
          Get the parent SystemCompileProfile profile
 Vector getPromptableCompileCommands()
          Get all promptable compile commands associated with this type
 String getType()
          Get the source type value this represents.
 void insertCompileCommand(SystemCompileCommand compileName, int index)
          Insert a compile command at the given index
 boolean isDuplicateLabelExists(String nameString)
          Find out if a compile label with the same name already exists.
 boolean isIdExists(String id)
          Find out if a given compile label already exists
 boolean isLabelExists(String nameString)
          Find out if a given compile label already exists
 SystemCompileCommand removeCompileCommand(int index)
          Remove a compile command given its index
 void removeCompileCommand(SystemCompileCommand cmd)
          Remove a compile command give its reference
 void setLastUsedCompileCommand(SystemCompileCommand lastUsedCompileCommand)
          Set the last used compile command
 void setParentProfile(SystemCompileProfile profile)
          Set the parent SystemCompileProfile profile
 void setType(String type)
          Set the source type value this represents.
 String toString()
          Return this object as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

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

SystemCompileType

public SystemCompileType(SystemCompileProfile profile)
Constructor for SystemCompileType when the source type isn't known yet.

See Also:
setType(String)

SystemCompileType

public SystemCompileType(SystemCompileProfile profile,
                         String type)
Constructor for SystemCompileType when you know the source type it represents.


SystemCompileType

public SystemCompileType(SystemCompileProfile profile,
                         String type,
                         SystemCompileCommand lastUsedCompileCmd)
Constructor for SystemCompileType when you know the source type and last used command

Method Detail

setParentProfile

public void setParentProfile(SystemCompileProfile profile)
Set the parent SystemCompileProfile profile


getParentProfile

public SystemCompileProfile getParentProfile()
Get the parent SystemCompileProfile profile

Returns:
the parent profile

setType

public void setType(String type)
Set the source type value this represents. This is typically a file type like "cpp".


getType

public String getType()
Get the source type value this represents. This is typically a file type like "cpp".

Returns:
the type

setLastUsedCompileCommand

public void setLastUsedCompileCommand(SystemCompileCommand lastUsedCompileCommand)
Set the last used compile command


getLastUsedCompileCommand

public SystemCompileCommand getLastUsedCompileCommand()
Get the last used compile command


addCompileCommand

public void addCompileCommand(SystemCompileCommand command)
Add a compile command at the end.


addCompileCommandInOrder

public void addCompileCommandInOrder(SystemCompileCommand compileCommand)
Add a compile command, into its appropriate order as per its getOrder() value.


removeCompileCommand

public void removeCompileCommand(SystemCompileCommand cmd)
Remove a compile command give its reference

Parameters:
cmd - the compile command to remove

removeCompileCommand

public SystemCompileCommand removeCompileCommand(int index)
Remove a compile command given its index

Parameters:
index - the zero-based index of the compile command to remove

insertCompileCommand

public void insertCompileCommand(SystemCompileCommand compileName,
                                 int index)
Insert a compile command at the given index

Parameters:
index - the zero-based index to insert it at

getCompileCommands

public Vector getCompileCommands()
Get all compile commands associated with this type

Returns:
a Vector of SystemCompileCommand objects

getCompileCommandsArray

public SystemCompileCommand[] getCompileCommandsArray()
Get all compile commands associated with this type, as an array.

Returns:
an array of SystemCompileCommand objects

getNumOfCommands

public int getNumOfCommands()
Get the number of compile commands associated with this type


getPromptableCompileCommands

public Vector getPromptableCompileCommands()
Get all promptable compile commands associated with this type

Returns:
a vector of all promptable compile commands ... that is, SystemCompileCommand objecs

getNonPromptableCompileCommands

public Vector getNonPromptableCompileCommands()
Get all non-promptable compile commands associated with this type

Returns:
a vector of all non-promptable compile commands ... that is, SystemCompileCommand objecs

getCompileLabel

public SystemCompileCommand getCompileLabel(String label)
Get the compile command, given its label


getCompileId

public Vector getCompileId(String id)
Get compile commands, given the id. Note that compile commands with the same id might exist for a compile type. This is possible if a user copies a compile command in the Work With dialog, and pastes it in the same type. We only require the label to be changed, but the id remains the same.

Returns:
a vector of compile commands that have the given id.

isIdExists

public boolean isIdExists(String id)
Find out if a given compile label already exists


getCompileCommand

public SystemCompileCommand getCompileCommand(int index)
Get the compile command, given its index


isLabelExists

public boolean isLabelExists(String nameString)
Find out if a given compile label already exists


isDuplicateLabelExists

public boolean isDuplicateLabelExists(String nameString)
Find out if a compile label with the same name already exists. Checks if it exists twice or more, since the first is assumed to be the current one being edited.


getExistingLabels

public Vector getExistingLabels()
Return a vector of Strings representing the labels for all the compile commands within this type. This is typically for uniqueness checking.


toString

public String toString()
Return this object as a string.


getAdapter

public Object getAdapter(Class adapterType)
This is the method required by the IAdaptable interface. Given an adapter class type, return an object castable to the type, or null if this is not possible.

Specified by:
getAdapter in interface IAdaptable

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.