Question

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?

Was it helpful?

Solution

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
  }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top