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

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

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

Label.setBackground介绍

暂无

代码示例

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

private void refreshTextNote() {
  int swt = SWT.NORMAL;
  if ( wFontBold.getSelection() ) {
   swt = SWT.BOLD;
  }
  if ( wFontItalic.getSelection() ) {
   swt = swt | SWT.ITALIC;
  }
  // dispose of old font only after setting it on wDesc
  Font oldFont = font;
  font = new Font( shell.getDisplay(), wFontName.getText(), wFontSize.getSelection(), swt );
  wDesc.setFont( font );
  if ( oldFont != null && !oldFont.isDisposed() ) {
   oldFont.dispose();
  }
  for ( Control control : wDesc.getChildren() ) {
   control.setBackground( bgColor );
  }

  wFontColor.setBackground( fontColor );
  wBackGroundColor.setBackground( bgColor );
  wBorderColor.setBackground( borderColor );
 }
}

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

public void widgetSelected( SelectionEvent e ) {
  ColorDialog cd = new ColorDialog( shell );
  cd.setText( BaseMessages.getString( PKG, "NotePadDialog.Font.Color.Dialog.Label" ) );
  cd.setRGB( wBorderColor.getBackground().getRGB() );
  RGB newColor = cd.open();
  if ( newColor == null ) {
   return;
  }
  borderColor.dispose();
  borderColor = new Color( shell.getDisplay(), newColor );
  wBorderColor.setBackground( borderColor );
 }
} );

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

public void widgetSelected( SelectionEvent e ) {
  ColorDialog cd = new ColorDialog( shell );
  cd.setText( BaseMessages.getString( PKG, "NotePadDialog.Font.Color.Dialog.Label" ) );
  cd.setRGB( wBackGroundColor.getBackground().getRGB() );
  RGB newColor = cd.open();
  if ( newColor == null ) {
   return;
  }
  bgColor.dispose();
  bgColor = new Color( shell.getDisplay(), newColor );
  wBackGroundColor.setBackground( bgColor );
  refreshTextNote();
 }
} );

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

public void widgetSelected( SelectionEvent e ) {
  ColorDialog cd = new ColorDialog( shell );
  cd.setText( BaseMessages.getString( PKG, "NotePadDialog.Font.Color.Dialog.Label" ) );
  cd.setRGB( wFontColor.getBackground().getRGB() );
  RGB newColor = cd.open();
  if ( newColor == null ) {
   return;
  }
  fontColor.dispose();
  fontColor = new Color( shell.getDisplay(), newColor );
  wFontColor.setBackground( fontColor );
  refreshTextNote();
 }
} );

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

imageLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
FormData fdImageLabel = new FormData();
fdImageLabel.left = new FormAttachment( 0, 0 );
titleLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
titleLabel.setFont( GUIResource.getInstance().getFontBold() );
FormData fdTitleLabel = new FormData();
line.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
FormData fdLine = new FormData();
fdLine.left = new FormAttachment( imageLabel, 5 );
messageLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) );
FormData fdMessageLabel = new FormData();
fdMessageLabel.left = new FormAttachment( imageLabel, 20 );

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

label.setBackground( perfComposite.getBackground() );
label.setFont( GUIResource.getInstance().getFontMedium() );

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

wFontColor.setBackground( fontColor );
wBackGroundColor.setBackground( bgColor );
wBorderColor.setBackground( borderColor );

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

wResultsLabel.setBackground( GUIResource.getInstance().getColorWhite() );
wResultsLabel.setText( BaseMessages.getString( PKG, "JobLog.ResultsPanel.NameLabel" ) );
FormData fdResultsLabel = new FormData();

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

wResultsLabel.setBackground( GUIResource.getInstance().getColorWhite() );
wResultsLabel.setText( BaseMessages.getString( PKG, "TransLog.ResultsPanel.NameLabel" ) );
FormData fdResultsLabel = new FormData();

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

sep3.setBackground( GUIResource.getInstance().getColorWhite() );
FormData fdSep3 = new FormData();
fdSep3.left = new FormAttachment( 0, 0 );
sep4.setBackground( GUIResource.getInstance().getColorWhite() );
FormData fdSep4 = new FormData();
fdSep4.left = new FormAttachment( 0, 0 );

代码示例来源:origin: org.codehaus.openxma/xmartclient

/**
   * Sets the background for this PagingControl.
   * the background color is also set for the labels 
   */    
  public void setBackground(Color color) {        
    super.setBackground(color);
    info.setBackground(color);
    pageSizeL.setBackground(color);
  }
}

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

private Label createDescriptionLabel(Composite parent, String text) {
  Label description = new Label(parent, SWT.WRAP);
  GridData data = new GridData(GridData.FILL_HORIZONTAL);
  data.horizontalSpan = 2;
  description.setLayoutData(data);
  description.setText(text);
  description.setBackground(getBackgroundColor(parent));
  return description;
}

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

private Label createLabel(Composite parent, String text) {
  Label label = new Label(parent, SWT.NONE);
  GridData data= new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(data);
  if (text != null)
    label.setText(text);
  label.setBackground(fBackgroundColor);
  label.setForeground(fForegroundColor);
  return label;
}

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

protected Label createDescriptionLabel(Composite parent, String text) {
  Label description = new Label(parent, SWT.WRAP);
  GridData data = new GridData(GridData.FILL_HORIZONTAL);
  data.horizontalSpan = 2;
  data.widthHint = 100;
  description.setLayoutData(data);
  description.setText(text);
  description.setBackground(getBackgroundColor());
  return description;
}

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

private Label createLabel(Composite parent, String text) {
  Label label = new Label(parent, SWT.NONE);
  if (text != null)
    label.setText(text);
  label.setBackground(fBackgroundColor);
  label.setForeground(fForegroundColor);
  return label;
}

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

private Label createTitleLabel(Composite parent, String text) {
  Label label = new Label(parent, SWT.NONE);
  if (text != null)
    label.setText(text);
  label.setBackground(fBackgroundColor);
  label.setForeground(fForegroundColor);
  label.setFont(JFaceResources.getHeaderFont());
  fHeaderLabels.add(label);
  return label;
}

代码示例来源:origin: infinitest/infinitest

@Override
  public void run() {
    statusLabel.setBackground(getColor(systemColor));
    composite.redraw();
  }
});

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

private Label createBanner(Composite parent, String text) {
    Label label = new Label(parent, SWT.NONE);
    if (text != null)
      label.setText(text);
    label.setBackground(fBackgroundColor);
    label.setForeground(fForegroundColor);
    label.setFont(JFaceResources.getBannerFont());
    return label;
  }
}

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

/**
 * Set the colors of the message area.
 *
 * @param color
 *            The color to be use in the message area.
 */
private void setMessageColors(Color color) {
  messageText.setBackground(color);
  messageComposite.setBackground(color);
  messageImageLabel.setBackground(color);
}

代码示例来源:origin: infinitest/infinitest

private void addStatusLabel(int newSide) {
  statusLabel = new Label(composite, BORDER | LEFT);
  statusLabel.setLayoutData(getRowData(newSide));
  statusLabel.setForeground(getColor(COLOR_WHITE));
  statusLabel.setText(statusString);
  statusLabel.setBackground(getColor(backgroundColor));
}

相关文章