Search in sources :

Example 41 with FlexCellFormatter

use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project gerrit by GerritCodeReview.

the class DashboardsTable method populate.

protected void populate(final int row, final DashboardInfo k) {
    if (k.isDefault()) {
        table.setWidget(row, 1, new Image(Gerrit.RESOURCES.greenCheck()));
        final FlexCellFormatter fmt = table.getFlexCellFormatter();
        fmt.getElement(row, 1).setTitle(Util.C.dashboardDefaultToolTip());
    }
    table.setWidget(row, 2, new Anchor(k.path(), "#" + PageLinks.toProjectDashboard(new Project.NameKey(k.project()), k.id())));
    table.setText(row, 3, k.title() != null ? k.title() : k.path());
    table.setText(row, 4, k.description());
    if (k.definingProject() != null && !k.definingProject().equals(k.project())) {
        table.setWidget(row, 5, new Anchor(k.definingProject(), "#" + PageLinks.toProjectDashboards(new Project.NameKey(k.definingProject()))));
    }
    setRowItem(row, k);
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter) Image(com.google.gwt.user.client.ui.Image)

Example 42 with FlexCellFormatter

use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project gerrit by GerritCodeReview.

the class DocTable method insertNoneRow.

private void insertNoneRow(int row) {
    table.insertRow(row);
    table.setText(row, 0, Util.C.docTableNone());
    FlexCellFormatter fmt = table.getFlexCellFormatter();
    fmt.setStyleName(row, 0, Gerrit.RESOURCES.css().emptySection());
}
Also used : FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)

Example 43 with FlexCellFormatter

use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project gerrit by GerritCodeReview.

the class ProjectsTable method initColumnHeaders.

protected void initColumnHeaders() {
    table.setText(0, C_STATE, Util.C.projectStateAbbrev());
    table.getCellFormatter().getElement(0, C_STATE).setTitle(Util.C.projectStateHelp());
    table.setText(0, C_NAME, Util.C.projectName());
    table.setText(0, C_DESCRIPTION, Util.C.projectDescription());
    final FlexCellFormatter fmt = table.getFlexCellFormatter();
    fmt.addStyleName(0, C_STATE, Gerrit.RESOURCES.css().iconHeader());
    fmt.addStyleName(0, C_NAME, Gerrit.RESOURCES.css().dataHeader());
    fmt.addStyleName(0, C_DESCRIPTION, Gerrit.RESOURCES.css().dataHeader());
}
Also used : FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)

Example 44 with FlexCellFormatter

use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project gerrit by GerritCodeReview.

the class MyWatchesTable method populate.

protected void populate(final int row, final ProjectWatchInfo info) {
    final FlowPanel fp = new FlowPanel();
    fp.add(new ProjectLink(info.project(), new Project.NameKey(info.project())));
    if (info.filter() != null) {
        Label filter = new Label(info.filter());
        filter.setStyleName(Gerrit.RESOURCES.css().watchedProjectFilter());
        fp.add(filter);
    }
    table.setWidget(row, 1, new CheckBox());
    table.setWidget(row, 2, fp);
    addNotifyButton(ProjectWatchInfo.Type.NEW_CHANGES, info, row, 3);
    addNotifyButton(ProjectWatchInfo.Type.NEW_PATCHSETS, info, row, 4);
    addNotifyButton(ProjectWatchInfo.Type.ALL_COMMENTS, info, row, 5);
    addNotifyButton(ProjectWatchInfo.Type.SUBMITTED_CHANGES, info, row, 6);
    addNotifyButton(ProjectWatchInfo.Type.ABANDONED_CHANGES, info, row, 7);
    final FlexCellFormatter fmt = table.getFlexCellFormatter();
    fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().iconCell());
    fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell());
    fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell());
    fmt.addStyleName(row, 4, Gerrit.RESOURCES.css().dataCell());
    fmt.addStyleName(row, 5, Gerrit.RESOURCES.css().dataCell());
    fmt.addStyleName(row, 6, Gerrit.RESOURCES.css().dataCell());
    fmt.addStyleName(row, 7, Gerrit.RESOURCES.css().dataCell());
    setRowItem(row, info);
}
Also used : ProjectLink(com.google.gerrit.client.ui.ProjectLink) CheckBox(com.google.gwt.user.client.ui.CheckBox) FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) Label(com.google.gwt.user.client.ui.Label)

Example 45 with FlexCellFormatter

use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project gerrit by GerritCodeReview.

the class GroupTable method populate.

void populate(final int row, final GroupInfo k, final String toHighlight) {
    if (k.url() != null) {
        if (isInteralGroup(k)) {
            table.setWidget(row, 1, new HighlightingInlineHyperlink(k.name(), Dispatcher.toGroup(k.getGroupId()), toHighlight));
        } else {
            Anchor link = new Anchor();
            link.setHTML(Util.highlight(k.name(), toHighlight));
            link.setHref(k.url());
            table.setWidget(row, 1, link);
        }
    } else {
        table.setHTML(row, 1, Util.highlight(k.name(), toHighlight));
    }
    table.setText(row, 2, k.description());
    if (k.options().isVisibleToAll()) {
        table.setWidget(row, 3, new Image(Gerrit.RESOURCES.greenCheck()));
    }
    final FlexCellFormatter fmt = table.getFlexCellFormatter();
    fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().groupName());
    for (int i = 1; i <= NUM_COLS; i++) {
        fmt.addStyleName(row, i, Gerrit.RESOURCES.css().dataCell());
    }
    setRowItem(row, k);
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter) Image(com.google.gwt.user.client.ui.Image) HighlightingInlineHyperlink(com.google.gerrit.client.ui.HighlightingInlineHyperlink)

Aggregations

FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)48 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)25 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)25 TabItem (cz.metacentrum.perun.webgui.tabs.TabItem)19 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)19 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)17 ExtendedTextBox (cz.metacentrum.perun.webgui.widgets.ExtendedTextBox)14 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)10 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)10 RegistrarFormItemGenerator (cz.metacentrum.perun.webgui.client.applicationresources.RegistrarFormItemGenerator)6 PerunError (cz.metacentrum.perun.webgui.model.PerunError)5 JSONString (com.google.gwt.json.client.JSONString)3 VirtualOrganization (cz.metacentrum.perun.webgui.model.VirtualOrganization)3 ListBoxWithObjects (cz.metacentrum.perun.webgui.widgets.ListBoxWithObjects)3 ArrayList (java.util.ArrayList)3 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)2 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)2 ImageResource (com.google.gwt.resources.client.ImageResource)2 Anchor (com.google.gwt.user.client.ui.Anchor)2 Image (com.google.gwt.user.client.ui.Image)2