/** * Sets whether the specified cell will allow word wrapping of its contents. * * @param row the row of the cell whose word-wrap is to be set * @param column the column of the cell whose word-wrap is to be set * @param wrap <code>false </code> to disable word wrapping in this cell * @throws IndexOutOfBoundsException */ public void setWordWrap(int row, int column, boolean wrap) { prepareCell(row, column); String wrapValue = wrap ? "" : "nowrap"; getElement(row, column).getStyle().setProperty("whiteSpace", wrapValue); }
private int addCell(Widget widget, String width, String className) { int cell = grid.getCellCount(0); grid.setWidget(0, cell, widget); grid.getCellFormatter().setWidth(0, cell, width); if (className != null) { grid.getCellFormatter().setStyleName(0, cell, className); } return cell; } }
getColumnFormatter().getElement(2).setAttribute("width", "0px"); FlexTable dateTable = new FlexTable(); FlexTable userTable = new FlexTable(); dateTable.getColumnFormatter().setWidth(0, "200px"); getFlexCellFormatter().setColSpan(1, 0, 3); detailsTable.getColumnFormatter().getElement(2).setAttribute("width", "0px"); description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 100); Label descriptionLabel = new Label(Utils.constants.description()); descriptionLabel.setWidth("200px"); detailsTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP); detailsTable.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP); detailsTable.getFlexCellFormatter().setColSpan(1, 0, 3); buttonsPanel = new HorizontalPanel(); buttonsPanel.setSpacing(5); detailsTable.getCellFormatter().setHorizontalAlignment( 2, 0, HasHorizontalAlignment.ALIGN_RIGHT); detailsTable.getFlexCellFormatter().setColSpan(2, 0, 2);
version = new KaaAdminSizedTextBox(-1, false); version.setWidth("100%"); detailsTable.setWidget(0, 0, versionLabel); detailsTable.setWidget(0, 1, version); versionLabel.setVisible(!create); version.setVisible(!create); createdUsername = new KaaAdminSizedTextBox(-1, false); createdUsername.setWidth("100%"); detailsTable.setWidget(1, 0, authorLabel); detailsTable.setWidget(1, 1, createdUsername); description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 80); Label descriptionLabel = new Label(Utils.constants.description()); detailsTable.setWidget(5, 0, descriptionLabel); description.addInputHandler(this); detailsTable.getCellFormatter().setVerticalAlignment(5, 0, HasVerticalAlignment.ALIGN_TOP); HorizontalPanel ctlSwitchPanel = new HorizontalPanel(); detailsTable.setWidget(6, 0, ctlSwitchPanel); detailsTable.getFlexCellFormatter().setColSpan(6, 0, 2); ctlSwitchPanel.getElement().getStyle().setPaddingTop(10, Unit.PX); ctlSwitchPanel.getElement().getStyle().setPaddingBottom(10, Unit.PX); existingCtlButton = new ToggleButton(Utils.constants.selectExistingType()); newCtlButton = new ToggleButton(Utils.constants.createNewType());
VerticalPanel dialogContents = new VerticalPanel(); dialogContents.setSpacing(4); setWidget(dialogContents); dialogContents.add(errorPanel); FlexTable table = new FlexTable(); table.setCellSpacing(6); topic.addValueChangeHandler(this); table.setWidget(0, 0, label); table.setWidget(0, 1, topic); table.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT); dialogContents.add(table); addButton = new Button(Utils.constants.add(), new ClickHandler() { @Override public void onClick(ClickEvent event) { Button closeButton = new Button(Utils.constants.close(), new ClickHandler() { @Override public void onClick(ClickEvent event) { addButton(closeButton); addButton.setEnabled(false);
@Override protected void initDetailsTable() { if (!create) { detailsTable.getColumnFormatter().setWidth(2, "200px"); detailsTable.getFlexCellFormatter().setColSpan(row, 1, 2); description.addInputHandler(this); detailsTable.getCellFormatter().setVerticalAlignment(row, 0, HasVerticalAlignment.ALIGN_TOP); setCheckBoxStyle(includeDeprecatedProfileFilters); addProfileFilterButton = new Button(Utils.constants.addProfileFilter()); addProfileFilterButton.addStyleName(Utils.kaaAdminStyle.bAppButtonSmall()); .getParentElement() .getStyle() .setPropertyPx("paddingBottom", 10); detailsTable.getFlexCellFormatter().setColSpan(row, 0, 3); addProfileFilterButton.getElement() .setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_RIGHT); detailsTable.getFlexCellFormatter().setColSpan(row, 0, 3); .setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_RIGHT); .setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_RIGHT);
days.setHTML(0, 6, "<span>" + dn[(6 + firstDOW) % 7] + "</span>"); days.getRowFormatter().getElement(0).setAttribute("role", "row"); days.getCellFormatter().getElement(0, i).setAttribute("role", "columnheader"); days.getCellFormatter().getElement(0, i).setAttribute("aria-label", longdn[i]); for (int row = 0; row < 6; row++) { if (GXT.isAriaEnabled()) { grid.getRowFormatter().getElement(row).setAttribute("role", "row"); grid.getCellFormatter().getElement(row, col).setAttribute("role", "presentation"); footer = new com.google.gwt.user.client.ui.HorizontalPanel(); footer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); footer.setWidth("100%");
public void addSection( String text ) { int row = table.getRowCount(); table.setText( row, 0, text ); table.getCellFormatter().getElement( row, 0 ).getStyle().setVerticalAlign( VerticalAlign.TOP ); table.getCellFormatter().getElement( row, 0 ).setAttribute( "colSpan", "2" ); table.getCellFormatter().getElement( row, 0 ).getStyle().setPaddingTop( 25, Unit.PX ); table.getCellFormatter().getElement( row, 0 ).getStyle().setPaddingBottom( 10, Unit.PX ); }
public void addHTMLSection( String html ) { int row = table.getRowCount(); table.setHTML( row, 0, html ); table.getCellFormatter().getElement( row, 0 ).getStyle().setVerticalAlign( VerticalAlign.TOP ); table.getCellFormatter().getElement( row, 0 ).setAttribute( "colSpan", "2" ); table.getCellFormatter().getElement( row, 0 ).getStyle().setPaddingTop( 25, Unit.PX ); table.getCellFormatter().getElement( row, 0 ).getStyle().setPaddingBottom( 10, Unit.PX ); }
@Override public Widget asWidget() { VerticalPanel layout = new VerticalPanel(); layout.setStyleName("fill-layout-width"); //$NON-NLS-1$ layout.add(new HTML("<div class='metric-table-title'>" + _title + "</div>")); //$NON-NLS-1$ //$NON-NLS-2$ _grid = new FlexTable(); _grid.getElement().setAttribute("width", _width + _unit.getType() + ""); //$NON-NLS-1$ //$NON-NLS-2$ _grid.setHTML(0, 0, Singleton.MESSAGES.label_metric()); _grid.setHTML(0, 1, Singleton.MESSAGES.label_actual()); _grid.setHTML(0, 2, " "); //$NON-NLS-1$ _grid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT); _grid.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_RIGHT); _grid.getRowFormatter().setVisible(row, false); _grid.getRowFormatter().addStyleName(row, "metric-table-baseline"); //$NON-NLS-1$ _grid.getCellFormatter().setStyleName(0, 0, "metric-table-header"); //$NON-NLS-1$ _grid.getCellFormatter().setStyleName(0, 1, "metric-table-header"); //$NON-NLS-1$ _grid.getCellFormatter().setStyleName(0, 2, "metric-table-header"); //$NON-NLS-1$ _grid.getCellFormatter().setWidth(0, 2, "50%"); //$NON-NLS-1$
public Object addField( String display, String name, FieldType fieldType, Widget fieldWidget, Object parent ) { int row = table.getRowCount(); // create the new field GroupInfo parentInfo = (GroupInfo) parent; FieldInfo info = new FieldInfo( name, parentInfo, row, fieldType, fieldWidget ); // Display the new field if( display != null ) { HTMLStream stream = new HTMLStream(); stream.addRight( new HTML( display ) ); stream.clFl(); table.setWidget( row, 0, stream ); } table.setWidget( row, 1, info.widget ); table.getCellFormatter().getElement( row, 0 ).getStyle().setVerticalAlign( VerticalAlign.TOP ); table.getCellFormatter().getElement( row, 1 ).getStyle().setVerticalAlign( VerticalAlign.TOP ); table.getCellFormatter().getElement( row, 0 ).getStyle().setFontWeight( FontWeight.BOLD ); return info; }
createdUsername = new KaaAdminSizedTextBox(-1, false); createdUsername.setWidth("100%"); detailsTable.setWidget(0, 0, authorLabel); detailsTable.setWidget(0, 1, createdUsername); createdDateTime = new KaaAdminSizedTextBox(-1, false); createdDateTime.setWidth("100%"); detailsTable.setWidget(1, 0, dateTimeCreatedLabel); detailsTable.setWidget(1, 1, createdDateTime); description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 100); Label descriptionLabel = new Label(Utils.constants.description()); detailsTable.setWidget(4, 0, descriptionLabel); description.addInputHandler(this); detailsTable.getCellFormatter().setVerticalAlignment(4, 0, HasVerticalAlignment.ALIGN_TOP); sendNotification = new Button(Utils.constants.sendNotification()); detailsTable.setWidget(5, 0, sendNotification); sendNotification.setVisible(!create); getSaveButtonWidget().setVisible(false); name.setEnabled(false); mandatory.setEnabled(false);
private FlexTable render( final FixtureList rfl, final Scenario sc ) { FlexTable data = new FlexTable(); data.getCellFormatter().addStyleName( i, 4, "testErrorValue" ); //NON-NLS 1, new SmallLabel( v.getRuleName() + ":" ) ); data.getFlexCellFormatter().setAlignment( i, 1, HasHorizontalAlignment.ALIGN_RIGHT, "e" ); final TextBox num = new TextBox(); ( (InputElement) num.getElement().cast() ).setSize( 5 ); HorizontalPanel h = new HorizontalPanel(); h.add( b ); h.add( num ); data.setWidget( i, 2,
version = new KaaAdminSizedTextBox(-1, false); version.setWidth("100%"); detailsTable.setWidget(0, 0, versionLabel); detailsTable.setWidget(0, 1, version); versionLabel.setVisible(!create); version.setVisible(!create); createdUsername = new KaaAdminSizedTextBox(-1, false); createdUsername.setWidth("100%"); detailsTable.setWidget(1, 0, authorLabel); detailsTable.setWidget(1, 1, createdUsername); description.getTextArea().getElement().getStyle().setPropertyPx("minHeight", 80); Label descriptionLabel = new Label(Utils.constants.description()); detailsTable.setWidget(5, 0, descriptionLabel); description.addInputHandler(this); detailsTable.getCellFormatter().setVerticalAlignment(5, 0, HasVerticalAlignment.ALIGN_TOP);
public VersionBrowser( final Metadata metadata ) { this.metadata = checkNotNull( "metadata", metadata ); final HorizontalPanel wrapper = new HorizontalPanel(); layout = new FlexTable(); final ClickableLabel vh = new ClickableLabel( MetadataConstants.INSTANCE.VersionHistory1(), clickHandler ); layout.setWidget( 0, 0, vh ); layout.getCellFormatter().setStyleName( 0, 0, "metadata-Widget" ); final FlexCellFormatter formatter = layout.getFlexCellFormatter(); formatter.setHorizontalAlignment( 0, 0, ALIGN_LEFT ); layout.setWidget( 0, 1, refresh ); formatter.setHorizontalAlignment( 0, 1, ALIGN_RIGHT ); wrapper.setStyleName( "version-browser-Border" ); wrapper.add( layout ); layout.setWidth( "100%" );
data.setWidget( i, 0, new Image( CommonImages.INSTANCE.warning() ) ); data.setWidget( i, 4, new HTML( TestScenarioConstants.INSTANCE.ActualResult(v.getActualResult().toString()) ) ); data.getCellFormatter().addStyleName( i, 4, "testErrorValue" ); //NON-NLS 1, new SmallLabel( v.getRuleName() + ":" ) ); data.getFlexCellFormatter().setAlignment( i, 1, HasHorizontalAlignment.ALIGN_RIGHT, HorizontalPanel h = new HorizontalPanel(); h.add( b ); h.add( num ); data.setWidget( i, 2,
int cnt = table.getRowCount(); for (int i = 0; i < cnt; i++) { table.removeRow(0); table.setWidth(cm.getTotalWidth() + "px"); Element body = fly(table.getElement()).selectNode("tbody").dom; table.getElement().insertBefore(tbody, body); removeChildren(tbody); DomHelper.insertHtml("afterBegin", tbody, renderHiddenHeaders(getColumnWidths())); rf.setStyleName(i, "x-grid3-hd-row"); rf.getElement(i).setAttribute("role", "presentation"); table.setWidget(row, col, group); cf.setStyleName(row, col, cellClass); table.getCellFormatter().setHorizontalAlignment(row, i, HasHorizontalAlignment.ALIGN_RIGHT); table.getCellFormatter().getElement(row, i).getFirstChildElement().getStyle().setPropertyPx("paddingRight", 16); } else if (align == HorizontalAlignment.CENTER) { table.getCellFormatter().setHorizontalAlignment(row, i, HasHorizontalAlignment.ALIGN_CENTER); } else { table.getCellFormatter().setHorizontalAlignment(row, i, HasHorizontalAlignment.ALIGN_LEFT);
private FlexTable render(final VerifyFact vf) { FlexTable data = new FlexTable(); for ( int i = 0; i < vf.getFieldValues().size(); i++ ) { final VerifyField fld = (VerifyField) vf.getFieldValues().get( i ); data.setWidget( i, 1, new SmallLabel( fld.getFieldName() + ":" ) ); data.getFlexCellFormatter().setHorizontalAlignment( i, 1, HasHorizontalAlignment.ALIGN_RIGHT ); data.setWidget( i, 5, new HTML( TestScenarioConstants.INSTANCE.ActualResult( fld.getActualResult() ) ) ); data.getCellFormatter().addStyleName( i, 5, "testErrorValue" ); //NON-NLS
final String separatorText = ((Separator) menuItem).getText(); if (separatorText == null) { table.getCellFormatter().setStyleName(i, 0, POPUP_RESOURCES.popup().popupMenuDelimiter()); } else { table.setWidget(i, 0, new Label(separatorText)); table .getCellFormatter() .setStyleName(i, 0, POPUP_RESOURCES.popup().popupMenuTextDelimiter()); .setStyleName( i, 0, .setStyleName( i, work, table .getCellFormatter() .setStyleName( i, work, if (showTooltips) { Tooltip.create( (elemental.dom.Element) table.getCellFormatter().getElement(i, work), BOTTOM, MIDDLE,
private void render(final FixtureList retList, final FlexTable outer, final Scenario sc) { outer.clear(); outer.getCellFormatter().setStyleName(0, 0, "modeller-fact-TypeHeader"); outer.getCellFormatter().setAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER, 0, new SmallLabel(TestScenarioConstants.INSTANCE.ActivateRuleFlowGroup())); outer.getFlexCellFormatter().setColSpan(0, 0, 2);