public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, IAdaptable
Since 3.3, working copies can be nested. For example a working copy B can
be created from the original launch configuration A. Then a nested working
copy C can be created from working copy B. When the doSave()
method
is called on C, changes are written back to its parent working copy B without
effecting the original launch configuration A. When doSave()
is called
on B, the changes are persisted back to the original A.
Clients that define a launch configuration delegate extension implement the
ILaunchConfigurationDelegate
interface.
ILaunchConfiguration
,
ILaunchConfigurationType
,
ILaunchConfigurationDelegate
ATTR_SOURCE_LOCATOR_ID, ATTR_SOURCE_LOCATOR_MEMENTO, CONFIGURATION, LAUNCH_CONFIGURATION_FILE_EXTENSION, LAUNCH_CONFIGURATION_PROTOTYPE_FILE_EXTENSION, PROTOTYPE, UPDATE_NONE, UPDATE_PROTOTYPE_CHILDREN
Modifier and Type | Method and Description |
---|---|
void |
addModes(Set<String> modes)
Adds the specified launch modes to this configuration's settings.
|
void |
copyAttributes(ILaunchConfiguration prototype)
Copies all attributes from the given prototype to this working.
|
ILaunchConfiguration |
doSave()
Saves this working copy to its underlying file and returns
a handle to the resulting launch configuration.
|
ILaunchConfiguration |
doSave(int flag)
Saves this working copy to its underlying file and returns a handle to
the resulting launch configuration.
|
ILaunchConfiguration |
getOriginal()
Returns the original launch configuration this working copy
was created from or
null if this is a new
working copy created from a launch configuration type. |
ILaunchConfigurationWorkingCopy |
getParent()
Returns the parent of this working copy or
null if this working
copy is not a nested copy of another working copy. |
boolean |
isDirty()
Returns whether this configuration has been modified
since it was last saved or created.
|
Object |
removeAttribute(String attributeName)
Removes the specified attribute from the this configuration and returns
the previous value associated with the specified attribute name, or null
if there was no mapping for the attribute.
|
void |
removeModes(Set<String> modes)
Removes the specified launch modes from this configuration's settings.
|
void |
rename(String name)
Renames this launch configuration to the specified name.
|
void |
setAttribute(String attributeName,
boolean value)
Sets the boolean-valued attribute with the given name.
|
void |
setAttribute(String attributeName,
int value)
Sets the integer-valued attribute with the given name.
|
void |
setAttribute(String attributeName,
List<String> value)
Sets the
java.util.List -valued attribute with the given name. |
void |
setAttribute(String attributeName,
Map<String,String> value)
Sets the
java.util.Map -valued attribute with the given name. |
void |
setAttribute(String attributeName,
Object value)
Sets the valued attribute with the given name.
|
void |
setAttribute(String attributeName,
Set<String> value)
Sets the
java.util.Set -valued attribute with the given name. |
void |
setAttribute(String attributeName,
String value)
Sets the String-valued attribute with the given name.
|
void |
setAttributes(Map<String,? extends Object> attributes)
Sets the attributes of this launch configuration to be the ones contained
in the given map.
|
void |
setContainer(IContainer container)
Sets the container this launch configuration will be stored
in when saved.
|
void |
setMappedResources(IResource[] resources)
Sets the resources associated with this launch configuration, possibly
null . |
void |
setModes(Set<String> modes)
Set the launch modes for this configuration.
|
void |
setPreferredLaunchDelegate(Set<String> modes,
String delegateId)
Set the preferred launch delegates' id for the given mode set.
|
void |
setPrototype(ILaunchConfiguration prototype,
boolean copy)
Sets the prototype that this configuration is based on, possibly
null ,
and optionally copies attributes from the prototype to this working copy. |
contentsEqual, copy, delete, delete, exists, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributes, getCategory, getFile, getKind, getLocation, getMappedResources, getMemento, getModes, getName, getPreferredDelegate, getPrototype, getPrototypeChildren, getPrototypeVisibleAttributes, getType, getWorkingCopy, hasAttribute, isAttributeModified, isLocal, isMigrationCandidate, isPrototype, isReadOnly, isWorkingCopy, launch, launch, launch, migrate, setPrototypeAttributeVisibility, supportsMode
getAdapter
boolean isDirty()
ILaunchConfiguration doSave() throws CoreException
Since 3.3, if this is a nested working copy, the contents of this working copy are saved to the parent working copy and the parent working copy is returned without effecting the original launch configuration.
Equivalent to #doSave(UPDATE_NONE).
CoreException
- if an exception occurs while
writing this configuration to its underlying file.doSave(int)
ILaunchConfiguration doSave(int flag) throws CoreException
Since 3.3, if this is a nested working copy, the contents of this working copy are saved to the parent working copy and the parent working copy is returned without effecting the original launch configuration.
Updates any affected prototype children based on the given flag. When a working copy is renamed or moved to a new location, prototype children's back pointers will be updated to refer the proper configuration.
flag
- one of ILaunchConfiguration.UPDATE_NONE
or
ILaunchConfiguration.UPDATE_PROTOTYPE_CHILDREN
CoreException
- if an exception occurs while writing this
configuration or any of its affected prototype children to
underlying storagevoid setAttribute(String attributeName, int value)
attributeName
- the name of the attribute, cannot be null
value
- the valuevoid setAttribute(String attributeName, String value)
null
, the attribute is removed from
this launch configuration.attributeName
- the name of the attribute, cannot be null
value
- the value, or null
if the attribute is to be undefinedvoid setAttribute(String attributeName, List<String> value)
java.util.List
-valued attribute with the given name.
The specified List must contain only String-valued entries.
If the value is null
, the attribute is removed from
this launch configuration.attributeName
- the name of the attribute, cannot be null
value
- the value, or null
if the attribute is to be undefinedvoid setAttribute(String attributeName, Map<String,String> value)
java.util.Map
-valued attribute with the given name.
The specified Map must contain only String keys and String values.
If the value is null
, the attribute is removed from
this launch configuration.attributeName
- the name of the attribute, cannot be null
value
- the value, or null
if the attribute is to be undefinedvoid setAttribute(String attributeName, Set<String> value)
java.util.Set
-valued attribute with the given name.
The specified Set must contain only String values.
If the value is null
, the attribute is removed from
this launch configuration.attributeName
- the name of the attribute, cannot be null
value
- the value, or null
if the attribute is to be undefinedvoid setAttribute(String attributeName, boolean value)
attributeName
- the name of the attribute, cannot be null
value
- the valuevoid setAttribute(String attributeName, Object value)
attributeName
- the name of the attribute, cannot be null
value
- the valueILaunchConfiguration getOriginal()
null
if this is a new
working copy created from a launch configuration type.null
void rename(String name)
null
. Has no effect if the name
is the same as the current name. If this working copy is based
on an existing launch configuration, this will cause
the underlying launch configuration file to be renamed when
this working copy is saved.name
- the new name for this configurationvoid setContainer(IContainer container)
null
, this configuration
will be stored locally with the workspace. The specified
container must exist, if specified.
If this configuration is changed from local to non-local, a file will be created in the specified container when saved. The local file associated with this configuration will be deleted.
If this configuration is changed from non-local to local, a file will be created locally when saved. The original file associated with this configuration in the workspace will be deleted.
container
- the container in which to store this
launch configuration, or null
if this
configuration is to be stored locallyvoid setAttributes(Map<String,? extends Object> attributes)
String
, Integer
, or
Boolean
, List
, Map
. Attributes
previously set on this launch configuration but not included in the given
map are considered to be removals. Setting the given map to be
null
is equivalent to removing all attributes.attributes
- a map of attribute names to attribute values.
Attribute names are not allowed to be null
void setMappedResources(IResource[] resources)
null
.
Clients contributing launch configuration types are responsible for maintaining
resource mappings.resources
- the resource to map to this launch configuration or null
void setModes(Set<String> modes)
Setting launch modes on a configuration allows the configuration to be
launched in a mixed mode - for example, debug
and
profile
.
modes
- launch mode identifiers to set on this configuration or
null
to clear mode settingsvoid setPreferredLaunchDelegate(Set<String> modes, String delegateId)
null
as a delegate
id will cause the mapping for the specified mode set (if any) to be removed.modes
- the set of modes to set this delegate id fordelegateId
- the id of the delegate to associate as preferred for the specified mode set
or null
to clear the settingvoid addModes(Set<String> modes)
Setting launch modes on a configuration allows the configuration to be launched in a mixed mode - for example, debug and profile.
modes
- launch mode identifiers to append to the current set of
launch modes set on this configurationvoid removeModes(Set<String> modes)
Setting launch modes on a configuration allows the configuration to be launched in a mixed mode - for example, debug and profile.
modes
- launch mode identifiers to remove from the current set of
launch modes set on this configurationObject removeAttribute(String attributeName)
This method allows non-object attributes to be removed.
attributeName
- the name of the attribute to removenull
ILaunchConfigurationWorkingCopy getParent()
null
if this working
copy is not a nested copy of another working copy.null
void copyAttributes(ILaunchConfiguration prototype) throws CoreException
prototype
- configuration prototypeCoreException
- if unable to retrieve attributes from the prototypevoid setPrototype(ILaunchConfiguration prototype, boolean copy) throws CoreException
null
,
and optionally copies attributes from the prototype to this working copy.
When the specified prototype is null
, this working copy is no longer
associated with any prototype.
prototype
- prototype or null
copy
- whether to copy attributes from the prototype to this working copy. Has
no effect when prototype is null
CoreException
- if
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.