ExecuteScript.java
Go to the documentation of this file.
1 package com.generalrobotix.ui.actions;
2 
3 import org.eclipse.jface.action.IAction;
4 import org.eclipse.jface.viewers.ISelection;
5 import org.eclipse.ui.IWorkbench;
6 import org.eclipse.ui.IWorkbenchPage;
7 import org.eclipse.ui.IWorkbenchWindow;
8 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
9 import org.eclipse.ui.PartInitException;
10 import org.eclipse.ui.PlatformUI;
11 
15 
16 public class ExecuteScript implements IWorkbenchWindowActionDelegate {
17  public ExecuteScript() {}
18 
19  public void run(IAction action) {
21  GrxJythonPromptView jythonView = (GrxJythonPromptView)manager_.getView( GrxJythonPromptView.class, false );
22  if(jythonView==null){
23  IWorkbench workbench = PlatformUI.getWorkbench();
24  IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
25  IWorkbenchPage page = window.getActivePage();
26  try {
27  page.showView("com.generalrobotix.ui.view.GrxJythonPromptViewPart", null, IWorkbenchPage.VIEW_CREATE);
28  } catch (PartInitException e1) {
29  e1.printStackTrace();
30  }
31  jythonView = (GrxJythonPromptView)manager_.getView( GrxJythonPromptView.class, true );
32  }
33  if(jythonView.getEnabledExecBtn())
34  jythonView.selectExecBtn();
35  }
36 
37  public void selectionChanged(IAction action, ISelection selection) {}
38  public void dispose() {}
39  public void init(IWorkbenchWindow window) {}
40 }
#define null
our own NULL pointer
Definition: IceTypes.h:57
void selectionChanged(IAction action, ISelection selection)
GrxBaseView getView(Class<?extends GrxBaseView > cls, boolean active)
void init(IWorkbenchWindow window)
プラグイン管理クラス GrxUIの核になるクラス。プラグインのロード等の、初期化を実行する。 プラグインとそ...
org


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat May 8 2021 02:42:37