Preferences.java

Go to the documentation of this file.
00001 
00004 package edu.rice.cs.hpc.viewer.actions;
00005 
00006 import org.eclipse.jface.action.IAction;
00007 import org.eclipse.jface.viewers.ISelection;
00008 import org.eclipse.ui.IWorkbenchWindow;
00009 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
00010 
00011 import org.eclipse.ui.dialogs.PreferencesUtil;
00012 import org.eclipse.jface.window.Window;
00013 import org.eclipse.jface.preference.PreferenceDialog;
00014 
00015 
00020 public class Preferences implements IWorkbenchWindowActionDelegate {
00021     IWorkbenchWindow objWindow;
00022     /* (non-Javadoc)
00023      * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
00024      */
00025     public void dispose() {
00026         // TODO Auto-generated method stub
00027 
00028     }
00029 
00030     /* (non-Javadoc)
00031      * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
00032      */
00033     public void init(IWorkbenchWindow window) {
00034         // TODO Auto-generated method stub
00035         this.objWindow = window;
00036     }
00037 
00038     /* (non-Javadoc)
00039      * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
00040      */
00041     public void run(IAction action) {
00042 
00043         //Show the preference for hpcviewer
00044         PreferenceDialog objDialog = PreferencesUtil.createPreferenceDialogOn(this.objWindow.getShell(), 
00045                 "edu.rice.cs.hpc.viewer.util.PreferencePage", null, null);
00046         if(objDialog != null) {
00047             int iRet = objDialog.open();
00048             if(iRet == Window.OK) {
00049                 // user click OK
00050             }
00051         }
00052     }
00053 
00054     /* (non-Javadoc)
00055      * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
00056      */
00057     public void selectionChanged(IAction action, ISelection selection) {
00058         // TODO Auto-generated method stub
00059 
00060     }
00061 
00062 }

Generated on 5 May 2015 for HPCVIEWER by  doxygen 1.6.1