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

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

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

Button.getDisplay介绍

暂无

代码示例

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void widgetSelected(SelectionEvent e){
     newIconChosen( null );
     updateButtonIcon(iconChooser.getDisplay(), null);
  }    
});

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

@Override
protected void setButtonLayoutData(Button button) {
  GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
  // On large fonts this can make this dialog huge
  widthHint = Math.min(widthHint,
      button.getDisplay().getBounds().width / 5);
  Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
  data.widthHint = Math.max(widthHint, minSize.x);
  button.setLayoutData(data);
}

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

@Override
protected void setButtonLayoutData(Button button) {
  GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
  // On large fonts this can make this dialog huge
  widthHint = Math.min(widthHint,
      button.getDisplay().getBounds().width / 5);
  Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
  data.widthHint = Math.max(widthHint, minSize.x);
  button.setLayoutData(data);
}

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

protected void setButtonLayoutData(Button button) {
  GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
  // On large fonts this can make this dialog huge
  widthHint = Math.min(widthHint,
      button.getDisplay().getBounds().width / 5);
  Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
  data.widthHint = Math.max(widthHint, minSize.x);
  button.setLayoutData(data);
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
public void parameterChanged(String parameterName) {
 file = COConfigurationManager.getStringParameter(configID);

 updateButtonIcon(iconChooser.getDisplay(), file);
}

代码示例来源:origin: BiglySoftware/BiglyBT

public void setColor(int _r, int _g, int _b) {
    r = _r;
    g = _g;
    b = _b;

    if (configID == null) {
    updateButtonColor(colorChooser.getDisplay(), r, g, b);
    } else {
      COConfigurationManager.setRGBParameter(configID, r, g, b);
    }
 }
}

代码示例来源:origin: BiglySoftware/BiglyBT

public void setIcon(String _file) {
    file = _file;

    if (configID == null) {
      updateButtonIcon(iconChooser.getDisplay(), file);
    } else {
      COConfigurationManager.setParameter(configID, file);
    }
 }
}

代码示例来源:origin: org.xworker/xworker_swt

@Override
public void finished(UserTask task) {
  this.append(task.getLabel() + " finished");
  
  final Button closeButton = (Button) actionContext.getObject("closeButton");
  if(closeButton != null && !closeButton.isDisposed()){
    closeButton.getDisplay().asyncExec(new Runnable(){
      public void run(){
        closeButton.setEnabled(true);
      }
    });
    
  }
}

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

@Override
protected void updateCheckBox(Button curr) {
  super.updateCheckBox(curr);
  Event event= new Event();
  event.type= SWT.Selection;
  event.display= curr.getDisplay();
  event.widget= curr;
  curr.notifyListeners(SWT.Selection, event);
}

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

@Override
protected void updateCheckBox(Button curr) {
  super.updateCheckBox(curr);
  Event event= new Event();
  event.type= SWT.Selection;
  event.display= curr.getDisplay();
  event.widget= curr;
  curr.notifyListeners(SWT.Selection, event);
}

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

protected void updateCheckBox(Button curr) {
  super.updateCheckBox(curr);
  Event event= new Event();
  event.type= SWT.Selection;
  event.display= curr.getDisplay();
  event.widget= curr;
  curr.notifyListeners(SWT.Selection, event);
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
public void parameterChanged(String parameterName) {
 r = COConfigurationManager.getIntParameter(configID +".red");
 g = COConfigurationManager.getIntParameter(configID +".green");
 b = COConfigurationManager.getIntParameter(configID +".blue");
 updateButtonColor(colorChooser.getDisplay(), r, g, b);
}

代码示例来源: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.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.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: com.eclipsesource.tabris/tabris

@Override
public void createUi( Composite uiParent ) {
 if( control == null ) {
  control = new Button( uiParent, SWT.PUSH );
  control.setData( RWT.CUSTOM_VARIANT, CUSTOM_VARIANT_TABRIS_UI );
  control.setEnabled( descriptor.isEnabled() );
  control.setVisible( descriptor.isVisible() );
  control.setToolTipText( descriptor.getTitle() );
  control.setImage( getImage( control.getDisplay(), descriptor.getImage() ) );
  control.addListener( SWT.Selection, new ActionSelectionListener() );
 }
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
 public void handleEvent(Event e) {
   FileDialog dialog = new FileDialog(iconChooser.getShell(), SWT.APPLICATION_MODAL);
   dialog.setFilterPath( file);
      String newFile = dialog.open();
   if ( newFile == null ){
     return;
   }
   
   newIconChosen(newFile);
      if (configID != null) {
        COConfigurationManager.setParameter(configID, newFile);
   } else {
     file = newFile;
     updateButtonIcon(iconChooser.getDisplay(), file);
   }
   newIconSet(newFile);
 }
});

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

/**
 * Update the image being displayed on the button using the current color
 * setting.
 */
protected void updateColorImage() {
  Display display = fButton.getDisplay();
  GC gc = new GC(fImage);
  gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
  gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);
  if (fColor != null) {
    fColor.dispose();
  }
  fColor = new Color(display, fColorValue);
  gc.setBackground(fColor);
  gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5);
  gc.dispose();
  fButton.setImage(fImage);
}

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

/**
 * Update the image being displayed on the button using the current color
 * setting.
 */
protected void updateColorImage() {
  Display display = fButton.getDisplay();
  GC gc = new GC(fImage);
  gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
  gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);
  if (fColor != null) {
    fColor.dispose();
  }
  fColor = new Color(display, fColorValue);
  gc.setBackground(fColor);
  gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5);
  gc.dispose();
  fButton.setImage(fImage);
}

相关文章

微信公众号

最新文章

更多

Button类方法