本文整理汇总了Java中com.google.gwt.user.client.ui.Anchor.setText方法的典型用法代码示例。如果您正苦于以下问题:Java Anchor.setText方法的具体用法?Java Anchor.setText怎么用?Java Anchor.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Anchor
的用法示例。
在下文中一共展示了Anchor.setText方法的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: buildClick
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public Anchor buildClick() {
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 (clickHandler != null) {
anchor.addClickHandler(clickHandler);
}
return anchor;
}
示例3: 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");
}
}
}
示例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: 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: 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");
}
}
}
示例7: setValue
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object, boolean)
*
* <div class="sitwatch-event">
* <div class="icon icon-severity-critical"></div>
* <a class="title" href="#">Rate Limit Exceeded</a>
* <span class="timestamp">9:16 AM</span>
* <span class="subject">{urn:namespace}ImportantService|VeryImportantOperation</span>
* </div>
*/
@Override
public void setValue(SituationEventBean value, boolean fireEvents) {
clear();
FlowPanel icon = new FlowPanel();
icon.setStyleName("icon"); //$NON-NLS-1$
icon.addStyleName("icon-severity-" + value.getSeverity()); //$NON-NLS-1$
Anchor type = toDetailsPageLinkFactory.get("id", value.getSituationId()); //$NON-NLS-1$
type.setText(value.getType());
type.setStyleName("title"); //$NON-NLS-1$
InlineLabel timestamp = new InlineLabel(ClientMessages.getTimeFormat().format(value.getTimestamp()));
timestamp.setStyleName("timestamp"); //$NON-NLS-1$
InlineLabel subject = new InlineLabel(value.getSubject());
subject.setStyleName("subject"); //$NON-NLS-1$
add(icon);
add(type);
add(timestamp);
add(subject);
}
示例8: addRow
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Adds a single row to the table.
* @param situationSummaryBean
*/
public void addRow(final SituationSummaryBean situationSummaryBean) {
int rowIdx = this.rowElements.size();
DateTimeFormat format = DateTimeFormat.getFormat(i18n.format("dateTime-format")); //$NON-NLS-1$
FlowPanel icon = new FlowPanel();
icon.getElement().setClassName("icon"); //$NON-NLS-1$
icon.getElement().addClassName("icon-severity-" + situationSummaryBean.getSeverity()); //$NON-NLS-1$
Anchor type = toDetailsPageLinkFactory.get("id", situationSummaryBean.getSituationId()); //$NON-NLS-1$
type.setText(situationSummaryBean.getType());
InlineLabel resolutionState = new InlineLabel(situationSummaryBean.getResolutionState());
InlineLabel subject = new InlineLabel(situationSummaryBean.getSubject());
InlineLabel description = new InlineLabel(situationSummaryBean.getDescription());
InlineLabel timestamp = new InlineLabel(format.format(situationSummaryBean.getTimestamp()));
Widget infoIcons = createInfoPanel(situationSummaryBean);
add(rowIdx, 0, icon);
add(rowIdx, 1, type);
add(rowIdx, 2, resolutionState);
add(rowIdx, 3, subject);
add(rowIdx, 4, timestamp);
add(rowIdx, 5, description);
add(rowIdx, 6, infoIcons);
}
示例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://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();
}
示例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://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();
}
示例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://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();
}
示例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://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();
}
示例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://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();
}
示例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://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();
}
示例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://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();
}