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


Java Anchor.setHref方法代码示例

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

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

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

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

	}
 
开发者ID:dawg6,项目名称:dhcalc,代码行数:23,代码来源:MainPanel.java

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

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

示例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();
}
 
开发者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://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

示例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();
}
 
开发者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://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

示例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(" ", "&nbsp;");
		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("&nbsp;");
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:36,代码来源:WebTable.java

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


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