Grid grid = new Grid(); HTMLTable.CellFormatter formatter = grid.getCellFormatter(); formatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER); formatter.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
/** * Replaces the contents of the specified cell with a single space. * * @param row the cell's row * @param column the cell's column * @throws IndexOutOfBoundsException */ @Override public boolean clearCell(int row, int column) { Element td = getCellFormatter().getElement(row, column); boolean b = internalClearCell(td, false); td.setInnerHTML(" "); return b; }
private void handleCellStyle(Grid wrapped, Element element, int columnIndex) { String styleName = element.getAttribute(STYLE_ATTR); if (styleName.length() > 0) { wrapped.getCellFormatter().setStyleName(currentRowIndex, columnIndex, styleName); } }
private void handleCellStyle(Grid wrapped, Element element, int columnIndex) { String styleName = element.getAttribute(STYLE_ATTR); if (styleName.length() > 0) { wrapped.getCellFormatter().setStyleName(currentRowIndex, columnIndex, styleName); } }
private void makeGrid() { grid.getCellFormatter().addStyleName(0, 0, "northwestCorner"); grid.setHTML(0, 0, ""); grid.getCellFormatter().addStyleName(0, 1, "horizontalLine"); grid.setHTML(0, 1, ""); grid.getCellFormatter().addStyleName(0, 2, "northeastCorner"); grid.setHTML(0, 2, ""); grid.getCellFormatter().addStyleName(1, 0, "verticalLine"); grid.setHTML(1, 0, ""); grid.setWidget(1, 1, widget); grid.getCellFormatter().addStyleName(1, 2, "verticalLine"); grid.setHTML(1, 2, ""); grid.getCellFormatter().addStyleName(2, 0, "southwestCorner"); grid.setHTML(2, 0, ""); grid.getCellFormatter().addStyleName(2, 1, "horizontalLine"); grid.setHTML(2, 1, ""); grid.getCellFormatter().addStyleName(2, 2, "smallButton"); grid.setHTML(2, 2, ""); }
/** * Replaces the contents of the specified cell with a single space. * * @param row the cell's row * @param column the cell's column * @throws IndexOutOfBoundsException */ @Override public boolean clearCell(int row, int column) { Element td = getCellFormatter().getElement(row, column); boolean b = internalClearCell(td, false); td.setInnerHTML(" "); return b; }
/** * Replaces the contents of the specified cell with a single space. * * @param row the cell's row * @param column the cell's column * @throws IndexOutOfBoundsException */ @Override public boolean clearCell(int row, int column) { Element td = getCellFormatter().getElement(row, column); boolean b = internalClearCell(td, false); td.setInnerHTML(" "); return b; }
this.mainGrid.getCellFormatter().setWidth(0, 0, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(0, 0, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(0, 1, this.sideWidth+"px"); this.mainGrid.getCellFormatter().setHeight(0, 1, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(0, 2, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(0, 2, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(1, 0, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(1, 0, this.sideHeight+"px"); this.mainGrid.getCellFormatter().setWidth(1, 2, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(1, 2, this.sideHeight+"px"); this.mainGrid.getCellFormatter().setWidth(2, 2, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(2, 2, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(2, 0, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(2, 0, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(2, 1, this.sideWidth+"px"); this.mainGrid.getCellFormatter().setHeight(2, 1, this.getConfiguration().getSideImagesHeight()+"px");
/*************************************** * @see Table#setData(DataModel) */ public void setData(DataModel<? extends DataModel<?>> rData) { this.rData = rData; if (aToolBar == null) { // the toolbar depends on model features, so it can only be created // after the model is available aToolBar = new TableToolBar(this); aMainPanel.setWidget(TOOLBAR_ROW, 0, aToolBar); aMainPanel.getCellFormatter() .setVerticalAlignment(TOOLBAR_ROW, 0, HasVerticalAlignment.ALIGN_BOTTOM); } update(); }
/** * @param rfl List<VeryfyRuleFired> * @param scenario = the scenario to add/remove from */ public VerifyRulesFiredWidget(final FixtureList rfl, final Scenario scenario, boolean showResults) { outer = new Grid( 2, 1 ); this.showResults = showResults; outer.getCellFormatter().setStyleName( 0, 0, "modeller-fact-TypeHeader" ); //NON-NLS outer.getCellFormatter().setAlignment( 0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE ); outer.setStyleName( "modeller-fact-pattern-Widget" ); //NON-NLS outer.setWidget( 0, 0, new SmallLabel( TestScenarioConstants.INSTANCE.ExpectRules() ) ); initWidget( outer ); FlexTable data = render( rfl, scenario ); outer.setWidget( 1, 0, data ); }
/** * @param rfl List<VeryfyRuleFired> * @param scenario = the scenario to add/remove from */ public VerifyRulesFiredWidget( final FixtureList rfl, final Scenario scenario, final boolean showResults ) { outer = new Grid( 2, 1 ); this.showResults = showResults; outer.getCellFormatter().setStyleName( 0, 0, "modeller-fact-TypeHeader" ); //NON-NLS outer.getCellFormatter().setAlignment( 0, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE ); outer.setStyleName( "modeller-fact-pattern-Widget" ); //NON-NLS outer.setWidget( 0, 0, new SmallLabel( TestScenarioConstants.INSTANCE.ExpectRules() ) ); initWidget( outer ); FlexTable data = render( rfl, scenario ); outer.setWidget( 1, 0, data ); }
layout.getColumnFormatter().setWidth( 1, "90%" ); layout.getCellFormatter().setAlignment( 0, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP ); layout.getCellFormatter().setAlignment( 0, 1, HasHorizontalAlignment.ALIGN_LEFT,
this.mainGrid.getCellFormatter().getElement(0, 0).addClassName("notification-topleft"); this.mainGrid.getCellFormatter().getElement(0, 1).addClassName("notification-top"); this.mainGrid.getCellFormatter().getElement(0, 2).addClassName("notification-topright"); this.mainGrid.getCellFormatter().getElement(1, 0).addClassName("notification-left"); this.mainGrid.getCellFormatter().getElement(1, 2).addClassName("notification-right"); this.mainGrid.getCellFormatter().getElement(1, 1).addClassName("notification-content"); this.mainGrid.getCellFormatter().getElement(2, 2).addClassName("notification-bottomright"); this.mainGrid.getCellFormatter().getElement(2, 0).addClassName("notification-bottomleft"); this.mainGrid.getCellFormatter().getElement(2, 1).addClassName("notification-bottom");
addKeyRadioButton(grid, 4, 2, "out bottom center"); addKeyRadioButton(grid, 4, 4, "out bottom right"); final Grid.CellFormatter cf = grid.getCellFormatter(); cf.getElement(1, 1).getStyle().setProperty("borderLeft", "1px solid #000"); cf.getElement(1, 1).getStyle().setProperty("borderTop", "1px solid #000");
aMainPanel.getCellFormatter().setWidth(DATA_ROW, 0, "100%"); aMainPanel.getCellFormatter().setHeight(DATA_ROW, 0, "100%"); aMainPanel.setCellSpacing(0); aMainPanel.setCellPadding(0);
/** * Builds the panel containing customizations for the axes of the graph. */ private Grid makeAxesPanel() { final Grid grid = new Grid(5, 3); grid.setText(0, 1, "Y"); grid.setText(0, 2, "Y2"); setTextAlignCenter(grid.getRowFormatter().getElement(0)); grid.setText(1, 0, "Label"); grid.setWidget(1, 1, ylabel); grid.setWidget(1, 2, y2label); grid.setText(2, 0, "Format"); grid.setWidget(2, 1, yformat); grid.setWidget(2, 2, y2format); grid.setText(3, 0, "Range"); grid.setWidget(3, 1, yrange); grid.setWidget(3, 2, y2range); grid.setText(4, 0, "Log scale"); grid.setWidget(4, 1, ylog); grid.setWidget(4, 2, y2log); setTextAlignCenter(grid.getCellFormatter().getElement(4, 1)); setTextAlignCenter(grid.getCellFormatter().getElement(4, 2)); return grid; }
outer = new Grid(2, 1); outer.getCellFormatter().setStyleName(0, 0, "modeller-fact-TypeHeader"); //NON-NLS outer.getCellFormatter().setAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER,
@Override public void setFeature(Feature feature) { // Clear the current panel: contentPanel.clear(); // Layout the attributes of the feature in a grid: Grid grid = new Grid(feature.getLayer().getAttributeDescriptors().size(), 3); CellFormatter formatter = grid.getCellFormatter(); int i = 0; for (AttributeDescriptor descriptor : feature.getLayer().getAttributeDescriptors()) { // Put the attribute label in the first column: grid.setText(i, 0, getAttributeLabel(feature, descriptor)); formatter.getElement(i, 0).addClassName(resource.css().attributeLabel()); // Put a delimiter in the second column: grid.setText(i, 1, getDelimiter()); // Create a widget for the attribute value and put it in the last column: Widget attributeWidget = ATTRIBUTE_FACTORY.createAttributeWidget(feature, descriptor); attributeWidget.getElement().addClassName(resource.css().attributeValue()); grid.setWidget(i, 2, attributeWidget); i++; } contentPanel.add(grid); }
outer = new Grid( 2, 1 ); outer.getCellFormatter().setStyleName( 0, 0, "modeller-fact-TypeHeader" ); //NON-NLS outer.getCellFormatter().setAlignment( 0, 0, HasHorizontalAlignment.ALIGN_CENTER,
aGrid.setWidget(0, COL_NEXT_YEAR, aNextYearButton); CellFormatter rFormatter = aGrid.getCellFormatter(); aPanel.setWidget(0, 0, aTimePicker); aPanel.setWidget(1, 0, aGrid); aPanel.getCellFormatter() .addStyleName(0, 0, CSS.ewtTimePicker()); aPanel.getCellFormatter() .setHorizontalAlignment(0, 0,