Eclipse Platform
2.0

org.eclipse.debug.ui
Class AbstractLaunchConfigurationTab

java.lang.Object
  |
  +--org.eclipse.debug.ui.AbstractLaunchConfigurationTab
All Implemented Interfaces:
ILaunchConfigurationTab
Direct Known Subclasses:
CommonTab

public abstract class AbstractLaunchConfigurationTab
extends Object
implements ILaunchConfigurationTab

Common function for launch configuration tabs.

Clients may subclass this class.

Since:
2.0
See Also:
ILaunchConfigurationTab

Constructor Summary
AbstractLaunchConfigurationTab()
           
 
Method Summary
 boolean canSave()
          Returns whether this tab is in a state that allows the launch configuration whose values this tab is showing to be saved.
protected  Button createPushButton(Composite parent, String label, Image image)
          Creates and returns a new push button with the given label and/or image.
protected  Button createRadioButton(Composite parent, String label)
          Creates and returns a new radio button with the given label and/or image.
protected  void createVerticalSpacer(Composite comp, int colSpan)
          Create some empty space.
 void dispose()
          By default, do nothing.
 Control getControl()
          Returns the top level control for this tab.
 String getErrorMessage()
          Returns the current error message for this tab.
 Image getImage()
          Returns the image for this tab, or null if none
protected  ILaunchConfigurationDialog getLaunchConfigurationDialog()
          Returns the dialog this tab is contained in, or null if not yet set.
protected  ILaunchManager getLaunchManager()
          Convenience method to return the launch manager.
 String getMessage()
          Returns the current message for this tab.
protected  Shell getShell()
          Returns the shell this tab is contained in, or null.
 boolean isValid(ILaunchConfiguration launchConfig)
          Returns whether this tab is in a valid state in the context of the specified launch configuration.
 void launched(ILaunch launch)
          By default, do nothing.
protected  void setControl(Control control)
          Sets the control to be displayed in this tab.
protected  void setErrorMessage(String errorMessage)
          Sets this page's error message, possibly null.
 void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog)
          Sets the launch configuration dialog that hosts this tab.
protected  void setMessage(String message)
          Sets this page's message, possibly null.
protected  void updateLaunchConfigurationDialog()
          Updates the buttons and message in this page's launch configuration dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.debug.ui.ILaunchConfigurationTab
createControl, getName, initializeFrom, performApply, setDefaults
 

Constructor Detail

AbstractLaunchConfigurationTab

public AbstractLaunchConfigurationTab()
Method Detail

getLaunchConfigurationDialog

protected ILaunchConfigurationDialog getLaunchConfigurationDialog()
Returns the dialog this tab is contained in, or null if not yet set.

Returns:
launch configuration dialog, or null

updateLaunchConfigurationDialog

protected void updateLaunchConfigurationDialog()
Updates the buttons and message in this page's launch configuration dialog.


getControl

public Control getControl()
Description copied from interface: ILaunchConfigurationTab
Returns the top level control for this tab.

May return null if the control has not been created yet.

Specified by:
getControl in interface ILaunchConfigurationTab
Returns:
the top level control or null
See Also:
ILaunchConfigurationTab.getControl()

setControl

protected void setControl(Control control)
Sets the control to be displayed in this tab.

Parameters:
control - the control for this tab

getErrorMessage

public String getErrorMessage()
Description copied from interface: ILaunchConfigurationTab
Returns the current error message for this tab. May be null to indicate no error message.

An error message should describe some error state, as opposed to a message which may simply provide instruction or information to the user.

Specified by:
getErrorMessage in interface ILaunchConfigurationTab
Returns:
the error message, or null if none
See Also:
ILaunchConfigurationTab.getErrorMessage()

getMessage

public String getMessage()
Description copied from interface: ILaunchConfigurationTab
Returns the current message for this tab.

A message provides instruction or information to the user, as opposed to an error message which should describe some error state.

Specified by:
getMessage in interface ILaunchConfigurationTab
Returns:
the message, or null if none
See Also:
ILaunchConfigurationTab.getMessage()

launched

public void launched(ILaunch launch)
By default, do nothing.

Specified by:
launched in interface ILaunchConfigurationTab
Parameters:
launch - the result of launching the current launch configuration
See Also:
ILaunchConfigurationTab.launched(ILaunch)

setLaunchConfigurationDialog

public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog)
Description copied from interface: ILaunchConfigurationTab
Sets the launch configuration dialog that hosts this tab. This is the first method called on a launch configuration tab, and marks the beginning of this tab's lifecycle.

Specified by:
setLaunchConfigurationDialog in interface ILaunchConfigurationTab
Parameters:
dialog - launch configuration dialog
See Also:
ILaunchConfigurationTab.setLaunchConfigurationDialog(ILaunchConfigurationDialog)

setErrorMessage

protected void setErrorMessage(String errorMessage)
Sets this page's error message, possibly null.

Parameters:
errorMessage - the error message or null

setMessage

protected void setMessage(String message)
Sets this page's message, possibly null.

Parameters:
message - the message or null

getLaunchManager

protected ILaunchManager getLaunchManager()
Convenience method to return the launch manager.

Returns:
the launch manager

dispose

public void dispose()
By default, do nothing.

Specified by:
dispose in interface ILaunchConfigurationTab
See Also:
ILaunchConfigurationTab.dispose()

getShell

protected Shell getShell()
Returns the shell this tab is contained in, or null.

Returns:
the shell this tab is contained in, or null

createPushButton

protected Button createPushButton(Composite parent,
                                  String label,
                                  Image image)
Creates and returns a new push button with the given label and/or image.

Parameters:
parent - parent control
label - button label or null
image - image of null
Returns:
a new push button

createRadioButton

protected Button createRadioButton(Composite parent,
                                   String label)
Creates and returns a new radio button with the given label and/or image.

Parameters:
parent - parent control
label - button label or null
Returns:
a new radio button

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
Returns:
whether this tab is in a state that allows the current launch configuration to be saved
See Also:
ILaunchConfigurationTab.canSave()

isValid

public boolean isValid(ILaunchConfiguration launchConfig)
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
Parameters:
launchConfig - launch configuration which provides context for validating this tab. This value must not be null.
Returns:
whether this tab is in a valid state
See Also:
ILaunchConfigurationTab.isValid(ILaunchConfiguration)

createVerticalSpacer

protected void createVerticalSpacer(Composite comp,
                                    int colSpan)
Create some empty space.


getImage

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

Specified by:
getImage in interface ILaunchConfigurationTab
Returns:
the image for this tab, or null if none
See Also:
ILaunchConfigurationTab.getImage()

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.