Example usage for com.google.gwt.user.client.ui Hyperlink getTargetHistoryToken

List of usage examples for com.google.gwt.user.client.ui Hyperlink getTargetHistoryToken

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Hyperlink getTargetHistoryToken.

Prototype

public String getTargetHistoryToken() 

Source Link

Document

Gets the history token referenced by this hyperlink.

Usage

From source file:com.flatown.client.BookmarksPanel.java

License:Apache License

/** 
 * Implement the ClickListener interface -- only listens for save links.
 *///from w  ww .j  av a 2  s. co  m
public void onClick(Widget sender) {
    if (sender instanceof Hyperlink) {
        Hyperlink link = (Hyperlink) sender;
        if (link.getText().equals("Save Bookmark")) {
            String id = link.getTargetHistoryToken();
            if (saveId(id))
                EntrezEngine.fetchBookmarks(new String[] { id });
        } else if (link.getText().equals("Remove Bookmark")) {
            removeId(link.getTargetHistoryToken());
        } else if (link.getTargetHistoryToken().equals("clearBookmarksToken")) {
            removeAll();
        } else if (link.getTargetHistoryToken().equals("exportAllToken")) {
            _bookmarks.tagAllForExport();
        }
    }
}

From source file:com.flatown.client.ExportPanel.java

License:Apache License

private void createExportLink() {
    _exportLink = new HoverLink("Export...", "exportToken", new ClickListener() {
        public void onClick(Widget sender) {
            if (sender instanceof Hyperlink) {
                Hyperlink link = (Hyperlink) sender;
                if (link.getTargetHistoryToken().equals("exportToken")) {
                    openExportWindow(exportAllApplicable());
                }/*  w  w  w  .  j a va  2  s .com*/
            }
        }
    }, "shareLink");
    DOM.setStyleAttribute(_exportLink.getElement(), "marginLeft", "15px");
}