1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Bug 508446 - [memory] Preferences dialog empty tree on the left

This apply to the Floating Point and Traditional Renderings, 
When calling these preferences from the drop down inside the memory
view, the associated preferences dialog comes up with the left side
empty, this left side shall reflect the preference page three path.

The call to the preference dialog has been replaced to use
PreferenceUtil.createPreferenceDialogOn  which takes care of this.

Change-Id: I89d6b1289a7eac5ffcca54a1ca6d8b3c3ed831df
This commit is contained in:
Alvaro Sanchez-Leon 2016-12-09 09:49:46 -05:00
parent 0169f0a907
commit 377f0cc815
2 changed files with 4 additions and 28 deletions

View file

@ -13,16 +13,12 @@
package org.eclipse.cdt.debug.ui.memory.floatingpoint; package org.eclipse.cdt.debug.ui.memory.floatingpoint;
import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IAction;
import org.eclipse.jface.preference.IPreferenceNode;
import org.eclipse.jface.preference.IPreferencePage; import org.eclipse.jface.preference.IPreferencePage;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.jface.preference.PreferenceNode;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.ui.IViewActionDelegate; import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart; import org.eclipse.ui.IViewPart;
import org.eclipse.ui.actions.ActionDelegate; import org.eclipse.ui.actions.ActionDelegate;
import org.eclipse.ui.dialogs.PreferencesUtil;
public class FPRenderingPreferenceAction extends ActionDelegate implements IViewActionDelegate public class FPRenderingPreferenceAction extends ActionDelegate implements IViewActionDelegate
{ {
@ -51,20 +47,12 @@ public class FPRenderingPreferenceAction extends ActionDelegate implements IView
protected void showPreferencePage(String id, IPreferencePage page) protected void showPreferencePage(String id, IPreferencePage page)
{ {
final IPreferenceNode targetNode = new PreferenceNode(id, page);
PreferenceManager manager = new PreferenceManager();
manager.addToRoot(targetNode);
final PreferenceDialog dialog = new PreferenceDialog(FPRenderingPlugin.getShell(), manager);
final boolean[] result = new boolean[] { false };
BusyIndicator.showWhile(FPRenderingPlugin.getStandardDisplay(), new Runnable() BusyIndicator.showWhile(FPRenderingPlugin.getStandardDisplay(), new Runnable()
{ {
@Override @Override
public void run() public void run()
{ {
dialog.create(); PreferencesUtil.createPreferenceDialogOn(FPRenderingPlugin.getShell(), id, new String[] { id }, null).open();
dialog.setMessage(targetNode.getLabelText());
result[0] = (dialog.open() == Window.OK);
} }
}); });
} }

View file

@ -13,16 +13,12 @@ package org.eclipse.cdt.debug.ui.memory.traditional;
import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IAction;
import org.eclipse.jface.preference.IPreferenceNode;
import org.eclipse.jface.preference.IPreferencePage; import org.eclipse.jface.preference.IPreferencePage;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.jface.preference.PreferenceNode;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.ui.IViewActionDelegate; import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart; import org.eclipse.ui.IViewPart;
import org.eclipse.ui.actions.ActionDelegate; import org.eclipse.ui.actions.ActionDelegate;
import org.eclipse.ui.dialogs.PreferencesUtil;
public class TraditionalRenderingPreferenceAction extends ActionDelegate implements IViewActionDelegate { public class TraditionalRenderingPreferenceAction extends ActionDelegate implements IViewActionDelegate {
@ -42,17 +38,9 @@ public class TraditionalRenderingPreferenceAction extends ActionDelegate impleme
} }
protected void showPreferencePage(String id, IPreferencePage page) { protected void showPreferencePage(String id, IPreferencePage page) {
final IPreferenceNode targetNode = new PreferenceNode(id, page);
PreferenceManager manager = new PreferenceManager();
manager.addToRoot(targetNode);
final PreferenceDialog dialog = new PreferenceDialog(TraditionalRenderingPlugin.getShell(), manager);
final boolean [] result = new boolean[] { false };
BusyIndicator.showWhile(TraditionalRenderingPlugin.getStandardDisplay(), new Runnable() { BusyIndicator.showWhile(TraditionalRenderingPlugin.getStandardDisplay(), new Runnable() {
public void run() { public void run() {
dialog.create(); PreferencesUtil.createPreferenceDialogOn(TraditionalRenderingPlugin.getShell(), id, new String[] { id }, null).open();
dialog.setMessage(targetNode.getLabelText());
result[0]= (dialog.open() == Window.OK);
} }
}); });
} }