ApplicationWorkbenchAdvisor.java
Go to the documentation of this file.
1 package com.generalrobotix.ui.grxui;
2 
3 import org.eclipse.ui.IWorkbench;
4 import org.eclipse.ui.PlatformUI;
5 import org.eclipse.ui.application.IWorkbenchConfigurer;
6 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
7 import org.eclipse.ui.application.WorkbenchAdvisor;
8 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
9 
10 public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
11 
12  private static final String PERSPECTIVE_ID = "com.generalrobotix.ui.grxui.GrxUIPerspectiveFactory";
13 
14  public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
15  IWorkbenchWindowConfigurer configurer) {
16  return new ApplicationWorkbenchWindowAdvisor(configurer);
17  }
18 
20  return PERSPECTIVE_ID;
21  }
22 
23  public void initialize(IWorkbenchConfigurer configurer) {
24  configurer.setSaveAndRestore(true);
25  }
26 
27  public void preStartup(){
28  //window が開く前に実行される //
29 
30  Activator activator = Activator.getDefault();
31  IWorkbench workbench = PlatformUI.getWorkbench();
32  workbench.addWorkbenchListener(activator);
33 
34  try{
35  activator.tryLockFile();
36  } catch (Exception ex) {
37  activator.breakStart( ex, null );
38  }
39  if(activator.getImageRegistry() == null)
40  try {
41  activator.registryImage();
42  } catch (Exception e) {
43  e.printStackTrace();
44  }
45  if(activator.getFontRegistry() == null)
46  activator.registryFont();
47  if(activator.getColorRegistry() == null)
48  activator.registryColor();
49  activator.startGrxUI();
50  }
51 
52  public void postStartup(){
55  }
56 }
#define null
our own NULL pointer
Definition: IceTypes.h:57
WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer)
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:36