public class RefreshTab extends AbstractLaunchConfigurationTab
Clients may call AbstractLaunchConfigurationTab.setHelpContextId(String)
on this tab prior to control
creation to alter the default context help associated with this tab.
This class may be instantiate.
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_REFRESH_RECURSIVE
Boolean attribute indicating if a refresh scope is recursive.
|
static String |
ATTR_REFRESH_SCOPE
String attribute identifying the scope of resources that should be
refreshed after an external tool is run.
|
Constructor and Description |
---|
RefreshTab()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
activated(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. |
void |
createControl(Composite parent)
Creates the top level control for this launch configuration
tab under the given parent composite.
|
void |
deactivated(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. |
String |
getId()
Returns this tab's unique identifier or
null if none. |
Image |
getImage()
Returns the image for this tab, or
null if none |
String |
getName()
Returns the name of this tab.
|
static String |
getRefreshAttribute(IWorkingSet workingSet)
Creates and returns a memento for the given working set, to be used as a
refresh attribute.
|
static IResource[] |
getRefreshResources(String scope)
Returns a collection of resources referred to by a refresh scope attribute.
|
static String |
getRefreshScope(ILaunchConfiguration configuration)
Returns the refresh scope attribute specified by the given launch configuration
or
null if none. |
static IWorkingSet |
getWorkingSet(String refreshAttribute)
Creates and returns a working set from the given refresh attribute created by
the method
getRefreshAttribute(IWorkingSet) , or null
if none. |
void |
initializeFrom(ILaunchConfiguration configuration)
Initializes this tab's controls with values from the given
launch configuration.
|
static boolean |
isRefreshRecursive(ILaunchConfiguration configuration)
Returns whether the refresh scope specified by the given launch
configuration is recursive.
|
boolean |
isValid(ILaunchConfiguration launchConfig)
Returns whether this tab is in a valid state in the context of the specified launch configuration.
|
void |
performApply(ILaunchConfigurationWorkingCopy configuration)
Copies values from this tab into the given
launch configuration.
|
static void |
refreshResources(ILaunchConfiguration configuration,
IProgressMonitor monitor)
Refreshes the resources as specified by the given launch configuration.
|
void |
setDefaults(ILaunchConfigurationWorkingCopy configuration)
Initializes the given launch configuration with
default values for this tab.
|
canSave, createCheckButton, createPushButton, createRadioButton, createSeparator, createUpdateJob, createVerticalSpacer, dispose, getControl, getErrorMessage, getHelpContextId, getLaunchConfigurationDialog, getLaunchManager, getMessage, getShell, getUpdateJobDelay, getWarningMessage, isDirty, launched, scheduleUpdateJob, setAttribute, setControl, setDirty, setErrorMessage, setHelpContextId, setLaunchConfigurationDialog, setMessage, setWarningMessage, updateLaunchConfigurationDialog
public static final String ATTR_REFRESH_RECURSIVE
true
.public static final String ATTR_REFRESH_SCOPE
null
, indicating no refresh.public void createControl(Composite parent)
ILaunchConfigurationTab
setLaunchConfigurationDialog
is called.
Implementors are responsible for ensuring that
the created control can be accessed via getControl
parent
- the parent compositeILaunchConfigurationTab.createControl(org.eclipse.swt.widgets.Composite)
public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
ILaunchConfigurationTab
configuration
- launch configurationILaunchConfigurationTab.setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
public void initializeFrom(ILaunchConfiguration configuration)
ILaunchConfigurationTab
configuration
- launch configurationILaunchConfigurationTab.initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
public void performApply(ILaunchConfigurationWorkingCopy configuration)
ILaunchConfigurationTab
configuration
- launch configurationILaunchConfigurationTab.performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
public String getName()
ILaunchConfigurationTab
ILaunchConfigurationTab.getName()
public Image getImage()
ILaunchConfigurationTab
null
if nonegetImage
in interface ILaunchConfigurationTab
getImage
in class AbstractLaunchConfigurationTab
null
if noneILaunchConfigurationTab.getImage()
public boolean isValid(ILaunchConfiguration launchConfig)
ILaunchConfigurationTab
This information is typically used by the launch configuration dialog to decide when it is okay to launch.
isValid
in interface ILaunchConfigurationTab
isValid
in class AbstractLaunchConfigurationTab
launchConfig
- launch configuration which provides context for validating this tab.
This value must not be null
.ILaunchConfigurationTab.isValid(ILaunchConfiguration)
public static void refreshResources(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException
configuration
- launch configurationmonitor
- progress monitor which may be null
CoreException
- if an exception occurs while refreshing resourcespublic static IResource[] getRefreshResources(String scope) throws CoreException
scope
- refresh scope attribute (ATTR_REFRESH_SCOPE
)CoreException
- if unable to resolve a set of resourcespublic static String getRefreshScope(ILaunchConfiguration configuration) throws CoreException
null
if none.configuration
- launch configurationATTR_REFRESH_SCOPE
)CoreException
- if unable to access the associated attributepublic static boolean isRefreshRecursive(ILaunchConfiguration configuration) throws CoreException
configuration
- the configuration to check for recursive refresh being setCoreException
- if unable to access the associated attributepublic static String getRefreshAttribute(IWorkingSet workingSet)
workingSet
- a working set, or null
public static IWorkingSet getWorkingSet(String refreshAttribute)
getRefreshAttribute(IWorkingSet)
, or null
if none.refreshAttribute
- a refresh attribute that represents a working setnull
public void activated(ILaunchConfigurationWorkingCopy workingCopy)
AbstractLaunchConfigurationTab
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 originally 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.
activated
in interface ILaunchConfigurationTab
activated
in class AbstractLaunchConfigurationTab
workingCopy
- the launch configuration being editedILaunchConfigurationTab.activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy)
AbstractLaunchConfigurationTab
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 originally 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.
deactivated
in interface ILaunchConfigurationTab
deactivated
in class AbstractLaunchConfigurationTab
workingCopy
- the launch configuration being editedILaunchConfigurationTab.deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
public String getId()
AbstractLaunchConfigurationTab
null
if none.
By default, null
is returned. Subclasses should override
as necessary.
Tab identifiers allow contributed tabs to be ordered relative to one another.
getId
in class AbstractLaunchConfigurationTab
null
AbstractLaunchConfigurationTab.getId()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.