java - How to write a SWT based GUI in Eclipse plug-in? -


i learned how write swt based application following tutorial. however, don't know how move forward gui eclipse plug-in.

the plug-in writing right-clicking on ijavaelement node in package explorer, show 1 more action, action bring gui dialog letting me fill out value , save result database.

right problems are:

  • i can write stand alone swt based gui application, don't know how put following code snippet in public void run(iaction action)

    display display = new display(); shell shell = new shell(display);  shell.setlayout(new gridlayout()); shell.open();  while (!shell.isdisposed()) {     if (!display.readanddispatch())         display.sleep(); } display.dispose(); 

    all swt tutorial found create shell, display in main, looks should differently in eclipse plug-in. must use jface create dialog while developing eclipse plug-in?

  • without adding org.eclipse.swt(.cocoa.macosx.x86_64.source) in plugin.xml dependency, show action if right-clicked on ijavaelement. when try run action, eclipse show

    problem occurred unhandled event loop exception not implemented [multiple displays] 

    i guess it's because new 1 more display. however, if added org.eclipse.swt(.cocoa.macosx.x86_64.source) plugin.xml dependency, action won't show in popup menu.

your code creating new display - should not when creating eclipse plugin. eclipse has display , event loop running.

try putting code in action:

shell shell = new shell(display.getcurrent());  shell.setlayout(new gridlayout()); shell.open(); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -