当前位置: 首页>>代码示例>>Java>>正文


Java Label.setForeground方法代码示例

本文整理汇总了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;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:N4MFWizardNewProjectCreationPage.java

示例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;
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:25,代码来源:PluginsSWT.java

示例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));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:17,代码来源:RuntimePropertyDialog.java

示例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;
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:15,代码来源:CodeSWT.java

示例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;
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:15,代码来源:AccountSWT.java

示例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);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:15,代码来源:HivePartitionKeyValueDialog.java

示例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));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:FieldDialog.java

示例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);
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:HiveInputExtractMetaStoreDialog.java

示例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));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:15,代码来源:HiveOutputFieldDialog.java

示例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));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:SecondaryColumnKeysDialog.java

示例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);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:JdkPathDialog.java

示例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));
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:17,代码来源:FakeToolTip.java

示例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;
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:13,代码来源:InvocationArea.java

示例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;
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:44,代码来源:PandionJView.java

示例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;
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:33,代码来源:PopupDialog.java


注:本文中的org.eclipse.swt.widgets.Label.setForeground方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。