當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。