本文整理汇总了Java中com.google.gwt.user.client.ui.Anchor.addStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Anchor.addStyleName方法的具体用法?Java Anchor.addStyleName怎么用?Java Anchor.addStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Anchor
的用法示例。
在下文中一共展示了Anchor.addStyleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PageIndexWidget
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* THe basic constructor
* @param searchData the original search object with the pageIndex field indicating he currently selected page
* @param pageIndex the page index is the index for which this page-index widget is created
* @param isEnabled true to create the widget in the enabled mode, false in the disabled
* @param siteSectionPrefix the history token site section prefix
*/
public PageIndexWidget( final ForumSearchData searchData, final int pageIndex,
final boolean isEnabled, final String siteSectionPrefix ) {
this.isCurrentPage = (searchData.pageIndex == pageIndex );
//Create a copy in order to be able to set the proper search object index and not spoil the original search object
final ForumSearchData localSearchData = searchData.clone();
localSearchData.pageIndex = pageIndex;
hyperLink = new Anchor("" + pageIndex, CommonResourcesContainer.URI_HASH_SYMBOL + siteSectionPrefix + localSearchData.serialize(encoder));
if( isCurrentPage ) {
hyperLink.addStyleName( CommonResourcesContainer.CURRENT_PAGE_INDEX_STYLE );
//the current page index widget is always disabled
setEnabled( false );
} else {
//Set the link as enabled/disabled
setEnabled( isEnabled );
}
initWidget(hyperLink);
}
示例2: AlertStackWidget
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public AlertStackWidget() {
alertWidgets = new ArrayList<AlertWidget>();
VerticalPanel rootPanel = new VerticalPanel();
rootPanel.setWidth("100%");
alertsPanel = new VerticalPanel();
alertsPanel.setWidth("100%");
rootPanel.add(alertsPanel);
showHideAnchor = new Anchor(
I18nUtils.tr(visible ? "hide.alerts" : "show.alerts"));
showHideAnchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
visible = !visible;
alertsPanel.setVisible(visible);
showHideAnchor.setText(
I18nUtils.tr(visible ? "hide.alerts" : "show.alerts"));
}
});
showHideAnchor.addStyleName("alert-showhide-link");
showHideAnchor.setVisible(false);
rootPanel.add(showHideAnchor);
initWidget(rootPanel);
}
示例3: addLink
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public void addLink(String label, final String target) {
final Anchor anchor = new Anchor(new SafeHtmlBuilder().appendEscapedLines(label).toSafeHtml());
// this link relies on the org.apache.cordova.inappbrowser which offers secure viewing of external html pages and handles user navigation such as back navigation.
// in this case the link will be opend in the system browser rather than in the cordova application.
outerPanel.add(anchor);
final SingleShotEventListner singleShotEventListner = new SingleShotEventListner() {
@Override
protected void singleShotFired() {
Window.open(target, "_system", "");
}
};
anchor.addClickHandler(singleShotEventListner);
anchor.addTouchStartHandler(singleShotEventListner);
anchor.addTouchMoveHandler(singleShotEventListner);
anchor.addTouchEndHandler(singleShotEventListner);
anchor.addStyleName("pageLink");
}
示例4: 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();
}
示例5: 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();
}
示例6: 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();
}
示例7: 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();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
示例11: getMouseOverhandler
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private MouseOverHandler getMouseOverhandler(final Anchor anchor) {
return new MouseOverHandler() {
@Override
public void onMouseOver(MouseOverEvent event) {
anchor.addStyleName(ThemeStyles.get().style().borderBottom());
}
};
}
示例12: initFeedbackPanel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void initFeedbackPanel() {
playgroundUI.feedbackPanel.setHorizontalAlignment(
HasHorizontalAlignment.ALIGN_RIGHT);
for (Menu menu : Menu.values()) {
Anchor menuItem = new Anchor();
menuItem.setHTML(menu.description);
menuItem.setHref(menu.url);
menuItem.setWordWrap(false);
menuItem.addStyleName("menuItems");
playgroundUI.feedbackPanel.add(menuItem);
playgroundUI.feedbackPanel.setCellWidth(menuItem, "100%");
}
}
示例13: setAnchorEnabled
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Update css of button.
* @param anchor
* @param enabled
*/
private void setAnchorEnabled(Anchor anchor, boolean enabled) {
anchor.setEnabled(enabled);
if(enabled) {
anchor.removeStyleName("offline-action-disabled");
} else {
anchor.addStyleName("offline-action-disabled");
}
}
示例14: setAction
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void setAction(int row, int column, String text, int actionType, String id, String styleName) {
formatCell(row, column);
Anchor actionHyperlink = new Anchor(text);
actionHyperlink.addClickHandler(this);
if (styleName != null)
actionHyperlink.addStyleName(styleName);
itemFlexTable.setWidget(row, column, actionHyperlink);
actionMap.put(actionHyperlink, actionType + id);
}
示例15: selectTag
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* <p>selectTag</p>
*
* @param tag a {@link java.lang.String} object.
*/
public void selectTag(String tag) {
for (Widget widget : tagPanel) {
if (widget instanceof Anchor) {
Anchor anchor = (Anchor)widget;
if (tag != null && tag.replaceAll(" ", " ").equals(anchor.getHTML())) {
anchor.addStyleName(tagStyles.selectedTag());
} else {
anchor.removeStyleName(tagStyles.selectedTag());
}
}
}
}