當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。