本文整理汇总了Java中com.google.gwt.user.client.ui.Anchor.setHref方法的典型用法代码示例。如果您正苦于以下问题:Java Anchor.setHref方法的具体用法?Java Anchor.setHref怎么用?Java Anchor.setHref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Anchor
的用法示例。
在下文中一共展示了Anchor.setHref方法的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: 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;
}
示例4: updateLabels
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public void updateLabels() {
for (Slot s : Slot.values()) if (!s.isCube()) {
final Anchor label = labels.get(s);
ItemHolder item = items.get(s);
if (item != null) {
String url = "http://us.battle.net/d3/en/itemData/" + item.getTooltip();
label.setHref(url);
item.getInfo(new DefaultCallback<ItemInformation>(){
@Override
protected void doOnSuccess(ItemInformation result) {
label.setText(result.name);
}
});
} else {
label.setHref("javascript:void(0)");
label.setText("Empty");
}
}
}
示例5: 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;
}
示例6: 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");
}
}
示例7: 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();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
示例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://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();
}
示例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.coinsolver.com/user-details.php?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();
}
示例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://wafflepool.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();
}
示例14: InstructorCell
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public InstructorCell(ArrayList<String> names, ArrayList<String> emails, String separator) {
super(null, separator);
if (names != null && !names.isEmpty()) {
separator = separator.replace(" ", " ");
for (int i = 0; i < names.size(); i++) {
String text = names.get(i) + (i + 1 < names.size() ? separator : "");
String email = (emails != null && i < emails.size() ? emails.get(i) : null);
if (email != null && !email.isEmpty()) {
iText += text;
HorizontalPanel p = new HorizontalPanel();
p.setStyleName("instructor");
Anchor a = new Anchor();
a.setHref("mailto:" + email);
a.setHTML(new Image(RESOURCES.email()).getElement().getString());
a.setTitle(MESSAGES.sendEmail(names.get(i)));
a.setStyleName("unitime-SimpleLink");
a.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
event.stopPropagation();
}
});
p.add(a);
p.setCellVerticalAlignment(a, HasVerticalAlignment.ALIGN_MIDDLE);
HTML h = new HTML(text, false);
h.getElement().getStyle().setMarginLeft(2, Unit.PX);
p.add(h);
iPanel.add(p);
iContent.add(h);
} else
add(text);
}
} else {
add(" ");
}
}
示例15: addAnchor
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void addAnchor(int row, int col, String text, String url) {
Anchor anchor = new Anchor(text);
anchor.setTarget("_blank");
anchor.setHref(url);
anchor.setWordWrap(false);
table.setWidget(row, col, anchor);
}