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

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

Introduction

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

Prototype

public InlineHyperlink(String text, String targetHistoryToken) 

Source Link

Document

Creates a hyperlink with its text and target history token specified.

Usage

From source file:com.google.api.explorer.client.FullView.java

License:Apache License

/**
 * Generate breadcrumbs into the specified container using the format link > link > text where the
 * last breadcrumb is always plain text.
 *//* w  w w .  j  a  v a  2  s  .c  o m*/
private void generateBreadcrumbs(Panel container, List<Title> titles) {
    container.clear();

    // For all of the titles previous to the last, add a link and a separator.
    for (Title notLast : titles.subList(0, titles.size() - 1)) {
        container.add(new InlineHyperlink(notLast.getTitle(), notLast.getFragment()));
        container.add(new InlineLabel(" > "));
    }

    // Append only the text for the last title.
    Title lastTitle = Iterables.getLast(titles);
    container.add(new InlineLabel(lastTitle.getTitle()));
    if (lastTitle.getSubtitle() != null) {
        Label subtitle = new InlineLabel(" - " + lastTitle.getSubtitle());
        subtitle.addStyleName(style.methodSubtitle());
        container.add(subtitle);
    }
}

From source file:com.googlesource.gerrit.plugins.cookbook.client.BuildsDropDownPanel.java

License:Apache License

BuildsDropDownPanel() {
    Grid g = new Grid(3, 4);
    g.addStyleName("infoBlock");
    CellFormatter fmt = g.getCellFormatter();

    g.setText(0, 0, "State");
    fmt.addStyleName(0, 0, "header");
    g.setText(0, 1, "PS");
    fmt.addStyleName(0, 1, "header");
    g.setText(0, 2, "Date");
    fmt.addStyleName(0, 2, "header");
    g.setText(0, 3, "Log");
    fmt.addStyleName(0, 3, "header");

    HorizontalPanel p = new HorizontalPanel();
    p.add(new Image(CookBookPlugin.RESOURCES.greenCheck()));
    p.add(new InlineLabel("OK"));
    g.setWidget(1, 0, p);/*from w ww  .j a v  a2s  .  com*/
    g.setWidget(1, 1, new InlineLabel("2"));
    g.setWidget(1, 2, new InlineLabel("2015-07-09 11:06:13"));
    g.setWidget(1, 3, new InlineHyperlink("Build Log", "TODO"));

    p = new HorizontalPanel();
    p.add(new Image(CookBookPlugin.RESOURCES.redNot()));
    p.add(new InlineLabel("FAILED"));
    g.setWidget(2, 0, p);
    g.setWidget(2, 1, new InlineLabel("1"));
    g.setWidget(2, 2, new InlineLabel("2015-07-09 09:17:28"));
    g.setWidget(2, 3, new InlineHyperlink("Build Log", "TODO"));

    fmt.addStyleName(0, 0, "topmost");
    fmt.addStyleName(0, 1, "topmost");
    fmt.addStyleName(0, 2, "topmost");
    fmt.addStyleName(0, 3, "topmost");

    add(new PopDownButton("Builds", g));
}

From source file:com.googlesource.gerrit.plugins.examples.wuichangescreenheaderrightofpopdowns.client.BuildsDropDownPanel.java

License:Apache License

BuildsDropDownPanel() {
    Grid g = new Grid(3, 4);
    g.addStyleName("infoBlock");
    CellFormatter fmt = g.getCellFormatter();

    g.setText(0, 0, "State");
    fmt.addStyleName(0, 0, "header");
    g.setText(0, 1, "PS");
    fmt.addStyleName(0, 1, "header");
    g.setText(0, 2, "Date");
    fmt.addStyleName(0, 2, "header");
    g.setText(0, 3, "Log");
    fmt.addStyleName(0, 3, "header");

    HorizontalPanel p = new HorizontalPanel();
    p.add(new Image(ExamplePlugin.RESOURCES.greenCheck()));
    p.add(new InlineLabel("OK"));
    g.setWidget(1, 0, p);/*from ww  w .ja va 2  s .com*/
    g.setWidget(1, 1, new InlineLabel("2"));
    g.setWidget(1, 2, new InlineLabel("2015-07-09 11:06:13"));
    g.setWidget(1, 3, new InlineHyperlink("Build Log", "TODO"));

    p = new HorizontalPanel();
    p.add(new Image(ExamplePlugin.RESOURCES.redNot()));
    p.add(new InlineLabel("FAILED"));
    g.setWidget(2, 0, p);
    g.setWidget(2, 1, new InlineLabel("1"));
    g.setWidget(2, 2, new InlineLabel("2015-07-09 09:17:28"));
    g.setWidget(2, 3, new InlineHyperlink("Build Log", "TODO"));

    fmt.addStyleName(0, 0, "topmost");
    fmt.addStyleName(0, 1, "topmost");
    fmt.addStyleName(0, 2, "topmost");
    fmt.addStyleName(0, 3, "topmost");

    add(new PopDownButton("Builds", g));
}

From source file:com.googlesource.gerrit.plugins.verifystatus.client.JobsPanel.java

License:Apache License

private void display(String patchsetId, NativeMap<VerificationInfo> jobs) {
    int row = 0;// w  w w.  j  a v  a 2s . c om
    int column = 1;
    Grid grid = new Grid(row, column);
    for (String key : jobs.keySet()) {
        HorizontalPanel p = new HorizontalPanel();
        short vote = jobs.get(key).value();
        if (vote > 0) {
            p.add(new Image(VerifyStatusPlugin.RESOURCES.greenCheck()));
        } else if (vote < 0) {
            p.add(new Image(VerifyStatusPlugin.RESOURCES.redNot()));
        } else if (vote == 0) {
            p.add(new Image(VerifyStatusPlugin.RESOURCES.warning()));
        }
        Anchor anchor = new Anchor(jobs.get(key).name(), jobs.get(key).url());
        anchor.setTitle("view logs");
        p.add(anchor);
        InlineLabel label = new InlineLabel(" (" + jobs.get(key).duration() + ")");
        label.setTitle("duration");
        p.add(label);
        if (jobs.get(key).rerun()) {
            Image img = new Image(VerifyStatusPlugin.RESOURCES.rerun());
            img.setTitle("re-run");
            p.add(img);
        }
        if (jobs.get(key).abstain()) {
            Image img = new Image(VerifyStatusPlugin.RESOURCES.info());
            img.setTitle("non voting");
            p.add(img);
        }
        grid.insertRow(row);
        grid.setWidget(row, 0, p);
        row++;
    }
    HorizontalPanel p = new HorizontalPanel();
    InlineHyperlink all = new InlineHyperlink("Show All Reports",
            "/x/" + Plugin.get().getName() + "/jobs/" + patchsetId);
    p.add(all);
    grid.insertRow(row);
    grid.setWidget(row, 0, p);
    add(grid);
}

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

License:Apache License

private InlineHyperlink createBaseLink() {
    InlineHyperlink link = new InlineHyperlink("Base",
            getUrl(change._number(), null, patchSet, path, diffView));
    if (isBaseSelected()) {
        link.setStyleName("xdocs-patch-set-select-box-selected");
    }//from  w w  w  .ja v a  2 s .co m
    return link;
}

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

License:Apache License

private InlineHyperlink createHiddenBaseLink() {
    InlineHyperlink link = new InlineHyperlink("Base", null);
    link.addStyleName("xdocs-hidden");
    return link;/*from  w w w .java2  s. co  m*/
}

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

License:Apache License

private InlineHyperlink createLink(RevisionInfo r) {
    String label = r.is_edit() ? "edit" : Integer.toString(r._number());
    Integer patchSetIdA = sideA() ? Integer.valueOf(r._number()) : basePatchSet;
    int patchSetIdB = sideA() ? patchSet : r._number();
    InlineHyperlink link = new InlineHyperlink(label,
            getUrl(change._number(), patchSetIdA, patchSetIdB, path, diffView));
    if (isSelected(r._number())) {
        link.setStyleName("xdocs-patch-set-select-box-selected");
    }/*w  w  w  .  j ava 2 s  .c  om*/
    return link;
}

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

License:Apache License

private Widget getPathHeader(ChangeInfo change) {
    HorizontalPanel p = new HorizontalPanel();
    p.setStyleName("xdocs-file-header");
    p.add(new InlineHyperlink(change.project(), "/admin/projects/" + change.project()));
    p.add(new Label("/"));

    SafeHtmlBuilder html = new SafeHtmlBuilder();
    if (FileInfo.COMMIT_MSG.equals(path)) {
        html.append("Commit Message");
    } else {/*from w w  w.jav a 2  s. c om*/
        int s = path.lastIndexOf('/') + 1;
        html.append(path.substring(0, s));
        html.openElement("b");
        html.append(path.substring(s));
        html.closeElement("b");
    }
    p.add(new InlineHTML(html.toSafeHtml()));

    return p;
}

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

License:Apache License

XDocScreen(String projectName, String revision, String path) {
    setStyleName("xdocs-panel");

    HorizontalPanel p = new HorizontalPanel();
    p.setStyleName("xdocs-file-header");
    p.add(new InlineHyperlink(projectName, "/admin/projects/" + projectName));
    p.add(new Label("/"));
    p.add(new Label(path));
    p.add(new Label("(" + revision + ")"));
    add(p);/*from   w w w.  ja  v a2 s.  c  o m*/

    final String url = XDocApi.getUrl(projectName, revision, path);
    XDocApi.checkHtml(url, new AsyncCallback<VoidResult>() {
        @Override
        public void onSuccess(VoidResult result) {
            String frameId = "xdoc_iframe";
            Frame frame = new Frame(url);
            frame.getElement().setId(frameId);
            resize(frame, frameId);
            add(frame);
        }

        @Override
        public void onFailure(Throwable caught) {
            showError(caught.getMessage());
        }
    });
}

From source file:com.gwtplatform.samples.hplace.client.application.breadcrumbs.BreadcrumbsView.java

License:Apache License

@Override
public void clearBreadcrumbs(int breadcrumbSize) {
    breadcrumbs.clear();/*from  ww  w.  ja  v a 2  s.c o m*/
    for (int i = 0; i < breadcrumbSize; ++i) {
        if (i > 0) {
            breadcrumbs.add(new InlineLabel(" > "));
        }
        breadcrumbs.add(new InlineHyperlink("Loading title...", placeManager.buildRelativeHistoryToken(i + 1)));
    }
}