Package org.eclipse.swt.widgets

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


  public void stop() {
    if (!PlatformUI.isWorkbenchRunning())
      return;
    final IWorkbench workbench = PlatformUI.getWorkbench();
    final Display display = workbench.getDisplay();
    display.syncExec(new Runnable() {
      public void run() {
        if (!display.isDisposed())
          workbench.close();
      }
    });
View Full Code Here


            final Set<FamixClass> classes = selectedPackage.getClasses();
            final String message = "You are about to open the source code of " + classes.size()
            + " files. Do you really want to continue?";
            final IWorkbench workbench = PlatformUI.getWorkbench();
            Display display = workbench.getDisplay();
            display.syncExec(new Runnable() {
                public void run() {
                    IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
                    Shell shell = activeWorkbenchWindow.getShell();
                    boolean confirmed = MessageDialog.openConfirm(shell, "Open Source Code", message);
                    if (confirmed) {
View Full Code Here

                    }
                }
            } catch (final PartInitException e) {
                final IWorkbench workbench = PlatformUI.getWorkbench();
                Display display = workbench.getDisplay();
                display.syncExec(new Runnable() {
                    public void run() {
                        IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
                        IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
                        DialogUtil.openError(activePage.getWorkbenchWindow().getShell(), WorkbenchMessages.Error, e
                                .getMessage(), e);
View Full Code Here

        final IEditorPart[] result = new IEditorPart[1];
        final PartInitException[] exception = new PartInitException[1];
        final IWorkbench workbench = PlatformUI.getWorkbench();
        Display display = workbench.getDisplay();
        display.syncExec(new Runnable() {
            public void run() {
                IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
                IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
                try {
                    IEditorPart openEditor = activePage.openEditor(input, COMPILATION_UNIT_EDITOR_ID);
View Full Code Here

            // change selection
            final ISelection selection = new TextSelection(document, start - 1, end - start + 1);
            final IWorkbench workbench = PlatformUI.getWorkbench();
            Display display = workbench.getDisplay();
            display.syncExec(new Runnable() {
                public void run() {
                    selectionProvider.setSelection(selection);
                }
            });
        }
View Full Code Here

                    fGraphPanel.getCommandController().executeCommand(command);
                } else {
                    final String message = "Unable add elements to the current graph!";
                    final IWorkbench workbench = PlatformUI.getWorkbench();
                    Display display = workbench.getDisplay();
                    display.syncExec(new Runnable() {
                        public void run() {
                            IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
                            Shell shell = activeWorkbenchWindow.getShell();
                            ErrorDialog.openError(shell, "Error", message, new Status(IStatus.ERROR, DAForJavaPlugin.PLUGIN_ID, 1,
                                    "The selected elements don't belong to the currently visualized project.", null));
View Full Code Here

        final Tracker tracker = new Tracker(display, SWT.NULL);
        tracker.setStippled(true);

        tracker.addListener(SWT.Move, new Listener() {
            public void handleEvent(final Event event) {
                display.syncExec(new Runnable() {
                    public void run() {
                      // Get the curslor location as a point
                        Point location = new Point(event.x, event.y);

                        // Select a drop target; use the global one by default
View Full Code Here

  public void stop() {
    if (!PlatformUI.isWorkbenchRunning())
      return;
    final IWorkbench workbench = PlatformUI.getWorkbench();
    final Display display = workbench.getDisplay();
    display.syncExec(new Runnable() {
      public void run() {
        if (!display.isDisposed())
          workbench.close();
      }
    });
View Full Code Here

      logger.warn("Stop called, but workbench was null");
      return;
    }
    final Display display = workbench.getDisplay();
    logger.debug("Stopping display in a seperate thread...");
    display.syncExec(new Runnable() {
      public void run() {
        if (!display.isDisposed()) {
          workbench.close();
          logger.debug("Workbench closed");
        } else {
View Full Code Here

    final IWorkbench workbench = PlatformUI.getWorkbench();
    if (workbench == null) {
      return;
    }
    final Display display = workbench.getDisplay();
    display.syncExec(new Runnable() {
      public void run() {
        if (!display.isDisposed()) {
          workbench.close();
        }
      }
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.