org.eclipse.swt.widgets.Button.setCursor()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.eclipse.swt.widgets.Button.setCursor()方法的一些代码示例,展示了Button.setCursor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setCursor()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Button
类名称:Button
方法名:setCursor

Button.setCursor介绍

暂无

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.ui

public void handleEvent(Event event) {
    if (event.type == SWT.MouseHover)
      advancedButton.setCursor(hand);
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

@Override
protected void clearCursors() {
  if (detailsButton != null && !detailsButton.isDisposed()) {
    detailsButton.setCursor(null);
  }
  super.clearCursors();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

/**
 * Create the details button for the receiver.
 *
 * @param parent
 *            The parent of the new button.
 */
protected void createDetailsButton(Composite parent) {
  detailsButton = createButton(parent, IDialogConstants.DETAILS_ID,
      ProgressMessages.ProgressMonitorJobsDialog_DetailsTitle,
      false);
  detailsButton.addSelectionListener(widgetSelectedAdapter(e -> handleDetailsButtonSelect()));
  detailsButton.setCursor(arrowCursor);
  detailsButton.setEnabled(enableDetailsButton);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Clear the cursors in the dialog.
 *
 * @since 3.0
 */
protected void clearCursors() {
  if (cancel != null && !cancel.isDisposed()) {
    cancel.setCursor(null);
  }
  Shell shell = getShell();
  if (shell != null && !shell.isDisposed()) {
    shell.setCursor(null);
  }
  if (arrowCursor != null) {
    arrowCursor.dispose();
  }
  arrowCursor = null;
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.debug.ui

protected void createCancelButton(Composite parent) {
    cancel = createButton(parent, IDialogConstants.CANCEL_ID,
        IDialogConstants.STOP_LABEL, true);
    if (arrowCursor == null) {
      arrowCursor = new Cursor(cancel.getDisplay(), SWT.CURSOR_ARROW);
    }
    cancel.setCursor(arrowCursor);
    setOperationCancelButtonEnabled(enableCancelButton);
  }
};

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Creates the cancel button.
 *
 * @param parent
 *            the parent composite
 * @since 3.0
 */
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);
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Clear the cursors in the dialog.
 */
protected void clearCursors() {
  if (cancel != null && !cancel.isDisposed()) {
    cancel.setCursor(null);
  }
  Shell shell = getShell();
  if (shell != null && !shell.isDisposed()) {
    shell.setCursor(null);
  }
  if (arrowCursor != null) {
    arrowCursor.dispose();
  }
  if (waitCursor != null) {
    waitCursor.dispose();
  }
  arrowCursor = null;
  waitCursor = null;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Clear the cursors in the dialog.
 *
 * @since 3.0
 */
protected void clearCursors() {
  if (cancel != null && !cancel.isDisposed()) {
    cancel.setCursor(null);
  }
  Shell shell = getShell();
  if (shell != null && !shell.isDisposed()) {
    shell.setCursor(null);
  }
  if (arrowCursor != null) {
    arrowCursor.dispose();
  }
  if (waitCursor != null) {
    waitCursor.dispose();
  }
  arrowCursor = null;
  waitCursor = null;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Creates the cancel button.
 *
 * @param parent
 *            the parent composite
 * @since 3.0
 */
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);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

@Override
protected void createButtonsForButtonBar(Composite parent) {
  Button runInWorkspace = createButton(
      parent,
      IDialogConstants.CLOSE_ID,
      ProgressMessages.ProgressMonitorFocusJobDialog_RunInBackgroundButton,
      true);
  runInWorkspace.addSelectionListener(widgetSelectedAdapter(e -> {
    Rectangle shellPosition = getShell().getBounds();
    job.setProperty(IProgressConstants.PROPERTY_IN_DIALOG, Boolean.FALSE);
    finishedRun();
    ProgressManagerUtil.animateDown(shellPosition);
  }));
  runInWorkspace.setCursor(arrowCursor);
  cancel = createButton(parent, IDialogConstants.CANCEL_ID,
      IDialogConstants.CANCEL_LABEL, false);
  cancel.setCursor(arrowCursor);
  createDetailsButton(parent);
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Creates the cancel button.
 *
 * @param parent
 *            the parent composite
 */
protected void createCancelButton(Composite parent) {
  cancel = createButton(parent, IDialogConstants.CANCEL_ID,
      IDialogConstants.get().CANCEL_LABEL, true);
  if (arrowCursor == null) {
    arrowCursor = new Cursor(cancel.getDisplay(), SWT.CURSOR_ARROW);
  }
  cancel.setCursor(arrowCursor);
  setOperationCancelButtonEnabled(enableCancelButton);
}

代码示例来源:origin: org.eclipse/org.eclipse.ltk.ui.refactoring

private void stopped(Object savedState) {
  Shell shell= getShell();
  if (shell != null) {
    Button cancelButton= getButton(IDialogConstants.CANCEL_ID);
    
    if (fProgressMonitorPart != null)
      fProgressMonitorPart.removeFromCancelComponent(cancelButton);
      
    fStatusContainer.showPage(fMessageBox);
    Map state = (Map)savedState;
    restoreUIState(state);

    setDisplayCursor(shell.getDisplay(), null);    
    cancelButton.setCursor(null);
    fWaitCursor.dispose();
    fWaitCursor = null;
    fArrowCursor.dispose();
    fArrowCursor = null;
    Control focusControl = (Control)state.get("focus"); //$NON-NLS-1$
    if (focusControl != null)
      focusControl.setFocus();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * A long running operation triggered through the wizard was stopped either
 * by user input or by normal end. Hides the progress monitor and restores
 * the enable state wizard's buttons and controls.
 *
 * @param savedState
 *            the saved UI state as returned by <code>aboutToStart</code>
 * @see #aboutToStart
 */
private void stopped(Map<String, Object> savedState) {
  if (getShell() != null && !getShell().isDisposed()) {
    if (wizard.needsProgressMonitor()) {
      progressMonitorPart.setVisible(false);
      progressMonitorPart.removeFromCancelComponent(cancelButton);
    }
    restoreUIState(savedState);
    setDisplayCursor(null);
    if (useCustomProgressMonitorPart) {
      cancelButton.addSelectionListener(cancelListener);
      cancelButton.setCursor(null);
    }
    Control focusControl = (Control) savedState.get(FOCUS_CONTROL);
    if (focusControl != null && !focusControl.isDisposed()) {
      focusControl.setFocus();
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.search

/**
 * A long running operation triggered through the wizard
 * was stopped either by user input or by normal end.
 * @param savedState The saveState returned by <code>aboutToStart</code>.
 * @see #aboutToStart(boolean)
 */
protected synchronized void stopped(Object savedState) {
  Assert.isTrue( savedState instanceof HashMap);
  Shell shell= getShell();
  if (shell != null) {
    if (fUseEmbeddedProgressMonitorPart) {
      fProgressMonitorPart.setVisible(false);
      fProgressMonitorPart.removeFromCancelComponent(fCancelButton);
    }
    @SuppressWarnings("unchecked")
    HashMap<Object, Object> state= (HashMap<Object, Object>)savedState;
    restoreUIState(state);
    setDisplayCursor(shell.getDisplay(), null);
    fCancelButton.setCursor(null);
    Control focusControl= (Control)state.get(FOCUS_CONTROL);
    if (focusControl != null && ! focusControl.isDisposed())
      focusControl.setFocus();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.search

fCancelButton.setCursor(d.getSystemCursor(SWT.CURSOR_ARROW));

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

if (useCustomProgressMonitorPart) {
  cancelButton.addSelectionListener(cancelListener);
  cancelButton.setCursor(null);
  arrowCursor.dispose();
  arrowCursor = null;

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

if (useCustomProgressMonitorPart) {
  cancelButton.addSelectionListener(cancelListener);
  cancelButton.setCursor(null);
  arrowCursor.dispose();
  arrowCursor = null;

代码示例来源:origin: org.eclipse/org.eclipse.search

fCancelButton.setCursor(fArrowCursor);

代码示例来源:origin: org.eclipse/org.eclipse.search

/**
 * A long running operation triggered through the wizard
 * was stopped either by user input or by normal end.
 * @param savedState The saveState returned by <code>aboutToStart</code>.
 * @see #aboutToStart(boolean)
 */
protected synchronized void stopped(Object savedState) {
  Assert.isTrue( savedState instanceof HashMap);
  Shell shell= getShell();
  if (shell != null) {
    if (fUseEmbeddedProgressMonitorPart) {
      fProgressMonitorPart.setVisible(false);	
      fProgressMonitorPart.removeFromCancelComponent(fCancelButton);
    }
        
    HashMap state= (HashMap)savedState;
    restoreUIState(state);

    setDisplayCursor(shell.getDisplay(), null);    
    fCancelButton.setCursor(null);
    fWaitCursor.dispose();
    fWaitCursor= null;
    fArrowCursor.dispose();
    fArrowCursor= null;
    Control focusControl= (Control)state.get(FOCUS_CONTROL);
    if (focusControl != null && ! focusControl.isDisposed())
      focusControl.setFocus();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.ltk.ui.refactoring

cancelButton.setCursor(fArrowCursor);

相关文章

Button类方法