1 11 12 package org.eclipse.debug.internal.ui.views.memory.renderings; 13 14 import org.eclipse.debug.internal.ui.DebugUIMessages; 15 import org.eclipse.debug.internal.ui.DebugUIPlugin; 16 import org.eclipse.jface.action.IAction; 17 import org.eclipse.jface.preference.IPreferenceNode; 18 import org.eclipse.jface.preference.IPreferencePage; 19 import org.eclipse.jface.preference.PreferenceDialog; 20 import org.eclipse.jface.preference.PreferenceManager; 21 import org.eclipse.jface.preference.PreferenceNode; 22 import org.eclipse.jface.window.Window; 23 import org.eclipse.swt.custom.BusyIndicator; 24 import org.eclipse.ui.IViewActionDelegate; 25 import org.eclipse.ui.IViewPart; 26 import org.eclipse.ui.actions.ActionDelegate; 27 28 public class TableRenderingPrefAction extends ActionDelegate implements IViewActionDelegate { 29 30 33 public void run(IAction action) { 34 IPreferencePage page = new TableRenderingPreferencePage(DebugUIMessages.TableRenderingPrefAction_0); 35 showPreferencePage("org.eclipse.debug.ui.tableRenderingPreferencepage", page); } 37 38 41 public void init(IViewPart view) { 42 } 43 44 protected void showPreferencePage(String id, IPreferencePage page) { 45 final IPreferenceNode targetNode = new PreferenceNode(id, page); 46 47 PreferenceManager manager = new PreferenceManager(); 48 manager.addToRoot(targetNode); 49 final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), manager); 50 final boolean [] result = new boolean[] { false }; 51 BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable () { 52 public void run() { 53 dialog.create(); 54 dialog.setMessage(targetNode.getLabelText()); 55 result[0]= (dialog.open() == Window.OK); 56 } 57 }); 58 } 59 60 } 61 | Popular Tags |