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

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

Introduction

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

Prototype

public FlexTable() 

Source Link

Usage

From source file:com.ephesoft.gxt.batchinstance.client.view.BatchInstanceDetailView.java

License:Open Source License

public void initializeBatchInstanceDetails(List<DetailsDTO> detailsList) {
    batchProgressTable = new FlexTable();
    // batchProgressTable.setWidth("100%");
    batchProgressTable.setCellSpacing(0);
    batchProgressTable.setBorderWidth(0);
    batchProgressTable.addStyleName("borderResultTableGXTProgress");
    batchInstanceDetailsGrid.setData(detailsList);

}

From source file:com.ephesoft.gxt.uploadbatch.client.view.AssociateBCFView.java

License:Open Source License

public AssociateBCFView() {
    initWidget(binder.createAndBindUi(this));
    validationMessage = new Label();
    editTable = new FlexTable();
    this.validationMessage.addStyleName(CoreCommonConstants.ERROR_STYLE_CSS);
}

From source file:com.ephesoft.gxt.uploadbatch.client.view.AssociateBCFView.java

License:Open Source License

public void setView() {
    dialogBox.setDialogListener(new DialogAdapter() {

        @Override/*  www  .  jav  a 2  s  . com*/
        public void onOkClick() {
            presenter.onSave();
        }

        @Override
        public void onCloseClick() {
            dialogBox.hide();
        }

        @Override
        public void onCancelClick() {
            dialogBox.hide();
        }
    });
    scrollPanel = new ScrollPanel();
    setValidationMessage(CoreCommonConstants.EMPTY_STRING);
    editTable = new FlexTable();
    editTable.setWidth(CoreCommonConstants._100_PERCENTAGE);
    scrollPanel.add(editTable);
    flexEditTable.setWidget(1, 0, scrollPanel);
    flexEditTable.setWidget(0, 0, validationMessage);
    flexEditTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
}

From source file:com.ephesoft.gxt.uploadbatch.client.view.AssociateBCFView.java

License:Open Source License

@Override
public void initialize() {
    flexEditTable = new FlexTable() {

        @Override/*from w ww  .  j ava  2  s. com*/
        protected void onLoad() {
            super.onLoad();
            if (null != dialogBox) {
                Timer timer = new Timer() {

                    @Override
                    public void run() {
                        int flexTableHeight = flexEditTable.getOffsetHeight();
                        if (flexTableHeight > 200) {
                            scrollPanel.setHeight(CoreCommonConstants._200PX);
                        }
                        dialogBox.setHeight(flexEditTable.getOffsetHeight() + 100);
                        //                     dialogBox.setPixelSize(flexEditTable.getOffsetWidth(), flexEditTable.getOffsetHeight() + 100);
                    }
                };
                timer.schedule(50);
            }
        }
    };
}

From source file:com.example3.client.HelloFront.java

License:Apache License

public void init() {

    /* panel *///from w  w w  .j  a v  a 2 s  . c o m
    VerticalPanel pnl = new VerticalPanel();
    pnl.setWidth("100%");
    pnl.setBorderWidth(3);
    pnl.setSpacing(3);

    /* table */
    FlexTable tbl = new FlexTable();
    tbl.setWidth("100%");
    tbl.setBorderWidth(3);
    tbl.getColumnFormatter().setWidth(0, "100%");

    /* row */
    int row = 0;
    {
        TextArea txt = new TextArea();
        txt.setWidth("100%");
        txt.setText("HelloJsonp Test");
        Button btn = new Button("Click to test", new ClickHandler() {
            public void onClick(ClickEvent event) {
                HelloJsonp.get();
            }
        });
        tbl.setWidget(row, 0, txt);
        tbl.setWidget(row, 1, btn);
    }

    /* add table to panel, panel to root */
    pnl.add(tbl);
    Hello.hookNewRoot(pnl);
    thisPanel = pnl;
}

From source file:com.extjs.gxt.samples.client.examples.grid.ColumnGroupingExample.java

License:Open Source License

private void createGrid(boolean widget) {
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

    ColumnConfig column = new ColumnConfig();
    column.setId("name");
    column.setHeader("Company");
    column.setWidth(200);/*from   w  w  w .j  a  va 2  s .  co m*/
    configs.add(column);

    column = new ColumnConfig();
    column.setId("symbol");
    column.setHeader("Symbol");
    column.setWidth(100);
    configs.add(column);

    column = new ColumnConfig();
    column.setId("last");
    column.setHeader("Last");
    column.setAlignment(HorizontalAlignment.RIGHT);
    column.setWidth(75);
    column.setRenderer(gridNumber);
    configs.add(column);

    column = new ColumnConfig("change", "Change", 100);
    column.setAlignment(HorizontalAlignment.RIGHT);
    column.setRenderer(change);
    configs.add(column);

    column = new ColumnConfig("date", 125);
    if (widget) {
        Button btn = new Button("Updated");
        btn.addListener(Events.OnClick, new Listener<ButtonEvent>() {
            public void handleEvent(ButtonEvent be) {
                // stop column from getting click and causing sort
                be.cancelBubble();
            }
        });
        btn.setStyleAttribute("float", "left");
        column.setWidget(btn, "Last Updated");
    } else {
        column.setAlignment(HorizontalAlignment.RIGHT);
        column.setHeader("Last Updated");
    }

    column.setDateTimeFormat(DateTimeFormat.getFormat("MM/dd/yyyy"));
    configs.add(column);

    ListStore<Stock> store = new ListStore<Stock>();
    store.add(TestData.getStocks());

    ColumnModel cm = new ColumnModel(configs);

    cm.addHeaderGroup(0, 0, new HeaderGroupConfig("Header Grouping Example", 1, 5));
    cm.addHeaderGroup(1, 2, new HeaderGroupConfig("Stock Performance", 1, 2));

    if (widget) {
        Slider s = new Slider();
        s.setWidth(100);

        // ugly, but centers slider
        FlexTable tbl = new FlexTable();
        tbl.setWidth("100%");
        tbl.setHTML(0, 0, "&nbsp;");
        tbl.setHTML(0, 1, "<span style='white-space: nowrap;font-size: 11px'>Slide Me: &nbsp;</span>");
        tbl.setWidget(0, 2, s);
        tbl.setHTML(0, 3, "&nbsp;");
        tbl.getCellFormatter().setWidth(0, 0, "50%");
        tbl.getCellFormatter().setWidth(0, 3, "50%");
        cm.addHeaderGroup(1, 0, new HeaderGroupConfig(tbl, 1, 2));
    } else {
        cm.addHeaderGroup(1, 0, new HeaderGroupConfig("Stock Information", 1, 2));
    }

    ContentPanel cp = new ContentPanel();
    cp.setBodyBorder(false);
    cp.setIcon(Resources.ICONS.table());
    cp.setHeading(widget ? "Column Grouping with Widget" : "Column Grouping");
    cp.setButtonAlign(HorizontalAlignment.CENTER);
    cp.setLayout(new FitLayout());
    cp.setSize(600, 300);

    Grid<Stock> grid = new Grid<Stock>(store, cm);
    grid.setStyleAttribute("borderTop", "none");
    grid.getView().setForceFit(true);
    grid.setBorders(true);
    cp.add(grid);

    vp.add(cp);
}

From source file:com.extjs.gxt.samples.client.examples.layouts.BorderLayoutExample.java

License:Open Source License

protected void onRender(Element target, int index) {
    super.onRender(target, index);
    final BorderLayout layout = new BorderLayout();
    setLayout(layout);//from  w  w w.  ja  va 2  s.  c  o m
    setStyleAttribute("padding", "10px");

    ContentPanel north = new ContentPanel();
    ContentPanel west = new ContentPanel();
    ContentPanel center = new ContentPanel();
    center.setHeading("BorderLayout Example");
    center.setScrollMode(Scroll.AUTOX);

    FlexTable table = new FlexTable();
    table.getElement().getStyle().setProperty("margin", "10px");
    table.setCellSpacing(8);
    table.setCellPadding(4);

    for (int i = 0; i < LayoutRegion.values().length; i++) {
        final LayoutRegion r = LayoutRegion.values()[i];
        if (r == LayoutRegion.CENTER) {
            continue;
        }
        SelectionListener<ButtonEvent> sl = new SelectionListener<ButtonEvent>() {

            @Override
            public void componentSelected(ButtonEvent ce) {
                String txt = ce.getButton().getText();
                if (txt.equals("Expand")) {
                    layout.expand(r);
                } else if (txt.equals("Collapse")) {
                    layout.collapse(r);
                } else if (txt.equals("Show")) {
                    layout.show(r);
                } else {
                    layout.hide(r);
                }

            }
        };
        table.setHTML(i, 0, "<div style='font-size: 12px; width: 100px'>" + r.name() + ":</span>");
        table.setWidget(i, 1, new Button("Expand", sl));
        table.setWidget(i, 2, new Button("Collapse", sl));
        table.setWidget(i, 3, new Button("Show", sl));
        table.setWidget(i, 4, new Button("Hide", sl));
    }
    center.add(table);

    ContentPanel east = new ContentPanel();
    ContentPanel south = new ContentPanel();

    BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH, 100);
    northData.setCollapsible(true);
    northData.setFloatable(true);
    northData.setHideCollapseTool(true);
    northData.setSplit(true);
    northData.setMargins(new Margins(0, 0, 5, 0));

    BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 150);
    westData.setSplit(true);
    westData.setCollapsible(true);
    westData.setMargins(new Margins(0, 5, 0, 0));

    BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
    centerData.setMargins(new Margins(0));

    BorderLayoutData eastData = new BorderLayoutData(LayoutRegion.EAST, 150);
    eastData.setSplit(true);
    eastData.setCollapsible(true);
    eastData.setMargins(new Margins(0, 0, 0, 5));

    BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 100);
    southData.setSplit(true);
    southData.setCollapsible(true);
    southData.setFloatable(true);
    southData.setMargins(new Margins(5, 0, 0, 0));

    add(north, northData);
    add(west, westData);
    add(center, centerData);
    add(east, eastData);
    add(south, southData);
}

From source file:com.google.caliper.cloud.client.BenchmarkDataViewer.java

License:Apache License

public void rebuildResultsTable() {
    if (plainText) {
        Label label = new Label();
        label.setStyleName("plaintext");
        label.setText(gridToString(toGrid()));

        resultsDiv.clear();// w w  w .ja  va2  s.com
        resultsDiv.add(label);
        resultsDiv.add(new PlainTextEditor().getWidget());
        HTML dash = new HTML(" - ", false);
        dash.setStyleName("inline");
        resultsDiv.add(dash);
        resultsDiv.add(new SnapshotCreator().getWidget());
        return;
    }

    FlexTable table = new FlexTable();
    table.setStyleName("data");
    int r = 0;
    int c = 0;
    int evenRowMod = 0;

    // results header #1: cValue variables
    if (cVariable != null) {
        evenRowMod = 1;
        table.insertRow(r);
        table.getRowFormatter().setStyleName(r, "valueRow");
        table.getRowFormatter().addStyleName(r, "headerRow");

        table.addCell(r);
        table.getFlexCellFormatter().setColSpan(r, 0, rVariables.size());
        c++;
        for (Value cValue : cValues) {
            table.addCell(r);
            table.getFlexCellFormatter().setColSpan(r, c, 3);
            table.getCellFormatter().setStyleName(r, c, "parameterKey");

            Widget contents = newVariableLabel(cVariable, cValue.getLabel(), rVariables.size());
            contents.setStyleName("valueHeader");

            table.setWidget(r, c++, contents);
        }
        r++;
    }

    // results header 2: rValue variables, followed by "nanos/barchart" column pairs
    c = 0;
    table.insertRow(r);
    table.getRowFormatter().setStyleName(r, "evenRow");
    table.getRowFormatter().addStyleName(r, "headerRow");
    for (Variable variable : rVariables) {
        table.addCell(r);
        table.getCellFormatter().setStyleName(r, c, "parameterKey");
        table.setWidget(r, c, newVariableLabel(variable, variable.getName(), c));
        c++;
    }
    for (Value unused : cValues) {
        table.addCell(r);
        table.getCellFormatter().setStyleName(r, c, "parameterKey");
        table.setWidget(r, c++, newUnitLabel(unitMap.get(selectedType).trim()));

        table.addCell(r);
        table.getCellFormatter().setStyleName(r, c, "parameterKey");
        table.setWidget(r, c++, newRuntimeLabel());

        table.addCell(r);
        table.getCellFormatter().setStyleName(r, c, "parameterKey");
        table.setWidget(r, c++, new InlineLabel("%"));
    }
    r++;

    Key key = newDefaultKey();
    for (RowsIterator rows = new RowsIterator(rVariables); rows.nextRow();) {
        rows.updateKey(key);

        table.insertRow(r);
        table.getRowFormatter().setStyleName(r, r % 2 == evenRowMod ? "evenRow" : "oddRow");
        c = 0;
        for (int v = 0, size = rVariables.size(); v < size; v++) {
            table.addCell(r);
            table.setWidget(r, c++, new Label(rows.getRValue(v).getLabel()));
        }

        for (Value value : cValues) {
            table.addCell(r);
            table.addCell(r);

            if (cVariable != null) {
                key.set(cVariable, value);
            }

            final Datapoint datapoint = keysToDatapoints.get(key);
            table.getCellFormatter().setStyleName(r, c, "numericCell");
            table.getCellFormatter().setStyleName(r, c + 1, "bar");
            table.getCellFormatter().setStyleName(r, c + 2, "numericCell");
            MeasurementSet measurementSet;
            if (datapoint != null
                    && (measurementSet = datapoint.scenarioResults.getMeasurementSet(selectedType)) != null) {
                double rawMedian = getMedian(selectedType, measurementSet);
                String displayedValue = numberFormatMap.get(selectedType)
                        .format(rawMedian / divideByMap.get(selectedType));
                Anchor valueAnchor = new Anchor(displayedValue, false);
                valueAnchor.setStyleName("subtleLink");
                valueAnchor.setStyleName("nanos", true);

                final DialogBox eventLogPopup = new DialogBox(true);
                eventLogPopup.setText("");

                valueAnchor.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent clickEvent) {
                        // Do this lazily since it takes quite a bit of time to render these popups for all
                        // the scenarios shown, and quite often they won't even be used.
                        if (eventLogPopup.getText().isEmpty()) {
                            eventLogPopup.setText("Event Log");
                            String eventLog = datapoint.scenarioResults.getEventLog(selectedType);
                            if (eventLog == null || eventLog.isEmpty()) {
                                eventLog = "No event log recorded.";
                            }
                            FlowPanel panel = new FlowPanel();
                            for (String line : eventLog.split("\n")) {
                                panel.add(new Label(line));
                            }
                            panel.setStyleName("eventLog");
                            eventLogPopup.add(panel);
                        }
                        eventLogPopup.center();
                        eventLogPopup.show();
                    }
                });

                table.setWidget(r, c, valueAnchor);
                table.setWidget(r, c + 1, newBar(datapoint.style, measurementSet, value));
                table.setWidget(r, c + 2, newPercentOfReferencePointLabel(rawMedian, value));
            } else {
                table.setWidget(r, c, new Label(""));
                table.setWidget(r, c + 1, new Label(""));
                table.setWidget(r, c + 2, new Label(""));
            }
            c += 3;
        }

        r++;
    }
    resultsDiv.clear();
    resultsDiv.add(table);
    resultsDiv.add(new PlainTextEditor().getWidget());
    HTML dash = new HTML(" - ", false);
    dash.setStyleName("inline");
    resultsDiv.add(dash);
    resultsDiv.add(new SnapshotCreator().getWidget());
}

From source file:com.google.caliper.cloud.client.BenchmarkDataViewer.java

License:Apache License

public void rebuildVariablesTable() {
    FlexTable table = new FlexTable();
    table.setStyleName("data");

    int r = 0;/*from w  ww . j ava  2s  . c o  m*/
    for (Variable variable : variables) {
        table.insertRow(r);

        table.addCell(r);
        table.getRowFormatter().setStyleName(r, r % 2 == 0 ? "evenRow" : "oddrow");
        table.getCellFormatter().setStyleName(r, 0, "fixedParameterKey");
        table.setWidget(r, 0, new Label(variable.getName()));

        table.addCell(r);
        FlowPanel checkBoxes = new FlowPanel();
        if (variable.hasMultipleValues()) {
            for (Value value : variable.getValues()) {
                checkBoxes.add(newShownCheckbox(value));
            }
        } else {
            checkBoxes.add(new Label(variable.getOnlyValue().getName()));
        }
        table.setWidget(r, 1, checkBoxes);

        r++;
    }

    fixedVariablesDiv.clear();
    fixedVariablesDiv.add(table);
}

From source file:com.google.code.p.gwtchismes.client.editor.GWTCColorPicker.java

License:Apache License

public GWTCColorPicker() {
    super(true);//w w w  .j  ava2 s  .c  om
    FlexTable t = new FlexTable();
    t.setCellPadding(0);
    t.setCellSpacing(0);
    DOM.setStyleAttribute(t.getElement(), "border", "1px solid #cccccc");

    int i = 0;
    for (int r = 0; i < colors.length; r++) {
        for (int c = 0; c < 7 && i < colors.length; c++, i++) {
            ColorCell cell = new ColorCell(colors[i]);
            cell.addClickHandler(this);
            t.setWidget(r, c, cell);
        }
    }

    add(t);
    setAnimationEnabled(true);
    setStyleName("hupa-color-picker");
}