Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 228315 Details for
Bug 402787
Move ETFW Version menu to preference page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patches org.eclipse.ptp.etfw
org.eclipse.ptp.etfw.patch (text/plain), 28.12 KB, created by
Chris Navarro
on 2013-03-12 16:44:57 EDT
(
hide
)
Description:
patches org.eclipse.ptp.etfw
Filename:
MIME Type:
Creator:
Chris Navarro
Created:
2013-03-12 16:44:57 EDT
Size:
28.12 KB
patch
obsolete
>diff --git a/tools/etfw/org.eclipse.ptp.etfw/META-INF/MANIFEST.MF b/tools/etfw/org.eclipse.ptp.etfw/META-INF/MANIFEST.MF >index 9cda021..1ff77ce 100644 >--- a/tools/etfw/org.eclipse.ptp.etfw/META-INF/MANIFEST.MF >+++ b/tools/etfw/org.eclipse.ptp.etfw/META-INF/MANIFEST.MF >@@ -29,5 +29,5 @@ > Bundle-Vendor: %pluginProvider > Bundle-RequiredExecutionEnvironment: J2SE-1.5 > Export-Package: org.eclipse.ptp.etfw, >- org.eclipse.ptp.etfw.internal;x-friends:="org.eclipse.ptp.etfw.tau,org.eclipse.ptp.etfw.tau.perfdmf", >+ org.eclipse.ptp.etfw.internal;x-friends:="org.eclipse.ptp.etfw.tau,org.eclipse.ptp.etfw.tau.perfdmf,org.eclipse.ptp.etfw.tau.ui", > org.eclipse.ptp.etfw.ui;x-friends:="org.eclipse.ptp.etfw.tau,org.eclipse.ptp.etfw.launch" >diff --git a/tools/etfw/org.eclipse.ptp.etfw/plugin.xml b/tools/etfw/org.eclipse.ptp.etfw/plugin.xml >index 57c8e02..4ba83ec 100644 >--- a/tools/etfw/org.eclipse.ptp.etfw/plugin.xml >+++ b/tools/etfw/org.eclipse.ptp.etfw/plugin.xml >@@ -72,4 +72,10 @@ > type="org.eclipse.cdt.launch.applicationLaunchType"> > </launchDelegate> > </extension> >+ <extension >+ point="org.eclipse.core.runtime.preferences"> >+ <initializer >+ class="org.eclipse.ptp.etfw.internal.PreferenceInitializer"> >+ </initializer> >+ </extension> > </plugin> >diff --git a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/IToolLaunchConfigurationConstants.java b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/IToolLaunchConfigurationConstants.java >index c38b154..ee7441d 100644 >--- a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/IToolLaunchConfigurationConstants.java >+++ b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/IToolLaunchConfigurationConstants.java >@@ -48,17 +48,17 @@ > /** > * @since 6.0 > */ >- public static final String ETFW_VERSION = "ETFW_VERSION"; >+ public static final String ETFW_VERSION = "ETFW_VERSION"; //$NON-NLS-1$ > > /** > * @since 6.0 > */ >- public static final String USE_SAX_PARSER = "sax-parser"; >+ public static final String USE_SAX_PARSER = "sax-parser"; //$NON-NLS-1$ > > /** > * @since 6.0 > */ >- public static final String USE_JAXB_PARSER = "jaxb-parser"; >+ public static final String USE_JAXB_PARSER = "jaxb-parser"; //$NON-NLS-1$ > /** > * ID for boolean: true = keep instrumented executable > */ >diff --git a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/PreferenceConstants.java b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/PreferenceConstants.java >new file mode 100644 >index 0000000..5b8d39e >--- /dev/null >+++ b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/PreferenceConstants.java >@@ -0,0 +1,11 @@ >+package org.eclipse.ptp.etfw; >+ >+/** >+ * Preference constants for the external tools framework >+ * >+ * @since 6.0 >+ * >+ */ >+public interface PreferenceConstants { >+ public static final String ETFW_VERSION = "ETFW_VERSION"; //$NON-NLS-1$ >+} >diff --git a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/Preferences.java b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/Preferences.java >new file mode 100644 >index 0000000..bc4ac91 >--- /dev/null >+++ b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/Preferences.java >@@ -0,0 +1,511 @@ >+package org.eclipse.ptp.etfw; >+ >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.core.runtime.preferences.DefaultScope; >+import org.eclipse.core.runtime.preferences.IEclipsePreferences; >+import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; >+import org.eclipse.core.runtime.preferences.IScopeContext; >+import org.eclipse.core.runtime.preferences.InstanceScope; >+import org.eclipse.ptp.remote.core.PTPRemoteCorePlugin; >+import org.osgi.service.prefs.BackingStoreException; >+ >+/** >+ * Convenience class to facilitate using the new {@link IEclipsePreferences} story. Adapted from >+ * org.eclipse.debug.internal.core.Preferences. >+ * >+ * @since 6.0 >+ * @noinstantiate This class is not intended to be instantiated by clients. >+ */ >+public final class Preferences { >+ private static final IScopeContext[] contexts = new IScopeContext[] { DefaultScope.INSTANCE, InstanceScope.INSTANCE }; >+ >+ private static final int DEFAULT_CONTEXT = 0; >+ private static final int INSTANCE_CONTEXT = 1; >+ >+ /** >+ * Adds the given preference listener to the {@link DefaultScope} and the {@link InstanceScope} >+ * >+ * @param qualifier >+ * @param listener >+ */ >+ public static void addPreferenceChangeListener(String qualifier, IPreferenceChangeListener listener) { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).addPreferenceChangeListener(listener); >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).addPreferenceChangeListener(listener); >+ } >+ >+ /** >+ * Returns whether the named preference is know in the preference store. >+ * >+ * @param qualifier >+ * @param name >+ * @return >+ */ >+ public static boolean contains(String qualifier, String name) { >+ return (contexts[INSTANCE_CONTEXT].getNode(qualifier).get(name, null) != null || contexts[DEFAULT_CONTEXT].getNode( >+ qualifier).get(name, null) != null); >+ } >+ >+ /** >+ * Returns the value in the preference store for the given key. If the key >+ * is not defined then return the default value. Use the canonical scope >+ * lookup order for finding the preference value. >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the value of the preference or the given default value >+ */ >+ public static boolean getBoolean(String qualifier, String key) { >+ return Platform.getPreferencesService().getBoolean(qualifier, key, false, null); >+ } >+ >+ /** >+ * Returns the value in the preference store for the given key. If the key >+ * is not defined then return the default value. Use the canonical scope >+ * lookup order for finding the preference value. >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the value of the preference or the given default value >+ */ >+ public static byte[] getByteArray(String qualifier, String key) { >+ return Platform.getPreferencesService().getByteArray(qualifier, key, null, null); >+ } >+ >+ /** >+ * Returns the default boolean value stored in the {@link DefaultScope} for >+ * the given key or the specified default value if the key does not appear >+ * in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the boolean value set in the {@link DefaultScope} for the given >+ * key, or the specified default value. >+ */ >+ public static synchronized boolean getDefaultBoolean(String qualifier, String key, boolean defaultvalue) { >+ return contexts[DEFAULT_CONTEXT].getNode(qualifier).getBoolean(key, defaultvalue); >+ } >+ >+ /** >+ * Returns the default byte array value stored in the {@link DefaultScope} for the given key or the specified default value if >+ * the key does not >+ * appear in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the byte array value set in the {@link DefaultScope} for the >+ * given key, or the specified default value. >+ */ >+ public static synchronized byte[] getDefaultByteArray(String qualifier, String key, byte[] defaultvalue) { >+ return contexts[DEFAULT_CONTEXT].getNode(qualifier).getByteArray(key, defaultvalue); >+ } >+ >+ /** >+ * Returns the default double value stored in the {@link DefaultScope} for >+ * the given key or the specified default value if the key does not appear >+ * in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the double value set in the {@link DefaultScope} for the given >+ * key, or the specified default value. >+ */ >+ public static synchronized double getDefaultDouble(String qualifier, String key, double defaultvalue) { >+ return contexts[DEFAULT_CONTEXT].getNode(qualifier).getDouble(key, defaultvalue); >+ } >+ >+ /** >+ * Returns the default float value stored in the {@link DefaultScope} for >+ * the given key or the specified default value if the key does not appear >+ * in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the float value set in the {@link DefaultScope} for the given >+ * key, or the specified default value. >+ */ >+ public static synchronized float getDefaultFloat(String qualifier, String key, float defaultvalue) { >+ return contexts[DEFAULT_CONTEXT].getNode(qualifier).getFloat(key, defaultvalue); >+ } >+ >+ /** >+ * Returns the default integer value stored in the {@link DefaultScope} for >+ * the given key or the specified default value if the key does not appear >+ * in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the integer value set in the {@link DefaultScope} for the given >+ * key, or the specified default value. >+ */ >+ public static synchronized int getDefaultInt(String qualifier, String key, int defaultvalue) { >+ return contexts[DEFAULT_CONTEXT].getNode(qualifier).getInt(key, defaultvalue); >+ } >+ >+ /** >+ * Returns the default long value stored in the {@link DefaultScope} for the >+ * given key or the specified default value if the key does not appear in >+ * the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the long value set in the {@link DefaultScope} for the given key, >+ * or the specified default value. >+ */ >+ public static synchronized long getDefaultLong(String qualifier, String key, long defaultvalue) { >+ return contexts[DEFAULT_CONTEXT].getNode(qualifier).getLong(key, defaultvalue); >+ } >+ >+ /** >+ * Returns the default string value stored in the {@link DefaultScope} for >+ * the given key or the specified default value if the key does not appear >+ * in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the string value set in the {@link DefaultScope} for the given >+ * key, or the specified default value. >+ */ >+ public static synchronized String getDefaultString(String qualifier, String key, String defaultvalue) { >+ return contexts[DEFAULT_CONTEXT].getNode(qualifier).get(key, defaultvalue); >+ } >+ >+ /** >+ * Returns the value in the preference store for the given key. If the key >+ * is not defined then return the default value. Use the canonical scope >+ * lookup order for finding the preference value. >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the value of the preference or the given default value >+ */ >+ public static double getDouble(String qualifier, String key) { >+ return Platform.getPreferencesService().getDouble(qualifier, key, 0.0, null); >+ } >+ >+ /** >+ * Returns the value in the preference store for the given key. If the key >+ * is not defined then return the default value. Use the canonical scope >+ * lookup order for finding the preference value. >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the value of the preference or the given default value >+ */ >+ public static float getFloat(String qualifier, String key) { >+ return Platform.getPreferencesService().getFloat(qualifier, key, 0.0f, null); >+ } >+ >+ /** >+ * Returns the value in the preference store for the given key. If the key >+ * is not defined then return the default value. Use the canonical scope >+ * lookup order for finding the preference value. >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the value of the preference or the given default value >+ */ >+ public static int getInt(String qualifier, String key) { >+ return Platform.getPreferencesService().getInt(qualifier, key, 0, null); >+ } >+ >+ /** >+ * Returns the value in the preference store for the given key. If the key >+ * is not defined then return the default value. Use the canonical scope >+ * lookup order for finding the preference value. >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the value of the preference or the given default value >+ */ >+ public static long getLong(String qualifier, String key) { >+ return Platform.getPreferencesService().getLong(qualifier, key, 0L, null); >+ } >+ >+ /** >+ * Returns the value in the preference store for the given key. If the key >+ * is not defined then return the default value. Use the canonical scope >+ * lookup order for finding the preference value. >+ * >+ * @param qualifier >+ * @param key >+ * @param defaultvalue >+ * >+ * @return the value of the preference or the given default value >+ */ >+ public static String getString(String qualifier, String key) { >+ return Platform.getPreferencesService().getString(qualifier, key, null, null); >+ } >+ >+ /** >+ * Returns true if the named preference has the default value. >+ * >+ * @param qualifier >+ * @param name >+ * @return >+ */ >+ public static boolean isDefault(String qualifier, String name) { >+ String defVal = contexts[DEFAULT_CONTEXT].getNode(qualifier).get(name, null); >+ if (defVal != null) { >+ String val = contexts[INSTANCE_CONTEXT].getNode(qualifier).get(name, null); >+ return (val != null && val.equals(defVal)); >+ } >+ return false; >+ } >+ >+ /** >+ * Removes the given preference listener from the {@link DefaultScope} and >+ * the {@link InstanceScope} >+ * >+ * @param qualifier >+ * @param listener >+ */ >+ public static void removePreferenceChangeListener(String qualifier, IPreferenceChangeListener listener) { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).removePreferenceChangeListener(listener); >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).removePreferenceChangeListener(listener); >+ } >+ >+ /** >+ * Save the preferences for the given plugin identifier. It should be noted >+ * that all pending preference changes will be flushed with this method. >+ * >+ * @param qualifier >+ */ >+ public static synchronized void savePreferences(String qualifier) { >+ try { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).flush(); >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).flush(); >+ } catch (BackingStoreException bse) { >+ PTPRemoteCorePlugin.log(bse); >+ } >+ } >+ >+ /** >+ * Sets a boolean preference in the {@link InstanceScope}. >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the value >+ */ >+ public static synchronized void setBoolean(String qualifier, String key, boolean value) { >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).putBoolean(key, value); >+ } >+ >+ /** >+ * Sets a byte array preference in the {@link InstanceScope}. >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the value >+ */ >+ public static synchronized void setByteArray(String qualifier, String key, byte[] value) { >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).putByteArray(key, value); >+ } >+ >+ /** >+ * Sets a boolean in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the new value >+ */ >+ public static synchronized void setDefaultBoolean(String qualifier, String key, boolean value) { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).putBoolean(key, value); >+ } >+ >+ /** >+ * Sets a byte array in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the new value >+ */ >+ public static synchronized void setDefaultByteArray(String qualifier, String key, byte[] value) { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).putByteArray(key, value); >+ } >+ >+ /** >+ * Sets a double in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the new value >+ */ >+ public static synchronized void setDefaultDouble(String qualifier, String key, double value) { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).putDouble(key, value); >+ } >+ >+ /** >+ * Sets a float in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the new value >+ */ >+ public static synchronized void setDefaultFloat(String qualifier, String key, float value) { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).putFloat(key, value); >+ } >+ >+ /** >+ * Sets a integer in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the new value >+ */ >+ public static synchronized void setDefaultInt(String qualifier, String key, int value) { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).putInt(key, value); >+ } >+ >+ /** >+ * Sets a long in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the new value >+ */ >+ public static synchronized void setDefaultLong(String qualifier, String key, long value) { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).putLong(key, value); >+ } >+ >+ /** >+ * Sets a string in the {@link DefaultScope} >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the new value >+ */ >+ public static synchronized void setDefaultString(String qualifier, String key, String value) { >+ contexts[DEFAULT_CONTEXT].getNode(qualifier).put(key, value); >+ } >+ >+ /** >+ * Sets a double preference in the {@link InstanceScope}. >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the value >+ */ >+ public static synchronized void setDouble(String qualifier, String key, double value) { >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).putDouble(key, value); >+ } >+ >+ /** >+ * Sets a float preference in the {@link InstanceScope}. >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the value >+ */ >+ public static synchronized void setFloat(String qualifier, String key, float value) { >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).putFloat(key, value); >+ } >+ >+ /** >+ * Sets a integer preference in the {@link InstanceScope}. >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the value >+ */ >+ public static synchronized void setInt(String qualifier, String key, int value) { >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).putInt(key, value); >+ } >+ >+ /** >+ * Sets a long preference in the {@link InstanceScope}. >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the value >+ */ >+ public static synchronized void setLong(String qualifier, String key, long value) { >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).putLong(key, value); >+ } >+ >+ /** >+ * Sets a string preference in the {@link InstanceScope}. >+ * >+ * @param qualifier >+ * @param key >+ * the key >+ * @param value >+ * the value >+ */ >+ public static synchronized void setString(String qualifier, String key, String value) { >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).put(key, value); >+ } >+ >+ /** >+ * Sets the given preference to its default value. This is done by removing >+ * any set value from the {@link InstanceScope}. Has no effect if the given >+ * key is <code>null</code>. >+ * >+ * @param qualifier >+ * @param key >+ * the key for the preference >+ */ >+ public static synchronized void setToDefault(String qualifier, String key) { >+ if (key != null) { >+ contexts[INSTANCE_CONTEXT].getNode(qualifier).remove(key); >+ } >+ } >+ >+ /** >+ * Constructor >+ */ >+ private Preferences() { >+ // no direct instantiation >+ } >+} >diff --git a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/internal/PreferenceInitializer.java b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/internal/PreferenceInitializer.java >new file mode 100644 >index 0000000..cbda8cf >--- /dev/null >+++ b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/internal/PreferenceInitializer.java >@@ -0,0 +1,20 @@ >+package org.eclipse.ptp.etfw.internal; >+ >+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; >+import org.eclipse.ptp.etfw.Activator; >+import org.eclipse.ptp.etfw.IToolLaunchConfigurationConstants; >+import org.eclipse.ptp.etfw.PreferenceConstants; >+import org.eclipse.ptp.etfw.Preferences; >+ >+/** >+ * Initializes default preferences for the external tools framework >+ * >+ */ >+public class PreferenceInitializer extends AbstractPreferenceInitializer { >+ >+ @Override >+ public void initializeDefaultPreferences() { >+ Preferences.setDefaultString(Activator.PLUGIN_ID, PreferenceConstants.ETFW_VERSION, >+ IToolLaunchConfigurationConstants.USE_JAXB_PARSER); >+ } >+} >diff --git a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/messages/Messages.java b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/messages/Messages.java >index c4aca13..5c6ef8f 100644 >--- a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/messages/Messages.java >+++ b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/messages/Messages.java >@@ -75,10 +75,12 @@ > public static String ParametricParameterTab_SelectPerfExScript; > public static String ParametricParameterTab_Values; > public static String ExternalToolPreferencePage_Add; >+ public static String ExternalToolPreferencePage_ETFW_PARSER; > public static String ExternalToolPreferencePage_ExToolConf; > public static String ExternalToolPreferencePage_Remove; > public static String ExternalToolPreferencePage_SelectToolDefXML; > public static String ExternalToolPreferencePage_ToolDefFile; >+ public static String ExternalToolPreferencePage_ToolParser; > public static String ToolLocationPreferencePage_BinDir; > public static String ToolLocationPreferencePage_BinDirectory; > public static String ToolLocationPreferencePage_Browse; >diff --git a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/messages/messages.properties b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/messages/messages.properties >index 14a3242..69d7083 100644 >--- a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/messages/messages.properties >+++ b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/messages/messages.properties >@@ -69,10 +69,12 @@ > ParametricParameterTab_SelectPerfExScript=Select a PerfExplorer script > ParametricParameterTab_Values=Values > ExternalToolPreferencePage_Add=Add >+ExternalToolPreferencePage_ETFW_PARSER=ETFW Parser: > ExternalToolPreferencePage_ExToolConf=External Tool Configuration > ExternalToolPreferencePage_Remove=Remove > ExternalToolPreferencePage_SelectToolDefXML=Select tool definition xml file > ExternalToolPreferencePage_ToolDefFile=Tool Definition File: >+ExternalToolPreferencePage_ToolParser=External Tool Parser > ToolLocationPreferencePage_BinDir=\ Bin Directory: > ToolLocationPreferencePage_BinDirectory=\ Bin Directory > ToolLocationPreferencePage_Browse=Browse >diff --git a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/preferences/ExternalToolPreferencePage.java b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/preferences/ExternalToolPreferencePage.java >index 75b65bb..685c182 100644 >--- a/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/preferences/ExternalToolPreferencePage.java >+++ b/tools/etfw/org.eclipse.ptp.etfw/src/org/eclipse/ptp/etfw/preferences/ExternalToolPreferencePage.java >@@ -36,7 +36,9 @@ > import org.eclipse.jface.util.PropertyChangeEvent; > import org.eclipse.ptp.etfw.Activator; > import org.eclipse.ptp.etfw.IToolLaunchConfigurationConstants; >+import org.eclipse.ptp.etfw.PreferenceConstants; > import org.eclipse.ptp.etfw.messages.Messages; >+import org.eclipse.ptp.remote.core.Preferences; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.ModifyEvent; > import org.eclipse.swt.events.ModifyListener; >@@ -45,6 +47,7 @@ > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Combo; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.FileDialog; >@@ -68,6 +71,7 @@ > protected List XMLLocs = null; > protected Button browseXMLButton = null; > protected Button removeItemButton = null; >+ protected Combo parser = null; > > // protected Button checkAutoOpts=null; > // protected Button checkAixOpts=null; >@@ -111,10 +115,31 @@ > composite.setLayout(createGridLayout(1, true, 0, 0)); > composite.setLayoutData(spanGridData(GridData.FILL_HORIZONTAL, 2)); > >+ createParserSelection(composite); > createTauConf(composite); > loadSaved(); > defaultSetting(); > return composite; >+ } >+ >+ private void createParserSelection(Composite parent) { >+ Group group = new Group(parent, SWT.SHADOW_ETCHED_IN); >+ group.setLayout(createGridLayout(1, true, 10, 10)); >+ group.setLayoutData(spanGridData(GridData.FILL_HORIZONTAL, 2)); >+ group.setText(Messages.ExternalToolPreferencePage_ToolParser); >+ >+ Composite content = new Composite(group, SWT.NONE); >+ content.setLayout(createGridLayout(2, false, 0, 0)); >+ content.setLayoutData(spanGridData(GridData.FILL_HORIZONTAL, SWT.WRAP)); >+ >+ Label parserLbl = new Label(content, SWT.NONE); >+ parserLbl.setText(Messages.ExternalToolPreferencePage_ETFW_PARSER); >+ >+ parser = new Combo(content, SWT.READ_ONLY); >+ parser.add(USE_SAX_PARSER); >+ parser.add(USE_JAXB_PARSER); >+ // Text parser = new Text(content, SWT.BORDER); >+ // parser.setLayoutData(spanGridData(GridData.FILL_HORIZONTAL, 1)); > } > > /** >@@ -191,10 +216,14 @@ > // TODO Auto-generated catch block > > path = EFS.getLocalFileSystem().getStore(new Path(correctPath)); >- //e.printStackTrace(); >+ // e.printStackTrace(); > } >- if (path!=null&&path.fetchInfo().exists()) >- dialog.setFilterPath(!path.fetchInfo().isDirectory() ? correctPath : path.getParent().toURI().getPath()); //TODO: This may be bad >+ if (path != null && path.fetchInfo().exists()) >+ dialog.setFilterPath(!path.fetchInfo().isDirectory() ? correctPath : path.getParent().toURI().getPath()); // TODO: >+ // This >+ // may >+ // be >+ // bad > } > > // String tlpath = correctPath+File.separator+"lib"; >@@ -215,7 +244,7 @@ > String out = getFieldContent(dialog.open()); > > if (out != null) { >- IFileStore test = EFS.getLocalFileSystem().getStore(new Path(out));//new IFFile(out); >+ IFileStore test = EFS.getLocalFileSystem().getStore(new Path(out));// new IFFile(out); > if (test.fetchInfo().exists() && !test.fetchInfo().isDirectory()) { > XMLLocs.add(out); > } else { >@@ -247,14 +276,22 @@ > } > > private void loadSaved() { >- >- //Preferences preferences = Activator.getDefault().getPluginPreferences(); >+ >+ // Preferences preferences = Activator.getDefault().getPluginPreferences(); > IPreferencesService service = Platform.getPreferencesService(); >- String fiList = service.getString(Activator.PLUGIN_ID, XMLLOCID, "", null);//.getString(XMLLOCID); >+ String fiList = service.getString(Activator.PLUGIN_ID, XMLLOCID, EMPTY_STRING, null);// .getString(XMLLOCID); > > String[] files = fiList.split(",,,"); //$NON-NLS-1$ > for (String s : files) { > XMLLocs.add(s);// setText(preferences.getString(XMLLOCID)); >+ } >+ >+ String etfwVersion = Preferences.getString(Activator.PLUGIN_ID, PreferenceConstants.ETFW_VERSION); >+ for (int index = 0; index < parser.getItemCount(); index++) { >+ if (parser.getItem(index).equals(etfwVersion)) { >+ parser.select(index); >+ break; >+ } > } > // TODO: Add checks > // checkAutoOpts.setSelection(preferences.getBoolean(ITAULaunchConfigurationConstants.TAU_CHECK_AUTO_OPT)); >@@ -262,12 +299,12 @@ > // checkAixOpts.setSelection(preferences.getBoolean(ITAULaunchConfigurationConstants.TAU_CHECK_AIX_OPT)); > } > >+ @Override > public boolean performOk() { >- //Activator.getDefault().getPluginPreferences(); >+ // Activator.getDefault().getPluginPreferences(); > >- > IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); >- >+ > String fiList = ""; //$NON-NLS-1$ > > for (int i = 0; i < XMLLocs.getItemCount(); i++) { >@@ -284,6 +321,8 @@ > e.printStackTrace(); > } > Activator.getDefault().refreshTools(); >+ >+ Preferences.setString(Activator.PLUGIN_ID, PreferenceConstants.ETFW_VERSION, parser.getItem(parser.getSelectionIndex())); > // TODO: Add checks > // preferences.setValue(ITAULaunchConfigurationConstants.TAU_CHECK_AUTO_OPT, > // checkAutoOpts.getSelection()); >@@ -313,10 +352,12 @@ > protected void defaultSetting() { > } > >+ @Override > public void dispose() { > super.dispose(); > } > >+ @Override > public void performDefaults() { > defaultSetting(); > updateApplyButton();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 402787
: 228315 |
228317