blob: 98cfb09500041ce8724b859bce9e669f6d966264 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2015 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.pde.internal.ui.samples;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.preference.*;
import org.eclipse.pde.internal.ui.preferences.TargetPlatformPreferenceNode;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
public class ShowTargetPlatformAction extends Action {
// Bring up Target Platform prefrences page
@Override
public void run() {
final IPreferenceNode targetNode = new TargetPlatformPreferenceNode();
PreferenceManager manager = new PreferenceManager();
manager.addToRoot(targetNode);
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
final PreferenceDialog dialog = new PreferenceDialog(shell, manager);
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
dialog.create();
dialog.setMessage(targetNode.getLabelText());
dialog.open();
}
});
}
}