Remote Systems
v6.4.1

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

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.compile.SystemCompilableSource
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
UniversalCompilableSource

public class SystemCompilableSource
extends Object
implements Runnable

When a user selects a remote compilable source member, and then one of the compile commands from the cascading compile popup menu action, an instance of this class is created to manage the actual running of the compile command against the selected source.


Field Summary
protected  SystemCompileCommand compileCmd
           
static String Copyright
           
protected  Object firstSelection
           
protected  boolean isPrompt
           
protected  ISystemRemoteElementAdapter rmtAdapter
           
protected  Shell shell
           
protected  Viewer viewer
           
 
Constructor Summary
SystemCompilableSource(Shell shell, Object firstSelection, SystemCompileCommand compileCmd, boolean isPrompt, Viewer viewer)
          Constructor for SystemCompilableSource.
 
Method Summary
protected  RemoteCmdSubSystem getCommandSubSystem()
          Return the command subsystem for the remote connection.
protected  SystemCompileCommand getCompileCommand()
          Return the compile command to compile the selected source object with.
protected  ISystemRemoteElementAdapter getRemoteAdapter()
          Return the remote adapter for the currently selected compilable remote source object
protected  Object getSelectedObject()
          Return the selected compilable remote source object we are to compile
 Shell getShell()
          Return the shell as set in the constructor.
 String getSourceType()
          Return the source type of this remote object
protected  String getSubstitutedString(SystemCompileCommand compileCmd, Object firstSelection, ISystemCompileCommandSubstitutor substitutor)
          Given the compile command, the selected source object, do the variable substitution.
protected  SystemCmdSubstVarList getSubstitutionVariableList()
          Return the substitution variable list.
protected  ISystemCompileCommandSubstitutor getSubstitutor()
          Return the substitutor for doing variable substitution.
protected  SubSystem getSubSystem()
          Return the subsystem which is responsible for producing the remote object.
 SystemConnection getSystemConnection()
          Return the system connection from the which the selected object came from
protected  String internalPromptCompileCommand(String substitutedCompileCommand)
          When running a compile command from the prompt menu, we prompt the command.
protected  boolean internalRunCompileCommand(String compileCmd)
          After the substituting and the prompting, it is now time to the remote running of the fully resolved compile command.
protected  boolean isPrompt()
          Return if the compile command is to be prompted or not
 void run()
          The run() method for running code in a thread.
 boolean runCompileCommand()
          Run the compile command against the selected source.
 
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

firstSelection

protected Object firstSelection

isPrompt

protected boolean isPrompt

compileCmd

protected SystemCompileCommand compileCmd

rmtAdapter

protected ISystemRemoteElementAdapter rmtAdapter

shell

protected Shell shell

viewer

protected Viewer viewer
Constructor Detail

SystemCompilableSource

public SystemCompilableSource(Shell shell,
                              Object firstSelection,
                              SystemCompileCommand compileCmd,
                              boolean isPrompt,
                              Viewer viewer)
Constructor for SystemCompilableSource. Instantiated by SystemCompileAction.

Parameters:
shell - - the current shell, in case we need it for the prompt dialog or error messages.
firstSelection - - the selected compilable source member
compileCmd - - the Compile Command that is to be run against the selected compilable source member
isPrompt - - true if the user choose the flavor of the action to prompt the compile command
viewer - - the viewer that originated the compile action
Method Detail

getShell

public Shell getShell()
Return the shell as set in the constructor. If this is null, we attempt to get the active shell


getSelectedObject

protected Object getSelectedObject()
Return the selected compilable remote source object we are to compile


getCompileCommand

protected SystemCompileCommand getCompileCommand()
Return the compile command to compile the selected source object with.


isPrompt

protected boolean isPrompt()
Return if the compile command is to be prompted or not


getRemoteAdapter

protected ISystemRemoteElementAdapter getRemoteAdapter()
Return the remote adapter for the currently selected compilable remote source object


getSourceType

public String getSourceType()
Return the source type of this remote object


getSystemConnection

public SystemConnection getSystemConnection()
Return the system connection from the which the selected object came from


getSubSystem

protected SubSystem getSubSystem()
Return the subsystem which is responsible for producing the remote object.


getCommandSubSystem

protected RemoteCmdSubSystem getCommandSubSystem()
Return the command subsystem for the remote connection. Typically needed to actually run the compile command.


getSubstitutionVariableList

protected SystemCmdSubstVarList getSubstitutionVariableList()
Return the substitution variable list. Called by runCompileCommand default implementation. By default, returns it from the SystemCompileManager, but you can override if you have your own list.


getSubstitutor

protected ISystemCompileCommandSubstitutor getSubstitutor()
Return the substitutor for doing variable substitution. Called by runCompileCommand default implementation. By default, returns it from the SystemCompileManager, but you can override if you have your own list.


runCompileCommand

public boolean runCompileCommand()
Run the compile command against the selected source. Do not override this directly, as it tries to handle the prompting first. Rather, override internalPromptCompileCommand(String) and internalRunCompileCommand(String)


getSubstitutedString

protected String getSubstitutedString(SystemCompileCommand compileCmd,
                                      Object firstSelection,
                                      ISystemCompileCommandSubstitutor substitutor)
Given the compile command, the selected source object, do the variable substitution. This can be overridden if needed. The default implementation here is:

	return compileCmd.doVariableSubstitution(firstSelection, substitutor);
 


internalRunCompileCommand

protected boolean internalRunCompileCommand(String compileCmd)
After the substituting and the prompting, it is now time to the remote running of the fully resolved compile command. Do that here.

Must be overridden.

Returns:
true if all is well, false if something went wrong. This prevents the next compile from running

internalPromptCompileCommand

protected String internalPromptCompileCommand(String substitutedCompileCommand)
When running a compile command from the prompt menu, we prompt the command. This is the method that does this prompt. Override if appropriate, else a simple dialog is presented to the user showing the substituted compile command and allowing them to change it.

By default, this uses the SystemPromptCompileCommandDialog dialog to prompt the user to change the compile command.


run

public void run()
The run() method for running code in a thread. This is empty by default, but we include it for your convenience to save adding "implements Runnable" in your subclass. Override if using threads or asynchExec.

Specified by:
run in interface Runnable

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.