net.bpelunit.framework.client.eclipse.launch
Class BPELLaunchMainTab

java.lang.Object
  extended by org.eclipse.debug.ui.AbstractLaunchConfigurationTab
      extended by net.bpelunit.framework.client.eclipse.launch.BPELLaunchMainTab
All Implemented Interfaces:
org.eclipse.debug.ui.ILaunchConfigurationTab

public class BPELLaunchMainTab
extends org.eclipse.debug.ui.AbstractLaunchConfigurationTab

The main tab for the BPELUnit test Suite Runner. Most of this code has been blatantly ripped out of JavaMainTab (JDT).

Version:
$Id$
Author:
Philip Mayer

Constructor Summary
BPELLaunchMainTab()
           
 
Method Summary
 void createControl(org.eclipse.swt.widgets.Composite parent)
           
protected static org.eclipse.swt.graphics.Image createImage(String path)
           
protected  void createProjectSection(org.eclipse.swt.widgets.Composite parent)
           
protected  void createSuiteSection(org.eclipse.swt.widgets.Composite parent, String text, org.eclipse.swt.widgets.Button[] buttons)
          Creates the widgets for specifying a main type.
static org.eclipse.ui.IWorkbenchPage getActivePage()
           
static org.eclipse.ui.IWorkbenchWindow getActiveWorkbenchWindow()
          Returns the active workbench window
protected  org.eclipse.core.resources.IFile getContext()
          Returns the current file context in the active workbench page or null if none.
 org.eclipse.swt.graphics.Image getImage()
           
 String getName()
           
protected  org.eclipse.core.resources.IProject getProject()
          Return the IProject corresponding to the project name in the project name text field, or null if the text does not match a project name.
protected  org.eclipse.core.resources.IWorkspaceRoot getWorkspaceRoot()
          Convenience method to get the workspace root.
protected  void handleProjectButtonSelected()
           
protected  void handleSearchButtonSelected()
          Show a dialog that lists all main types
 void initializeFrom(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
protected  void initializeProject(org.eclipse.core.resources.IFile file, org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
          Sets the project attribute on the given working copy to the project associated with the given file.
protected  void initializeSuiteAndName(org.eclipse.core.resources.IFile file, org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
           
 boolean isValid(org.eclipse.debug.core.ILaunchConfiguration config)
           
protected  void mapResources(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
          Maps the config to associated IProject
 void performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
           
 void setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)
           
protected  void updateSuiteFromConfig(org.eclipse.debug.core.ILaunchConfiguration config)
          Loads the main type from the launch configuration's preference store
 
Methods inherited from class org.eclipse.debug.ui.AbstractLaunchConfigurationTab
activated, canSave, createCheckButton, createPushButton, createRadioButton, createSeparator, createUpdateJob, createVerticalSpacer, deactivated, dispose, getControl, getErrorMessage, getHelpContextId, getId, getLaunchConfigurationDialog, getLaunchManager, getMessage, getShell, getUpdateJobDelay, isDirty, launched, scheduleUpdateJob, setAttribute, setControl, setDirty, setErrorMessage, setHelpContextId, setLaunchConfigurationDialog, setMessage, updateLaunchConfigurationDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BPELLaunchMainTab

public BPELLaunchMainTab()
Method Detail

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)

getName

public String getName()

initializeFrom

public void initializeFrom(org.eclipse.debug.core.ILaunchConfiguration configuration)

performApply

public void performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)

setDefaults

public void setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy configuration)

createProjectSection

protected void createProjectSection(org.eclipse.swt.widgets.Composite parent)

handleProjectButtonSelected

protected void handleProjectButtonSelected()

getProject

protected org.eclipse.core.resources.IProject getProject()
Return the IProject corresponding to the project name in the project name text field, or null if the text does not match a project name.


getWorkspaceRoot

protected org.eclipse.core.resources.IWorkspaceRoot getWorkspaceRoot()
Convenience method to get the workspace root.


createSuiteSection

protected void createSuiteSection(org.eclipse.swt.widgets.Composite parent,
                                  String text,
                                  org.eclipse.swt.widgets.Button[] buttons)
Creates the widgets for specifying a main type.

Parameters:
parent - the parent composite

handleSearchButtonSelected

protected void handleSearchButtonSelected()
Show a dialog that lists all main types


updateSuiteFromConfig

protected void updateSuiteFromConfig(org.eclipse.debug.core.ILaunchConfiguration config)
Loads the main type from the launch configuration's preference store

Parameters:
config - the config to load the main type from

mapResources

protected void mapResources(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
Maps the config to associated IProject

Parameters:
config -

getContext

protected org.eclipse.core.resources.IFile getContext()
Returns the current file context in the active workbench page or null if none.

Returns:
current file in the active page or null

getActivePage

public static org.eclipse.ui.IWorkbenchPage getActivePage()

getActiveWorkbenchWindow

public static org.eclipse.ui.IWorkbenchWindow getActiveWorkbenchWindow()
Returns the active workbench window

Returns:
the active workbench window

initializeProject

protected void initializeProject(org.eclipse.core.resources.IFile file,
                                 org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)
Sets the project attribute on the given working copy to the project associated with the given file.

Parameters:
file - File this tab is associated with
config - configuration on which to set the project attribute

initializeSuiteAndName

protected void initializeSuiteAndName(org.eclipse.core.resources.IFile file,
                                      org.eclipse.debug.core.ILaunchConfigurationWorkingCopy config)

getImage

public org.eclipse.swt.graphics.Image getImage()
Specified by:
getImage in interface org.eclipse.debug.ui.ILaunchConfigurationTab
Overrides:
getImage in class org.eclipse.debug.ui.AbstractLaunchConfigurationTab

createImage

protected static org.eclipse.swt.graphics.Image createImage(String path)

isValid

public boolean isValid(org.eclipse.debug.core.ILaunchConfiguration config)
Specified by:
isValid in interface org.eclipse.debug.ui.ILaunchConfigurationTab
Overrides:
isValid in class org.eclipse.debug.ui.AbstractLaunchConfigurationTab


Copyright © 2013 Leibniz Universität Hannover. All Rights Reserved.