本文整理汇总了Java中com.google.gwt.user.client.ui.Anchor.setTarget方法的典型用法代码示例。如果您正苦于以下问题:Java Anchor.setTarget方法的具体用法?Java Anchor.setTarget怎么用?Java Anchor.setTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Anchor
的用法示例。
在下文中一共展示了Anchor.setTarget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Build the Anchor with target="_blank"
*
* @return Anchor
*/
public Anchor build() {
final Anchor anchor = new Anchor();
if (image != null) {
anchor.getElement().appendChild(image.getElement());
}
if (text != null) {
anchor.setText(text);
}
if (title != null) {
anchor.setTitle(title);
}
if (bottomBorderOnMouseOver) {
anchor.addMouseOverHandler(getMouseOverhandler(anchor));
anchor.addMouseOutHandler(getMouseOutHandler(anchor));
}
anchor.setHref(href);
anchor.setTarget("_blank");
return anchor;
}
示例2: makeValidLink
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Helper method to validify a hyperlink
* @param link the GWT anchor object to validify
* @param linktext the actual http link that the anchor should point to
*/
private void makeValidLink(Anchor link, String linktext) {
if (linktext == null) {
link.setText("N/A");
} else {
if (linktext.isEmpty()) {
link.setText("N/A");
} else {
linktext = linktext.toLowerCase();
// Validate link format, fill in http part
if (!linktext.startsWith("http")) {
linktext = "http://" + linktext;
}
link.setText(linktext);
link.setHref(linktext);
link.setTarget("_blank");
}
}
}
示例3: setEntity
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
@Override
public void setEntity(Synonym synonym) {
this.synonym = synonym;
Term term = synonym.getTerm();
int row = 0;
grid.setText(row++, 1, term.getOntology().getName());
if(UrlValidator.validate(term.getUrl())) {
Anchor a = new Anchor(term.getName(), term.getUrl().trim());
a.setTarget("TermUrl");
grid.setWidget(row++, 1, a);
} else {
grid.setText(row++, 1, term.getName());
}
grid.setText(row++, 1, synonym.getSynonym());
typeDropBox.setSelectedIndex(synonym.getType().ordinal());
}
示例4: toAnchor
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private static Anchor toAnchor(WebLinkInfoCommon info) {
Anchor a = new Anchor();
a.setHref(info.url);
if (info.target != null && !info.target.isEmpty()) {
a.setTarget(info.target);
}
if (info.imageUrl != null && !info.imageUrl.isEmpty()) {
Image img = new Image();
img.setAltText(info.name);
img.setUrl(info.imageUrl);
img.setTitle(info.name);
a.getElement().appendChild(img.getElement());
} else {
a.setText("(" + info.name + ")");
}
return a;
}
示例5: addOne
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
void addOne(AgreementInfo info) {
int row = table.getRowCount();
table.insertRow(row);
applyDataRowStyle(row);
String url = info.url();
if (url != null && url.length() > 0) {
Anchor a = new Anchor(info.name(), url);
a.setTarget("_blank");
table.setWidget(row, 1, a);
} else {
table.setText(row, 1, info.name());
}
table.setText(row, 2, info.description());
FlexCellFormatter fmt = table.getFlexCellFormatter();
for (int c = 1; c < 3; c++) {
fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
}
}
示例6: addExtensionLink
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private static void addExtensionLink(LinkMenuBar m, TopMenuItem item) {
if (item.getUrl().startsWith("#") && (item.getTarget() == null || item.getTarget().isEmpty())) {
LinkMenuItem a = new LinkMenuItem(item.getName(), item.getUrl().substring(1));
if (item.getId() != null) {
a.getElement().setAttribute("id", item.getId());
}
m.addItem(a);
} else {
Anchor atag =
anchor(
item.getName(),
isAbsolute(item.getUrl()) ? item.getUrl() : selfRedirect(item.getUrl()));
if (item.getTarget() != null && !item.getTarget().isEmpty()) {
atag.setTarget(item.getTarget());
}
if (item.getId() != null) {
atag.getElement().setAttribute("id", item.getId());
}
m.add(atag);
}
}
示例7: toAnchor
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public final Anchor toAnchor() {
Anchor a = new Anchor();
a.setHref(url());
if (target() != null && !target().isEmpty()) {
a.setTarget(target());
}
if (imageUrl() != null && !imageUrl().isEmpty()) {
Image img = new Image();
img.setAltText(name());
img.setUrl(imageUrl());
img.setTitle(name());
a.getElement().appendChild(img.getElement());
} else {
a.setText("(" + name() + ")");
}
return a;
}
示例8: updateRuneLabel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
protected void updateRuneLabel(Anchor label, ListBox skills, ListBox runes) {
ActiveSkill skill = ActiveSkill.SENTRY;
if (skills != null)
skill = this.getSkill(skills);
if (skill != null) {
Rune rune = getRune(runes);
label.setTarget("_blank");
if ((rune != null) && (rune != Rune.None))
label.setHref(skill.getUrl() + "#" + rune.getSlug() + "+");
else
label.setHref(skill.getUrl());
} else {
label.setHref("javascript:void(0)");
label.setTarget("_self");
}
}
示例9: updateBugSection
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void updateBugSection() {
bugGrid.resize(capabilityBugs.size() + 1, 1);
bugGrid.setTitle("Bugs (" + capabilityBugs.size() + " total)");
bugGrid.setWidget(0, 0, buildBugHeaderWidget("Bugs (" + capabilityBugs.size() + " total)",
"add bug"));
for (int i = 0; i < capabilityBugs.size(); i++) {
Bug bug = capabilityBugs.get(i);
HorizontalPanel panel = new HorizontalPanel();
panel.add(getBugStateImage(bug.getState()));
Anchor anchor = new Anchor(bug.getLinkText(), bug.getLinkUrl());
anchor.setTarget("_blank");
panel.add(anchor);
Label statusLabel = new Label();
statusLabel.setText(" - filed " + getDateText(bug.getStateDate()));
panel.add(statusLabel);
bugGrid.setWidget(i + 1, 0, panel);
}
}
示例10: updateCheckinsSection
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void updateCheckinsSection() {
changeGrid.setTitle("Recent Code Changes (" + capabilityCheckins.size() + " total)");
changeGrid.resize(capabilityCheckins.size() + 1, 1);
changeGrid.setWidget(0, 0, buildCheckinHeaderWidget(
"Recent Code Changes (" + capabilityCheckins.size() + " total)", "add code change"));
for (int i = 0; i < capabilityCheckins.size(); i++) {
Checkin checkin = capabilityCheckins.get(i);
HorizontalPanel panel = new HorizontalPanel();
panel.add(new Image("/images/teststate-passed.png"));
Anchor anchor = new Anchor(checkin.getLinkText(), checkin.getLinkUrl());
anchor.setTarget("_blank");
panel.add(anchor);
Label statusLabel = new Label();
statusLabel.setText(" - submitted " + getDateText(checkin.getStateDate()));
panel.add(statusLabel);
changeGrid.setWidget(i + 1, 0, panel);
}
}
示例11: GlobalChartPanel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public GlobalChartPanel(String title) {
mainPanel = new FramedPanel();
mainPanel.setHeadingText(title);
mainPanel.setCollapsible(true);
Anchor officialAnchor = new Anchor(false);
officialAnchor.addStyleName("officialAnchor");
officialAnchor.setText("Official");
officialAnchor.setHref("http://www.middlecoin.com");
officialAnchor.setTarget("_blank");
mainPanel.getHeader().addTool(officialAnchor);
lastRefreshLabel = new RefreshLabel();
mainPanel.getHeader().addTool(lastRefreshLabel);
contentPanel = new VerticalLayoutContainer();
contentPanel.addStyleName("whiteBackground");
mainPanel.add(contentPanel);
initBTCChart();
initPowerChart();
}
示例12: AddressChartPanel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public AddressChartPanel(String title, boolean isTotal) {
mainPanel = new FramedPanel();
mainPanel.setHeadingText(title);
mainPanel.setCollapsible(true);
if (!isTotal) {
Anchor officialAnchor = new Anchor(false);
officialAnchor.addStyleName("officialAnchor");
officialAnchor.setText("Official");
officialAnchor.setHref("http://www.middlecoin.com/reports/" + title + ".html");
officialAnchor.setTarget("_blank");
mainPanel.getHeader().addTool(officialAnchor);
}
lastRefreshLabel = new RefreshLabel();
mainPanel.getHeader().addTool(lastRefreshLabel);
contentPanel = new VerticalLayoutContainer();
contentPanel.addStyleName("whiteBackground");
mainPanel.add(contentPanel);
initBTCChart();
initPowerChart();
}
示例13: GlobalChartPanel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public GlobalChartPanel(String title) {
mainPanel = new FramedPanel();
mainPanel.setHeadingText(title);
mainPanel.setCollapsible(true);
Anchor officialAnchor = new Anchor(false);
officialAnchor.addStyleName("officialAnchor");
officialAnchor.setText("Official");
officialAnchor.setHref("http://coinshift.com/stats");
officialAnchor.setTarget("_blank");
mainPanel.getHeader().addTool(officialAnchor);
lastRefreshLabel = new RefreshLabel();
mainPanel.getHeader().addTool(lastRefreshLabel);
contentPanel = new VerticalLayoutContainer();
contentPanel.addStyleName("whiteBackground");
mainPanel.add(contentPanel);
initBTCChart();
initPowerChart();
}
示例14: AddressChartPanel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public AddressChartPanel(String title, boolean isTotal) {
mainPanel = new FramedPanel();
mainPanel.setHeadingText(title);
mainPanel.setCollapsible(true);
if (!isTotal) {
Anchor officialAnchor = new Anchor(false);
officialAnchor.addStyleName("officialAnchor");
officialAnchor.setText("Official");
officialAnchor.setHref("http://coinshift.com/account/" + title);
officialAnchor.setTarget("_blank");
mainPanel.getHeader().addTool(officialAnchor);
}
lastRefreshLabel = new RefreshLabel();
mainPanel.getHeader().addTool(lastRefreshLabel);
contentPanel = new VerticalLayoutContainer();
contentPanel.addStyleName("whiteBackground");
mainPanel.add(contentPanel);
initBTCChart();
initPowerChart();
}
示例15: GlobalChartPanel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public GlobalChartPanel(String title) {
mainPanel = new FramedPanel();
mainPanel.setHeadingText(title);
mainPanel.setCollapsible(true);
Anchor officialAnchor = new Anchor(false);
officialAnchor.addStyleName("officialAnchor");
officialAnchor.setText("Official");
officialAnchor.setHref("http://coinsolver.com/poolstats.php");
officialAnchor.setTarget("_blank");
mainPanel.getHeader().addTool(officialAnchor);
lastRefreshLabel = new RefreshLabel();
mainPanel.getHeader().addTool(lastRefreshLabel);
contentPanel = new VerticalLayoutContainer();
contentPanel.addStyleName("whiteBackground");
mainPanel.add(contentPanel);
initBTCChart();
initPowerChart();
}