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

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

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

Label.setForeground介绍

暂无

代码示例

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

wlStatusMessage.setForeground( display.getSystemColor( SWT.COLOR_RED ) );
props.setLook( wlStatusMessage );
fdlStatusMessage = new FormData();

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

fdlPOP3Message.top = new FormAttachment( 0, 3 * margin );
wlPOP3Message.setLayoutData( fdlPOP3Message );
wlPOP3Message.setForeground( GUIResource.getInstance().getColorOrange() );

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

fdlPOP3Message.top = new FormAttachment( wActionType, 3 * margin );
wlPOP3Message.setLayoutData( fdlPOP3Message );
wlPOP3Message.setForeground( GUIResource.getInstance().getColorOrange() );

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

private Label createLabel(Composite parent, String text) {
  Label label= new Label(parent, SWT.WRAP);
  if (text != null)
    label.setText(text);
  label.setBackground(fBackgroundColor);
  label.setForeground(fForegroundColor);
  GridData gd= new GridData(SWT.FILL, SWT.FILL, true, false);
  label.setLayoutData(gd);
  return label;
}

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

@Override
  public void run() {
    statusLabel.setForeground(getColor(color));
  }
});

代码示例来源: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.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.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.jdt/org.eclipse.jdt.ui

private Label createLabel(Composite parent, String text) {
  Label label= new Label(parent, SWT.WRAP);
  if (text != null)
    label.setText(text);
  label.setBackground(fBackgroundColor);
  label.setForeground(fForegroundColor);
  GridData gd= new GridData(SWT.FILL, SWT.FILL, true, false);
  label.setLayoutData(gd);
  return label;
}

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

private Label createLabel(Composite parent, String text) {
  Label label= new Label(parent, SWT.WRAP);
  if (text != null)
    label.setText(text);
  label.setBackground(fBackgroundColor);
  label.setForeground(fForegroundColor);
  GridData gd= new GridData(SWT.FILL, SWT.FILL, true, false);
  label.setLayoutData(gd);
  return label;
}

代码示例来源:origin: org.eclipse.platform/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: be.yildiz-games/module-window-swt

public Label createLabel(final String text, final SwtWindowUtils.ColorValue color, final Font font) {
  Label label = new Label(this.shell, SWT.NONE);
  label.setFont(font);
  label.setForeground(this.shell.getDisplay().getSystemColor(color.value));
  label.setText(text);
  return label;
}

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

private Label createHeader(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);
  label.setFont(JFaceResources.getHeaderFont());
  return label;
}

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

private Label createHeader(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);
  label.setFont(JFaceResources.getHeaderFont());
  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: 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: 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));
}

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

private void createSmallNavigator(Composite parent, IntroLink[] links) {
  for (int i = 0; i < links.length; i++) {
    Control c = createImageHyperlink(parent, links[i]);
    c.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
  }
  for (int i = 0; i < links.length; i++) {
    Label text = toolkit.createLabel(parent, links[i].getLabel());
    text.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
    text.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
  }
}

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

@Override
  public void mouseUp(MouseEvent e) {
    boolean vis = !config.getBooleanParameter(keys[f_i] + ".vis", true );
    config.setParameter(keys[f_i] + ".vis", vis );
    listener.visibilityChange( vis, f_i );
    lblDesc.setForeground(vis?Colors.getSystemColor(lblDesc.getDisplay(), SWT.COLOR_BLACK ):Colors.grey );
  }
});

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

private void setStatusLabelColors(Color foreground, Color background) {
  if (foreground == null || background == null) return;
  if (fStatusLabelForeground != null) {
    fStatusLabelForeground.dispose();
  }
  fStatusLabelForeground = new Color(fStatusLabel.getDisplay(), Colors.blend(background.getRGB(), foreground.getRGB(), 0.56f));
  fStatusLabel.setForeground(fStatusLabelForeground);
  fStatusLabel.setBackground(background);
}

相关文章