Search in sources :

Example 26 with FlexCellFormatter

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

the class ChangeTable method updateColumnsForLabels.

public void updateColumnsForLabels(ChangeList... lists) {
    labelNames = new ArrayList<>();
    for (ChangeList list : lists) {
        for (int i = 0; i < list.length(); i++) {
            for (String name : list.get(i).labels()) {
                if (!labelNames.contains(name)) {
                    labelNames.add(name);
                }
            }
        }
    }
    Collections.sort(labelNames);
    int baseColumns = BASE_COLUMNS;
    if (baseColumns + labelNames.size() < columns) {
        int n = columns - (baseColumns + labelNames.size());
        for (int row = 0; row < table.getRowCount(); row++) {
            table.removeCells(row, columns, n);
        }
    }
    columns = baseColumns + labelNames.size();
    FlexCellFormatter fmt = table.getFlexCellFormatter();
    for (int i = 0; i < labelNames.size(); i++) {
        String name = labelNames.get(i);
        int col = baseColumns + i;
        String abbrev = getAbbreviation(name, "-");
        table.setText(0, col, abbrev);
        table.getCellFormatter().getElement(0, col).setTitle(name);
        fmt.addStyleName(0, col, Gerrit.RESOURCES.css().dataHeader());
    }
    for (Section s : sections) {
        if (s.titleRow >= 0) {
            fmt.setColSpan(s.titleRow, 0, columns);
        }
    }
}
Also used : FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)

Example 27 with FlexCellFormatter

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

the class ChangeTable method insertNoneRow.

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

Example 28 with FlexCellFormatter

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

the class DashboardsTable method insert.

protected void insert(final int row, final DashboardInfo k) {
    table.insertRow(row);
    applyDataRowStyle(row);
    final FlexCellFormatter fmt = table.getFlexCellFormatter();
    fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell());
    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());
    populate(row, k);
}
Also used : FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)

Example 29 with FlexCellFormatter

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

the class DashboardsTable method initColumnHeaders.

protected void initColumnHeaders() {
    final FlexCellFormatter fmt = table.getFlexCellFormatter();
    fmt.setColSpan(0, 0, 2);
    fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().dataHeader());
    fmt.addStyleName(0, 2, Gerrit.RESOURCES.css().dataHeader());
    fmt.addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader());
    fmt.addStyleName(0, 4, Gerrit.RESOURCES.css().dataHeader());
    table.setText(0, 1, Util.C.dashboardName());
    table.setText(0, 2, Util.C.dashboardTitle());
    table.setText(0, 3, Util.C.dashboardDescription());
    table.setText(0, 4, Util.C.dashboardInherited());
}
Also used : FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)

Example 30 with FlexCellFormatter

use of com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter in project perun by CESNET.

the class FormInputStatusWidget method build.

private void build() {
    ft.clear();
    FlexCellFormatter ftf = ft.getFlexCellFormatter();
    Image img;
    String classname = "";
    if (status == Status.OK) {
        img = new Image(SmallIcons.INSTANCE.acceptIcon());
        classname = "input-status-ok";
    } else if (status == Status.ERROR) {
        img = new Image(SmallIcons.INSTANCE.exclamationIcon());
        classname = "input-status-error";
    } else {
        img = new Image(AjaxLoaderImage.SMALL_IMAGE_URL);
        classname = "input-status-loading";
    }
    Label label = new Label(message);
    label.addStyleName(classname);
    label.getElement().setId(classname);
    ft.setWidget(0, 0, img);
    ft.setWidget(0, 1, label);
    ftf.setWidth(0, 0, "25px");
    ftf.setHeight(0, 0, "25px");
    ftf.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
    ftf.setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE);
}
Also used : FlexCellFormatter(com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter) AjaxLoaderImage(cz.metacentrum.perun.webgui.widgets.AjaxLoaderImage)

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