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

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

Introduction

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

Prototype

public FlexCellFormatter getFlexCellFormatter() 

Source Link

Document

Explicitly gets the FlexCellFormatter .

Usage

From source file:org.metawidget.gwt.client.ui.layout.FlexTableLayout.java

License:LGPL

public void startContainerLayout(Panel container, GwtMetawidget metawidget) {

    State state = getState(container, metawidget);
    FlexTable flexTable = new FlexTable();
    flexTable.setStyleName(mTableStyleName);
    container.add(flexTable);//from  ww w.  j  a v  a  2  s  . co  m

    state.formatter = flexTable.getFlexCellFormatter();
}

From source file:org.nuxeo.ecm.platform.gwt.client.ui.old.LoginDialog2.java

License:Apache License

protected Widget createContent() {
    userBox = new TextBox();
    passBox = new PasswordTextBox();
    Button submit = new Button("Login");
    submit.addClickListener(this);
    VerticalPanel panel = new VerticalPanel();
    panel.add(new Label("Username:"));
    panel.add(userBox);//ww w. j a v a  2s  .  co  m
    panel.add(new Label("Password:"));
    panel.add(passBox);
    panel.add(submit);
    panel.setSpacing(2);

    FlexTable grid = new FlexTable();
    grid.setWidget(0, 0, new Label("Username"));
    grid.setWidget(0, 1, userBox);
    grid.setWidget(0, 0, new Label("Password"));
    grid.setWidget(1, 1, passBox);
    FlowPanel flowPanel = new FlowPanel();
    grid.setWidget(2, 0, flowPanel);
    flowPanel.add(submit);
    grid.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    grid.getFlexCellFormatter().setColSpan(2, 0, 2);

    return grid;
}

From source file:org.openelis.gwt.widget.MenuItem.java

License:Open Source License

public Widget create(String icon, Widget wid, String descriptionText) {
    FlexTable table = new FlexTable();
    table.setStyleName("TopMenuRowContainer");
    iconPanel.setStyleName(icon);/*w ww.  j av a2 s . c o  m*/
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(wid);
    hp.setCellWidth(wid, "100%");
    hp.add(openIcon);
    hp.setWidth("100%");
    VerticalPanel textPanel = new VerticalPanel();
    //Label label = new Label(labelText);
    wid.setStyleName("topMenuItemTitle");
    wid.addStyleName("locked");

    Label description;
    if ("EXCEPTION".equals(descriptionText))
        description = new Label();
    else
        description = new Label(descriptionText);

    description.setStyleName("topMenuItemDesc");
    table.setWidget(0, 0, iconPanel);
    textPanel.add(hp);
    textPanel.setCellWidth(hp, "100%");
    textPanel.add(description);
    textPanel.setWidth("100%");
    table.setWidget(0, 1, textPanel);
    table.getFlexCellFormatter().setStyleName(0, 0, "topMenuIcon");
    table.getFlexCellFormatter().setStyleName(0, 1, "topMenuItemMiddle");
    return table;
}

From source file:org.openelis.gwt.widget.MenuItem.java

License:Open Source License

public static Widget createDefault(String icon, Widget wid, String descriptionText) {
    FlexTable table = new FlexTable();
    table.setStyleName("TopMenuRowContainer");
    AbsolutePanel iconPanel = new AbsolutePanel();
    iconPanel.setStyleName(icon);//w w  w  .j a  v  a 2 s .c  o  m
    VerticalPanel textPanel = new VerticalPanel();
    //Label label = new Label(labelText);
    wid.setStyleName("topMenuItemTitle");
    wid.addStyleName("locked");

    Label description;
    if ("EXCEPTION".equals(descriptionText))
        description = new Label();
    else
        description = new Label(descriptionText);

    description.setStyleName("topMenuItemDesc");
    table.setWidget(0, 0, iconPanel);
    textPanel.add(wid);
    textPanel.add(description);
    table.setWidget(0, 1, textPanel);
    table.getFlexCellFormatter().setStyleName(0, 0, "topMenuIcon");
    table.getFlexCellFormatter().setStyleName(0, 1, "topMenuItemMiddle");
    return table;
}

From source file:org.openremote.web.console.widget.panel.GridPanelComponent.java

License:Open Source License

@Override
public void onRender(int width, int height, List<DataValuePairContainer> data) {
    FlexTable grid = (FlexTable) getWidget();
    int colWidth = (int) Math.round((double) width / cols);
    int rowHeight = (int) Math.round((double) height / rows);

    for (int i = 0; i < rows; i++) {
        for (int j = 0; j < cols; j++) {
            CellData cellData = cellDataArr[i][j];
            if (cellData != null) {
                if (!cellData.ignore) {
                    FlexCellFormatter formatter = grid.getFlexCellFormatter();
                    int cellWidth = cellData.colSpan * colWidth;
                    int cellHeight = cellData.rowSpan * rowHeight;
                    formatter.setRowSpan(i, j, cellData.rowSpan);
                    formatter.setColSpan(i, j, cellData.colSpan);
                    formatter.setHeight(i, j, cellHeight + "px");
                    formatter.setWidth(i, j, cellWidth + "px");
                    formatter.setHorizontalAlignment(i, j, HasHorizontalAlignment.ALIGN_CENTER);
                    formatter.setVerticalAlignment(i, j, HasVerticalAlignment.ALIGN_MIDDLE);

                    Widget widget = grid.getWidget(i, j);
                    if (widget != null) {
                        ConsoleComponent component = (ConsoleComponent) widget;
                        if (component != null) {
                            component.onAdd(cellWidth, cellHeight);
                        }/*from ww w.j ava  2  s.com*/
                    } else {
                        // Just add an empty cell
                        this.setComponent(i, j, null);
                    }
                }
            }
        }
    }
}

From source file:org.otalo.ao.client.search.MsgStatusFilterCriteria.java

License:Apache License

/**
 * Constructs new author criteria panel//  ww w  .  j av  a2  s  .co  m
 */
public MsgStatusFilterCriteria() {
    any = new CheckBox("Any");
    inbox = new CheckBox("Inbox");
    approved = new CheckBox("Approved");
    rejected = new CheckBox("Rejected");
    responses = new CheckBox("Responses");

    any.setName(AoAPI.SearchConstants.StausConstants.STATUS_ANY);
    inbox.setName(AoAPI.SearchConstants.StausConstants.STATUS_INPUT);
    approved.setName(AoAPI.SearchConstants.StausConstants.STATUS_APPROVED);
    rejected.setName(AoAPI.SearchConstants.StausConstants.STATUS_REJECTED);
    responses.setName(AoAPI.SearchConstants.StausConstants.STATUS_RESPONDED);

    any.addClickHandler(this);
    inbox.addClickHandler(this);
    approved.addClickHandler(this);
    rejected.addClickHandler(this);
    responses.addClickHandler(this);

    FlexTable fieldGrid = new FlexTable();
    fieldGrid.setCellSpacing(8);
    fieldGrid.setWidget(0, 0, any);
    fieldGrid.getFlexCellFormatter().setColSpan(0, 0, 2);
    fieldGrid.setWidget(1, 0, inbox);
    fieldGrid.setWidget(1, 1, approved);
    fieldGrid.setWidget(2, 0, rejected);
    fieldGrid.setWidget(2, 1, responses);
    fieldGrid.addStyleName("status-filter");
    any.setValue(true);
    setResetAny();

    initWidget(fieldGrid);

    selectedStatusQuery = new CustomStringBuilder();
}

From source file:org.otalo.ao.client.search.SearchFilterPanel.java

License:Apache License

public SearchFilterPanel(SearchResultMsgList searchResultContainer) {
    //Initializing queryParams
    queryParamsMap = new SearchQueryParamMap();

    this.searchResultContainer = searchResultContainer;

    verticalPanel = new VerticalPanel();
    verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
    verticalPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);

    //Initializing other widgets
    searchInput = new TextBox();
    searchInput.setName(AoAPI.SearchConstants.SEARCH_KEYWORD);
    searchInput.setTitle(AoAPI.SearchConstants.SEARCH_KEYWORD);
    searchInput.addStyleName("input-txt");
    searchInput.addKeyUpHandler(this);

    Label searchLbl = new Label();
    searchLbl.setText("Keywords");
    searchLbl.addStyleName("label-txt");
    searchLbl.addStyleName("search-label");

    Label mstatusLbl = new Label();
    mstatusLbl.setText("Status");
    mstatusLbl.addStyleName("label-txt");
    msgStatusFilter = new MsgStatusFilterCriteria();

    Label dateLbl = new Label();
    dateLbl.setText("From");
    dateLbl.addStyleName("label-txt");
    Label toLbl = new Label();
    toLbl.setText("To");
    toLbl.addStyleName("label-txt");
    toLbl.addStyleName("to-lbl");

    fromDate = new CustomDateBox();
    toDate = new CustomDateBox();
    fromDate.setName(AoAPI.SearchConstants.FROMDATE);
    toDate.setName(AoAPI.SearchConstants.TODATE);

    fromDate.setFormat(new DateBox.DefaultFormat(formatter));
    toDate.setFormat(new DateBox.DefaultFormat(formatter));

    fromDate.addStyleName("date-txt");
    toDate.addStyleName("date-txt");

    Label tagLbl = new Label();
    tagLbl.setText("Tags");
    tagLbl.addStyleName("label-txt");
    tagLbl.addStyleName("tag-label");
    tagsInput = new SearchTagWidget(false, false);
    tagsInput.setWidth("255px");

    Label forumLbl = new Label();
    forumLbl.setText("Forum");
    forumLbl.addStyleName("label-txt");
    forumList = new ForumList();

    Label authorLbl = new Label();
    authorLbl.setText("Search By");
    authorLbl.addStyleName("label-txt");
    authorFilter = new AuthorFilterCriteria();

    cancelButton = new HTML("<a href='javascript:;'>Cancel</a>");
    cancelButton.addStyleName("btn-cancel");

    searchButton = new Button();
    searchButton.setText("Search");
    searchButton.addStyleName("btn-search");

    ButtonClickHandler clickHandler = new ButtonClickHandler();
    searchButton.addClickHandler(clickHandler);
    cancelButton.addClickHandler(clickHandler);

    FlexTable fieldGrid = new FlexTable();
    fieldGrid.setCellSpacing(3);/*from w ww.  j a v a  2  s .c  om*/
    fieldGrid.setWidget(0, 0, searchLbl);
    fieldGrid.getFlexCellFormatter().setColSpan(0, 0, 2);

    fieldGrid.setWidget(1, 0, searchInput);
    fieldGrid.getFlexCellFormatter().setColSpan(1, 0, 2);

    fieldGrid.setWidget(2, 0, forumLbl);
    fieldGrid.getFlexCellFormatter().setColSpan(2, 0, 2);
    fieldGrid.setWidget(3, 0, forumList);
    fieldGrid.getFlexCellFormatter().setColSpan(3, 0, 2);
    fieldGrid.getFlexCellFormatter().addStyleName(9, 0, "dropdown");

    fieldGrid.setWidget(4, 0, mstatusLbl);
    fieldGrid.getFlexCellFormatter().setColSpan(4, 0, 2);
    fieldGrid.setWidget(5, 0, msgStatusFilter);
    fieldGrid.getFlexCellFormatter().setColSpan(5, 0, 2);

    fieldGrid.setWidget(6, 0, dateLbl);
    fieldGrid.setWidget(6, 1, toLbl);
    fieldGrid.setWidget(7, 0, fromDate);
    fieldGrid.setWidget(7, 1, toDate);

    fieldGrid.setWidget(8, 0, tagLbl);
    fieldGrid.getFlexCellFormatter().setColSpan(8, 0, 2);
    fieldGrid.setWidget(9, 0, tagsInput);
    fieldGrid.getFlexCellFormatter().setColSpan(9, 0, 2);

    fieldGrid.setWidget(10, 0, authorLbl);
    fieldGrid.getFlexCellFormatter().setColSpan(10, 0, 2);
    fieldGrid.setWidget(11, 0, authorFilter);
    fieldGrid.getFlexCellFormatter().setColSpan(11, 0, 2);

    HorizontalPanel buttonPlacer = new HorizontalPanel();
    buttonPlacer.setSpacing(8);

    buttonPlacer.add(cancelButton);
    buttonPlacer.add(searchButton);
    DOM.setStyleAttribute(buttonPlacer.getElement(), "cssFloat", "right");
    fieldGrid.setWidget(12, 0, buttonPlacer);
    fieldGrid.getFlexCellFormatter().setColSpan(12, 0, 2);

    verticalPanel.add(fieldGrid);

    initWidget(verticalPanel);
    //setting default search fields
    setDefaults();

}

From source file:org.pentaho.gwt.widgets.client.colorpicker.ColorPicker.java

License:Artistic License

public ColorPicker() {
    // UI Drawing
    // ------------------

    hue = 0;//from   w ww  .j  av  a2 s .com
    saturation = 100;
    brightness = 100;
    red = 255;
    green = 0;
    blue = 0;

    HorizontalPanel panel = new HorizontalPanel();
    FlexTable table = new FlexTable();

    // Add the large slider map
    slidermap = new SliderMap(this);
    panel.add(slidermap);
    panel.setCellWidth(slidermap, "258px"); //$NON-NLS-1$
    panel.setCellHeight(slidermap, "258px"); //$NON-NLS-1$

    // Add the small slider bar
    sliderbar = new SliderBar(this);
    panel.add(sliderbar);
    panel.setCellWidth(sliderbar, "40px"); //$NON-NLS-1$
    panel.setCellHeight(sliderbar, "258px"); //$NON-NLS-1$

    // Define the Flextable's content
    // Color preview at the top
    colorpreview = new HTML(""); //$NON-NLS-1$
    colorpreview.setWidth("50px"); //$NON-NLS-1$
    colorpreview.setHeight("50px"); //$NON-NLS-1$
    DOM.setStyleAttribute(colorpreview.getElement(), "border", "1px solid black"); //$NON-NLS-1$ //$NON-NLS-2$

    // Radio buttons
    rbHue = new RadioButton("color", "H:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbHue.addClickListener(this);
    rbSaturation = new RadioButton("color", "S:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbSaturation.addClickListener(this);
    rbBrightness = new RadioButton("color", "V:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbBrightness.addClickListener(this);
    rbRed = new RadioButton("color", "R:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbRed.addClickListener(this);
    rbGreen = new RadioButton("color", "G:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbGreen.addClickListener(this);
    rbBlue = new RadioButton("color", "B:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbBlue.addClickListener(this);

    // Textboxes
    tbHue = new TextBox();
    tbHue.setText(new Integer(hue).toString());
    tbHue.setMaxLength(3);
    tbHue.setVisibleLength(4);
    tbHue.addKeyboardListener(this);
    tbHue.addChangeListener(this);
    tbSaturation = new TextBox();
    tbSaturation.setText(new Integer(saturation).toString());
    tbSaturation.setMaxLength(3);
    tbSaturation.setVisibleLength(4);
    tbSaturation.addKeyboardListener(this);
    tbSaturation.addChangeListener(this);
    tbBrightness = new TextBox();
    tbBrightness.setText(new Integer(brightness).toString());
    tbBrightness.setMaxLength(3);
    tbBrightness.setVisibleLength(4);
    tbBrightness.addKeyboardListener(this);
    tbBrightness.addChangeListener(this);
    tbRed = new TextBox();
    tbRed.setText(new Integer(red).toString());
    tbRed.setMaxLength(3);
    tbRed.setVisibleLength(4);
    tbRed.addKeyboardListener(this);
    tbRed.addChangeListener(this);
    tbGreen = new TextBox();
    tbGreen.setText(new Integer(green).toString());
    tbGreen.setMaxLength(3);
    tbGreen.setVisibleLength(4);
    tbGreen.addKeyboardListener(this);
    tbGreen.addChangeListener(this);
    tbBlue = new TextBox();
    tbBlue.setText(new Integer(blue).toString());
    tbBlue.setMaxLength(3);
    tbBlue.setVisibleLength(4);
    tbBlue.addKeyboardListener(this);
    tbBlue.addChangeListener(this);
    tbHexColor = new TextBox();
    tbHexColor.setText("ff0000"); //$NON-NLS-1$
    tbHexColor.setMaxLength(6);
    tbHexColor.setVisibleLength(6);
    tbHexColor.addKeyboardListener(this);
    tbHexColor.addChangeListener(this);

    // Put together the FlexTable
    table.setWidget(0, 0, colorpreview);
    table.getFlexCellFormatter().setColSpan(0, 0, 3);
    table.setWidget(1, 0, rbHue);
    table.setWidget(1, 1, tbHue);
    table.setWidget(1, 2, new HTML("&deg;")); //$NON-NLS-1$
    table.setWidget(2, 0, rbSaturation);
    table.setWidget(2, 1, tbSaturation);
    table.setText(2, 2, "%"); //$NON-NLS-1$
    table.setWidget(3, 0, rbBrightness);
    table.setWidget(3, 1, tbBrightness);
    table.setText(3, 2, "%"); //$NON-NLS-1$
    table.setWidget(4, 0, rbRed);
    table.setWidget(4, 1, tbRed);
    table.setWidget(5, 0, rbGreen);
    table.setWidget(5, 1, tbGreen);
    table.setWidget(6, 0, rbBlue);
    table.setWidget(6, 1, tbBlue);
    table.setText(7, 0, "#:"); //$NON-NLS-1$
    table.setWidget(7, 1, tbHexColor);
    table.getFlexCellFormatter().setColSpan(7, 1, 2);

    // Final setup
    panel.add(table);
    rbSaturation.setChecked(true);
    setPreview("ff0000"); //$NON-NLS-1$
    DOM.setStyleAttribute(colorpreview.getElement(), "cursor", "default"); //$NON-NLS-1$ //$NON-NLS-2$

    // First event
    onClick(rbSaturation);

    initWidget(panel);
}

From source file:org.pentaho.mantle.client.solutionbrowser.workspace.WorkspacePanel.java

License:Open Source License

private FlexTable buildEmptySubscriptionsTable() {
    FlexTable table = new FlexTable();
    table.setWidth("100%"); //$NON-NLS-1$
    table.setStyleName("backgroundContentTable"); //$NON-NLS-1$
    table.setWidget(0, 0, new Label(Messages.getString("name"))); //$NON-NLS-1$
    table.setWidget(0, 1, new Label(Messages.getString("scheduleDate"))); //$NON-NLS-1$
    table.setWidget(0, 2, new Label(Messages.getString("type"))); //$NON-NLS-1$
    table.setWidget(0, 3, new Label(Messages.getString("size"))); //$NON-NLS-1$
    table.setWidget(0, 4, new Label(Messages.getString("actions"))); //$NON-NLS-1$
    table.getFlexCellFormatter().setWidth(1, 0, "200em"); //$NON-NLS-1$
    table.getFlexCellFormatter().setWidth(1, 1, "200em"); //$NON-NLS-1$
    table.getFlexCellFormatter().setWidth(1, 2, "100em"); //$NON-NLS-1$
    table.getFlexCellFormatter().setWidth(1, 3, "100em"); //$NON-NLS-1$
    table.getFlexCellFormatter().setWidth(1, 4, "450em"); //$NON-NLS-1$

    table.getCellFormatter().setStyleName(0, 0, "backgroundContentHeaderTableCell"); //$NON-NLS-1$
    table.getCellFormatter().setStyleName(0, 1, "backgroundContentHeaderTableCell"); //$NON-NLS-1$
    table.getCellFormatter().setStyleName(0, 2, "backgroundContentHeaderTableCell"); //$NON-NLS-1$
    table.getCellFormatter().setStyleName(0, 3, "backgroundContentHeaderTableCell"); //$NON-NLS-1$
    table.getCellFormatter().setStyleName(0, 4, "backgroundContentHeaderTableCell"); //$NON-NLS-1$
    return table;
}

From source file:org.pentaho.pat.client.ui.panels.windows.ConnectionManagerPanel.java

License:Open Source License

private Widget createRichListBoxCell(final ConnectionItem item) {
    final FlexTable table = new FlexTable();
    final FlexCellFormatter cellFormatter = table.getFlexCellFormatter();

    table.setWidth("100%"); //$NON-NLS-1$
    table.setBorderWidth(0);/*w w w . ja v a 2  s  .c  o m*/
    table.setCellPadding(3);
    table.setCellSpacing(0);

    Image cImage;
    if (item.isConnected()) {
        cImage = Pat.IMAGES.connect().createImage();
    } else {
        cImage = Pat.IMAGES.disconnect().createImage();
    }
    final CustomButton cButton = new CustomButton(cImage) {
        @Override
        protected void onClick() {
            super.onClick();
            connectEvent(item.getId(), item.isConnected(), true);
        };
    };
    table.setWidget(0, 0, cButton);
    cellFormatter.setWidth(0, 0, "25px"); //$NON-NLS-1$
    table.setHTML(0, 1, "<b>" + item.getName() + "</b>"); //$NON-NLS-1$ //$NON-NLS-2$
    cellFormatter.setWidth(0, 1, "100%"); //$NON-NLS-1$
    return table;
}