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

x33g5p2x  于2022-01-23 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(261)

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

Label.setImage介绍

[英]Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.
[中]将接收器图像设置为参数,该参数可能为null,表示不应显示图像。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

public void handleEvent( Event event ) {
  cancelButton.setImage(
    new Image( display, GoogleAuthorizationDialog.class.getResourceAsStream( "/images/close-button.png" ) ) );
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * build icon cell
 */
protected void buildIconCell() {
 Image icon = Display.getCurrent().getSystemImage( SWT.ICON_INFORMATION );
 this.iconLabel = new Label( this.dialog, SWT.NONE );
 this.iconLabel.setImage( icon );
 GridData grdData = new GridData();
 grdData.horizontalIndent = DEFAULT_INDENT;
 grdData.verticalIndent = DEFAULT_INDENT;
 this.iconLabel.setLayoutData( grdData );
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * build icon cell
 */
protected void buildIconCell() {
 Image icon = Display.getCurrent().getSystemImage( SWT.ICON_INFORMATION );
 this.iconLabel = new Label( this.dialog, SWT.NONE );
 this.iconLabel.setImage( icon );
 GridData grdData = new GridData();
 grdData.horizontalIndent = DEFAULT_INDENT;
 grdData.verticalIndent = DEFAULT_INDENT;
 this.iconLabel.setLayoutData( grdData );
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * build icon cell
 */
protected void buildIconCell() {
 Image icon = Display.getCurrent().getSystemImage( SWT.ICON_INFORMATION );
 this.iconLabel = new Label( this.dialog, SWT.NONE );
 this.iconLabel.setImage( icon );
 GridData grdData = new GridData();
 grdData.horizontalIndent = DEFAULT_INDENT;
 grdData.verticalIndent = DEFAULT_INDENT;
 this.iconLabel.setLayoutData( grdData );
}

代码示例来源:origin: pentaho/pentaho-kettle

public void handleEvent( Event event ) {
  cancelButton.setImage(
    new Image( display, GoogleAuthorizationDialog.class.getResourceAsStream( "/images/close-button-hover.png" ) ) );
  cancelButton.setCursor( new Cursor( display, SWT.CURSOR_HAND ) );
 }
} );

代码示例来源:origin: caoxinyu/RedisClient

label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
label.setAlignment(SWT.CENTER);
label.setImage(code);

代码示例来源:origin: caoxinyu/RedisClient

lblNewLabel_1.setImage(questionImage);

代码示例来源:origin: caoxinyu/RedisClient

private void tranformImage(Combo imageType, Label label) {
  int index = imageType.getSelectionIndex();
  if (index == 0) {
    BASE64Decoder decode = new BASE64Decoder();
    try {
      byte[] b = decode.decodeBuffer(value);
      ByteArrayInputStream bais = new ByteArrayInputStream(b);
      Image img = new Image(shell.getDisplay(), bais);
      label.setImage(img);
      
    } catch (SWTException e) {
      imageType.select(currentImageType);
      throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.IMAGEEXCEPTION));
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
  shell.pack();
  setMiddle();
}

代码示例来源:origin: pentaho/pentaho-kettle

private void setWarningIcon( Display display ) {
 warningIcon = new Label( shell, SWT.NONE );
 Image image = display.getSystemImage( SWT.ICON_WARNING );
 warningIcon.setImage( image );
 props.setLook( warningIcon );
 FormData fdIcon = new FormData();
 fdIcon.left = new FormAttachment( 0, 0 );
 fdIcon.top = new FormAttachment( 0, 0 );
 fdIcon.right = new FormAttachment( 0, image.getBounds().width );
 fdIcon.bottom = new FormAttachment( 0, image.getBounds().height ); //icon should be at the top left corner
 warningIcon.setLayoutData( fdIcon );
}

代码示例来源:origin: pentaho/pentaho-kettle

private void minMaxExtraView() {
 // What is the state?
 //
 boolean maximized = sashForm.getMaximizedControl() != null;
 if ( maximized ) {
  // Minimize
  //
  sashForm.setMaximizedControl( null );
  minMaxButton.setImage( GUIResource.getInstance().getImageMaximizePanel() );
  minMaxButton.setToolTipText( BaseMessages
   .getString( PKG, "JobGraph.ExecutionResultsPanel.MaxButton.Tooltip" ) );
 } else {
  // Maximize
  //
  sashForm.setMaximizedControl( extraViewComposite );
  minMaxButton.setImage( GUIResource.getInstance().getImageMinimizePanel() );
  minMaxButton.setToolTipText( BaseMessages
   .getString( PKG, "JobGraph.ExecutionResultsPanel.MinButton.Tooltip" ) );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

private void minMaxExtraView() {
 // What is the state?
 //
 boolean maximized = sashForm.getMaximizedControl() != null;
 if ( maximized ) {
  // Minimize
  //
  sashForm.setMaximizedControl( null );
  minMaxButton.setImage( GUIResource.getInstance().getImageMaximizePanel() );
  minMaxButton
   .setToolTipText( BaseMessages.getString( PKG, "TransGraph.ExecutionResultsPanel.MaxButton.Tooltip" ) );
 } else {
  // Maximize
  //
  sashForm.setMaximizedControl( extraViewComposite );
  minMaxButton.setImage( GUIResource.getInstance().getImageMinimizePanel() );
  minMaxButton
   .setToolTipText( BaseMessages.getString( PKG, "TransGraph.ExecutionResultsPanel.MinButton.Tooltip" ) );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

private void buildHeader() {
 buildPreHeader();
 // Step icon
 final Label wicon = new Label( shell, SWT.RIGHT );
 wicon.setImage( getImage() );
 wicon.setLayoutData( new FormDataBuilder().top( 0, -BaseDialog.LABEL_SPACING ).right( 100, 0 ).result() );
 props.setLook( wicon );
 // Step name label
 wlStepname = new Label( shell, SWT.RIGHT );
 wlStepname.setText( BaseMessages.getString( PKG, "CommonStepDialog.Stepname.Label" ) ); //$NON-NLS-1$
 props.setLook( wlStepname );
 fdlStepname = new FormDataBuilder().left( 0, 0 ).top( 0, -BaseDialog.LABEL_SPACING ).result();
 wlStepname.setLayoutData( fdlStepname );
 // Step name field
 wStepname = new Text( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
 wStepname.setText( stepname );
 props.setLook( wStepname );
 wStepname.addModifyListener( lsMod );
 wStepname.addSelectionListener( lsDef );
 fdStepname = new FormDataBuilder().width( BaseDialog.MEDIUM_FIELD ).left( 0, 0 ).top(
  wlStepname, BaseDialog.LABEL_SPACING ).result();
 wStepname.setLayoutData( fdStepname );
 // horizontal separator between step name and tabs
 headerSpacer = new Label( shell, SWT.HORIZONTAL | SWT.SEPARATOR );
 props.setLook( headerSpacer );
 headerSpacer.setLayoutData( new FormDataBuilder().left().right( 100, 0 ).top(
  wStepname, BaseDialog.MARGIN_SIZE ).width( SHELL_WIDTH - 2 * ( BaseDialog.MARGIN_SIZE ) ).result() );
 buildPostHeader();
}

代码示例来源:origin: pentaho/pentaho-kettle

wIcon.setImage( image );
FormData fdIcon = new FormData();
fdIcon.left = new FormAttachment( 0, 0 );

代码示例来源:origin: pentaho/pentaho-kettle

imageLabel.setImage( image );
imageLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
FormData fdImageLabel = new FormData();

代码示例来源:origin: pentaho/pentaho-kettle

wlImage.setImage( GUIResource.getInstance().getImageWarning32() );
FormData fdWarnImage = new FormData();
fdWarnImage.left = new FormAttachment( 0, 15 );

代码示例来源:origin: pentaho/pentaho-kettle

props.setLook( image );
Image icon = display.getSystemImage( SWT.ICON_QUESTION );
image.setImage( icon );
FormData imageData = new FormData();
imageData.left = new FormAttachment( 0, 5 );

代码示例来源:origin: pentaho/pentaho-kettle

wiInfo.setImage( display.getSystemImage( SWT.ICON_INFORMATION ) );

代码示例来源:origin: pentaho/pentaho-kettle

Label lIcon = new Label( shell, SWT.RIGHT );
lIcon.setLayoutData( new FormDataBuilder().right().result() );
lIcon.setImage( JobDialog.getImage( shell, JobDialog.getPlugin( getEntry() ) ) );

代码示例来源:origin: pentaho/pentaho-kettle

closeButton.setImage( GUIResource.getInstance().getImageClosePanel() );
closeButton
 .setToolTipText( BaseMessages.getString( PKG, "JobGraph.ExecutionResultsPanel.CloseButton.Tooltip" ) );
minMaxButton.setImage( GUIResource.getInstance().getImageMaximizePanel() );
minMaxButton
 .setToolTipText( BaseMessages.getString( PKG, "JobGraph.ExecutionResultsPanel.MaxButton.Tooltip" ) );

代码示例来源:origin: pentaho/pentaho-kettle

closeButton.setImage( GUIResource.getInstance().getImageClosePanel() );
closeButton.setToolTipText( BaseMessages.getString( PKG, "TransGraph.ExecutionResultsPanel.CloseButton.Tooltip" ) );
FormData fdClose = new FormData();
minMaxButton.setImage( GUIResource.getInstance().getImageMaximizePanel() );
minMaxButton.setToolTipText( BaseMessages.getString( PKG, "TransGraph.ExecutionResultsPanel.MaxButton.Tooltip" ) );
FormData fdMinMax = new FormData();

相关文章