Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlain Magloire2003-10-14 20:36:34 +0000
committerAlain Magloire2003-10-14 20:36:34 +0000
commit71c5ec9d072253d47043a8a17001f2c25bc8f0ef (patch)
tree78488428183db7cc6ef90a0999b72aa631725536 /core
parent833492ccf092cb9f2338df65711a0556cd4c635d (diff)
downloadorg.eclipse.cdt-71c5ec9d072253d47043a8a17001f2c25bc8f0ef.tar.gz
org.eclipse.cdt-71c5ec9d072253d47043a8a17001f2c25bc8f0ef.tar.xz
org.eclipse.cdt-71c5ec9d072253d47043a8a17001f2c25bc8f0ef.zip
New method added in ICOptionPage
Preferences getPreferences()
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java3
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java8
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java26
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java4
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java13
5 files changed, 38 insertions, 16 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java
index 24292decd36..923593a259f 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/AbstractBinaryParserPage.java
@@ -99,6 +99,9 @@ public abstract class AbstractBinaryParserPage extends AbstractCOptionPage {
public void setContainer(ICOptionContainer container) {
super.setContainer(container);
initializeParserPageMap();
+ ICOptionPage page = getCurrentBinaryParserPage();
+ if (page != null)
+ page.setContainer(container);
}
public ICOptionPage getBinaryParserPage(String parserID) {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java
index f9602944da3..0833f1cc69c 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/BinaryParserBlock.java
@@ -116,7 +116,6 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(getContainer().getProject());
desc.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
desc.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, (String) idMap.get(selected));
- CCorePlugin.getDefault().getCoreModel().resetBinaryParser(getContainer().getProject());
} else {
fPrefs.setValue(CCorePlugin.PREF_BINARY_PARSER, (String) idMap.get(selected));
}
@@ -128,11 +127,17 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
// We have to do it last to make sure the parser id is save
// in .cdtproject
super.performApply(new SubProgressMonitor(monitor, 1));
+
+ // Reset the binary parser the paths may have change.
+ if (getContainer().getProject() != null)
+ CCorePlugin.getDefault().getCoreModel().resetBinaryParser(getContainer().getProject());
+
monitor.done();
}
public void setContainer(ICOptionContainer container) {
super.setContainer(container);
+
IExtensionPoint point = CCorePlugin.getDefault().getDescriptor().getExtensionPoint(CCorePlugin.BINARY_PARSER_SIMPLE_ID);
if (point != null) {
IExtension[] exts = point.getExtensions();
@@ -181,6 +186,7 @@ public class BinaryParserBlock extends AbstractBinaryParserPage {
// Give a change to the UI contributors to react.
// But do it last after the comboBox is set.
handleBinaryParserChanged();
+ super.performDefaults();
getContainer().updateContainer();
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java
index 5d229ec6d00..1d33158e98b 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/GNUElfBinaryParserPage.java
@@ -25,6 +25,7 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -42,6 +43,9 @@ import org.eclipse.swt.widgets.Text;
*/
public class GNUElfBinaryParserPage extends AbstractCOptionPage {
+ public final static String PREF_ADDR2LINE_PATH = CUIPlugin.PLUGIN_ID + ".addr2line"; //$NON-NLS-1$
+ public final static String PREF_CPPFILT_PATH = CUIPlugin.PLUGIN_ID + ".cppfilt"; //$NON-NLS-1$
+
protected Text fAddr2LineCommandText;
protected Text fCPPFiltCommandText;
@@ -52,12 +56,14 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
+
+ String addr2line = fAddr2LineCommandText.getText().trim();
+ String cppfilt = fCPPFiltCommandText.getText().trim();
+
monitor.beginTask("Saving Attributes", 1);
IProject proj = getContainer().getProject();
if (proj != null) {
ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(proj);
- String addr2line = fAddr2LineCommandText.getText().trim();
- String cppfilt = fCPPFiltCommandText.getText().trim();
ICExtensionReference[] cext = cdesc.get(CCorePlugin.BINARY_PARSER_UNIQ_ID);
if (cext.length == 0) {
// The value was not save yet and we need to save it now
@@ -87,6 +93,12 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
cext[0].setExtensionData("c++filt", cppfilt);
}
}
+ } else {
+ Preferences store = getContainer().getPreferences();
+ if (store != null) {
+ store.setValue(PREF_ADDR2LINE_PATH, addr2line);
+ store.setValue(PREF_CPPFILT_PATH, cppfilt);
+ }
}
}
@@ -107,9 +119,15 @@ public class GNUElfBinaryParserPage extends AbstractCOptionPage {
}
} catch (CoreException e) {
}
+ } else {
+ Preferences store = getContainer().getPreferences();
+ if (store != null) {
+ addr2line = store.getString(PREF_ADDR2LINE_PATH);
+ cppfilt = store.getString(PREF_CPPFILT_PATH);
+ }
}
- fAddr2LineCommandText.setText((addr2line == null) ? "addr2line" : addr2line);
- fCPPFiltCommandText.setText((cppfilt == null) ? "c++filt" : cppfilt);
+ fAddr2LineCommandText.setText((addr2line == null || addr2line.length() == 0) ? "addr2line" : addr2line);
+ fCPPFiltCommandText.setText((cppfilt == null || cppfilt.length() == 0) ? "c++filt" : cppfilt);
}
/* (non-Javadoc)
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java
index 7635522f35d..d785a25a662 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/dialogs/ICOptionContainer.java
@@ -12,7 +12,7 @@ package org.eclipse.cdt.ui.dialogs;
***********************************************************************/
import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.core.runtime.Preferences;
public interface ICOptionContainer {
@@ -25,6 +25,6 @@ public interface ICOptionContainer {
*
* @return the preference store, or <code>null</code> if none
*/
- public IPreferenceStore getPreferenceStore();
+ public Preferences getPreferences();
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java
index e7c5e29ad5b..f904fd37268 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewCProjectWizardOptionPage.java
@@ -12,6 +12,7 @@ import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.WizardPage;
@@ -56,17 +57,11 @@ public abstract class NewCProjectWizardOptionPage extends WizardPage implements
/* (non-Javadoc)
* @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getPreferenceStore()
*/
- public IPreferenceStore getPreferenceStore() {
- return preferenceStore;
- }
+ public abstract Preferences getPreferences();
- /**
- * @param store
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getProject()
*/
- public void setPreferenceStore(IPreferenceStore store) {
- preferenceStore = store;
- }
-
public abstract IProject getProject();
}

Back to the top