Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Cursor


  }

  //setzt den Maus auf Pfeil
  public static void stopCursor(Shell shell){
    if(!shell.isDisposed())
      shell.setCursor(new Cursor(shell.getDisplay(), SWT.CURSOR_ARROW));
  }
View Full Code Here


        final Button btnNewButton = new Button(parent, SWT.NONE);
        btnNewButton.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
        btnNewButton.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_WAIT);
                try {
                    parent.setCursor(cursor);
                    parent.setEnabled(false);

                    final RuntimeInfo runtime = BackendCore.getRuntimeInfoCatalog()
                            .getErlideRuntime();
                    HostnameUtils.detectHostNames(runtime.getOtpHome());
                    updateHostNames();
                } finally {
                    parent.setCursor(null);
                    parent.setEnabled(true);
                    cursor.dispose();
                }
            }

        });
        btnNewButton.setText("Detect host names");
View Full Code Here

     *            int The ID value for the cursor
     * @return Cursor The system cursor matching the specific ID
     */
    public static Cursor getCursor(final int id) {
        final Integer key = Integer.valueOf(id);
        Cursor cursor = m_idToCursorMap.get(key);
        if (cursor == null) {
            cursor = new Cursor(Display.getDefault(), id);
            m_idToCursorMap.put(key, cursor);
        }
        return cursor;
    }
View Full Code Here

        final Font font = JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
        viewer.getTextWidget().setFont(font);
        new ErlangSourceViewerUpdater(viewer, configuration, store);
        viewer.setEditable(false);

        final Cursor arrowCursor = viewer.getTextWidget().getDisplay()
                .getSystemCursor(SWT.CURSOR_ARROW);
        viewer.getTextWidget().setCursor(arrowCursor);

        return viewer;
    }
View Full Code Here

   */
  protected void configureShell(final Shell shell) {
    super.configureShell(shell);
    shell.setText(JFaceResources.getString("ProgressMonitorDialog.title")); //$NON-NLS-1$
    if (waitCursor == null) {
      waitCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
    }
    shell.setCursor(waitCursor);
    // Add a listener to set the message properly when the dialog becomes
    // visible
    shell.addListener(SWT.Show, new Listener() {
View Full Code Here

   */
  protected void createCancelButton(Composite parent) {
    cancel = createButton(parent, IDialogConstants.CANCEL_ID,
        IDialogConstants.CANCEL_LABEL, true);
    if (arrowCursor == null) {
      arrowCursor = new Cursor(cancel.getDisplay(), SWT.CURSOR_ARROW);
    }
    cancel.setCursor(arrowCursor);
    setOperationCancelButtonEnabled(enableCancelButton);
  }
View Full Code Here

     */
  private ToolBar createHelpImageButton(Composite parent, Image image) {
        ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
        ((GridLayout) parent.getLayout()).numColumns++;
    toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
    final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
    toolBar.setCursor(cursor);
    toolBar.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        cursor.dispose();
      }
    });   
        fHelpButton = new ToolItem(toolBar, SWT.CHECK);
    fHelpButton.setImage(image);
    fHelpButton.setToolTipText(JFaceResources.getString("helpToolTip")); //$NON-NLS-1$
View Full Code Here

    fProgressBarComposite.setLayout(layout);
    fProgressBar = new ProgressIndicator(fProgressBarComposite);
    fProgressBar.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
        | GridData.GRAB_VERTICAL));

    fStopButtonCursor = new Cursor(getDisplay(), SWT.CURSOR_ARROW);
  }
View Full Code Here

 
  public static Cursor getCursor(int type) {
    String name = "CURSOR:" + type;
    if (resources.containsKey(name))
      return (Cursor) resources.get(name);
    Cursor cursor = new Cursor(Display.getDefault(), type);
    resources.put(name, cursor);
    return cursor;
  }
View Full Code Here

     */
    public void run(IAction action)
    {
        IWorkbenchWindow window = PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow();
        Cursor waitCursor = new Cursor(window.getShell().getDisplay(),
                SWT.CURSOR_WAIT);
        try
        {
            window.getShell().setCursor(waitCursor);
            ((ApplicationWindow) window).setStatus(Messages.ADDING_NATURE);

            //new way
            if (currentJavaProject == null)
            {
                // if the java nature is not present
                // it must be added, along with the Derby nature
                IProjectDescription description = currentProject
                        .getDescription();
                String[] natureIds = description.getNatureIds();
                String[] newNatures = new String[natureIds.length + 2];
                System.arraycopy(natureIds, 0, newNatures, 0, natureIds.length);
                newNatures[newNatures.length - 2] = JavaCore.NATURE_ID;
                newNatures[newNatures.length - 1] = CommonNames.DERBY_NATURE;
                description.setNatureIds(newNatures);
                currentProject.setDescription(description, null);

                currentJavaProject = (IJavaProject) JavaCore
                        .create((IProject) currentProject);
            }
            else
            {
                //add the derby nature, the java nature is already present
                IProjectDescription description = currentJavaProject
                        .getProject().getDescription();
                String[] natures = description.getNatureIds();
                String[] newNatures = new String[natures.length + 1];
                System.arraycopy(natures, 0, newNatures, 0, natures.length);
                // must prefix with plugin id
                newNatures[natures.length] = CommonNames.DERBY_NATURE;
                description.setNatureIds(newNatures);
                currentJavaProject.getProject().setDescription(description,
                        null);
            }

            IClasspathEntry[] rawClasspath = currentJavaProject
                    .getRawClasspath();

            currentJavaProject.setRawClasspath(DerbyUtils
                    .addDerbyJars(rawClasspath), null);

            // refresh project so user sees new files, libraries, etc
            currentJavaProject.getProject().refreshLocal(
                    IResource.DEPTH_INFINITE, null);
            ((ApplicationWindow) window).setStatus(Messages.DERBY_NATURE_ADDED);

        } catch ( Exception e)
        {
            Logger.log(Messages.ERROR_ADDING_NATURE + " '"
                    + currentJavaProject.getProject().getName() + "' : " + e,
                    IStatus.ERROR);
            Shell shell = new Shell();
            MessageDialog.openInformation(shell, CommonNames.PLUGIN_NAME,
                    Messages.ERROR_ADDING_NATURE + ":\n"
                            + SelectionUtil.getStatusMessages(e));
        } finally
        {
            window.getShell().setCursor(null);
            waitCursor.dispose();
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.Cursor

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.