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

Quick Search    Search Deep

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

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

public class CommonTab
extends AbstractLaunchConfigurationTab

Launch configuration tab used to specify the location a launch configuration is stored in, whether it should appear in the favorites list, and perspective switching behavior for an associated launch.

Clients may instantiate this class. This class is not intended to be subclassed.

Since:
2.0

Nested Class Summary
(package private)  class CommonTab.FavoritesContentProvider
           
(package private)  class CommonTab.FavoritesLabelProvider
           
 
Field Summary
private  org.eclipse.swt.events.ModifyListener fBasicModifyListener
          Modify listener that simply updates the owning launch configuration dialog.
private  org.eclipse.jface.viewers.CheckboxTableViewer fFavoritesTable
          Check box list for specifying favorites
protected  org.eclipse.swt.widgets.Button fLaunchInBackgroundButton
           
private  org.eclipse.swt.widgets.Button fLocalRadioButton
           
private  org.eclipse.swt.widgets.Label fLocalSharedLabel
           
private  org.eclipse.swt.widgets.Button fSharedLocationButton
           
private  org.eclipse.swt.widgets.Label fSharedLocationLabel
           
private  org.eclipse.swt.widgets.Text fSharedLocationText
           
private  org.eclipse.swt.widgets.Button fSharedRadioButton
           
 
Fields inherited from class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
 
Constructor Summary
CommonTab()
           
 
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.
 boolean canSave()
          Returns whether this tab is in a state that allows the launch configuration whose values this tab is showing to be saved.
 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 createLaunchInBackgroundComponent(org.eclipse.swt.widgets.Composite parent)
          Creates the controls needed to edit the launch in background attribute of an external tool
 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.
private  org.eclipse.core.resources.IContainer getContainer(java.lang.String path)
           
 org.eclipse.swt.graphics.Image getImage()
          Returns the image for this tab, or null if none
protected  org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager getLaunchConfigurationManager()
          Convenience accessor
private  org.eclipse.swt.widgets.Button getLocalRadioButton()
           
private  org.eclipse.swt.widgets.Label getLocalSharedLabel()
           
 java.lang.String getName()
          Returns the name of this tab.
private  org.eclipse.swt.widgets.Button getSharedLocationButton()
           
private  org.eclipse.swt.widgets.Label getSharedLocationLabel()
           
private  org.eclipse.swt.widgets.Text getSharedLocationText()
           
private  org.eclipse.swt.widgets.Button getSharedRadioButton()
           
private  org.eclipse.core.resources.IWorkspaceRoot getWorkspaceRoot()
          Convenience method for getting the workspace root.
private  void handleSharedLocationButtonSelected()
           
private  void handleSharedRadioButtonSelected()
           
 void initializeFrom(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Initializes this tab's controls with values from the given launch configuration.
static boolean isLaunchInBackground(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns whether the given configuration should be launched in the background.
private  boolean isShared()
           
 boolean isValid(org.eclipse.debug.core.ILaunchConfiguration config)
          Returns whether this tab is in a valid state in the context of the specified launch configuration.
 void performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
          Copies values from this tab into the given launch configuration.
 void setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
          Initializes the given launch configuration with default values for this tab.
private  void setLocalRadioButton(org.eclipse.swt.widgets.Button button)
           
private  void setLocalSharedLabel(org.eclipse.swt.widgets.Label localSharedLabel)
           
private  void setSharedEnabled(boolean enable)
           
private  void setSharedLocationButton(org.eclipse.swt.widgets.Button sharedLocationButton)
           
private  void setSharedLocationLabel(org.eclipse.swt.widgets.Label sharedLocationLabel)
           
private  void setSharedLocationText(org.eclipse.swt.widgets.Text sharedLocationText)
           
private  void setSharedRadioButton(org.eclipse.swt.widgets.Button button)
           
private  void updateConfigFromFavorites(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
          Update the favorite settings.
private  void updateConfigFromLocalShared(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
           
private  void updateFavoritesFromConfig(org.eclipse.debug.core.ILaunchConfiguration config)
           
protected  void updateLaunchInBackground(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
private  void updateLocalSharedFromConfig(org.eclipse.debug.core.ILaunchConfiguration config)
           
private  void updateSharedLocationFromConfig(org.eclipse.debug.core.ILaunchConfiguration config)
           
private  boolean validateLocalShared()
           
 
Methods inherited from class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
createCheckButton, createPushButton, createRadioButton, createSeparator, createVerticalSpacer, dispose, getControl, getErrorMessage, getLaunchConfigurationDialog, getLaunchManager, getMessage, getShell, isDirty, 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

fLocalSharedLabel

private org.eclipse.swt.widgets.Label fLocalSharedLabel

fLocalRadioButton

private org.eclipse.swt.widgets.Button fLocalRadioButton

fSharedRadioButton

private org.eclipse.swt.widgets.Button fSharedRadioButton

fSharedLocationLabel

private org.eclipse.swt.widgets.Label fSharedLocationLabel

fSharedLocationText

private org.eclipse.swt.widgets.Text fSharedLocationText

fSharedLocationButton

private org.eclipse.swt.widgets.Button fSharedLocationButton

fLaunchInBackgroundButton

protected org.eclipse.swt.widgets.Button fLaunchInBackgroundButton

fFavoritesTable

private org.eclipse.jface.viewers.CheckboxTableViewer fFavoritesTable
Check box list for specifying favorites


fBasicModifyListener

private org.eclipse.swt.events.ModifyListener fBasicModifyListener
Modify listener that simply updates the owning launch configuration dialog.

Constructor Detail

CommonTab

public CommonTab()
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


createLaunchInBackgroundComponent

protected void createLaunchInBackgroundComponent(org.eclipse.swt.widgets.Composite parent)
Creates the controls needed to edit the launch in background attribute of an external tool


setSharedLocationButton

private void setSharedLocationButton(org.eclipse.swt.widgets.Button sharedLocationButton)

getSharedLocationButton

private org.eclipse.swt.widgets.Button getSharedLocationButton()

setSharedLocationText

private void setSharedLocationText(org.eclipse.swt.widgets.Text sharedLocationText)

getSharedLocationText

private org.eclipse.swt.widgets.Text getSharedLocationText()

setSharedLocationLabel

private void setSharedLocationLabel(org.eclipse.swt.widgets.Label sharedLocationLabel)

getSharedLocationLabel

private org.eclipse.swt.widgets.Label getSharedLocationLabel()

setLocalSharedLabel

private void setLocalSharedLabel(org.eclipse.swt.widgets.Label localSharedLabel)

getLocalSharedLabel

private org.eclipse.swt.widgets.Label getLocalSharedLabel()

setLocalRadioButton

private void setLocalRadioButton(org.eclipse.swt.widgets.Button button)

getLocalRadioButton

private org.eclipse.swt.widgets.Button getLocalRadioButton()

setSharedRadioButton

private void setSharedRadioButton(org.eclipse.swt.widgets.Button button)

getSharedRadioButton

private org.eclipse.swt.widgets.Button getSharedRadioButton()

handleSharedRadioButtonSelected

private void handleSharedRadioButtonSelected()

setSharedEnabled

private void setSharedEnabled(boolean enable)

isShared

private boolean isShared()

handleSharedLocationButtonSelected

private void handleSharedLocationButtonSelected()

getContainer

private org.eclipse.core.resources.IContainer getContainer(java.lang.String path)

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.


updateLaunchInBackground

protected void updateLaunchInBackground(org.eclipse.debug.core.ILaunchConfiguration configuration)

isLaunchInBackground

public static boolean isLaunchInBackground(org.eclipse.debug.core.ILaunchConfiguration configuration)
Returns whether the given configuration should be launched in the background.


updateLocalSharedFromConfig

private void updateLocalSharedFromConfig(org.eclipse.debug.core.ILaunchConfiguration config)

updateSharedLocationFromConfig

private void updateSharedLocationFromConfig(org.eclipse.debug.core.ILaunchConfiguration config)

updateFavoritesFromConfig

private void updateFavoritesFromConfig(org.eclipse.debug.core.ILaunchConfiguration config)

updateConfigFromLocalShared

private void updateConfigFromLocalShared(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)

updateConfigFromFavorites

private void updateConfigFromFavorites(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
Update the favorite settings. NOTE: set to NULL instead of false for backwards compatibility when comparing if content is equal, since 'false' is default and will be missing for older configs.


getWorkspaceRoot

private org.eclipse.core.resources.IWorkspaceRoot getWorkspaceRoot()
Convenience method for getting the workspace root.


isValid

public boolean isValid(org.eclipse.debug.core.ILaunchConfiguration config)
Description copied from interface: ILaunchConfigurationTab
Returns whether this tab is in a valid state in the context of the specified launch configuration.

This information is typically used by the launch configuration dialog to decide when it is okay to launch.

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

validateLocalShared

private boolean validateLocalShared()

setDefaults

public void setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
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.


performApply

public void performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
Description copied from interface: ILaunchConfigurationTab
Copies values from this tab into the given launch configuration.


getName

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


canSave

public boolean canSave()
Description copied from interface: ILaunchConfigurationTab
Returns whether this tab is in a state that allows the launch configuration whose values this tab is showing to be saved. This differs from isValid() in that canSave() determines if this tab prevents the current launch configuration from being saved, whereas isValid() determines if this tab prevents the current launch configuration from being launched.

This information is typically used by the launch configuration dialog to decide when it is okay to save a launch configuration.

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

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

getLaunchConfigurationManager

protected org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager getLaunchConfigurationManager()
Convenience accessor


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