質問

i create a eclipse 4 rcp application using e4, in eclipse 3.x, we can modify ApplicationWorkbenchWindowAdvisor to implement it ,but in eclispe 4, it doesn't have ApplicationWorkbenchWindowAdvisor , so, how can i set the window to center?

役に立ちましたか?

解決

One way is to use a life cycle class (see http://www.vogella.com/articles/Eclipse4LifeCycle/article.html ). The application model is available at the point the @ProcessAdditions annotation is processed so you can find your top level window and set its size there.

  @ProcessAdditions
  void processAdditions(MApplication app, EModelService modelService)
  {
    MTrimmedWindow window = (MTrimmedWindow)modelService.find("window id", app);

    // Can call window.setX, setY, setWidth, setHeight here
  }
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top