Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2012-05-11 10:14:37 +0000
committerUwe Stieber2012-05-11 10:14:37 +0000
commit1051656fd709b3af2ee69f6eebdbc81fe03bf2e6 (patch)
tree1d96cc38cc857da2ecf017b3ee72002e7ade79f2 /target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te
parentb1b25b04fd882636c40887119a2b8c41ce4dd2e9 (diff)
downloadorg.eclipse.tcf-1051656fd709b3af2ee69f6eebdbc81fe03bf2e6.tar.gz
org.eclipse.tcf-1051656fd709b3af2ee69f6eebdbc81fe03bf2e6.tar.xz
org.eclipse.tcf-1051656fd709b3af2ee69f6eebdbc81fe03bf2e6.zip
Target Explorer: ADD favorites handling for launches
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java13
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/preferences/IPreferenceKeys.java118
3 files changed, 80 insertions, 56 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java
index 7b1e152f7..458b6ed1a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/delegates/DefaultLaunchManagerDelegate.java
@@ -16,6 +16,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.UUID;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
@@ -30,6 +31,7 @@ import org.eclipse.tcf.te.launch.core.interfaces.IReferencedProjectItem;
import org.eclipse.tcf.te.launch.core.interfaces.tracing.ITraceIds;
import org.eclipse.tcf.te.launch.core.lm.LaunchConfigSorter;
import org.eclipse.tcf.te.launch.core.lm.LaunchSpecification;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ICommonLaunchAttributes;
import org.eclipse.tcf.te.launch.core.lm.interfaces.IFileTransferLaunchAttributes;
import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchAttribute;
import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchContextLaunchAttributes;
@@ -37,6 +39,7 @@ import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchManagerDelegate;
import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
import org.eclipse.tcf.te.launch.core.lm.interfaces.IReferencedProjectLaunchAttributes;
import org.eclipse.tcf.te.launch.core.nls.Messages;
+import org.eclipse.tcf.te.launch.core.persistence.DefaultPersistenceDelegate;
import org.eclipse.tcf.te.launch.core.persistence.filetransfer.FileTransfersPersistenceDelegate;
import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
import org.eclipse.tcf.te.launch.core.persistence.projects.ReferencedProjectsPersistenceDelegate;
@@ -71,6 +74,11 @@ public class DefaultLaunchManagerDelegate extends ExecutableExtension implements
public void initLaunchConfigAttributes(ILaunchConfigurationWorkingCopy wc, ILaunchSpecification launchSpec) {
Assert.isNotNull(wc);
Assert.isNotNull(launchSpec);
+
+ if (!DefaultPersistenceDelegate.hasAttribute(wc, ICommonLaunchAttributes.ATTR_UUID)) {
+ DefaultPersistenceDelegate.setAttribute(wc, ICommonLaunchAttributes.ATTR_UUID, UUID.randomUUID().toString());
+ }
+
validateLaunchSpecification(launchSpec);
}
@@ -81,6 +89,11 @@ public class DefaultLaunchManagerDelegate extends ExecutableExtension implements
public void updateLaunchConfigAttributes(ILaunchConfigurationWorkingCopy wc, ILaunchSpecification launchSpec) {
Assert.isNotNull(wc);
Assert.isNotNull(launchSpec);
+
+ if (!DefaultPersistenceDelegate.hasAttribute(wc, ICommonLaunchAttributes.ATTR_UUID)) {
+ DefaultPersistenceDelegate.setAttribute(wc, ICommonLaunchAttributes.ATTR_UUID, UUID.randomUUID().toString());
+ }
+
validateLaunchSpecification(launchSpec);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java
index 85caec4a9..0ca5cdc25 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/lm/interfaces/ICommonLaunchAttributes.java
@@ -20,6 +20,11 @@ public interface ICommonLaunchAttributes {
public static final String ATTR_PREFIX = "org.eclipse.tcf.te.launch"; //$NON-NLS-1$
/**
+ * Unique identifier.
+ */
+ public static final String ATTR_UUID = ATTR_PREFIX + ".UUID"; //$NON-NLS-1$
+
+ /**
* Time stamp when last launched.
*/
public static final String ATTR_LAST_LAUNCHED = ATTR_PREFIX + ".lastLaunched"; //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/preferences/IPreferenceKeys.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/preferences/IPreferenceKeys.java
index cee4ca5d8..cbfa4ee84 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/preferences/IPreferenceKeys.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/preferences/IPreferenceKeys.java
@@ -1,56 +1,62 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
- * This program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.launch.core.preferences;
-
-
-/**
- * The locator model bundle preference key identifiers.
- */
-public interface IPreferenceKeys {
- /**
- * Common prefix for all core preference keys
- */
- public final String PREFIX = "te.launch.core."; //$NON-NLS-1$
-
- /**
- * Launch configuration find/create mode: Always create new launch configurations.
- */
- public static final int MODE_ALWAYS_NEW = 0;
-
- /**
- * Launch configuration find/create mode: Re-use launch configuration if all attributes are matching.
- */
- public static final int MODE_FULL_MATCH_LAUNCH_CONFIG = 1;
-
- /**
- * Launch configuration find/create mode: Re-use launch configuration if the target ID matches.
- */
- public static final int MODE_FULL_MATCH_TARGET = 2;
-
- /**
- * Launch configuration find/create mode: Re-use first matching launch configuration.
- */
- public static final int MODE_FIRST_MATCHING = 3;
-
- /**
- * Launch configuration find/create mode. See the <code>MODE_*</code> constants.
- */
- public static final String PREF_LAUNCH_CONFIG_FIND_CREATE_MODE = PREFIX + "launchConfigFindCreateMode"; //$NON-NLS-1$
-
- /**
- * If set to <code>true</code>, project references will be added by default to newly created launch configurations.
- */
- public static final String PREF_ADD_PROJECT_TO_NEW_LAUNCH_CONFIG = PREFIX + "addProjectToNewLaunchConfig"; //$NON-NLS-1$
-
- /**
- * If set to <code>true</code>, launches are sorted by their last launched time stamp.
- */
- public static final String PREF_SORT_LAUNCHES_BY_LAST_LAUNCHED = PREFIX + ".sortLaunchesByLastLaunched"; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.launch.core.preferences;
+
+
+/**
+ * The locator model bundle preference key identifiers.
+ */
+public interface IPreferenceKeys {
+ /**
+ * Common prefix for all core preference keys
+ */
+ public final String PREFIX = "te.launch.core."; //$NON-NLS-1$
+
+ /**
+ * Launch configuration find/create mode: Always create new launch configurations.
+ */
+ public static final int MODE_ALWAYS_NEW = 0;
+
+ /**
+ * Launch configuration find/create mode: Re-use launch configuration if all attributes are matching.
+ */
+ public static final int MODE_FULL_MATCH_LAUNCH_CONFIG = 1;
+
+ /**
+ * Launch configuration find/create mode: Re-use launch configuration if the target ID matches.
+ */
+ public static final int MODE_FULL_MATCH_TARGET = 2;
+
+ /**
+ * Launch configuration find/create mode: Re-use first matching launch configuration.
+ */
+ public static final int MODE_FIRST_MATCHING = 3;
+
+ /**
+ * Launch configuration find/create mode. See the <code>MODE_*</code> constants.
+ */
+ public static final String PREF_LAUNCH_CONFIG_FIND_CREATE_MODE = PREFIX + "launchConfigFindCreateMode"; //$NON-NLS-1$
+
+ /**
+ * If set to <code>true</code>, project references will be added by default to newly created launch configurations.
+ */
+ public static final String PREF_ADD_PROJECT_TO_NEW_LAUNCH_CONFIG = PREFIX + "addProjectToNewLaunchConfig"; //$NON-NLS-1$
+
+ /**
+ * If set to <code>true</code>, launches are sorted by their last launched time stamp.
+ */
+ public static final String PREF_SORT_LAUNCHES_BY_LAST_LAUNCHED = PREFIX + ".sortLaunchesByLastLaunched"; //$NON-NLS-1$
+
+ /**
+ * Preference key to access the flag to hide favorite launches content extension.
+ */
+ public static final String PREF_HIDE_FAVORITE_LAUNCHES_EXTENSION = "org.eclipse.tcf.te.tcf.launch.ui.navigator.favorites.content.hide"; //$NON-NLS-1$
+
+}

Back to the top