Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » startup opening editor exception
startup opening editor exception [message #1498358] Thu, 04 December 2014 10:52
Alberto Cardellini is currently offline Alberto CardelliniFriend
Messages: 2
Registered: December 2014
Junior Member
Hi there, I've just joined this community because I'm stuck with my gef editor. I'm following this tutorial ( ), adapting it to my different model. Everything is ok but if I launche the editor i got NullPointerException in ApplicationWorkbenchAdvisor class in postStartup method.
This is the code of the method:
@Override
public void postStartup() {
  try {
    IWorkbench bench = PlatformUI.getWorkbench();
    IWorkbenchWindow bw = bench.getActiveWorkbenchWindow();
    // Here bw is null so the exception is thrown in next line
    IWorkbenchPage page = bw.getActivePage;
   
   page.openEditor(new MyEditorInput("PlutoEditor"), MyGraphicalEditor.ID,     false);
  } catch (Exception e) {
    e.printStackTrace();
  }
}


On the web I found a partial solution that launch this code on a new thread, I suppose:

@Override
public void postStartup() {
  PlatformUI.getWorkbench().getDisplay.asyncExec(new Runnable() {
    public void run() {
      // Same code above opening the editor
      // .....
    }
  });
}


In this way I can get launching the editor and use it, but the outline is not showing. Then I discovered that I could add after "page.openEditor(.....)" line a new istruction to show the outline and property sheet view. I tried it but eveytime I launch the app the layout is random generated, and launching it more times create more empty views in the RCP app.
If needed I can put more code, just tell me

Thank you
Previous Topic:Rendering SVG Image in GEF
Next Topic:GEF Framework
Goto Forum:
  


Current Time: Tue Mar 19 09:41:02 GMT 2024

Powered by FUDForum. Page generated in 0.02508 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top