void setBackgroundColor(NSColor nsColor) { setBackground(nsColor); }
/** * Set the background of all widgets to the supplied color. * * @param color */ private void setAllBackgrounds(Color color) { setBackground(color); progressLabel.setBackground(color); actionBar.setBackground(color); jobImageLabel.setBackground(color); Iterator<Link> taskEntryIterator = taskEntries.iterator(); while (taskEntryIterator.hasNext()) { taskEntryIterator.next().setBackground(color); } }
@Override public void createControl(Composite parent) { Color background= parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND); Composite composite= new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); composite.setBackground(background); Link link= new Link(composite, SWT.NONE); link.setText(SearchMessages.SearchView_empty_search_label); link.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false)); link.setBackground(background); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { new OpenSearchDialogAction().run(); } }); fControl= composite; }
public void setStatus(final String statusMessage) { disposeChildren(status); final Link link = new Link(status, SWT.NONE); link.setText(statusMessage); link.setBackground(link.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND)); layout(); }
private void createMessage(Composite parent) { messageComposite = new Composite(parent, SWT.NONE); FillLayout layout = new FillLayout(); layout.marginHeight = 5; layout.marginWidth = 5; messageComposite.setLayout(layout); //GridLayoutFactory.swtDefaults().applyTo(messageComposite); messageComposite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); Link link = new Link(messageComposite, SWT.WRAP); link.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); link.setText("No build servers available. Create a <a href=\"create\">build server</a>..."); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { if ("create".equals(event.text)) { new NewBuildServerAction().run(); } } }); }
public void setStatusWithCallback(final String statusMessage, final SelectionListener listener) { disposeChildren(status); final Link link = new Link(status, SWT.NONE); link.setText(statusMessage); link.setBackground(link.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND)); link.addSelectionListener(listener); layout(); } }
textLink.setBackground(bg); return textLink;
public static Link createMethodLink(final Composite parent, final IMethod method, final EventBus workspaceBus) { final String text = "<a>" //$NON-NLS-1$ + JavaElementLabels.getElementLabel(method, JavaElementLabels.M_APP_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES) + "</a>"; //$NON-NLS-1$ final String tooltip = JavaElementLabels.getElementLabel(method, JavaElementLabels.DEFAULT_QUALIFIED); final Link link = new Link(parent, SWT.NONE); link.setText(text); link.setBackground(ExtdocUtils.createColor(SWT.COLOR_INFO_BACKGROUND)); link.setToolTipText(tooltip); link.setFont(JFaceResources.getDialogFont()); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { final JavaSelectionEvent event = new JavaSelectionEvent(method, METHOD_DECLARATION); workspaceBus.post(event); } }); return link; }
public static Link createMethodLink(final Composite parent, final IMethodName method, final JavaElementResolver resolver, final EventBus workspaceBus) { final String text = "<a>" + Names.vm2srcSimpleMethod(method) + "</a>"; //$NON-NLS-1$ //$NON-NLS-2$ final String tooltip = Names.vm2srcQualifiedMethod(method); final Link link = new Link(parent, SWT.NONE); link.setText(text); link.setBackground(ExtdocUtils.createColor(SWT.COLOR_INFO_BACKGROUND)); link.setFont(JFaceResources.getDialogFont()); link.setToolTipText(tooltip); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { final Optional<IMethod> opt = resolver.toJdtMethod(method); if (opt.isPresent()) { final JavaSelectionEvent event = new JavaSelectionEvent(opt.get(), METHOD_DECLARATION); workspaceBus.post(event); } else { link.setEnabled(false); } } }); return link; }