本文整理汇总了Java中org.eclipse.swt.widgets.Label.setForeground方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setForeground方法的具体用法?Java Label.setForeground怎么用?Java Label.setForeground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Label
的用法示例。
在下文中一共展示了Label.setForeground方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTestProjectUI
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private Composite initTestProjectUI(DataBindingContext dbc, Composite parent) {
// Additional test project options
final Group testProjectOptionsGroup = new Group(parent, NONE);
testProjectOptionsGroup.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).create());
final Button createTestGreeterFileButton = new Button(testProjectOptionsGroup, CHECK);
createTestGreeterFileButton.setText("Create a test project greeter file");
final Button addNormalSourceFolderButton = new Button(testProjectOptionsGroup, CHECK);
addNormalSourceFolderButton.setText("Also create a non-test source folder");
Label nextPageHint = new Label(testProjectOptionsGroup, NONE);
nextPageHint.setText("The projects which should be tested can be selected on the next page");
nextPageHint.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_FOREGROUND));
initTestProjectBinding(dbc, addNormalSourceFolderButton, createTestGreeterFileButton);
return testProjectOptionsGroup;
}
示例2: createViewerToolTipContentArea
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
@Override
protected Composite createViewerToolTipContentArea(Event event, ViewerCell cell, Composite parent) {
final Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
composite.setBackground(rowColorBack);
Plugin plugin = (Plugin) cell.getElement();
Hyperlink button = new Hyperlink(composite, SWT.FLAT);
button.setText("\uf05A");
button.setFont(fontAwesome);
button.setBackground(composite.getBackground());
button.setForeground(rowColorTitle);
button.setUnderlined(false);
button.addListener (SWT.MouseDown, e -> Program.launch(GLUON_PLUGIN_URL + plugin.getUrl()));
button.setToolTipText("Click to access the service's JavaDoc");
Label text = new Label(composite, SWT.LEFT);
final String description = plugin.getDescription();
text.setText(description.contains(".") ? description.substring(0, description.indexOf(".")) : description);
text.setBackground(composite.getBackground());
text.setForeground(rowColorTitle);
composite.pack();
return composite;
}
示例3: addErrorLabel
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void addErrorLabel(Composite container) {
Composite composite_3 = new Composite(container, SWT.NONE);
ColumnLayout cl_coposite_3 = new ColumnLayout();
cl_coposite_3.topMargin=0;
composite_3.setLayout(cl_coposite_3);
ColumnLayoutData cld_composite_3 = new ColumnLayoutData();
cld_composite_3.heightHint = 19;
composite_3.setLayoutData(cld_composite_3);
lblPropertyError = new Label(composite_3, SWT.NONE);
ColumnLayoutData cld_lblPropertyError = new ColumnLayoutData();
cld_lblPropertyError.heightHint = 25;
lblPropertyError.setLayoutData(cld_lblPropertyError);
lblPropertyError.setVisible(false);
lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
}
示例4: createButtonBar
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
@Override
protected Control createButtonBar(Composite parent) {
final Composite buttonBar = (Composite) super.createButtonBar(parent);
errorLabel = new Label(buttonBar, SWT.LEFT);
errorLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
errorLabel.setText("There are no defined remote functions");
errorLabel.setForeground(display.getSystemColor(SWT.COLOR_RED));
errorLabel.setVisible(false);
errorLabel.setFont(topFont);
errorLabel.moveAbove(super.buttonControl);
return buttonBar;
}
示例5: createButtonBar
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
@Override
protected Control createButtonBar(Composite parent) {
final Composite buttonBar = (Composite) super.createButtonBar(parent);
errorLabel = new Label(buttonBar, SWT.LEFT);
errorLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
errorLabel.setText("The provided credentials are invalid");
errorLabel.setForeground(display.getSystemColor(SWT.COLOR_RED));
errorLabel.setVisible(false);
errorLabel.setFont(topFont);
errorLabel.moveAbove(super.buttonControl);
return buttonBar;
}
示例6: addErrorLabel
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
/**
*
* @param container
*/
private void addErrorLabel(Composite container) {
lblPropertyError = new Label(container, SWT.NONE);
lblPropertyError.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,true,0,0));
lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
lblPropertyError.setText(Messages.HIVE_FIELD_DIALOG_ERROR);
lblPropertyError.setVisible(false);
lblPropertyError.setData("Error", lblPropertyError);
keyValueTableViewer.setData("Error", lblPropertyError);
}
示例7: addErrorLabel
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void addErrorLabel(Composite container) {
Composite composite_3 = new Composite(container, SWT.NONE);
composite_3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
composite_3.setLayout(new GridLayout(1, false));
lblPropertyError = new Label(composite_3, SWT.NONE);
lblPropertyError.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
lblPropertyError.setVisible(false);
lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
}
示例8: addErrorLabel
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void addErrorLabel(Composite container) {
lblPropertyError = new Label(container, SWT.NONE);
lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
lblPropertyError.setText(CREDENTIAL_BLANK_ERROR);
lblPropertyError.setVisible(false);
lblPropertyError.setData("Error", lblPropertyError);
}
示例9: addErrorLabel
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void addErrorLabel(Composite container) {
Composite composite_3 = new Composite(container, SWT.NONE);
composite_3.setLayout(new ColumnLayout());
ColumnLayoutData cld_composite_3 = new ColumnLayoutData();
cld_composite_3.heightHint = 72;
composite_3.setLayoutData(cld_composite_3);
lblPropertyError = new Label(composite_3, SWT.NONE);
ColumnLayoutData cld_lblPropertyError = new ColumnLayoutData();
cld_lblPropertyError.heightHint = 24;
lblPropertyError.setLayoutData(cld_lblPropertyError);
lblPropertyError.setVisible(false);
lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
}
示例10: addErrorLabel
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void addErrorLabel(Composite container) {
Composite composite_3 = new Composite(container, SWT.NONE);
composite_3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
composite_3.setLayout(new ColumnLayout());
lblPropertyError = new Label(composite_3, SWT.NONE);
lblPropertyError.setVisible(false);
lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
}
示例11: createErrorLabel
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private void createErrorLabel(Composite parent) {
Composite composite=new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(3,false));
composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
errorLbl = new Label(composite, SWT.NONE);
errorLbl.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 250,0,0));
errorLbl.setText("Invalid JDK bin path");
errorLbl.setVisible(false);
}
示例12: createFakeToolTip
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
/**
* Create the Shell and Label for the fake tooltip showing URLs
*/
private void createFakeToolTip() {
fakeToolTip = new Shell(GUI.shell, SWT.ON_TOP);
fakeToolTip.setLayout(LayoutShop.createFillLayout(2, 2));
fakeToolTip.setForeground(GUI.display
.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
fakeToolTip.setBackground(GUI.display
.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
fakeToolTipLabel = new Label(fakeToolTip, SWT.NONE);
fakeToolTipLabel.setForeground(GUI.display
.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
fakeToolTipLabel.setBackground(GUI.display
.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
}
示例13: createFileModifiedView
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private Composite createFileModifiedView() {
Composite blank = new Composite(this, SWT.NONE);
FillLayout fillLayout = new FillLayout();
fillLayout.marginWidth = Constants.MARGIN;
fillLayout.marginHeight = Constants.MARGIN;
blank.setLayout(fillLayout);
Label label = new Label(blank, SWT.NONE);
label.setText("File modified");
FontManager.setFont(label, Constants.MESSAGE_FONT_SIZE);
label.setForeground(Constants.Colors.ERROR);
return blank;
}
示例14: createIntroScreen
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
private Composite createIntroScreen(Composite parent) {
Composite introComp = new Composite(parent, SWT.NONE);
introComp.setLayoutData(new GridData(GridData.FILL_BOTH));
introComp.setLayout(new GridLayout());
Image image = PandionJUI.getImage("pandionj.png");
Label imageLabel = new Label(introComp, SWT.NONE);
imageLabel.setImage(image);
imageLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
Label versionLabel = new Label(introComp, SWT.NONE);
versionLabel.setText(getTitleToolTip());
versionLabel.setLayoutData(new GridData(SWT.CENTER, SWT.BEGINNING, false, false));
Link pluginLabel = new Link(introComp, SWT.NONE);
pluginLabel.setText("<a>view installed tags (@)</a>");
pluginLabel.setLayoutData(new GridData(SWT.CENTER, SWT.BEGINNING, false, false));
pluginLabel.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
String info = "";
for (ExtensionManager.TagDescription desc : ExtensionManager.getTagDescriptions()) {
String where = desc.description;
if(where == null)
where = "";
else
where += "\n";
info += desc.tag + "\n" + where + "\n";
}
MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Installed tags", info);
}
});
Label labelInit = new Label(introComp, SWT.WRAP);
FontManager.setFont(labelInit, PandionJConstants.MESSAGE_FONT_SIZE, FontStyle.ITALIC);
labelInit.setForeground(ColorConstants.gray);
labelInit.setText(PandionJConstants.Messages.START);
labelInit.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
return introComp;
}
示例15: createInfoTextArea
import org.eclipse.swt.widgets.Label; //导入方法依赖的package包/类
/**
* Creates the optional info text area. This method is only called if the
* <code>hasInfoArea()</code> method returns true. Subclasses typically
* need not override this method, but may do so.
*
* <p>
* If this method is overridden, the returned control's layout data must be
* an instance of <code>GridData</code>. This method must not modify the
* parent's layout.
*
*
* @param parent
* The parent composite.
* @return The control representing the info text area.
*
* @see PopupDialog#hasInfoArea()
* @see PopupDialog#createTitleControl(Composite)
*/
protected Control createInfoTextArea(Composite parent) {
// Status label
infoLabel = new Label(parent, SWT.RIGHT);
infoLabel.setText(infoText);
GridDataFactory.fillDefaults().grab(true, false)
.align(SWT.FILL, SWT.BEGINNING).applyTo(infoLabel);
Display display = parent.getDisplay();
infoColor = new Color(display,
blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(),
display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f));
infoLabel.setForeground(infoColor);
return infoLabel;
}