Class DevelServerLaunchConfigurationTab

  • All Implemented Interfaces:
    IValidationMessage, org.eclipse.debug.core.IPrototypeAttributesLabelProvider, org.eclipse.debug.ui.ILaunchConfigurationTab, org.eclipse.debug.ui.ILaunchConfigurationTab2

    public class DevelServerLaunchConfigurationTab
    extends org.eclipse.debug.ui.AbstractLaunchConfigurationTab
    implements IValidationMessage
    iizi Development Server launch configuration tab used to edit/view attributes of a specific type of launch configuration.

    Launch configurations are presented in a dialog, with a tab folder. Each tab manipulates one ore more attributes of a launch configuration.

    A tab has the following lifecycle methods:

    • setLaunchConfigurationDialog(ILaunchConfigurationDialog) - this is the first method called on a tab after it is instantiated.
    • initializeFrom(ILaunchConfiguration) - called when a launch configuration is selected to be displayed.
    • activated(ILaunchConfigurationWorkingCopy) - called when a tab is entered.
    • deactivated(ILaunchConfigurationWorkingCopy) - called when a tab is exited.
    • performApply(ILaunchConfigurationWorkingCopy) - called when a tab is to write its values to a launch configuration.
    • dispose() - the last method called on a tab, when it is to perform any required cleanup. Note that a tab can be disposed before its control has been created.
    Author:
    Christopher Mindus
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidcreateControl​(org.eclipse.swt.widgets.Composite parent)
      Creates the top level control for this launch configuration tab under the given parent composite.
      voiddispose()
      Disposes of the instance.
      static java.io.FilegetDefaultServerDirectory()
      Gets the default location of the iiziServer.
      org.eclipse.swt.graphics.ImagegetImage()
      Returns the image for this tab, or null if none
      java.lang.StringgetName()
      Returns the name of this tab.
      voidinitializeFrom​(org.eclipse.debug.core.ILaunchConfiguration configuration)
      Initializes this tab's controls with values from the given launch configuration.
      static booleanisConfigurationValid​(org.eclipse.debug.core.ILaunchConfiguration launchConfig)
      Returns whether this tab is in a valid state in the context of the specified launch configuration.
      protected booleanisDirty()
      Verifies for dirty.
      booleanisValid​(org.eclipse.debug.core.ILaunchConfiguration launchConfig)
      Returns whether this tab is in a valid state in the context of the specified launch configuration.
      voidonValidate​(boolean isValid)
      Call to inform validity of all validators.
      voidperformApply​(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
      Copies values from this tab into the given launch configuration.
      voidsetDefaults​(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
      Initializes the given launch configuration with default values for this tab.
      voidsetMessage​(java.lang.String newMessage, int newType)
      Set the message for this page with an indication of what type of message it is.
      • Methods inherited from class org.eclipse.debug.ui.AbstractLaunchConfigurationTab

        activated, canSave, createCheckButton, createPushButton, createRadioButton, createSeparator, createUpdateJob, createVerticalSpacer, deactivated, getAttributeLabel, getAttributesLabelsForPrototype, getControl, getErrorMessage, getHelpContextId, getId, getLaunchConfigurationDialog, getLaunchManager, getMessage, getShell, getUpdateJobDelay, getWarningMessage, initializeAttributes, launched, scheduleUpdateJob, setAttribute, setControl, setDirty, setErrorMessage, setHelpContextId, setLaunchConfigurationDialog, setMessage, setWarningMessage, updateLaunchConfigurationDialog
      • 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

        OkToLeaveTab, postApply
    • Method Detail

      • getDefaultServerDirectory

        public static java.io.File getDefaultServerDirectory()
                                                      throws java.io.IOException
        Gets the default location of the iiziServer.
        Throws:
        java.io.IOException - For I/O errors.
      • dispose

        public void dispose()
        Disposes of the instance.
        Specified by:
        dispose in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Overrides:
        dispose in class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
      • setDefaults

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

        Specified by:
        setDefaults in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Parameters:
        configuration - The launch configuration.
      • createControl

        public void createControl​(org.eclipse.swt.widgets.Composite parent)
        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.
        Specified by:
        createControl in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Parameters:
        parent - The parent composite.
      • initializeFrom

        public void initializeFrom​(org.eclipse.debug.core.ILaunchConfiguration configuration)
        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.
        Specified by:
        initializeFrom in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Parameters:
        configuration - Launch configuration.
      • performApply

        public void performApply​(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
        Copies values from this tab into the given launch configuration.
        Specified by:
        performApply in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Parameters:
        configuration - Launch configuration.
      • isValid

        public boolean isValid​(org.eclipse.debug.core.ILaunchConfiguration launchConfig)
        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 org.eclipse.debug.ui.ILaunchConfigurationTab
        Overrides:
        isValid in class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
        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
      • getName

        public java.lang.String getName()
        Returns the name of this tab.
        Specified by:
        getName in interface org.eclipse.debug.ui.ILaunchConfigurationTab
      • getImage

        public org.eclipse.swt.graphics.Image getImage()
        Returns the image for this tab, or null if none
        Specified by:
        getImage in interface org.eclipse.debug.ui.ILaunchConfigurationTab
        Overrides:
        getImage in class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
      • setMessage

        public void setMessage​(java.lang.String newMessage,
                               int newType)
        Set the message for this page with an indication of what type of message it is.

        The valid message types are one of IMessageProvider.NONE, IMessageProvider.INFORMATION, IMessageProvider.WARNING, or IMessageProvider.ERROR.

        Note that for backward compatibility, a message of type ERROR is different than an error message (set using setErrorMessage). An error message overrides the current message until the error message is cleared. This method replaces the current message and does not affect the error message.

        Specified by:
        setMessage in interface IValidationMessage
        Parameters:
        newMessage - The message, or null to clear the message.
        newType - The message type.
      • onValidate

        public void onValidate​(boolean isValid)
        Call to inform validity of all validators.
        Specified by:
        onValidate in interface IValidationMessage
        Parameters:
        isValid - true if valid, false otherwise.
      • isDirty

        protected boolean isDirty()
        Verifies for dirty.
        Overrides:
        isDirty in class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
      • isConfigurationValid

        public static boolean isConfigurationValid​(org.eclipse.debug.core.ILaunchConfiguration launchConfig)
        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.

        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