package com.dmissoh.biologic.actions;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.preference.IPreferenceNode;
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.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PlatformUI;
import com.dmissoh.biologic.Activator;
import com.dmissoh.biologic.preferences.BiologicPreferencePage;
public class OpenPreferencePageAction implements IWorkbenchWindowActionDelegate {
public void dispose() {
// TODO Auto-generated method stub
}
public void init(IWorkbenchWindow window) {
// TODO Auto-generated method stub
}
public void run(IAction action) {
IPreferencePage page = new BiologicPreferencePage();
page.setTitle("BioLogic");
PreferenceManager mgr = new PreferenceManager();
IPreferenceNode node = new PreferenceNode("1", page);
mgr.addToRoot(node);
PreferenceDialog dialog = new PreferenceDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), mgr);
dialog.setPreferenceStore(Activator.getDefault().getPreferenceStore());
dialog.create();
dialog.setMessage(page.getTitle());
dialog.open();
}
public void selectionChanged(IAction action, ISelection selection) {
// TODO Auto-generated method stub
}
}