Java Code Examples for org.eclipse.ui.forms.widgets.Hyperlink#setForeground()

The following examples show how to use org.eclipse.ui.forms.widgets.Hyperlink#setForeground() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AddRepositoryDialog.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
private void createConfigViewer(Composite container, FormToolkit toolkit) {
	UI.formLabel(container, toolkit, M.ServerUrl);
	configViewer = new ConfigViewer(container);
	configViewer.setInput(CloudConfigurations.get());
	Hyperlink editConfig = UI.formLink(container, toolkit, M.Edit);
	editConfig.setForeground(Colors.linkBlue());
	editConfig.addHyperlinkListener(new HyperlinkAdapter() {
		@Override
		public void linkActivated(HyperlinkEvent e) {
			PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, CloudPreferencePage.ID,
					null, null);
			dialog.setBlockOnOpen(true);
			dialog.open();
			configViewer.setInput(CloudConfigurations.get());
			configViewer.select(CloudConfigurations.getDefault());
		}
	});
}
 
Example 2
Source File: ListDisplay.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
private void enableHyperlinks(boolean bEnable){
	cLinks.setEnabled(bEnable);
	for (Control c : cLinks.getChildren()) {
		Hyperlink hl = (Hyperlink) c;
		if (bEnable) {
			hl.setForeground(UiDesk.getColor(UiDesk.COL_BLUE));
		} else {
			hl.setForeground(UiDesk.getColor(UiDesk.COL_GREY));
		}
		c.setEnabled(bEnable);
	}
	cLinks.redraw();
}
 
Example 3
Source File: DialogCellEditor.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
protected Hyperlink createLink(Composite parent) {
	Hyperlink link = new Hyperlink(parent, SWT.NONE);
	link.setText(M.Edit);
	link.setBackground(Colors.white());
	link.setForeground(Colors.linkBlue());
	return link;
}
 
Example 4
Source File: ConfigurationWizardRepositorySourceProviderPage.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void createControl(Composite parent) {
	Composite outerContainer = new Composite(parent,SWT.NONE);
	outerContainer.setLayout(new GridLayout());
	outerContainer.setLayoutData(
	new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
	
	Composite treeGroup = new Composite(outerContainer, SWT.NONE);
	GridLayout treeLayout = new GridLayout();
	treeLayout.numColumns = 1;
	treeGroup.setLayout(treeLayout);
	treeGroup.setLayoutData(
	new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));

	treeViewer = new TreeViewer(treeGroup, SWT.BORDER | SWT.SINGLE);
	treeViewer.setLabelProvider(new RepositorySourceLabelProvider());	
	treeViewer.setContentProvider(new RepositorySourceContentProvider());
	treeViewer.setUseHashlookup(true);
	GridData layoutData = new GridData();
	layoutData.grabExcessHorizontalSpace = true;
	layoutData.grabExcessVerticalSpace = true;
	layoutData.horizontalAlignment = GridData.FILL;
	layoutData.verticalAlignment = GridData.FILL;
	layoutData.minimumHeight = 300;
	layoutData.minimumWidth = 300;
	treeViewer.getControl().setLayoutData(layoutData);
	treeViewer.setInput(this);
	
	treeViewer.setSelection(new StructuredSelection("URL"));
	
	treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		public void selectionChanged(SelectionChangedEvent event) {
			Object selectedObject = ((IStructuredSelection)treeViewer.getSelection()).getFirstElement();
			if (selectedObject instanceof ISVNRepositorySourceProvider) {
				selectedRepositorySourceProvider = (ISVNRepositorySourceProvider)selectedObject;
			}
			else {
				selectedRepositorySourceProvider = null;
			}
			setPageComplete(!treeViewer.getSelection().isEmpty());
		}		
	});
	
	Hyperlink repositoryProviderLink = new Hyperlink(treeGroup, SWT.NONE);
	repositoryProviderLink.setUnderlined(true);
	repositoryProviderLink.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
	repositoryProviderLink.setText("Click here to see the list of available providers.");
	repositoryProviderLink.setToolTipText(REPOSITORY_PROVIDERS_WIKI_URL);
	repositoryProviderLink.addHyperlinkListener(new HyperlinkAdapter() {
		public void linkActivated(HyperlinkEvent evt) {
			showAvailableProviders();		
		}
	});
	
       Composite cloudForgeComposite = new CloudForgeComposite(outerContainer, SWT.NONE);
       GridData data = new GridData(GridData.VERTICAL_ALIGN_END | GridData.GRAB_VERTICAL | GridData.FILL_VERTICAL);
       cloudForgeComposite.setLayoutData(data);

	setControl(outerContainer);
}