Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.debug.ui
Class EnvironmentTab  view EnvironmentTab download EnvironmentTab.java

java.lang.Object
  extended byorg.eclipse.debug.ui.AbstractLaunchConfigurationTab
      extended byorg.eclipse.debug.ui.EnvironmentTab
All Implemented Interfaces:
ILaunchConfigurationTab

public class EnvironmentTab
extends AbstractLaunchConfigurationTab

Launch configuration tab for configuring the environment passed into Runtime.exec(...) when a config is launched.

This class may be instantiated; this class is not intended to be subclassed.

Since:
3.0

Nested Class Summary
protected  class EnvironmentTab.EnvironmentVariableContentProvider
          Content provider for the environment table
 class EnvironmentTab.EnvironmentVariableLabelProvider
          Label provider for the environment table
private  class EnvironmentTab.NativeEnvironmentDialog
           
 
Field Summary
protected  org.eclipse.swt.widgets.Button appendEnvironment
           
protected  org.eclipse.swt.widgets.Button envAddButton
           
protected  org.eclipse.swt.widgets.Button envEditButton
           
protected  org.eclipse.jface.viewers.TableViewer environmentTable
           
protected  org.eclipse.swt.widgets.Button envRemoveButton
           
protected  org.eclipse.swt.widgets.Button envSelectButton
           
protected  java.lang.String[] envTableColumnHeaders
           
protected  org.eclipse.jface.viewers.ColumnLayoutData[] envTableColumnLayouts
           
protected static java.lang.String[] envTableColumnProperties
           
private static java.lang.String NAME_LABEL
           
protected static java.lang.String P_VALUE
           
protected static java.lang.String P_VARIABLE
           
protected  org.eclipse.swt.widgets.Button replaceEnvironment
           
private static java.lang.String VALUE_LABEL
           
 
Fields inherited from class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
 
Constructor Summary
EnvironmentTab()
           
 
Method Summary
 void activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy workingCopy)
          This method was added to the ILaunchConfigurationTab interface in the 3.0 release to allow tabs to distinguish between a tab being activated and a tab group be initialized for the first time, from a selected launch configuration.
protected  boolean addVariable(org.eclipse.debug.internal.ui.launchConfigurations.EnvironmentVariable variable)
          Attempts to add the given variable.
protected  void createAppendReplace(org.eclipse.swt.widgets.Composite parent)
          Creates and configures the widgets which allow the user to choose whether the specified environment should be appended to the native environment or if it should completely replace it.
 void createControl(org.eclipse.swt.widgets.Composite parent)
          Creates the top level control for this launch configuration tab under the given parent composite.
protected  void createEnvironmentTable(org.eclipse.swt.widgets.Composite parent)
          Creates and configures the table that displayed the key/value pairs that comprise the environment.
private  org.eclipse.jface.viewers.IStructuredContentProvider createSelectionDialogContentProvider()
          Creates a content provider for the native native environment variable selection dialog.
private  org.eclipse.jface.viewers.ILabelProvider createSelectionDialogLabelProvider()
          Creates a label provider for the native native environment variable selection dialog.
protected  void createTableButtons(org.eclipse.swt.widgets.Composite parent)
          Creates the add/edit/remove buttons for the environment table
 void deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy workingCopy)
          This method was added to the ILaunchConfigurationTab interface in the 3.0 release to allow tabs to distinguish between a tab being deactivated and saving its attributes to a launch configuration.
 org.eclipse.swt.graphics.Image getImage()
          Returns the image for this tab, or null if none
 java.lang.String getName()
          Returns the name of this tab.
private  java.util.Map getNativeEnvironment()
          Gets native environment variable from the LaunchManager.
protected  void handleEnvAddButtonSelected()
          Adds a new environment variable to the table.
private  void handleEnvEditButtonSelected()
          Creates an editor for the value of the selected environment variable.
private  void handleEnvRemoveButtonSelected()
          Removes the selected environment variable from the table.
private  void handleEnvSelectButtonSelected()
          Displays a dialog that allows user to select native environment variables to add to the table.
protected  void handleTableSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
          Responds to a selection changed event in the environment table
 void initializeFrom(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Initializes this tab's controls with values from the given launch configuration.
 void performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
          Stores the environment in the given configuration
 void setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
          Initializes the given launch configuration with default values for this tab.
protected  void updateAppendReplace()
          Updates the enablement of the append/replace widgets.
protected  void updateEnvironment(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Updates the environment table for the given launch configuration
 
Methods inherited from class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
canSave, createCheckButton, createPushButton, createRadioButton, createSeparator, createVerticalSpacer, dispose, getControl, getErrorMessage, getLaunchConfigurationDialog, getLaunchManager, getMessage, getShell, isDirty, isValid, launched, setAttribute, setControl, setDirty, setErrorMessage, setLaunchConfigurationDialog, setMessage, updateLaunchConfigurationDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

environmentTable

protected org.eclipse.jface.viewers.TableViewer environmentTable

envTableColumnHeaders

protected java.lang.String[] envTableColumnHeaders

envTableColumnLayouts

protected org.eclipse.jface.viewers.ColumnLayoutData[] envTableColumnLayouts

NAME_LABEL

private static final java.lang.String NAME_LABEL

VALUE_LABEL

private static final java.lang.String VALUE_LABEL

P_VARIABLE

protected static final java.lang.String P_VARIABLE
See Also:
Constant Field Values

P_VALUE

protected static final java.lang.String P_VALUE
See Also:
Constant Field Values

envTableColumnProperties

protected static java.lang.String[] envTableColumnProperties

envAddButton

protected org.eclipse.swt.widgets.Button envAddButton

envEditButton

protected org.eclipse.swt.widgets.Button envEditButton

envRemoveButton

protected org.eclipse.swt.widgets.Button envRemoveButton

appendEnvironment

protected org.eclipse.swt.widgets.Button appendEnvironment

replaceEnvironment

protected org.eclipse.swt.widgets.Button replaceEnvironment

envSelectButton

protected org.eclipse.swt.widgets.Button envSelectButton
Constructor Detail

EnvironmentTab

public EnvironmentTab()
Method Detail

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)
Description copied from interface: ILaunchConfigurationTab
Creates the top level control for this launch configuration tab under the given parent composite. This method is called once on tab creation, after setLaunchConfigurationDialog is called.

Implementors are responsible for ensuring that the created control can be accessed via getControl


createAppendReplace

protected void createAppendReplace(org.eclipse.swt.widgets.Composite parent)
Creates and configures the widgets which allow the user to choose whether the specified environment should be appended to the native environment or if it should completely replace it.


updateAppendReplace

protected void updateAppendReplace()
Updates the enablement of the append/replace widgets. The widgets should disable when there are no environment variables specified.


createEnvironmentTable

protected void createEnvironmentTable(org.eclipse.swt.widgets.Composite parent)
Creates and configures the table that displayed the key/value pairs that comprise the environment.


handleTableSelectionChanged

protected void handleTableSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Responds to a selection changed event in the environment table


createTableButtons

protected void createTableButtons(org.eclipse.swt.widgets.Composite parent)
Creates the add/edit/remove buttons for the environment table


handleEnvAddButtonSelected

protected void handleEnvAddButtonSelected()
Adds a new environment variable to the table.


addVariable

protected boolean addVariable(org.eclipse.debug.internal.ui.launchConfigurations.EnvironmentVariable variable)
Attempts to add the given variable. Returns whether the variable was added or not (as when the user answers not to overwrite an existing variable).


handleEnvSelectButtonSelected

private void handleEnvSelectButtonSelected()
Displays a dialog that allows user to select native environment variables to add to the table.


createSelectionDialogLabelProvider

private org.eclipse.jface.viewers.ILabelProvider createSelectionDialogLabelProvider()
Creates a label provider for the native native environment variable selection dialog.


createSelectionDialogContentProvider

private org.eclipse.jface.viewers.IStructuredContentProvider createSelectionDialogContentProvider()
Creates a content provider for the native native environment variable selection dialog.


getNativeEnvironment

private java.util.Map getNativeEnvironment()
Gets native environment variable from the LaunchManager. Creates EnvironmentVariable objects.


handleEnvEditButtonSelected

private void handleEnvEditButtonSelected()
Creates an editor for the value of the selected environment variable.


handleEnvRemoveButtonSelected

private void handleEnvRemoveButtonSelected()
Removes the selected environment variable from the table.


updateEnvironment

protected void updateEnvironment(org.eclipse.debug.core.ILaunchConfiguration configuration)
Updates the environment table for the given launch configuration


setDefaults

public void setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
Description copied from interface: ILaunchConfigurationTab
Initializes the given launch configuration with default values for this tab. This method is called when a new launch configuration is created such that the configuration can be initialized with meaningful values. This method may be called before this tab's control is created.


initializeFrom

public void initializeFrom(org.eclipse.debug.core.ILaunchConfiguration configuration)
Description copied from interface: ILaunchConfigurationTab
Initializes this tab's controls with values from the given launch configuration. This method is called when a configuration is selected to view or edit, after this tab's control has been created.


performApply

public void performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
Stores the environment in the given configuration


getName

public java.lang.String getName()
Description copied from interface: ILaunchConfigurationTab
Returns the name of this tab.


getImage

public org.eclipse.swt.graphics.Image getImage()
Description copied from interface: ILaunchConfigurationTab
Returns the image for this tab, or null if none

Specified by:
getImage in interface ILaunchConfigurationTab
Overrides:
getImage in class AbstractLaunchConfigurationTab

activated

public void activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy workingCopy)
Description copied from class: AbstractLaunchConfigurationTab
This method was added to the ILaunchConfigurationTab interface in the 3.0 release to allow tabs to distinguish between a tab being activated and a tab group be initialized for the first time, from a selected launch configuration. To maintain backwards compatible behavior, the default implementation provided, calls this tab's initializeFrom method. Tabs should override this method as required.

The launch tab framework was originially designed to take care of inter tab communication by applying attributes from the active tab to the launch configuration being edited, when a tab is exited, and by initializing a tab when activated. The addition of the methods activated and deactivated allow tabs to determine the appropriate course of action.

Specified by:
activated in interface ILaunchConfigurationTab
Overrides:
activated in class AbstractLaunchConfigurationTab

deactivated

public void deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy workingCopy)
Description copied from class: AbstractLaunchConfigurationTab
This method was added to the ILaunchConfigurationTab interface in the 3.0 release to allow tabs to distinguish between a tab being deactivated and saving its attributes to a launch configuration. To maintain backwards compatible behavior, the default implementation provided, calls this tab's performApply method. Tabs should override this method as required.

The launch tab framework was originially designed to take care of inter tab communication by applying attributes from the active tab to the launch configuration being edited, when a tab is exited, and by initializing a tab when activated. The addition of the methods activated and deactivated allow tabs to determine the appropriate course of action.

Specified by:
deactivated in interface ILaunchConfigurationTab
Overrides:
deactivated in class AbstractLaunchConfigurationTab