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

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

Introduction

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

Prototype

public String getText() 

Source Link

Usage

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

License:Apache License

/** 
 * Implement the ClickListener interface -- only listens for save links.
 *//*from  www  . j  ava2s.c  o  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.eutils.ui.PubmedArticle.java

License:Apache License

public void onClick(Widget sender) {
    if (sender instanceof Hyperlink) {
        Hyperlink link = (Hyperlink) sender;
        if (link.getText().equals("Tag for Export")) {
            AResult copy = copy();/*  w w  w  .j  av a  2 s  . c o  m*/
            copy.tagForExport();
        } else if (link.getText().equals("Untag for Export")) {
            untagForExport();
        }
    }
}

From source file:com.ics.tcg.web.workflow.client.AbstractConnections.java

License:Apache License

/**
 * Nothing really important. Presents links to source code on examples
 * panel.//from w w w  .  j  a v a 2 s .  c om
 * 
 * @see com.ics.tcg.web.workflow.client.AbstractEditRegion#sources()
 */
@Override
protected List sources() {
    ArrayList sources = new ArrayList();

    int dot = GWT.getTypeName(this).lastIndexOf('.');
    String className = GWT.getTypeName(this).substring(dot + 1);

    sources.add(new Hyperlink(className + ".java", ""));
    sources.add(new Hyperlink("AbstractExample.java", ""));
    sources.add(new Hyperlink("AbstractConnectionsExample.java", ""));

    for (Iterator i = sources.iterator(); i.hasNext();) {
        final Hyperlink h = (Hyperlink) i.next();
        h.addStyleName("gwt-diagrams-source-link");
        h.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                Window.open("../source/" + h.getText(), "", "");
            }
        });
    }

    return sources;
}

From source file:com.ics.tcg.web.workflow.client.examples.AbstractConnectionsExample.java

License:Apache License

/**
 * Nothing really important. Presents links to source code on examples
 * panel./*from   w w  w  .j a  v a2  s. c om*/
 * 
 * @see com.ics.tcg.web.workflow.client.examples.AbstractExample#sources()
 */
protected List sources() {
    ArrayList sources = new ArrayList();

    int dot = GWT.getTypeName(this).lastIndexOf('.');
    String className = GWT.getTypeName(this).substring(dot + 1);

    sources.add(new Hyperlink(className + ".java", ""));
    sources.add(new Hyperlink("AbstractExample.java", ""));
    sources.add(new Hyperlink("AbstractConnectionsExample.java", ""));

    for (Iterator i = sources.iterator(); i.hasNext();) {
        final Hyperlink h = (Hyperlink) i.next();
        h.addStyleName("gwt-diagrams-source-link");
        h.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                Window.open("../source/" + h.getText(), "", "");
            }
        });
    }

    return sources;
}

From source file:org.eurekastreams.web.client.ui.pages.profile.tabs.GroupProfileAboutTabPanel.java

License:Apache License

/**
 * Constructor.//from  w  w w  .j ava 2s.  co  m
 * 
 * @param group
 *            Group to display.
 */
public GroupProfileAboutTabPanel(final DomainGroupModelView group) {
    final HashMap<String, String> basicInfoTabURL = new HashMap<String, String>();
    basicInfoTabURL.put("tab", "Basic Info");

    CreateUrlRequest target = new CreateUrlRequest(Page.GROUP_SETTINGS, group.getShortName());
    target.setParameters(basicInfoTabURL);

    Panel overviewPanel = createTitledPanel("Overview");
    Panel keywordsPanel = createTitledPanel("Keywords");

    final HTML noOverview = new HTML("An overview has not been added.");
    final HTML noKeywords = new HTML("Keywords have not been added.");

    final Hyperlink overviewHyperlink = new Hyperlink();
    final Hyperlink keywordsHyperlink = new Hyperlink();
    addLeft(overviewPanel);
    addRight(keywordsPanel);

    if (group.getOverview() == null || group.getOverview().trim().isEmpty()) {
        overviewHyperlink.setText("Add an overview.");
        overviewHyperlink.setTargetHistoryToken(Session.getInstance().generateUrl(target));
        overviewHyperlink.setVisible(false);

        overviewPanel.add(overviewHyperlink);
        overviewPanel.add(noOverview);
    } else {
        HTML overview = new HTML(group.getOverview());
        overview.addStyleName(StaticResourceBundle.INSTANCE.coreCss().profileAboutOverview());
        overviewPanel.add(overview);
    }

    if (group.getCapabilities() == null || group.getCapabilities().isEmpty()) {
        keywordsHyperlink.setText("Add keywords.");
        keywordsHyperlink.setTargetHistoryToken(Session.getInstance().generateUrl(target));
        keywordsHyperlink.setVisible(false);

        keywordsPanel.add(keywordsHyperlink);
        keywordsPanel.add(noKeywords);
    } else {
        List<String> caps = group.getCapabilities();
        List<BackgroundItem> bgitems = new ArrayList<BackgroundItem>();
        for (String cap : caps) {
            bgitems.add(new BackgroundItem(cap, BackgroundItemType.NOT_SET));
        }
        keywordsPanel.add(new BackgroundItemLinksPanel("keywords", bgitems));
    }

    // Shows the appropriate "add" links for group coordinators, if necessary.
    final EventBus eventBus = Session.getInstance().getEventBus();
    eventBus.addObserver(AuthorizeUpdateGroupResponseEvent.class,
            new Observer<AuthorizeUpdateGroupResponseEvent>() {
                public void update(final AuthorizeUpdateGroupResponseEvent event) {
                    if (event.getResponse()) {
                        if (!overviewHyperlink.getText().isEmpty()) {
                            overviewHyperlink.setVisible(true);
                            noOverview.setVisible(false);
                        }

                        if (!keywordsHyperlink.getText().isEmpty()) {
                            keywordsHyperlink.setVisible(true);
                            noKeywords.setVisible(false);
                        }
                    }
                }
            });
}