+
+ final Display display = Display.getCurrent();
+ defaultCallbackHandler = new CallbackHandler() {
+ public void handle(final Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+
+ if (display != null) // RCP
+ display.syncExec(new Runnable() {
+ public void run() {
+ DefaultLoginDialog dialog = new DefaultLoginDialog();
+ try {
+ dialog.handle(callbacks);
+ } catch (IOException e) {
+ throw new ArgeoException("Cannot open dialog",
+ e);
+ }
+ }
+ });
+ else {// RAP
+ DefaultLoginDialog dialog = new DefaultLoginDialog();
+ dialog.handle(callbacks);
+ }
+ }
+ };
+ defaultCallbackHandlerReg = context.registerService(
+ CallbackHandler.class.getName(), defaultCallbackHandler, null);