1 11 package org.eclipse.jdt.internal.debug.ui.actions; 12 13 import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; 14 import org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersPreferencePage; 15 import org.eclipse.jface.action.IAction; 16 import org.eclipse.jface.preference.IPreferenceNode; 17 import org.eclipse.jface.preference.PreferenceDialog; 18 import org.eclipse.jface.preference.PreferenceManager; 19 import org.eclipse.jface.preference.PreferenceNode; 20 import org.eclipse.jface.viewers.ISelection; 21 import org.eclipse.jface.window.Window; 22 import org.eclipse.swt.custom.BusyIndicator; 23 import org.eclipse.ui.IViewActionDelegate; 24 import org.eclipse.ui.IViewPart; 25 26 29 public class DetailOptionsAction implements IViewActionDelegate { 30 31 34 public void init(IViewPart view) { 35 } 36 37 40 public void run(IAction action) { 41 final IPreferenceNode targetNode = new PreferenceNode("org.eclipse.jdt.debug.ui.JavaDetailFormattersPreferencePage", new JavaDetailFormattersPreferencePage()); 43 PreferenceManager manager = new PreferenceManager(); 44 manager.addToRoot(targetNode); 45 final PreferenceDialog dialog = new PreferenceDialog(JDIDebugUIPlugin.getActiveWorkbenchShell(), manager); 46 final boolean [] result = new boolean[] { false }; 47 BusyIndicator.showWhile(JDIDebugUIPlugin.getStandardDisplay(), new Runnable () { 48 public void run() { 49 dialog.create(); 50 dialog.setMessage(targetNode.getLabelText()); 51 result[0]= (dialog.open() == Window.OK); 52 } 53 }); 54 } 55 56 59 public void selectionChanged(IAction action, ISelection selection) { 60 } 61 62 } 63 | Popular Tags |