Java Code Examples for org.eclipse.swt.widgets.Label.setForeground()

The following are Jave code examples for showing how to use setForeground() of the org.eclipse.swt.widgets.Label class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: n4js   File: N4MFWizardNewProjectCreationPage.java   View Source Code Vote up 6 votes
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;
}
 
Example 2
Project: ide-plugins   File: PluginsSWT.java   View Source Code Vote up 6 votes
@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;
}
 
Example 3
Project: Hydrograph   File: RuntimePropertyDialog.java   View Source Code Vote up 6 votes
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));
}
 
Example 4
Project: ide-plugins   File: CodeSWT.java   View Source Code Vote up 5 votes
@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;
}
 
Example 5
Project: ide-plugins   File: AccountSWT.java   View Source Code Vote up 5 votes
@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;
}
 
Example 6
Project: Hydrograph   File: HivePartitionKeyValueDialog.java   View Source Code Vote up 5 votes
/**
 * 	
 * @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);
}
 
Example 7
Project: Hydrograph   File: FieldDialog.java   View Source Code Vote up 5 votes
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));
}
 
Example 8
Project: Hydrograph   File: HiveInputExtractMetaStoreDialog.java   View Source Code Vote up 5 votes
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);
	
}
 
Example 9
Project: Hydrograph   File: HiveOutputFieldDialog.java   View Source Code Vote up 5 votes
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));
}
 
Example 10
Project: Hydrograph   File: SecondaryColumnKeysDialog.java   View Source Code Vote up 5 votes
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));
}
 
Example 11
Project: Hydrograph   File: JdkPathDialog.java   View Source Code Vote up 5 votes
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);
}
 
Example 12
Project: openaudible   File: FakeToolTip.java   View Source Code Vote up 5 votes
/**
 * 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));
}
 
Example 13
Project: pandionj   File: InvocationArea.java   View Source Code Vote up 5 votes
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;
}
 
Example 14
Project: pandionj   File: PandionJView.java   View Source Code Vote up 4 votes
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;
}
 
Example 15
Project: SWET   File: PopupDialog.java   View Source Code Vote up 3 votes
/**
 * 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;
}