本文整理了Java中org.eclipse.ui.forms.widgets.Hyperlink.setForeground()
方法的一些代码示例,展示了Hyperlink.setForeground()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hyperlink.setForeground()
方法的具体详情如下:
包路径:org.eclipse.ui.forms.widgets.Hyperlink
类名称:Hyperlink
方法名:setForeground
暂无
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void linkEntered(HyperlinkEvent e)
{
link.setForeground(ColorConstants.lightBlue);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
/**
* Sets the group foreground and also sets the background of all the
* currently managed links.
*
* @param fg
* the new foreground
*/
@Override
public void setForeground(Color fg) {
super.setForeground(fg);
isForegroundSet = true;
if (links != null) {
for (int i = 0; i < links.size(); i++) {
Hyperlink label = links.get(i);
label.setForeground(fg);
}
}
}
/**
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
/**
* Sets the group foreground and also sets the background of all the
* currently managed links.
*
* @param fg
* the new foreground
*/
@Override
public void setForeground(Color fg) {
super.setForeground(fg);
isForegroundSet = true;
if (links != null) {
for (int i = 0; i < links.size(); i++) {
Hyperlink label = links.get(i);
label.setForeground(fg);
}
}
}
/**
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void linkExited(HyperlinkEvent e)
{
link.setForeground(link.getParent().getForeground());
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
private void onMouseExit(Event e) {
Hyperlink link = (Hyperlink) e.widget;
if (isActiveBackgroundSet)
link.setBackground(previousBackground);
if (isActiveForegroundSet)
link.setForeground(previousForeground);
if (getHyperlinkUnderlineMode() == UNDERLINE_HOVER)
link.setUnderlined(false);
}
@Override
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
private void onMouseExit(Event e) {
Hyperlink link = (Hyperlink) e.widget;
if (isActiveBackgroundSet)
link.setBackground(previousBackground);
if (isActiveForegroundSet)
link.setForeground(previousForeground);
if (getHyperlinkUnderlineMode() == UNDERLINE_HOVER)
link.setUnderlined(false);
}
@Override
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
/**
* Adds a hyperlink to the group to be jointly managed. Hyperlink will be
* managed until it is disposed. Settings like colors, cursors and modes
* will affect all managed hyperlinks.
*
* @param link
*/
public void add(Hyperlink link) {
if (isBackgroundSet)
link.setBackground(getBackground());
if (isForegroundSet)
link.setForeground(getForeground());
if (getHyperlinkUnderlineMode() == UNDERLINE_ALWAYS)
link.setUnderlined(true);
hook(link);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
/**
* Adds a hyperlink to the group to be jointly managed. Hyperlink will be
* managed until it is disposed. Settings like colors, cursors and modes
* will affect all managed hyperlinks.
*
* @param link
*/
public void add(Hyperlink link) {
if (isBackgroundSet)
link.setBackground(getBackground());
if (isForegroundSet)
link.setForeground(getForeground());
if (getHyperlinkUnderlineMode() == UNDERLINE_ALWAYS)
link.setUnderlined(true);
hook(link);
}
代码示例来源:origin: org.eclipse.egit/ui
private void createHeadLink(final Repository repository, Composite composite) throws IOException {
final ObjectId objectId = repository
.resolve(repository.getFullBranch());
if (objectId == null) {
Text headLabel = createLabeledReadOnlyText(composite, UIText.GitProjectPropertyPage_LabelId);
if (repository.getAllRefs().size() == 0)
headLabel.setText(UIText.GitProjectPropertyPage_ValueEmptyRepository);
else
headLabel.setText(UIText.GitProjectPropertyPage_ValueUnbornBranch);
} else {
Hyperlink headLink = createHeadHyperLink(composite, UIText.GitProjectPropertyPage_LabelId);
headLink.setText(objectId.name());
headLink.setUnderlined(true);
headLink.setFont(JFaceResources.getDialogFont());
headLink.setForeground(JFaceColors.getHyperlinkText(headLink
.getDisplay()));
headLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
RepositoryCommit commit = getCommit(repository, objectId);
if(commit != null)
CommitEditor.openQuiet(commit);
}
});
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
private void onMouseEnter(Event e) {
Hyperlink link = (Hyperlink) e.widget;
previousBackground = link.getBackground();
previousForeground = link.getForeground();
if (isActiveBackgroundSet)
link.setBackground(getActiveBackground());
if (isActiveForegroundSet)
link.setForeground(getActiveForeground());
if (getHyperlinkUnderlineMode() == UNDERLINE_HOVER)
link.setUnderlined(true);
link.setCursor(getHyperlinkCursor());
}
private void onMouseExit(Event e) {
代码示例来源:origin: org.eclipse.mylyn.commons/workbench
todayLink.setText(Messages.DatePickerPanel_Today);
todayLink.setUnderlined(true);
todayLink.setForeground(CommonColors.HYPERLINK_WIDGET);
GridDataFactory.fillDefaults().span(2, 1).grab(true, false).align(SWT.CENTER, SWT.TOP).applyTo(todayLink);
todayLink.addHyperlinkListener(new HyperlinkAdapter() {
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
private void onMouseEnter(Event e) {
Hyperlink link = (Hyperlink) e.widget;
previousBackground = link.getBackground();
previousForeground = link.getForeground();
if (isActiveBackgroundSet)
link.setBackground(getActiveBackground());
if (isActiveForegroundSet)
link.setForeground(getActiveForeground());
if (getHyperlinkUnderlineMode() == UNDERLINE_HOVER)
link.setUnderlined(true);
link.setCursor(getHyperlinkCursor());
}
private void onMouseExit(Event e) {
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.ui
link.setUnderlined(true);
Color color = new Color(parent.getDisplay(),new RGB(0,0,255) );
link.setForeground(color);
link.setText("Configure Target Runtime...");
link.addHyperlinkListener(new IHyperlinkListener() {
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
prev.setForeground(hyperlinkColor);
prev.addHyperlinkListener(new HyperlinkAdapter() {
@Override
if (i != curPage) {
final int selectedPage = i;
pageLink.setForeground(hyperlinkColor);
pageLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
next.setForeground(hyperlinkColor);
next.addHyperlinkListener(new HyperlinkAdapter() {
@Override
代码示例来源:origin: org.eclipse.egit/ui
Hyperlink addLink = toolkit.createHyperlink(optionsArea,
UIText.RepositoriesView_linkAdd, SWT.WRAP);
addLink.setForeground(linkColor);
addLink.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
Hyperlink cloneLink = toolkit.createHyperlink(optionsArea,
UIText.RepositoriesView_linkClone, SWT.WRAP);
cloneLink.setForeground(linkColor);
cloneLink.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
Hyperlink createLink = toolkit.createHyperlink(optionsArea,
UIText.RepositoriesView_linkCreate, SWT.WRAP);
createLink.setForeground(linkColor);
createLink.setText(UIText.RepositoriesView_linkCreate);
createLink.addHyperlinkListener(new HyperlinkAdapter() {
内容来源于网络,如有侵权,请联系作者删除!