ExecuteScript.java
Go to the documentation of this file.
00001 package com.generalrobotix.ui.actions;
00002 
00003 import org.eclipse.jface.action.IAction;
00004 import org.eclipse.jface.viewers.ISelection;
00005 import org.eclipse.ui.IWorkbench;
00006 import org.eclipse.ui.IWorkbenchPage;
00007 import org.eclipse.ui.IWorkbenchWindow;
00008 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
00009 import org.eclipse.ui.PartInitException;
00010 import org.eclipse.ui.PlatformUI;
00011 
00012 import com.generalrobotix.ui.GrxPluginManager;
00013 import com.generalrobotix.ui.grxui.Activator;
00014 import com.generalrobotix.ui.view.GrxJythonPromptView;
00015 
00016 public class ExecuteScript implements IWorkbenchWindowActionDelegate {
00017     public ExecuteScript() {}
00018 
00019     public void run(IAction action) {
00020         GrxPluginManager manager_ = Activator.getDefault().manager_;
00021         GrxJythonPromptView jythonView =  (GrxJythonPromptView)manager_.getView( GrxJythonPromptView.class, false );
00022         if(jythonView==null){
00023             IWorkbench workbench = PlatformUI.getWorkbench();
00024             IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
00025             IWorkbenchPage page = window.getActivePage();
00026             try {
00027                 page.showView("com.generalrobotix.ui.view.GrxJythonPromptViewPart", null, IWorkbenchPage.VIEW_CREATE);
00028             } catch (PartInitException e1) {
00029                 e1.printStackTrace();
00030             }
00031             jythonView =  (GrxJythonPromptView)manager_.getView( GrxJythonPromptView.class, true );
00032         }
00033         if(jythonView.getEnabledExecBtn())
00034             jythonView.selectExecBtn();
00035     }
00036 
00037     public void selectionChanged(IAction action, ISelection selection) {}
00038     public void dispose() {}
00039     public void init(IWorkbenchWindow window) {}
00040 }


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sun Apr 2 2017 03:43:53