Java Code Examples for com.google.gwt.dom.client.Style.setDisplay()

The following are Jave code examples for showing how to use setDisplay() of the com.google.gwt.dom.client.Style class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: cuba   File: CubaTreeTableWidget.java   Source Code and License Vote up 5 votes
public void setPresentationsMenu(Widget presentationsMenu) {
    if (_delegate.presentationsMenu != presentationsMenu) {
        Style presentationsIconStyle = ((CubaTreeTableTableHead) tHead).presentationsEditIcon.getElement().getStyle();
        if (presentationsMenu == null) {
            presentationsIconStyle.setDisplay(Style.Display.NONE);
        } else {
            presentationsIconStyle.setDisplay(Style.Display.BLOCK);
        }
    }
    _delegate.presentationsMenu = presentationsMenu;
}
 
Example 2
Project: cuba   File: CubaScrollTableWidget.java   Source Code and License Vote up 5 votes
public void setPresentationsMenu(Widget presentationsMenu) {
    if (_delegate.presentationsMenu != presentationsMenu) {
        Style presentationsIconStyle = ((CubaScrollTableHead) tHead).presentationsEditIcon.getElement().getStyle();
        if (presentationsMenu == null) {
            presentationsIconStyle.setDisplay(Style.Display.NONE);
        } else {
            presentationsIconStyle.setDisplay(Style.Display.BLOCK);
        }
    }
    _delegate.presentationsMenu = presentationsMenu;
}
 
Example 3
Project: cuba   File: CubaSuggestPopup.java   Source Code and License Vote up 5 votes
public CubaSuggestPopup() {
    Style style = loadingImage.getElement().getStyle();

    style.clearWidth();
    style.clearHeight();
    style.setDisplay(Style.Display.BLOCK);
}
 
Example 4
Project: cuba   File: CubaGroupBoxWidget.java   Source Code and License Vote up 5 votes
public void setCollapsable(boolean collapsable) {
    Style expanderStyle = expander.getStyle();
    if (collapsable) {
        expanderStyle.clearProperty("display");
        removeStyleDependentName("nocollapsable");
    } else {
        addStyleDependentName("nocollapsable");
        expanderStyle.setDisplay(Style.Display.NONE);
    }

    Tools.textSelectionEnable(captionNode, !collapsable);

    this.collapsable = collapsable;
}
 
Example 5
Project: Wiab.pro   File: ImageThumbnailWidget.java   Source Code and License Vote up 5 votes
@Override
public void execute() {
  Style style = menuButtonContainer.getElement().getStyle();
  if (resizeButtonVisible) {
    style.setDisplay(Display.BLOCK);
  } else {
    style.setDisplay(Display.NONE);
  }
}
 
Example 6
Project: Wiab.pro   File: FullStructure.java   Source Code and License Vote up 5 votes
private static void kickWebkit(Element element) {
  if (UserAgent.isWebkit()) {

    Style style = element.getStyle();
    String oldDisplay = style.getDisplay();

    // Erase layout. Querying getOffsetParent() forces layout.
    style.setDisplay(Display.NONE);
    element.getOffsetParent();

    // Restore layout.
    style.setProperty("display", oldDisplay);
  }
}
 
Example 7
Project: empiria.player   File: ExplanationViewImpl.java   Source Code and License Vote up 4 votes
@Override
public void show() {
    Style style = getElement().getStyle();
    style.setDisplay(Display.BLOCK);
}
 
Example 8
Project: empiria.player   File: ExplanationViewImpl.java   Source Code and License Vote up 4 votes
@Override
public void hide() {
    Style style = getElement().getStyle();
    style.setDisplay(Display.NONE);
}
 
Example 9
Project: gwt-material-table   File: BaseRenderer.java   Source Code and License Vote up 4 votes
@Override
public TableRow drawRow(DataView<T> dataView, RowComponent<T> rowComponent, Object valueKey,
                        List<Column<T, ?>> columns, boolean redraw) {
    T data = rowComponent.getData();
    TableRow row = rowComponent.getWidget();
    boolean draw = true;
    if(row == null) {
        // Create a new row element
        row = new TableRow();
        Style style = row.getElement().getStyle();
        style.setDisplay(Display.NONE);
        style.setProperty("height", getExpectedRowHeight() + "px");
        style.setProperty("maxHeight", getExpectedRowHeight() + "px");
        style.setProperty("minHeight", getExpectedRowHeight() + "px");
        row.setStyleName(TableCssName.DATA_ROW);
        rowComponent.setWidget(row);

        if(!dataView.getSelectionType().equals(SelectionType.NONE)) {
            TableData selection = drawSelectionCell();
            row.add(selection);
        }
    } else if(!redraw && !rowComponent.isRedraw()) {
        draw = false;
    }

    if(draw) {
        // Build the columns
        int colOffset = dataView.getColumnOffset();
        int colSize = columns.size();

        for(int c = 0; c < colSize; c++) {
            int colIndex = c + colOffset;
            Context context = new Context(rowComponent.getIndex(), colIndex, valueKey);
            drawColumn(row, context, data, columns.get(c), colIndex, dataView.isHeaderVisible(colIndex));
        }
        rowComponent.setRedraw(false);
    }

    if(dataView.isUseRowExpansion()) {
        if(!row.hasExpansionColumn()) {
            TableData expand = new TableData();
            expand.setId("colex");
            MaterialIcon expandIcon = new MaterialIcon();
            expandIcon.setId("expand");
            expandIcon.setWidth("100%");
            expandIcon.setIconType(IconType.KEYBOARD_ARROW_DOWN);
            expandIcon.setWaves(WavesType.LIGHT);
            expandIcon.getElement().getStyle().setCursor(Cursor.POINTER);
            expand.add(expandIcon);
            row.add(expand);
        }
    } else if(row.hasExpansionColumn()) {
        row.removeExpansionColumn();
    }

    Scheduler.get().scheduleDeferred(() -> {
        calculateRowHeight(rowComponent);
    });
    return row;
}