Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Display.asyncExec()


    protected void update(Runnable runnable) {
        IWorkbench workbench = PlatformUI.getWorkbench();
        IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
        if (windows != null && windows.length > 0) {
            Display display = windows[0].getShell().getDisplay();
            display.asyncExec(runnable);
        } else {
            runnable.run();
        }
    }
View Full Code Here


                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                    try {
                        monitor.beginTask(WYSIWYGPlugin.getResourceString("editor.task.init_wysiwyg"), 10);
                        WYSIWYGPlugin.getDefault().startWebServer(monitor, 9);
                        monitor.subTask(WYSIWYGPlugin.getResourceString("editor.subtask.waiting_init"));
                        display.asyncExec(new Runnable() {
                            public void run() {
                                monitorDialog.setCancelable(true);
                                browser.setUrl(WYSIWYGPlugin.getDefault().getEditorURL());
                            }
                        });
View Full Code Here

                        monitorDialog.setCancelable(true);
                        while (!isBrowserLoaded() && !monitor.isCanceled()) {
                            Thread.sleep(1000);
                        }
                        monitor.worked(1);
                        display.asyncExec(new Runnable() {
                            public void run() {
                                setActivePage(0);
                            }
                        });
                    } catch (Exception e) {
View Full Code Here

                    } finally {
                        monitor.done();
                    }
                }
            };
            display.asyncExec(new Runnable() {
                public void run() {
                    try {
                        monitorDialog.run(true, false, runnable);
                    } catch (InvocationTargetException e) {
                        DesignerLogger.logError(WYSIWYGPlugin.getResourceString("wysiwyg.design.create_error"), e.getTargetException());
View Full Code Here

    this.status = status;
  }
 
  public static void openGOIMErrorAsync(final Shell parentShell,final String dialogTitle, final String message, final Throwable e) {
    Display display = parentShell == null ? Display.getDefault() : parentShell.getDisplay();
    display.asyncExec(new Runnable() { public void run() {
      openGOIMError(parentShell,dialogTitle,message,e);
    }});
  }
  public static GOIMErrorDialog openGOIMError(Shell parentShell,String dialogTitle, String message, Throwable e) {
    GOIMErrorDialog dialog = new GOIMErrorDialog(parentShell,dialogTitle,message,new Status(IStatus.ERROR,GOIMPlugin.ID,IStatus.ERROR,message,e),IStatus.ERROR);
View Full Code Here

              IContactListView contactList = GOIMPlugin.getDefault().getContactList(GOIMAccount.this);
              if(contactList != null)
                parent = contactList.getShell();
              Display display = (parent == null ? Display.getDefault() : parent.getDisplay());
              final Shell shellParent = parent;
              display.asyncExec(new Runnable() { public void run() {
                boolean answer = MessageDialog.openConfirm(shellParent,"Adding Stats Contact to Roster","Would you like to add " + STATSCONTACTJID + " to your roster (this will enable more advanced features, but will publish your status to the web)");
                if(answer)
                  try {
                    roster.createEntry(STATSCONTACTJID,"Stats Tracking Contact",null);
                  } catch (XMPPException e) {
View Full Code Here

        Display display = mTreeViewer.getControl().getDisplay();

        if (!display.isDisposed())
        {
            display.asyncExec(new Runnable()
            {
                public void run()
                {
                    if (mTreeViewer.getControl().isDisposed())
                    {
View Full Code Here

     */
    public void refresh(final INlpElement element)
    {
        Display display = mTreeViewer.getControl().getDisplay();

        display.asyncExec(new Runnable()
        {

            public void run()
            {
                mTreeViewer.refresh(element);
View Full Code Here

    final IWorkbenchPage activePage = workbench.getActiveWorkbenchWindow().getActivePage();
    if (activePage != null) {
      final Display display = getShell().getDisplay();
      if (display != null) {
        display.asyncExec(new Runnable() {
          public void run() {
            try {
              IDE.openEditor(activePage, resource, true);
            } catch (PartInitException e) {
              Activator.logException(e);
View Full Code Here

    final IWorkbenchPage activePage = workbench.getActiveWorkbenchWindow().getActivePage();
    if (activePage != null) {
      final Display display = getShell().getDisplay();
      if (display != null) {
        display.asyncExec(new Runnable() {
          public void run() {
            try {
              IDE.openEditor(activePage, resource, true);
            } catch (PartInitException e) {
              Activator.logException(e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.