PTP
Release 7.0

org.eclipse.ptp.etfw.toolopts
Class ToolPane

java.lang.Object
  extended by org.eclipse.ptp.etfw.toolopts.ToolPane
All Implemented Interfaces:
IAppInput, IToolUITab

public class ToolPane
extends java.lang.Object
implements IAppInput, IToolUITab

This class represents a panel of tool options which may be selected or excluded via checkboxes. Each option may have means of including other data such as comboboxes or text fields


Nested Class Summary
protected  class ToolPane.MakeBrowseListener
          A listener class to launch file or directory browsers from browse buttons for a ToolPane's tools
 
Field Summary
static int ALL_COMPILERS
           
static int ANALYSIS
           
 org.eclipse.swt.events.SelectionListener browseListener
          The listener for browse buttons in this pane
static int CC_COMPILER
           
protected  ToolPaneListener checkListener
          The listener for check boxes and value entry fields in this pane
 java.lang.String configID
          This unique, generated ID is used to store the output of this pane in a launch configuration
 java.lang.String configVarID
           
static int CXX_COMPILER
           
 boolean displayOptions
          If true, the showOpts options display is used.
 boolean embedded
          Control the pane normally but don't the user must set it to be displayed manually in a plugin
 java.lang.String encloseOpts
          String/character put before the first and after the last option in the option string Default: empty
 java.lang.String encloseValues
          String/character placed around values Default: "
static int ENV_VAR
           
static int EXEC_UTIL
           
static int F90_COMPILER
           
 ToolOption[] options
          The individual tool options defined in this pane
 java.lang.String paneName
          The name associated with this tool pane
 int paneType
          The type of tool the parameter defined by this pane goes to
 java.lang.String prependOpts
          Added to the beginning of the opt string Default: empty
 java.lang.String separateNameValue
          String/character placed between option names and values Default: =
 java.lang.String separateOpts
          String/Character placed between individual options Default: newline
 org.eclipse.swt.widgets.Text showOpts
          The text box that shows the selected/defined options in this pane
 java.lang.String toolName
          The name of the top-level tool workflow associated with this pane
 boolean virtual
          If true then this pane is merely a placeholder for a pane defined elsewhere
 
Constructor Summary
ToolPane(boolean virtual)
          Creates a new tool pane
 
Method Summary
 java.lang.String getArgument(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the argument(s) contained by this object, building them from information in the configuration if necessary
 java.lang.String getConfigID()
           
 java.lang.String getConfigVarID()
           
 java.util.Map<java.lang.String,java.lang.String> getEnvVars(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
 java.lang.String getName()
           
 ToolOption getOption(java.lang.String optID)
           
 java.lang.String getOptionString()
          Returns the complete argument output of this pane, or the empty string if no input has been specified
 java.lang.String getToolName()
           
 java.util.Map<java.lang.String,java.lang.String> getVarMap()
           
 void initializePane(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Initializes all tool values and enabled/disabled states with the contents of configuration, or their defaults
 boolean isEmbedded()
          Returns true if this tab is embedded (managed internally but not displayed), otherwise false.
 boolean isVirtual()
           
 void makeToolPane(org.eclipse.swt.widgets.Composite comp)
          Creates the widgets and initializes the values for this ToolPane
 void makeToolPane(org.eclipse.swt.widgets.Composite comp, ToolPaneListener paneListener)
          Creates the widgets and initializes the values for this ToolPane
protected  void OptArgUpdate(ToolOption opt)
          If the given ToolOption has an assoicated value field, the name/value string is updated accordingly.
 void OptUpdate()
          For every option in this pane, if it is active/selected add its name/value string to the collection of active values for the whole pane
 void performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
          Saves the current pane-state in the supplied configuration
 void setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
          Sets the default values as suppled for the tools in this pane in the given configuration
 void setName(java.lang.String name)
           
 void setOptions(java.util.List<ToolOption> toptions)
           
 void updateOptDisplay()
          Places the current string of name/value pairs in the option-display text box
 boolean updateOptField(java.lang.Object source)
          If the object is a tool in this pane update the associated strings and displays for the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_COMPILERS

public static final int ALL_COMPILERS
See Also:
Constant Field Values

CC_COMPILER

public static final int CC_COMPILER
See Also:
Constant Field Values

CXX_COMPILER

public static final int CXX_COMPILER
See Also:
Constant Field Values

F90_COMPILER

public static final int F90_COMPILER
See Also:
Constant Field Values

EXEC_UTIL

public static final int EXEC_UTIL
See Also:
Constant Field Values

ANALYSIS

public static final int ANALYSIS
See Also:
Constant Field Values

ENV_VAR

public static final int ENV_VAR
See Also:
Constant Field Values

virtual

public final boolean virtual
If true then this pane is merely a placeholder for a pane defined elsewhere


browseListener

public org.eclipse.swt.events.SelectionListener browseListener
The listener for browse buttons in this pane

Since:
5.0

checkListener

protected ToolPaneListener checkListener
The listener for check boxes and value entry fields in this pane


displayOptions

public boolean displayOptions
If true, the showOpts options display is used.


showOpts

public org.eclipse.swt.widgets.Text showOpts
The text box that shows the selected/defined options in this pane


options

public ToolOption[] options
The individual tool options defined in this pane

Since:
5.0

paneName

public java.lang.String paneName
The name associated with this tool pane

Since:
5.0

toolName

public java.lang.String toolName
The name of the top-level tool workflow associated with this pane


prependOpts

public java.lang.String prependOpts
Added to the beginning of the opt string Default: empty


encloseOpts

public java.lang.String encloseOpts
String/character put before the first and after the last option in the option string Default: empty


separateOpts

public java.lang.String separateOpts
String/Character placed between individual options Default: newline


encloseValues

public java.lang.String encloseValues
String/character placed around values Default: "


separateNameValue

public java.lang.String separateNameValue
String/character placed between option names and values Default: =


configID

public java.lang.String configID
This unique, generated ID is used to store the output of this pane in a launch configuration


configVarID

public java.lang.String configVarID

paneType

public int paneType
The type of tool the parameter defined by this pane goes to


embedded

public boolean embedded
Control the pane normally but don't the user must set it to be displayed manually in a plugin

Since:
4.0
Constructor Detail

ToolPane

public ToolPane(boolean virtual)
Creates a new tool pane

Since:
5.0
Method Detail

getArgument

public java.lang.String getArgument(org.eclipse.debug.core.ILaunchConfiguration configuration)
Description copied from interface: IAppInput
Returns the argument(s) contained by this object, building them from information in the configuration if necessary

Specified by:
getArgument in interface IAppInput
Returns:

getConfigID

public java.lang.String getConfigID()
Specified by:
getConfigID in interface IToolUITab
Returns:
the key to this tab's input string defined in the ui and saved in the launch configuration
Since:
5.0

getConfigVarID

public java.lang.String getConfigVarID()
Specified by:
getConfigVarID in interface IToolUITab
Returns:
the key to this tab's environment variables defined in the ui and saved in the launch configuration
Since:
5.0

getEnvVars

public java.util.Map<java.lang.String,java.lang.String> getEnvVars(org.eclipse.debug.core.ILaunchConfiguration configuration)
Specified by:
getEnvVars in interface IAppInput
Returns:
The map of environment variables defined for this tool's launch

getName

public java.lang.String getName()
Specified by:
getName in interface IToolUITab
Returns:
the name of this ui tab
Since:
5.0

getOption

public ToolOption getOption(java.lang.String optID)

getOptionString

public java.lang.String getOptionString()
Returns the complete argument output of this pane, or the empty string if no input has been specified

Specified by:
getOptionString in interface IToolUITab
Returns:

getToolName

public java.lang.String getToolName()
Specified by:
getToolName in interface IToolUITab
Returns:
the name of the tool getting input from this tab
Since:
5.0

getVarMap

public java.util.Map<java.lang.String,java.lang.String> getVarMap()
Specified by:
getVarMap in interface IToolUITab
Returns:
the map of environment variable names and values defined in this tab and saved in the launch configuration

initializePane

public void initializePane(org.eclipse.debug.core.ILaunchConfiguration configuration)
                    throws org.eclipse.core.runtime.CoreException
Initializes all tool values and enabled/disabled states with the contents of configuration, or their defaults

Specified by:
initializePane in interface IToolUITab
Parameters:
configuration - The configuration from which the current tool values are to be extracted
Throws:
org.eclipse.core.runtime.CoreException

isEmbedded

public boolean isEmbedded()
Description copied from interface: IToolUITab
Returns true if this tab is embedded (managed internally but not displayed), otherwise false.

Specified by:
isEmbedded in interface IToolUITab
Returns:
Since:
5.0

isVirtual

public boolean isVirtual()
Specified by:
isVirtual in interface IToolUITab
Returns:
true if this is a virtual tab, not defined using an XML workflow. Otherwise false.
Since:
5.0

makeToolPane

public void makeToolPane(org.eclipse.swt.widgets.Composite comp)
Creates the widgets and initializes the values for this ToolPane

Specified by:
makeToolPane in interface IToolUITab
Parameters:
comp - The composite that will contain the elements of this tool pane

makeToolPane

public void makeToolPane(org.eclipse.swt.widgets.Composite comp,
                         ToolPaneListener paneListener)
Creates the widgets and initializes the values for this ToolPane

Specified by:
makeToolPane in interface IToolUITab
Parameters:
comp - The composite that will contain the elements of this tool pane
paneListener - The listener class that defines behavior when check boxes and value fields are manipulated

OptArgUpdate

protected void OptArgUpdate(ToolOption opt)
If the given ToolOption has an assoicated value field, the name/value string is updated accordingly.

Parameters:
opt - The ToolOption being updated

OptUpdate

public void OptUpdate()
For every option in this pane, if it is active/selected add its name/value string to the collection of active values for the whole pane

Specified by:
OptUpdate in interface IToolUITab

performApply

public void performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
Saves the current pane-state in the supplied configuration

Specified by:
performApply in interface IToolUITab
Parameters:
configuration - The configuration where the pane-state is to be saved

setDefaults

public void setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
Sets the default values as suppled for the tools in this pane in the given configuration

Specified by:
setDefaults in interface IToolUITab
Parameters:
configuration - The configuration where the default values are set

setName

public void setName(java.lang.String name)
Since:
5.0

setOptions

public void setOptions(java.util.List<ToolOption> toptions)
Since:
5.0

updateOptDisplay

public void updateOptDisplay()
Places the current string of name/value pairs in the option-display text box

Specified by:
updateOptDisplay in interface IToolUITab
Since:
5.0

updateOptField

public boolean updateOptField(java.lang.Object source)
If the object is a tool in this pane update the associated strings and displays for the object

Specified by:
updateOptField in interface IToolUITab
Parameters:
source - The object being searched for and updated if found
Returns:
True if the object is found, otherwise false

PTP
Release 7.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.