java - Stop IWizard for Warning Message -


i doing eclipse plug-in development... when user clicks finish, making service call return 3 options.

1. okay proceed 2. give user warning 3. stop finish 

so 1 , 3 easy.

here doing 3:

istatus status = new status(istatus.error, activator.plugin_id, istatus.ok, message, e); throw new coreexception(status); 

so throw exception , popup message dialog message passing it.

i stuck on number 2...

i have tried following:

messagedialog dialog = new messagedialog(null, thetitle, dialog.getimage(dialog.dlg_img_warning), dialogmessage, messagedialog.warning, new string[]{"yes", "no"}, 0);  int returncode = dialog.open(); if(returncode == 0){     //proceed finish } else if(returncode == 1){     //stop finsih     return; } 

here message receiving when doing this:

null argument:the dialog should created in ui thread 

is possible give user warning message after clicks finish?

all ui code must created , run in ui thread. if want display dialog other thread , wait result use display.syncexec:

final int [] returncode = new int[1];  display.getdefault().syncexec(new runnable()      {         @override         public void run()         {             messagedialog dialog = ....             returncode[0] = dialog.open();         }      });  if (returncode[0] == 0) ..... 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -