Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2013-07-16 16:57:17 +0000
committerMike Rennie2013-07-16 16:57:17 +0000
commit44c60018da2e1e14ec6b2d0b0f2b01a71df104fc (patch)
tree45b05cd32d2c68aec0046b2204d81a0d40e5645a /org.eclipse.debug.ui/ui/org/eclipse
parent2123eb384fbb6bfe61a03e40ffe6836b2daf4696 (diff)
downloadeclipse.platform.debug-44c60018da2e1e14ec6b2d0b0f2b01a71df104fc.tar.gz
eclipse.platform.debug-44c60018da2e1e14ec6b2d0b0f2b01a71df104fc.tar.xz
eclipse.platform.debug-44c60018da2e1e14ec6b2d0b0f2b01a71df104fc.zip
Bug 413095 - Clean up deprecation and code warnings
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java79
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java6
14 files changed, 264 insertions, 154 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
index 93b2f7d17..12f0af24b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation 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
@@ -35,7 +35,7 @@ public class DebugPerspectiveFactory implements IPerspectiveFactory {
IFolderLayout navFolder= layout.createFolder(IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW, IPageLayout.TOP, (float) 0.45, layout.getEditorArea());
navFolder.addView(IDebugUIConstants.ID_DEBUG_VIEW);
- navFolder.addPlaceholder(IPageLayout.ID_RES_NAV);
+ navFolder.addPlaceholder(IPageLayout.ID_PROJECT_EXPLORER);
IFolderLayout toolsFolder= layout.createFolder(IInternalDebugUIConstants.ID_TOOLS_FOLDER_VIEW, IPageLayout.RIGHT, (float) 0.50, IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW);
toolsFolder.addView(IDebugUIConstants.ID_VARIABLE_VIEW);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java
index 107ca9876..f8bb07b1b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation 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
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.actions.variables.details;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.actions.ActionMessages;
@@ -18,6 +20,7 @@ import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.ui.PlatformUI;
+import org.osgi.service.prefs.BackingStoreException;
/**
* An check box action that allows the word wrap property to be set, determining if the detail pane
@@ -38,8 +41,6 @@ public class DetailPaneWordWrapAction extends Action {
boolean prefSetting = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP);
fTextViewer.getTextWidget().setWordWrap(prefSetting);
setChecked(prefSetting);
-
-
}
/* (non-Javadoc)
@@ -47,8 +48,14 @@ public class DetailPaneWordWrapAction extends Action {
*/
public void run() {
fTextViewer.getTextWidget().setWordWrap(isChecked());
- DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP,isChecked());
- DebugUIPlugin.getDefault().savePluginPreferences();
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if(node != null) {
+ try {
+ node.putBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP, isChecked());
+ node.flush();
+ } catch (BackingStoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
}
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
index 845733b8a..181d6ebf4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation 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
@@ -10,8 +10,10 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.commands.IStepFiltersHandler;
import org.eclipse.debug.internal.core.StepFilterManager;
@@ -30,7 +32,7 @@ import org.eclipse.ui.IWorkbenchWindow;
/**
* This class provides the action for toggling step filters on or off for the debug view
*/
-public class ToggleStepFiltersAction extends DebugCommandAction implements IPropertyChangeListener {
+public class ToggleStepFiltersAction extends DebugCommandAction implements IPreferenceChangeListener {
private boolean fInitialized = !DebugUITools.isUseStepFilters();
@@ -150,7 +152,10 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IProp
* Initializes the state, by adding this action as a property listener
*/
protected void initState() {
- DebugPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(this);
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier());
+ if (node != null) {
+ node.addPreferenceChangeListener(this);
+ }
}
/**
@@ -158,22 +163,20 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IProp
*/
public void dispose() {
super.dispose();
- DebugPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier());
+ if (node != null) {
+ node.removePreferenceChangeListener(this);
+ }
}
- /**
- * @see org.eclipse.core.runtime.Preferences$IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(StepFilterManager.PREF_USE_STEP_FILTERS)) {
+ public void preferenceChange(PreferenceChangeEvent event) {
+ if (event.getKey().equals(StepFilterManager.PREF_USE_STEP_FILTERS)) {
boolean checked = DebugUITools.isUseStepFilters();
setChecked(checked);
IAction action = getActionProxy();
if (action != null) {
action.setChecked(checked);
}
- }
+ }
}
-
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
index 0551c39fa..80585cc0e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation 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
@@ -117,7 +117,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
private CheckboxTreeViewer fViewer = null;
private Text fFilePath = null;
private Button fOverwrite = null;
-
+ private ConfigContentProvider fContentProvider = null;
/**
* Constructor
*/
@@ -157,7 +157,8 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
fViewer = new CheckboxTreeViewer(tree);
fViewer.setLabelProvider(DebugUITools.newDebugModelPresentation());
fViewer.setComparator(new WorkbenchViewerComparator());
- fViewer.setContentProvider(new ConfigContentProvider());
+ fContentProvider = new ConfigContentProvider();
+ fViewer.setContentProvider(fContentProvider);
fViewer.setInput(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes());
//we don't want to see builders....
fViewer.addFilter(new LaunchCategoryFilter(IInternalDebugUIConstants.ID_EXTERNAL_TOOL_BUILDER_LAUNCH_CATEGORY));
@@ -174,14 +175,20 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
Button button = SWTFactory.createPushButton(buttoncomp, WizardMessages.ExportLaunchConfigurationsWizardPage_8, null);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- fViewer.setAllChecked(true);
+ Object[] items = fContentProvider.getElements(fViewer.getInput());
+ for (int i = 0; i < items.length; i++) {
+ fViewer.setSubtreeChecked(items[i], true);
+ }
setPageComplete(isComplete());
}
});
button = SWTFactory.createPushButton(buttoncomp, WizardMessages.ExportLaunchConfigurationsWizardPage_9, null);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- fViewer.setAllChecked(false);
+ Object[] items = fContentProvider.getElements(fViewer.getInput());
+ for (int i = 0; i < items.length; i++) {
+ fViewer.setSubtreeChecked(items[i], false);
+ }
setPageComplete(isComplete());
}
});
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java
index 338db1a96..70bf29578 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation 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
@@ -12,7 +12,6 @@
package org.eclipse.debug.internal.ui.memory;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
/**
* Represents an element that is capable of persisting properties.
@@ -47,17 +46,4 @@ public interface IPersistableDebugElement {
*/
public boolean supportsProperty(Object context, String propertyId);
- /**
- * Add the property change listener to the persistable. The listener will
- * be notified when properties have changed from the peristable element.
- * @param listener is the listener to add
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Remove the property change listener from the persistable. The listener will
- * no longer be notified when properties are changed from the persistable element.
- * @param listener is the listener to remove
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
index 24fc22883..1f342680b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation 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
@@ -361,6 +361,9 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
String modeString= fmodes.size() == 1 ? fmodes.get(0).toString() : fmodes.toString();
SWTFactory.createLabel(parent, modeString + ":", 1); //$NON-NLS-1$
combo = SWTFactory.createCombo(parent, SWT.READ_ONLY, 1, fgPerspectiveLabels);
+ if(combo == null) {
+ continue;
+ }
String text = getComboSelection(smodes);
if(text != null) {
combo.setText(text);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
index 239ed8bf3..829ae860e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
@@ -76,11 +76,10 @@ import org.eclipse.ui.IMemento;
*
* @since 3.3
*/
-public class InternalTreeModelViewer extends TreeViewer
- implements IInternalTreeModelViewer, org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer
+public class InternalTreeModelViewer extends TreeViewer implements IInternalTreeModelViewer, org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer
{
- private IPresentationContext fContext;
+ private final IPresentationContext fContext;
/**
* Current column presentation or <code>null</code>
@@ -91,25 +90,25 @@ public class InternalTreeModelViewer extends TreeViewer
* Map of columns presentation id to its visible columns id's (String[])
* When a columns presentation is not in the map, default settings are used.
*/
- private Map fVisibleColumns = new HashMap();
+ private final Map fVisibleColumns = new HashMap();
/**
* Map of column id's to persisted sizes
*/
- private Map fColumnSizes = new HashMap();
+ private final Map fColumnSizes = new HashMap();
/**
* Map of column presentation id's to an array of integers representing the column order
* for that presentation, or <code>null</code> if default.
*/
- private Map fColumnOrder = new HashMap();
+ private final Map fColumnOrder = new HashMap();
/**
* Map of column presentation id to whether columns should be displayed
* for that presentation (the user can toggle columns on/off when a
* presentation is optional.
*/
- private Map fShowColumns = new HashMap();
+ private final Map fShowColumns = new HashMap();
/**
* Item's tree path cache
@@ -176,7 +175,7 @@ public class InternalTreeModelViewer extends TreeViewer
}
}
- private ColumnListener fListener = new ColumnListener();
+ private final ColumnListener fListener = new ColumnListener();
/**
* Proxy to cell modifier/editor support
@@ -259,7 +258,7 @@ public class InternalTreeModelViewer extends TreeViewer
}
- private CellModifierProxy fCellModifier;
+ private final CellModifierProxy fCellModifier;
/**
@@ -739,8 +738,9 @@ public class InternalTreeModelViewer extends TreeViewer
int treeWidgetWidth = tree.getSize().x;
int avg = treeWidgetWidth;
- if (visibleColumnIds != null)
- avg /= visibleColumnIds.length;
+ if (visibleColumnIds != null) {
+ avg /= visibleColumnIds.length;
+ }
if (avg == 0) {
tree.addPaintListener(new PaintListener() {
@@ -809,7 +809,9 @@ public class InternalTreeModelViewer extends TreeViewer
for (int i = 0; i < columns.length; i++) {
boolean columnAvailable = false;
for (int j = 0; j < available.length; j++) {
- if (columns[i].equals(available[j])) columnAvailable = true;
+ if (columns[i].equals(available[j])) {
+ columnAvailable = true;
+ }
}
if (!columnAvailable || presentation.getHeader(columns[i]) == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
index 2f29050b3..d4bcd72ba 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
@@ -30,8 +30,10 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -68,17 +70,17 @@ import org.w3c.dom.NodeList;
*
* @since 3.2
*/
-public class ViewContextService implements IDebugContextListener, IPerspectiveListener4, IPropertyChangeListener, IContextManagerListener {
+public class ViewContextService implements IDebugContextListener, IPerspectiveListener4, IPreferenceChangeListener, IContextManagerListener {
/**
* Maps the perspectives in this window to its last activated workbench context
*/
- private Map fPerspectiveToActiveContext = new HashMap();
+ private final Map fPerspectiveToActiveContext = new HashMap();
/**
* Map of the perspectives to all workbench contexts activated in that perspective
*/
- private Map fPerspectiveToActivatedContexts = new HashMap();
+ private final Map fPerspectiveToActivatedContexts = new HashMap();
/**
* Map of context id's to context view bindings
@@ -101,9 +103,9 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
*/
private IWorkbenchWindow fWindow;
- private IContextService fContextService;
+ private final IContextService fContextService;
- private IDebugContextService fDebugContextService;
+ private final IDebugContextService fDebugContextService;
/**
* Perspective that is currently being de-activated. Used to determine
@@ -156,7 +158,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
private class DebugContextViewBindings {
// context id
- private String fId;
+ private final String fId;
// list of view bindings id's specific to this context
private String[] fViewBindingIds = EMPTY_IDS;
@@ -164,7 +166,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
// all bindings including inherited bindings, top down in activation order
private String[] fAllViewBindingIds = null;
// associated binding to activate
- private Map fAllViewIdToBindings = new HashMap();
+ private final Map fAllViewIdToBindings = new HashMap();
// all context id's in this context hierarchy (top down order)
private String[] fAllConetxtIds = null;
@@ -367,19 +369,19 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* Information for a view
*/
private class ViewBinding {
- private IConfigurationElement fElement;
+ private final IConfigurationElement fElement;
/**
* Set of perspectives this view was opened in by the user
*/
- private Set fUserOpened = new HashSet();
+ private final Set fUserOpened = new HashSet();
/**
* Set of perspectives this view was closed in by the user
*/
- private Set fUserClosed = new HashSet();
+ private final Set fUserClosed = new HashSet();
/**
* Set of perspectives this view was auto-opened by view management.
*/
- private Set fAutoOpened = new HashSet();
+ private final Set fAutoOpened = new HashSet();
public ViewBinding(IConfigurationElement element) {
fElement = element;
@@ -623,7 +625,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
loadPerspectives();
window.addPerspectiveListener(this);
getDebugContextService().addDebugContextListener(this);
- DebugUIPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(this);
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if (node != null) {
+ node.addPreferenceChangeListener(this);
+ }
fContextService.addContextManagerListener(this);
if (fWindow != null) {
IWorkbenchPage page = fWindow.getActivePage();
@@ -637,7 +642,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
fWindow.removePerspectiveListener(this);
fWindow = null; // avoid leaking a window reference (bug 321658).
getDebugContextService().removeDebugContextListener(this);
- DebugUIPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if (node != null) {
+ node.removePreferenceChangeListener(this);
+ }
fContextService.removeContextManagerListener(this);
fActivePerspective = null;
}
@@ -713,24 +721,6 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
}
}
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (!fIgnoreChanges) {
- if (IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES.equals(event.getProperty())) {
- loadPerspectives();
- } else if (IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS.equals(event.getProperty())) {
- loadContextToViewExtensions();
- applyUserViewBindings();
- // clear activations to re-enable activation based on new settings
- fPerspectiveToActivatedContexts.clear();
- ISelection selection = getDebugContextService().getActiveContext();
- contextActivated(selection);
- }
- }
- }
-
/**
* Returns whether this service's window's active perspective supports view management.
*
@@ -1002,7 +992,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @param perspective the perspective description
*/
private void activateChain(String contextId, IPerspectiveDescriptor perspective, Set allViewIds) {
- if (fWindow == null) return; // disposed
+ if (fWindow == null)
+ {
+ return; // disposed
+ }
IWorkbenchPage page = fWindow.getActivePage();
if (page != null) {
@@ -1014,7 +1007,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
}
private Set getAllContextsViewIDs(List contextsIds) {
- if (fWindow == null) return Collections.EMPTY_SET; // disposed
+ if (fWindow == null)
+ {
+ return Collections.EMPTY_SET; // disposed
+ }
TreeSet viewIds = new TreeSet();
for (int i = 0; i < contextsIds.size(); i++) {
@@ -1087,7 +1083,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
}
private void deactivate(String contextId, IPerspectiveDescriptor perspective) {
- if (fWindow == null) return; // disposed
+ if (fWindow == null)
+ {
+ return; // disposed
+ }
IWorkbenchPage page = fWindow.getActivePage();
if (page != null) {
@@ -1166,7 +1165,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @param viewId the id of the view to show
*/
public void showViewQuiet(String viewId) {
- if (fWindow == null) return; // disposed;
+ if (fWindow == null)
+ {
+ return; // disposed;
+ }
IWorkbenchPage page = fWindow.getActivePage();
if (page != null) {
@@ -1193,4 +1195,20 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
clean(perspective);
}
}
+
+ public void preferenceChange(PreferenceChangeEvent event) {
+ if (!fIgnoreChanges) {
+ if (IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES.equals(event.getKey())) {
+ loadPerspectives();
+ } else if (IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS.equals(event.getKey())) {
+ loadContextToViewExtensions();
+ applyUserViewBindings();
+ // clear activations to re-enable activation based on new
+ // settings
+ fPerspectiveToActivatedContexts.clear();
+ ISelection selection = getDebugContextService().getActiveContext();
+ contextActivated(selection);
+ }
+ }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
index ddb2bc4b7..1725bd43e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation 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
@@ -23,6 +23,8 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IMarkerDelta;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointManager;
import org.eclipse.debug.core.IBreakpointsListener;
@@ -40,6 +42,7 @@ import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
+import org.osgi.service.prefs.BackingStoreException;
/**
* Breakpoint organizers for breakpoint working sets.
@@ -322,7 +325,15 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
}
}
fDefaultWorkingSet = set;
- DebugUIPlugin.getDefault().getPluginPreferences().setValue(IInternalDebugUIConstants.MEMENTO_BREAKPOINT_WORKING_SET_NAME, name);
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if(node != null) {
+ try {
+ node.put(IInternalDebugUIConstants.MEMENTO_BREAKPOINT_WORKING_SET_NAME, name);
+ node.flush();
+ } catch (BackingStoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
}
/*
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
index 012236f7a..d6001e865 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
@@ -20,7 +20,9 @@ import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.internal.ui.DebugUIMessages;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.views.variables.VariablesViewMessages;
@@ -65,6 +67,7 @@ import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.part.ViewPart;
+import org.osgi.service.prefs.BackingStoreException;
/**
*
@@ -656,37 +659,41 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
return fVisibleViewPanes.contains(paneId);
}
- private void storeViewPaneVisibility()
- {
+ private void storeViewPaneVisibility() {
fVisibleViewPanes.clear();
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
StringBuffer visibleViewPanes= new StringBuffer();
Enumeration enumeration = fViewPaneControls.keys();
- while (enumeration.hasMoreElements())
- {
+ while (enumeration.hasMoreElements()) {
String paneId = (String)enumeration.nextElement();
Control control = (Control)fViewPaneControls.get(paneId);
- if (control.isVisible())
- {
+ if (control.isVisible()) {
visibleViewPanes.append(paneId);
visibleViewPanes.append(","); //$NON-NLS-1$
fVisibleViewPanes.add(paneId);
}
}
-
- prefs.setValue(getVisibilityPrefId(), visibleViewPanes.toString());
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if(node != null) {
+ try {
+ node.put(getVisibilityPrefId(), visibleViewPanes.toString());
+ node.flush();
+ } catch (BackingStoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
}
- private void loadViewPanesVisibility()
- {
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- String visiblePanes = prefs.getString(getVisibilityPrefId());
-
- if (visiblePanes != null && visiblePanes.length() > 0)
- {
+ private void loadViewPanesVisibility() {
+ String visiblePanes = Platform.getPreferencesService().getString(
+ DebugUIPlugin.getUniqueIdentifier(),
+ getVisibilityPrefId(),
+ null,
+ null);
+
+ if (visiblePanes != null && visiblePanes.length() > 0) {
StringTokenizer tokenizer = new StringTokenizer(visiblePanes, ","); //$NON-NLS-1$
while (tokenizer.hasMoreTokens())
{
@@ -694,8 +701,7 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
fVisibleViewPanes.add(paneId);
}
}
- else
- {
+ else {
for (int i=0 ;i<defaultVisiblePaneIds.length; i++)
{
fVisibleViewPanes.add(defaultVisiblePaneIds[i]);
@@ -720,13 +726,14 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
fSashForm.layout();
}
- private void loadOrientation()
- {
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- fViewOrientation = prefs.getInt(getOrientationPrefId());
-
- for (int i=0; i<fOrientationActions.length; i++)
- {
+ private void loadOrientation() {
+ fViewOrientation = Platform.getPreferencesService().getInt(
+ DebugUIPlugin.getUniqueIdentifier(),
+ getOrientationPrefId(),
+ HORIZONTAL_VIEW_ORIENTATION,
+ null);
+
+ for (int i=0; i<fOrientationActions.length; i++) {
if (fOrientationActions[i].getOrientation() == fViewOrientation)
{
fOrientationActions[i].run();
@@ -735,10 +742,16 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
updateOrientationActions();
}
- private void saveOrientation()
- {
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- prefs.setValue(getOrientationPrefId(), fViewOrientation);
+ private void saveOrientation() {
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if(node != null) {
+ try {
+ node.putInt(getOrientationPrefId(), fViewOrientation);
+ node.flush();
+ } catch (BackingStoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
}
private void updateOrientationActions()
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
index a8c040c29..e20a18ee3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation 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
@@ -17,7 +17,10 @@ import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Preferences;
+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.InstanceScope;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener;
@@ -33,6 +36,7 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
import org.eclipse.debug.ui.memory.IMemoryRenderingType;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPartSite;
+import org.osgi.service.prefs.BackingStoreException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -50,8 +54,8 @@ import org.w3c.dom.NodeList;
*/
public class ViewPaneRenderingMgr implements IDebugEventSetListener{
- private ArrayList fRenderings = new ArrayList();
- private IMemoryRenderingContainer fViewPane;
+ private final ArrayList fRenderings = new ArrayList();
+ private final IMemoryRenderingContainer fViewPane;
private static final String RENDERINGS_TAG = "persistedMemoryRenderings"; //$NON-NLS-1$
private static final String MEMORY_RENDERING_TAG = "memoryRendering"; //$NON-NLS-1$
@@ -66,8 +70,9 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
public void removeMemoryBlockRendering(IMemoryBlock mem, String renderingId)
{
- if(fRenderings == null)
+ if(fRenderings == null) {
return;
+ }
IMemoryRendering[] toRemove = getRenderings(mem, renderingId);
@@ -89,8 +94,9 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
public void addMemoryBlockRendering(IMemoryRendering rendering) {
// do not allow duplicated objects
- if (fRenderings.contains(rendering))
+ if (fRenderings.contains(rendering)) {
return;
+ }
fRenderings.add(rendering);
@@ -105,11 +111,13 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
public void removeMemoryBlockRendering(IMemoryRendering rendering) {
- if(rendering == null)
+ if(rendering == null) {
return;
+ }
- if(!fRenderings.contains(rendering))
+ if(!fRenderings.contains(rendering)) {
return;
+ }
fRenderings.remove(rendering);
@@ -191,8 +199,9 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
public void handleDebugEvents(DebugEvent[] events) {
- for (int i=0; i < events.length; i++)
+ for (int i=0; i < events.length; i++) {
handleDebugEvent(events[i]);
+ }
}
@@ -226,12 +235,18 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
fRenderings.clear();
String secondaryId = getViewSiteSecondaryId();
- if (secondaryId != null)
- {
+ if (secondaryId != null) {
// do not save renderings if this is not the primary rendering view
String prefid = getPrefId();
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- prefs.setToDefault(prefid);
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if (node != null) {
+ node.remove(prefid);
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
}
DebugPlugin.getDefault().removeDebugEventListener(this);
@@ -243,7 +258,6 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
*/
private void storeRenderings()
{
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
String renderingsStr= IInternalDebugCoreConstants.EMPTY_STRING;
try {
renderingsStr= getRenderingsAsXML();
@@ -256,11 +270,23 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
}
String prefid = getPrefId();
-
- if (renderingsStr != null)
- prefs.setValue(prefid, renderingsStr);
- else
- prefs.setToDefault(prefid);
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if(node != null) {
+ if (renderingsStr != null) {
+ node.put(prefid, renderingsStr);
+ }
+ else {
+ IEclipsePreferences def = DefaultScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if(def != null) {
+ node.put(prefid, def.get(prefid, IInternalDebugCoreConstants.EMPTY_STRING));
+ }
+ }
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
}
private String getPrefId() {
@@ -295,8 +321,9 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
private String getRenderingsAsXML() throws IOException, ParserConfigurationException, TransformerException {
IMemoryRendering[] renderings= (IMemoryRendering[])fRenderings.toArray(new IMemoryRendering[fRenderings.size()]);
- if (renderings.length == 0)
+ if (renderings.length == 0) {
return null;
+ }
Document document= LaunchManager.getDocument();
Element rootElement= document.createElement(RENDERINGS_TAG);
@@ -315,7 +342,11 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
* Load renderings currently stored.
*/
private void loadPersistedRenderings(String prefId) {
- String renderingsStr= DebugUIPlugin.getDefault().getPluginPreferences().getString(prefId);
+ String renderingsStr = Platform.getPreferencesService().getString(
+ DebugUIPlugin.getUniqueIdentifier(),
+ prefId,
+ "", //$NON-NLS-1$
+ null);
if (renderingsStr.length() == 0) {
return;
}
@@ -347,8 +378,9 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
IMemoryBlock memoryBlock = null;
for (int j=0; j<memoryBlocks.length; j++)
{
- if (Integer.toString(memoryBlocks[j].hashCode()).equals(memoryBlockHashCode))
+ if (Integer.toString(memoryBlocks[j].hashCode()).equals(memoryBlockHashCode)) {
memoryBlock = memoryBlocks[j];
+ }
}
if (memoryBlock != null)
@@ -357,8 +389,9 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
IMemoryRenderingType type = null;
for (int k=0; k<types.length; k++)
{
- if (types[k].getId().equals(renderingId))
+ if (types[k].getId().equals(renderingId)) {
type = types[k];
+ }
}
// if memory block is not found, the rendering is no longer valid
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
index d865d8bd4..23b1c4002 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation 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
@@ -33,12 +33,15 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.internal.core.IConfigurationElementConstants;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.IDetailPane;
import org.eclipse.debug.ui.IDetailPaneFactory;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.osgi.service.prefs.BackingStoreException;
/**
* Organizes the detail factories contributed through the extension point and keeps
@@ -499,7 +502,15 @@ public class DetailPaneManager {
buffer.append(entry.getValue());
buffer.append('|');
}
- DebugUIPlugin.getDefault().getPluginPreferences().setValue(PREF_DETAIL_AREAS, buffer.toString());
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if(node != null) {
+ node.put(PREF_DETAIL_AREAS, buffer.toString());
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
}
/**
@@ -509,7 +520,10 @@ public class DetailPaneManager {
*/
private void loadPreferredDetailsAreas() {
fPreferredDetailPanes = new HashMap();
- String preferenceValue = DebugUIPlugin.getDefault().getPluginPreferences().getString(PREF_DETAIL_AREAS);
+ String preferenceValue = Platform.getPreferencesService().getString(DebugUIPlugin.getUniqueIdentifier(),
+ PREF_DETAIL_AREAS,
+ "", //$NON-NLS-1$
+ null);
StringTokenizer entryTokenizer = new StringTokenizer(preferenceValue,"|"); //$NON-NLS-1$
while (entryTokenizer.hasMoreTokens()){
String token = entryTokenizer.nextToken();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
index 90d5babe2..c0c71c341 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation 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
@@ -13,6 +13,8 @@ package org.eclipse.debug.ui;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IExpression;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
@@ -50,6 +52,7 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PartInitException;
+import org.osgi.service.prefs.BackingStoreException;
/**
* A <code>DebugPopup</code> that can be used to inspect an
@@ -194,7 +197,15 @@ public class InspectPopupDialog extends DebugPopup {
int[] weights = fSashForm.getWeights();
if (weights.length == 2){
String weightString = weights[0] + ":" + weights[1]; //$NON-NLS-1$
- DebugUIPlugin.getDefault().getPluginPreferences().setValue(PREF_INSPECT_POPUP_SASH_WEIGHTS, weightString);
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
+ if(node != null) {
+ node.put(PREF_INSPECT_POPUP_SASH_WEIGHTS, weightString);
+ try {
+ node.flush();
+ } catch (BackingStoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
index 2599e5477..5e94b9d18 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation 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
@@ -182,7 +182,9 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
return;
}
attributes = collectBreakpointProperties(nodes[i]);
-
+ if(attributes == null) {
+ continue;
+ }
IResource resource;
if(fImportBreakpoints) {
resource = workspace.findMember((String) attributes.get(IImportExportConstants.IE_NODE_PATH));

Back to the top