当前位置: 首页>>代码示例>>Java>>正文


Java Anchor.setText方法代码示例

本文整理汇总了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;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:27,代码来源:AnchorBuilder.java

示例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;
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:19,代码来源:AnchorBuilder.java

示例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");
    }
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:24,代码来源:ProfilePage.java

示例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;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:18,代码来源:ProjectAccessEditor.java

示例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;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:18,代码来源:WebLinkInfo.java

示例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");
		}
	}
}
 
开发者ID:dawg6,项目名称:dhcalc,代码行数:24,代码来源:GearPanel.java

示例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);
}
 
开发者ID:Governance,项目名称:rtgov-ui,代码行数:30,代码来源:SituationWatcherEvent.java

示例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);
}
 
开发者ID:Governance,项目名称:rtgov-ui,代码行数:28,代码来源:SituationTable.java

示例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();
}
 
开发者ID:Stratehm,项目名称:multipool-stats-backend,代码行数:23,代码来源:GlobalChartPanel.java

示例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();
}
 
开发者ID:Stratehm,项目名称:multipool-stats-backend,代码行数:25,代码来源:AddressChartPanel.java

示例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();
}
 
开发者ID:Stratehm,项目名称:multipool-stats-backend,代码行数:23,代码来源:GlobalChartPanel.java

示例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();
}
 
开发者ID:Stratehm,项目名称:multipool-stats-backend,代码行数:25,代码来源:AddressChartPanel.java

示例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();
}
 
开发者ID:Stratehm,项目名称:multipool-stats-backend,代码行数:23,代码来源:GlobalChartPanel.java

示例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();
}
 
开发者ID:Stratehm,项目名称:multipool-stats-backend,代码行数:25,代码来源:AddressChartPanel.java

示例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();
}
 
开发者ID:Stratehm,项目名称:multipool-stats-backend,代码行数:23,代码来源:GlobalChartPanel.java


注:本文中的com.google.gwt.user.client.ui.Anchor.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。