1 11 package org.eclipse.pde.ui.internal.samples; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.jface.preference.IPreferenceNode; 15 import org.eclipse.jface.preference.PreferenceDialog; 16 import org.eclipse.jface.preference.PreferenceManager; 17 import org.eclipse.pde.internal.ui.preferences.TargetPlatformPreferenceNode; 18 import org.eclipse.swt.custom.BusyIndicator; 19 import org.eclipse.swt.widgets.Display; 20 import org.eclipse.swt.widgets.Shell; 21 import org.eclipse.ui.PlatformUI; 22 23 public class ShowTargetPlatformAction extends Action { 24 25 public void run() { 27 final IPreferenceNode targetNode = new TargetPlatformPreferenceNode(); 28 PreferenceManager manager = new PreferenceManager(); 29 manager.addToRoot(targetNode); 30 Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); 31 final PreferenceDialog dialog = new PreferenceDialog(shell, manager); 32 BusyIndicator.showWhile(Display.getCurrent(), new Runnable () { 33 public void run() { 34 dialog.create(); 35 dialog.setMessage(targetNode.getLabelText()); 36 dialog.open(); 37 } 38 }); 39 } 40 41 } 42 | Popular Tags |