Example usage for com.google.gwt.user.client.ui InlineHyperlink setTargetHistoryToken

List of usage examples for com.google.gwt.user.client.ui InlineHyperlink setTargetHistoryToken

Introduction

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

Prototype

public void setTargetHistoryToken(String targetHistoryToken) 

Source Link

Document

Sets the history token referenced by this hyperlink.

Usage

From source file:com.googlesource.gerrit.plugins.xdocs.client.XDocDiffScreen.java

License:Apache License

private InlineHyperlink createNavLink(ImageResource res, final ChangeInfo change, final int patchSet,
        final Integer base, final FileInfo file) {
    final InlineHyperlink link = createIcon(res, FileInfo.getFileName(file.path()),
            toFile(change, patchSet, base, file));
    XDocApi.checkHtml(XDocApi.getUrl(change.project(), getRevision(change, patchSet), file.path()),
            new AsyncCallback<VoidResult>() {
                @Override/*from  www .  java  2 s  .  c  om*/
                public void onSuccess(VoidResult result) {
                    link.setTargetHistoryToken(toPreview(change, patchSet, base, file));
                }

                @Override
                public void onFailure(Throwable caught) {
                }
            });
    return link;
}

From source file:de.knightsoftnet.navigation.client.ui.navigation.TreeNavigationView.java

License:Apache License

/**
 * create navigation in a recursive way.
 *
 * @param pitem the item to add new items
 * @param plist the list of the navigation entries
 * @param pactiveEntry the active entry/*from ww  w.  j  a v a2  s  .c  o  m*/
 */
public void createRecursiveNavigation(final TreeItem pitem, final List<NavigationEntryInterface> plist,
        final NavigationEntryInterface pactiveEntry) {
    for (final NavigationEntryInterface navEntry : plist) {
        final TreeItem newItem;
        if (navEntry instanceof NavigationEntryFolder) {
            newItem = new TreeItem(navEntry.getMenuValue());
            this.createRecursiveNavigation(newItem, ((NavigationEntryFolder) navEntry).getSubEntries(),
                    pactiveEntry);
            newItem.setState(navEntry.isOpenOnStartup());
        } else if (navEntry instanceof NavigationLink) {
            final Anchor link = ((NavigationLink) navEntry).getAnchor();
            link.setStylePrimaryName(this.resources.navigationStyle().link());
            newItem = new TreeItem(link);
        } else if (navEntry.getToken() == null) {
            newItem = null;
        } else {
            final InlineHyperlink entryPoint = GWT.create(InlineHyperlink.class);
            entryPoint.setHTML(navEntry.getMenuValue());
            entryPoint.setTargetHistoryToken(navEntry.getFullToken());
            entryPoint.setStylePrimaryName(this.resources.navigationStyle().link());
            newItem = new TreeItem(entryPoint);
            this.navigationMap.put(newItem, navEntry);
        }
        if (newItem != null) {
            pitem.addItem(newItem);
            if (pactiveEntry != null && pactiveEntry.equals(navEntry)) {
                this.selectedItem = newItem;
                this.selectedItem.setSelected(true);
            }
        }
    }
}