Class LaunchTargetWorkingCopy
- java.lang.Object
-
- org.eclipse.core.runtime.PlatformObject
-
- org.eclipse.launchbar.core.internal.target.LaunchTargetWorkingCopy
-
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable,ILaunchTarget,ILaunchTargetWorkingCopy
public class LaunchTargetWorkingCopy extends org.eclipse.core.runtime.PlatformObject implements ILaunchTargetWorkingCopy
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>changesprivate java.lang.StringnewIdprivate LaunchTargetoriginal-
Fields inherited from interface org.eclipse.launchbar.core.target.ILaunchTarget
ATTR_ARCH, ATTR_OS, NULL_TARGET
-
-
Constructor Summary
Constructors Constructor Description LaunchTargetWorkingCopy(LaunchTarget original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAttribute(java.lang.String key, java.lang.String defValue)Return a string attribute of this targetjava.util.Map<java.lang.String,java.lang.String>getAttributes()Returns a read-only map of the attributes.java.lang.StringgetId()The id for the target.ILaunchTargetgetOriginal()Get the original launch target.java.lang.StringgetTypeId()The type of the target.ILaunchTargetWorkingCopygetWorkingCopy()Create a working copy of this launch target to allow setting of attributes.ILaunchTargetsave()Save the changes to the original working copy.voidsetAttribute(java.lang.String key, java.lang.String value)Set an attribute.voidsetId(java.lang.String id)Gives the target a new ID.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.launchbar.core.target.ILaunchTarget
getName
-
-
-
-
Field Detail
-
original
private final LaunchTarget original
-
changes
private final java.util.Map<java.lang.String,java.lang.String> changes
-
newId
private java.lang.String newId
-
-
Constructor Detail
-
LaunchTargetWorkingCopy
public LaunchTargetWorkingCopy(LaunchTarget original)
-
-
Method Detail
-
getOriginal
public ILaunchTarget getOriginal()
Description copied from interface:ILaunchTargetWorkingCopyGet the original launch target.- Specified by:
getOriginalin interfaceILaunchTargetWorkingCopy- Returns:
- the original launch target
-
getTypeId
public java.lang.String getTypeId()
Description copied from interface:ILaunchTargetThe type of the target.- Specified by:
getTypeIdin interfaceILaunchTarget- Returns:
- type of the target
-
getId
public java.lang.String getId()
Description copied from interface:ILaunchTargetThe id for the target. It is unique for each type.- Specified by:
getIdin interfaceILaunchTarget- Returns:
- id for the target.
-
setId
public void setId(java.lang.String id)
Description copied from interface:ILaunchTargetWorkingCopyGives the target a new ID. The save method will return a new target with the given name.e- Specified by:
setIdin interfaceILaunchTargetWorkingCopy- Parameters:
id- new target ID
-
getWorkingCopy
public ILaunchTargetWorkingCopy getWorkingCopy()
Description copied from interface:ILaunchTargetCreate a working copy of this launch target to allow setting of attributes. It also allows changing the id, which results in a new launch target when saved.- Specified by:
getWorkingCopyin interfaceILaunchTarget- Returns:
- launch target working copy
-
getAttribute
public java.lang.String getAttribute(java.lang.String key, java.lang.String defValue)Description copied from interface:ILaunchTargetReturn a string attribute of this target- Specified by:
getAttributein interfaceILaunchTarget- Parameters:
key- keydefValue- default value- Returns:
- value of attribute
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Description copied from interface:ILaunchTargetReturns a read-only map of the attributes.- Specified by:
getAttributesin interfaceILaunchTarget- Returns:
- the attributes for this target
-
setAttribute
public void setAttribute(java.lang.String key, java.lang.String value)Description copied from interface:ILaunchTargetWorkingCopySet an attribute.- Specified by:
setAttributein interfaceILaunchTargetWorkingCopy- Parameters:
key- keyvalue- value
-
save
public ILaunchTarget save()
Description copied from interface:ILaunchTargetWorkingCopySave the changes to the original working copy.- Specified by:
savein interfaceILaunchTargetWorkingCopy- Returns:
- original launch target unless the id was changed in which case returns a new target
-
-