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


Java Anchor.setTarget方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.Anchor.setTarget方法的典型用法代码示例。如果您正苦于以下问题:Java Anchor.setTarget方法的具体用法?Java Anchor.setTarget怎么用?Java Anchor.setTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.Anchor的用法示例。


在下文中一共展示了Anchor.setTarget方法的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: setEntity

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
@Override
public void setEntity(Synonym synonym) {
	this.synonym = synonym;
	Term term = synonym.getTerm();
	int row = 0;
	grid.setText(row++, 1, term.getOntology().getName());
	if(UrlValidator.validate(term.getUrl())) {
		Anchor a = new Anchor(term.getName(), term.getUrl().trim());
		a.setTarget("TermUrl");
		grid.setWidget(row++, 1, a);
	} else {
		grid.setText(row++, 1, term.getName());
	}
	grid.setText(row++, 1, synonym.getSynonym());
	typeDropBox.setSelectedIndex(synonym.getType().ordinal());
	
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:18,代码来源:EditSynonymPopup.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: addOne

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
void addOne(AgreementInfo info) {
  int row = table.getRowCount();
  table.insertRow(row);
  applyDataRowStyle(row);

  String url = info.url();
  if (url != null && url.length() > 0) {
    Anchor a = new Anchor(info.name(), url);
    a.setTarget("_blank");
    table.setWidget(row, 1, a);
  } else {
    table.setText(row, 1, info.name());
  }
  table.setText(row, 2, info.description());
  FlexCellFormatter fmt = table.getFlexCellFormatter();
  for (int c = 1; c < 3; c++) {
    fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:MyAgreementsScreen.java

示例6: addExtensionLink

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private static void addExtensionLink(LinkMenuBar m, TopMenuItem item) {
  if (item.getUrl().startsWith("#") && (item.getTarget() == null || item.getTarget().isEmpty())) {
    LinkMenuItem a = new LinkMenuItem(item.getName(), item.getUrl().substring(1));
    if (item.getId() != null) {
      a.getElement().setAttribute("id", item.getId());
    }
    m.addItem(a);
  } else {
    Anchor atag =
        anchor(
            item.getName(),
            isAbsolute(item.getUrl()) ? item.getUrl() : selfRedirect(item.getUrl()));
    if (item.getTarget() != null && !item.getTarget().isEmpty()) {
      atag.setTarget(item.getTarget());
    }
    if (item.getId() != null) {
      atag.getElement().setAttribute("id", item.getId());
    }
    m.add(atag);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:22,代码来源:Gerrit.java

示例7: 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

示例8: 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

示例9: updateBugSection

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void updateBugSection() {
  bugGrid.resize(capabilityBugs.size() + 1, 1);
  bugGrid.setTitle("Bugs (" + capabilityBugs.size() + " total)");
  bugGrid.setWidget(0, 0, buildBugHeaderWidget("Bugs (" +  capabilityBugs.size() + " total)",
      "add bug"));

  for (int i = 0; i < capabilityBugs.size(); i++) {
    Bug bug = capabilityBugs.get(i);
    HorizontalPanel panel = new HorizontalPanel();
    panel.add(getBugStateImage(bug.getState()));
    Anchor anchor = new Anchor(bug.getLinkText(), bug.getLinkUrl());
    anchor.setTarget("_blank");
    panel.add(anchor);
    Label statusLabel = new Label();
    statusLabel.setText(" - filed " + getDateText(bug.getStateDate()));
    panel.add(statusLabel);
    bugGrid.setWidget(i + 1, 0, panel);
  }
}
 
开发者ID:rodion-goritskov,项目名称:test-analytics-ng,代码行数:20,代码来源:CapabilityDetailsViewImpl.java

示例10: updateCheckinsSection

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void updateCheckinsSection() {
  changeGrid.setTitle("Recent Code Changes (" + capabilityCheckins.size() + " total)");
  changeGrid.resize(capabilityCheckins.size() + 1, 1);
  changeGrid.setWidget(0, 0, buildCheckinHeaderWidget(
      "Recent Code Changes (" + capabilityCheckins.size() + " total)", "add code change"));

  for (int i = 0; i < capabilityCheckins.size(); i++) {
    Checkin checkin = capabilityCheckins.get(i);
    HorizontalPanel panel = new HorizontalPanel();
    panel.add(new Image("/images/teststate-passed.png"));
    Anchor anchor = new Anchor(checkin.getLinkText(), checkin.getLinkUrl());
    anchor.setTarget("_blank");
    panel.add(anchor);
    Label statusLabel = new Label();
    statusLabel.setText(" - submitted " + getDateText(checkin.getStateDate()));
    panel.add(statusLabel);
    changeGrid.setWidget(i + 1, 0, panel);
  }
}
 
开发者ID:rodion-goritskov,项目名称:test-analytics-ng,代码行数:20,代码来源:CapabilityDetailsViewImpl.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://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

示例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.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

示例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://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

示例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://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

示例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://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


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