Class LaunchBarManager
- java.lang.Object
-
- org.eclipse.launchbar.core.internal.LaunchBarManager
-
- All Implemented Interfaces:
org.eclipse.debug.core.ILaunchConfigurationListener,ILaunchBarManager,ILaunchTargetListener
public class LaunchBarManager extends java.lang.Object implements ILaunchBarManager, ILaunchTargetListener
The brains of the launch bar.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interfaceLaunchBarManager.FireAction
-
Field Summary
Fields Modifier and Type Field Description private ILaunchDescriptoractiveLaunchDescprivate org.eclipse.debug.core.ILaunchModeactiveLaunchModeprivate ILaunchTargetactiveLaunchTargetprivate java.util.Map<java.lang.String,java.util.List<LaunchConfigProviderInfo>>configProvidersprivate java.util.Map<Pair<java.lang.String,java.lang.String>,ILaunchDescriptor>descriptorsprivate java.util.Map<ILaunchDescriptorType,LaunchDescriptorTypeInfo>descriptorTypeInfoprivate java.util.Map<java.lang.String,LaunchDescriptorTypeInfo>descriptorTypes(package private) booleaninitializedprivate ILaunchTargetManagerlaunchTargetManagerprivate java.util.List<ILaunchBarListener>listenersprivate java.util.Map<java.lang.Object,ILaunchDescriptor>objectDescriptorMapprivate java.util.List<ILaunchObjectProvider>objectProvidersprivate java.util.List<LaunchDescriptorTypeInfo>orderedDescriptorTypesprivate static java.lang.StringPREF_ACTIVE_LAUNCH_MODEprivate static java.lang.StringPREF_ACTIVE_LAUNCH_TARGETprivate static java.lang.StringPREF_CONFIG_DESC_ORDERprivate static java.lang.StringPREF_TRACK_LAUNCHES
-
Constructor Summary
Constructors Constructor Description LaunchBarManager()LaunchBarManager(boolean doInit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddDescriptor(java.lang.Object launchObject, ILaunchDescriptor descriptor)voidaddListener(ILaunchBarListener listener)Add a listener that can react to launch bar changesvoiddispose()private voiddoSetActiveLaunchDescriptor(ILaunchDescriptor descriptor)private voidfireActiveLaunchDescriptorChanged()private voidfireActiveLaunchModeChanged()private voidfireActiveLaunchTargetChanged()private voidfireEvent(LaunchBarManager.FireAction action)private voidfireLaunchTargetsChanged()org.eclipse.debug.core.ILaunchConfigurationgetActiveLaunchConfiguration()ILaunchDescriptorgetActiveLaunchDescriptor()org.eclipse.debug.core.ILaunchModegetActiveLaunchMode()ILaunchTargetgetActiveLaunchTarget()private ILaunchTargetgetDefaultLaunchTarget(ILaunchDescriptor descriptor)private Pair<java.lang.String,java.lang.String>getDescriptorId(ILaunchDescriptor descriptor)java.lang.StringgetDescriptorTypeId(ILaunchDescriptorType type)Return the type id for the given launch descriptor type.(package private) org.eclipse.core.runtime.IExtensionPointgetExtensionPoint()private ILaunchDescriptorgetLastUsedDescriptor()org.eclipse.debug.core.ILaunchConfigurationgetLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target)org.eclipse.debug.core.ILaunchConfigurationTypegetLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target)private ILaunchDescriptorgetLaunchDescriptor(org.eclipse.debug.core.ILaunchConfiguration configuration, ILaunchTarget target)ILaunchDescriptor[]getLaunchDescriptors()(package private) org.eclipse.debug.core.ILaunchManagergetLaunchManager()org.eclipse.debug.core.ILaunchMode[]getLaunchModes()(package private) ILaunchTargetManagergetLaunchTargetManager()ILaunchTarget[]getLaunchTargets(ILaunchDescriptor descriptor)private org.osgi.service.prefs.PreferencesgetPerDescriptorStore()private org.osgi.service.prefs.PreferencesgetPerDescriptorStore(ILaunchDescriptor launchDesc)(package private) org.eclipse.core.runtime.preferences.IEclipsePreferencesgetPreferenceStore()private Pair<java.lang.String,java.lang.String>getTargetId(ILaunchTarget target)(package private) voidinit()voidlaunchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration configuration)voidlaunchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration configuration)voidlaunchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration configuration)private booleanlaunchDescriptorMatches(ILaunchDescriptor desc, org.eclipse.debug.core.ILaunchConfiguration configuration, ILaunchTarget target)ILaunchDescriptorlaunchObjectAdded(java.lang.Object launchObject)A launch object has been added.voidlaunchObjectChanged(java.lang.Object launchObject)A launch object has changed in some way that affects the launch bar.voidlaunchObjectRemoved(java.lang.Object launchObject)A launch object has been removed.voidlaunchTargetAdded(ILaunchTarget target)A launch target was added.voidlaunchTargetRemoved(ILaunchTarget target)A launch target was removed.private voidloadExtensions()voidremoveListener(ILaunchBarListener listener)Remove a listenerprivate voidsetActive(org.eclipse.debug.core.ILaunchConfiguration config, java.lang.String mode, ILaunchTarget target)voidsetActiveLaunchDescriptor(ILaunchDescriptor descriptor)voidsetActiveLaunchMode(org.eclipse.debug.core.ILaunchMode mode)voidsetActiveLaunchTarget(ILaunchTarget target)voidsetLaunchMode(ILaunchDescriptor desc, org.eclipse.debug.core.ILaunchMode mode)Sets the preferred mode for the given descriptorvoidsetLaunchTarget(ILaunchDescriptor desc, ILaunchTarget target)Sets preferred target for launch descriptorprivate voidsetPreference(org.osgi.service.prefs.Preferences store, java.lang.String prefId, java.lang.String value)private voidstoreActiveDescriptor(ILaunchDescriptor descriptor)private voidstoreLaunchMode(ILaunchDescriptor desc, org.eclipse.debug.core.ILaunchMode mode)private voidstoreLaunchTarget(ILaunchDescriptor desc, ILaunchTarget target)private booleansupportsMode(org.eclipse.debug.core.ILaunchMode mode)(package private) booleansupportsTarget(ILaunchDescriptor descriptor, ILaunchTarget target)private voidsyncActiveMode()private voidsyncActiveTarget()private Pair<java.lang.String,java.lang.String>toId(java.lang.String key)private java.lang.StringtoString(Pair<java.lang.String,java.lang.String> key)-
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.ILaunchTargetListener
launchTargetStatusChanged
-
-
-
-
Field Detail
-
listeners
private final java.util.List<ILaunchBarListener> listeners
-
objectProviders
private final java.util.List<ILaunchObjectProvider> objectProviders
-
descriptorTypes
private final java.util.Map<java.lang.String,LaunchDescriptorTypeInfo> descriptorTypes
-
orderedDescriptorTypes
private java.util.List<LaunchDescriptorTypeInfo> orderedDescriptorTypes
-
descriptorTypeInfo
private final java.util.Map<ILaunchDescriptorType,LaunchDescriptorTypeInfo> descriptorTypeInfo
-
configProviders
private final java.util.Map<java.lang.String,java.util.List<LaunchConfigProviderInfo>> configProviders
-
descriptors
private final java.util.Map<Pair<java.lang.String,java.lang.String>,ILaunchDescriptor> descriptors
-
objectDescriptorMap
private final java.util.Map<java.lang.Object,ILaunchDescriptor> objectDescriptorMap
-
launchTargetManager
private ILaunchTargetManager launchTargetManager
-
activeLaunchDesc
private ILaunchDescriptor activeLaunchDesc
-
activeLaunchMode
private org.eclipse.debug.core.ILaunchMode activeLaunchMode
-
activeLaunchTarget
private ILaunchTarget activeLaunchTarget
-
PREF_ACTIVE_LAUNCH_MODE
private static final java.lang.String PREF_ACTIVE_LAUNCH_MODE
- See Also:
- Constant Field Values
-
PREF_ACTIVE_LAUNCH_TARGET
private static final java.lang.String PREF_ACTIVE_LAUNCH_TARGET
- See Also:
- Constant Field Values
-
PREF_CONFIG_DESC_ORDER
private static final java.lang.String PREF_CONFIG_DESC_ORDER
- See Also:
- Constant Field Values
-
PREF_TRACK_LAUNCHES
private static final java.lang.String PREF_TRACK_LAUNCHES
- See Also:
- Constant Field Values
-
initialized
boolean initialized
-
-
Method Detail
-
getExtensionPoint
org.eclipse.core.runtime.IExtensionPoint getExtensionPoint() throws org.eclipse.core.runtime.CoreException- Throws:
org.eclipse.core.runtime.CoreException
-
getLaunchManager
org.eclipse.debug.core.ILaunchManager getLaunchManager()
-
getLaunchTargetManager
ILaunchTargetManager getLaunchTargetManager()
-
init
void init() throws org.eclipse.core.runtime.CoreException
- Throws:
org.eclipse.core.runtime.CoreException
-
loadExtensions
private void loadExtensions() throws org.eclipse.core.runtime.CoreException- Throws:
org.eclipse.core.runtime.CoreException
-
toString
private java.lang.String toString(Pair<java.lang.String,java.lang.String> key)
-
toId
private Pair<java.lang.String,java.lang.String> toId(java.lang.String key)
-
getDescriptorTypeId
public java.lang.String getDescriptorTypeId(ILaunchDescriptorType type)
Description copied from interface:ILaunchBarManagerReturn the type id for the given launch descriptor type. This is defined in the extension point that defines the type.- Specified by:
getDescriptorTypeIdin interfaceILaunchBarManager- Parameters:
type- descriptor type- Returns:
- the type id for the descriptor type
-
getDescriptorId
private Pair<java.lang.String,java.lang.String> getDescriptorId(ILaunchDescriptor descriptor)
-
getTargetId
private Pair<java.lang.String,java.lang.String> getTargetId(ILaunchTarget target)
-
addDescriptor
private void addDescriptor(java.lang.Object launchObject, ILaunchDescriptor descriptor) throws org.eclipse.core.runtime.CoreException- Throws:
org.eclipse.core.runtime.CoreException
-
getLaunchConfigurationType
public org.eclipse.debug.core.ILaunchConfigurationType getLaunchConfigurationType(ILaunchDescriptor descriptor, ILaunchTarget target) throws org.eclipse.core.runtime.CoreException
- Specified by:
getLaunchConfigurationTypein interfaceILaunchBarManager- Throws:
org.eclipse.core.runtime.CoreException
-
launchObjectAdded
public ILaunchDescriptor launchObjectAdded(java.lang.Object launchObject)
Description copied from interface:ILaunchBarManagerA launch object has been added. Create a matching launch descriptor if available.- Specified by:
launchObjectAddedin interfaceILaunchBarManager- Returns:
- the launch descriptor that got created, null of none was
-
launchObjectRemoved
public void launchObjectRemoved(java.lang.Object launchObject) throws org.eclipse.core.runtime.CoreExceptionDescription copied from interface:ILaunchBarManagerA launch object has been removed. Remove the associated launch descriptor if there is one.- Specified by:
launchObjectRemovedin interfaceILaunchBarManager- Throws:
org.eclipse.core.runtime.CoreException
-
launchObjectChanged
public void launchObjectChanged(java.lang.Object launchObject) throws org.eclipse.core.runtime.CoreExceptionDescription copied from interface:ILaunchBarManagerA launch object has changed in some way that affects the launch bar.- Specified by:
launchObjectChangedin interfaceILaunchBarManager- Throws:
org.eclipse.core.runtime.CoreException
-
getLastUsedDescriptor
private ILaunchDescriptor getLastUsedDescriptor()
-
getLaunchDescriptors
public ILaunchDescriptor[] getLaunchDescriptors()
- Specified by:
getLaunchDescriptorsin interfaceILaunchBarManager
-
getActiveLaunchDescriptor
public ILaunchDescriptor getActiveLaunchDescriptor()
- Specified by:
getActiveLaunchDescriptorin interfaceILaunchBarManager
-
setActive
private void setActive(org.eclipse.debug.core.ILaunchConfiguration config, java.lang.String mode, ILaunchTarget target) throws org.eclipse.core.runtime.CoreException- Throws:
org.eclipse.core.runtime.CoreException
-
setActiveLaunchDescriptor
public void setActiveLaunchDescriptor(ILaunchDescriptor descriptor) throws org.eclipse.core.runtime.CoreException
- Specified by:
setActiveLaunchDescriptorin interfaceILaunchBarManager- Throws:
org.eclipse.core.runtime.CoreException
-
doSetActiveLaunchDescriptor
private void doSetActiveLaunchDescriptor(ILaunchDescriptor descriptor)
-
storeActiveDescriptor
private void storeActiveDescriptor(ILaunchDescriptor descriptor)
-
syncActiveTarget
private void syncActiveTarget() throws org.eclipse.core.runtime.CoreException- Throws:
org.eclipse.core.runtime.CoreException
-
syncActiveMode
private void syncActiveMode() throws org.eclipse.core.runtime.CoreException- Throws:
org.eclipse.core.runtime.CoreException
-
supportsMode
private boolean supportsMode(org.eclipse.debug.core.ILaunchMode mode) throws org.eclipse.core.runtime.CoreException- Throws:
org.eclipse.core.runtime.CoreException
-
setPreference
private void setPreference(org.osgi.service.prefs.Preferences store, java.lang.String prefId, java.lang.String value)
-
getPerDescriptorStore
private org.osgi.service.prefs.Preferences getPerDescriptorStore()
-
getPerDescriptorStore
private org.osgi.service.prefs.Preferences getPerDescriptorStore(ILaunchDescriptor launchDesc)
-
getPreferenceStore
org.eclipse.core.runtime.preferences.IEclipsePreferences getPreferenceStore()
-
fireEvent
private void fireEvent(LaunchBarManager.FireAction action)
-
fireActiveLaunchDescriptorChanged
private void fireActiveLaunchDescriptorChanged()
-
getLaunchModes
public org.eclipse.debug.core.ILaunchMode[] getLaunchModes() throws org.eclipse.core.runtime.CoreException- Specified by:
getLaunchModesin interfaceILaunchBarManager- Throws:
org.eclipse.core.runtime.CoreException
-
getActiveLaunchMode
public org.eclipse.debug.core.ILaunchMode getActiveLaunchMode()
- Specified by:
getActiveLaunchModein interfaceILaunchBarManager
-
setLaunchMode
public void setLaunchMode(ILaunchDescriptor desc, org.eclipse.debug.core.ILaunchMode mode) throws org.eclipse.core.runtime.CoreException
Sets the preferred mode for the given descriptor- Parameters:
desc-mode-- Throws:
org.eclipse.core.runtime.CoreException
-
setActiveLaunchMode
public void setActiveLaunchMode(org.eclipse.debug.core.ILaunchMode mode) throws org.eclipse.core.runtime.CoreException- Specified by:
setActiveLaunchModein interfaceILaunchBarManager- Throws:
org.eclipse.core.runtime.CoreException
-
fireActiveLaunchModeChanged
private void fireActiveLaunchModeChanged()
-
storeLaunchMode
private void storeLaunchMode(ILaunchDescriptor desc, org.eclipse.debug.core.ILaunchMode mode)
-
getLaunchTargets
public ILaunchTarget[] getLaunchTargets(ILaunchDescriptor descriptor)
- Specified by:
getLaunchTargetsin interfaceILaunchBarManager
-
supportsTarget
boolean supportsTarget(ILaunchDescriptor descriptor, ILaunchTarget target)
-
getActiveLaunchTarget
public ILaunchTarget getActiveLaunchTarget()
- Specified by:
getActiveLaunchTargetin interfaceILaunchBarManager
-
setLaunchTarget
public void setLaunchTarget(ILaunchDescriptor desc, ILaunchTarget target) throws org.eclipse.core.runtime.CoreException
Sets preferred target for launch descriptor- Parameters:
desc-target-- Throws:
org.eclipse.core.runtime.CoreException
-
setActiveLaunchTarget
public void setActiveLaunchTarget(ILaunchTarget target) throws org.eclipse.core.runtime.CoreException
- Specified by:
setActiveLaunchTargetin interfaceILaunchBarManager- Throws:
org.eclipse.core.runtime.CoreException
-
storeLaunchTarget
private void storeLaunchTarget(ILaunchDescriptor desc, ILaunchTarget target)
-
fireActiveLaunchTargetChanged
private void fireActiveLaunchTargetChanged()
-
getDefaultLaunchTarget
private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor)
-
getActiveLaunchConfiguration
public org.eclipse.debug.core.ILaunchConfiguration getActiveLaunchConfiguration() throws org.eclipse.core.runtime.CoreException- Specified by:
getActiveLaunchConfigurationin interfaceILaunchBarManager- Throws:
org.eclipse.core.runtime.CoreException
-
getLaunchConfiguration
public org.eclipse.debug.core.ILaunchConfiguration getLaunchConfiguration(ILaunchDescriptor descriptor, ILaunchTarget target) throws org.eclipse.core.runtime.CoreException
- Specified by:
getLaunchConfigurationin interfaceILaunchBarManager- Throws:
org.eclipse.core.runtime.CoreException
-
addListener
public void addListener(ILaunchBarListener listener)
Description copied from interface:ILaunchBarManagerAdd a listener that can react to launch bar changes- Specified by:
addListenerin interfaceILaunchBarManager
-
removeListener
public void removeListener(ILaunchBarListener listener)
Description copied from interface:ILaunchBarManagerRemove a listener- Specified by:
removeListenerin interfaceILaunchBarManager
-
launchConfigurationAdded
public void launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration configuration)
- Specified by:
launchConfigurationAddedin interfaceorg.eclipse.debug.core.ILaunchConfigurationListener
-
launchConfigurationRemoved
public void launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration configuration)
- Specified by:
launchConfigurationRemovedin interfaceorg.eclipse.debug.core.ILaunchConfigurationListener
-
launchConfigurationChanged
public void launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration configuration)
- Specified by:
launchConfigurationChangedin interfaceorg.eclipse.debug.core.ILaunchConfigurationListener
-
dispose
public void dispose()
-
fireLaunchTargetsChanged
private void fireLaunchTargetsChanged()
-
launchTargetAdded
public void launchTargetAdded(ILaunchTarget target)
Description copied from interface:ILaunchTargetListenerA launch target was added.- Specified by:
launchTargetAddedin interfaceILaunchTargetListener- Parameters:
target- the new launch target
-
launchTargetRemoved
public void launchTargetRemoved(ILaunchTarget target)
Description copied from interface:ILaunchTargetListenerA launch target was removed.- Specified by:
launchTargetRemovedin interfaceILaunchTargetListener- Parameters:
target- the target about to be removed.
-
getLaunchDescriptor
private ILaunchDescriptor getLaunchDescriptor(org.eclipse.debug.core.ILaunchConfiguration configuration, ILaunchTarget target)
-
launchDescriptorMatches
private boolean launchDescriptorMatches(ILaunchDescriptor desc, org.eclipse.debug.core.ILaunchConfiguration configuration, ILaunchTarget target)
-
-