Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Control


    /* Select All */
    fViewSite.getActionBars().setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), new Action() {
      @Override
      public void run() {
        Control focusControl = fViewer.getControl().getDisplay().getFocusControl();

        /* Select All in Text Widget */
        if (focusControl instanceof Text) {
          ((Text) focusControl).selectAll();
        }

        /* Select All in Tree */
        else {
          ((Tree) fViewer.getControl()).selectAll();
          fViewer.setSelection(fViewer.getSelection());
        }
      }
    });

    /* Delete */
    fViewSite.getActionBars().setGlobalActionHandler(ActionFactory.DELETE.getId(), new Action() {
      @Override
      public void run() {
        fViewer.getControl().getParent().setRedraw(false);
        try {
          new DeleteTypesAction(fViewer.getControl().getShell(), (IStructuredSelection) fViewer.getSelection()).run();
        } finally {
          fViewer.getControl().getParent().setRedraw(true);
        }
      }
    });

    /* Reload */
    fViewSite.getActionBars().setGlobalActionHandler(RetargetActions.RELOAD, new Action() {
      @Override
      public void run() {
        new ReloadTypesAction((IStructuredSelection) fViewer.getSelection(), fViewSite.getShell()).run();
      }
    });

    /* Cut */
    fViewSite.getActionBars().setGlobalActionHandler(ActionFactory.CUT.getId(), new Action() {
      @Override
      public void run() {
        Control focusControl = fViewer.getControl().getDisplay().getFocusControl();

        /* Cut in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).cut();
      }
    });

    /* Copy */
    fViewSite.getActionBars().setGlobalActionHandler(ActionFactory.COPY.getId(), new Action() {
      @Override
      public void run() {
        Control focusControl = fViewer.getControl().getDisplay().getFocusControl();

        /* Copy in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).copy();
      }
    });

    /* Paste */
    fViewSite.getActionBars().setGlobalActionHandler(ActionFactory.PASTE.getId(), new Action() {
      @Override
      public void run() {
        Control focusControl = fViewer.getControl().getDisplay().getFocusControl();

        /* Paste in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).paste();
      }
View Full Code Here


  protected Control createButtonBar(Composite parent) {

    /* Spacer */
    new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false, 2, 1));

    Control control = super.createButtonBar(parent);

    /* Udate enablement */
    getButton(IDialogConstants.OK_ID).setEnabled(fNameInput.getText().length() > 0);

    return control;
View Full Code Here

    /* Select All */
    fSelectAllAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Select All in Text Widget */
        if (focusControl instanceof Text) {
          ((Text) focusControl).selectAll();
        }

        /* Select All in Viewer Tree */
        else {
          ((Tree) fNewsTableControl.getViewer().getControl()).selectAll();
          fNewsTableControl.getViewer().setSelection(fNewsTableControl.getViewer().getSelection());
        }
      }
    };

    /* Delete */
    fDeleteAction = new Action() {
      @Override
      public void run() {
        new DeleteTypesAction(fParent.getShell(), (IStructuredSelection) fNewsTableControl.getViewer().getSelection()).run();
      }
    };

    /* Cut */
    fCutAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Cut in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).cut();
      }
    };

    /* Copy */
    fCopyAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Copy in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).copy();
      }
    };

    /* Paste */
    fPasteAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Paste in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).paste();
      }
View Full Code Here

    setBrowserMaximized(!isMaximized);
    fPreferences.putBoolean(DefaultPreferences.FV_BROWSER_MAXIMIZED, !isMaximized);
  }

  private void setBrowserMaximized(boolean maximized) {
    Control maximizedControl = fSashForm.getMaximizedControl();

    /* Maximize Browser */
    if (maximized && maximizedControl == null) {
      updateSeparators(fInitialLayoutClassic, true);
      fSashForm.setMaximizedControl(fBrowserViewerControlContainer);
View Full Code Here

        menuMgr.addMenuListener(new IMenuListener() {
            public void menuAboutToShow(IMenuManager manager) {
                fillContextMenu(manager);
            }
        });
        Control control = viewer.getControl();
        Menu menu = menuMgr.createContextMenu(control);
        control.setMenu(menu);
        getSite().registerContextMenu(menuMgr, getSite().getSelectionProvider());
    }
View Full Code Here

            setText("Refresh");
            setImageDescriptor(ProsePlugin.getDefault().createImageDescriptor("icons/refresh.gif"));
        }

        public void run() {
            Control ctrl = viewer.getControl();
            if (ctrl == null || ctrl.isDisposed()) return;
            ctrl.getDisplay().syncExec(new Runnable() {
                public void run() {
                    if (!viewer.getControl().isDisposed()) {
                        viewer.refresh(run);
                    }
                }
View Full Code Here

            setText("Remove Prose Application");
            setImageDescriptor(ProsePlugin.getDefault().createImageDescriptor("icons/remove.gif"));
        }

        public void run() {
            Control ctrl = viewer.getControl();
            if (ctrl == null || ctrl.isDisposed()) return;
            ctrl.getDisplay().syncExec(new Runnable() {
                public void run() {
                    ProsePlugin.getDefault().removeRun(run);
                }
            });
View Full Code Here

            setText("Remove All Unreachable");
            setImageDescriptor(ProsePlugin.getDefault().createImageDescriptor("icons/remove_all.gif"));
        }

        public void run() {
            Control ctrl = viewer.getControl();
            if (ctrl == null || ctrl.isDisposed()) return;
            ctrl.getDisplay().syncExec(new Runnable() {
                public void run() {
                    Object[] runs = ProsePlugin.getDefault().getRuns();
                    for (int i = 0; i < runs.length; i++) {
                        ProseRunNode run = (ProseRunNode) runs[i];
                        if (!run.isReachable()) ProsePlugin.getDefault().removeRun((ProseRunNode) runs[i]);
View Full Code Here

        public void run() {
            try {
                aspectManager.commitTransaction();

                Control ctrl = viewer.getControl();
                if (ctrl == null || ctrl.isDisposed()) return;
                ctrl.getDisplay().syncExec(new Runnable() {
                    public void run() {
                        if (!viewer.getControl().isDisposed()) {
                            viewer.refresh(aspectManager);
                        }
                    }
View Full Code Here

        public void run() {
            try {
                aspectManager.abortTransaction();

                Control ctrl = viewer.getControl();
                if (ctrl == null || ctrl.isDisposed()) return;
                ctrl.getDisplay().syncExec(new Runnable() {
                    public void run() {
                        if (!viewer.getControl().isDisposed()) {
                            viewer.refresh(aspectManager);
                        }
                    }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Control

Copyright © 2018 www.massapicom. 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.