• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MaterialIcon类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中gwt.material.design.client.ui.MaterialIcon的典型用法代码示例。如果您正苦于以下问题:Java MaterialIcon类的具体用法?Java MaterialIcon怎么用?Java MaterialIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MaterialIcon类属于gwt.material.design.client.ui包,在下文中一共展示了MaterialIcon类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: build

点赞 3

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
protected void build() {
    addStyleName(TableCssName.SUBHEADER);

    iconTh = new TableHeader();
    icon = new MaterialIcon(openIcon);
    iconTh.add(icon);
    add(iconTh);

    nameTh = new TableHeader();
    nameLbl = new Text("Subheader");
    nameTh.add(nameLbl);
    add(nameTh);

    setName(category.getName());
    setId(category.getName());
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:17,
代码来源:TableSubHeader.java

示例2: drawColumnHeader

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
@Override
public TableHeader drawColumnHeader(Column<T, ?> column, String header, int index) {
    MaterialIcon sortIcon = new MaterialIcon();
    sortIcon.setIconSize(sortIconSize);

    TableHeader th = new TableHeader(sortIcon);
    th.setId("col" + index);
    th.setHeader(header);
    HideOn hideOn = column.getHideOn();
    if(hideOn != null) {
        th.setHideOn(hideOn);
    }
    TextAlign textAlign = column.getTextAlign();
    if(textAlign != null) {
        th.setTextAlign(textAlign);
    }
    if(column.isNumeric()) {
        th.addStyleName(TableCssName.NUMERIC);
    }

    // Apply the style properties
    Style style = th.getElement().getStyle();
    Map<StyleName, String> styleProps = column.getStyleProperties();
    if(styleProps != null) {
        styleProps.forEach((s, v) -> style.setProperty(s.styleName(), v));
    }

    // Set the headers width
    String width = column.getWidth();
    if(width != null) {
        th.setWidth(width);
    }
    th.setVisible(true);
    return th;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:36,
代码来源:BaseRenderer.java

示例3: setSortIcon

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public void setSortIcon(MaterialIcon sortIcon) {
    removeSortIcon();
    this.sortIcon = sortIcon;

    if(sortIcon != null) {
        IconSize iconSize = this.sortIcon.getIconSize();
        if(iconSize == null) {
            this.sortIcon.setIconSize(IconSize.SMALL);
        }
        this.sortIcon.getElement().getStyle().setFloat(Float.LEFT);
        headerWrap.insert(this.sortIcon, 0);
    }
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:14,
代码来源:TableHeader.java

示例4: testStructure

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public void testStructure() throws Exception {
    // given
    T table = attachTableWithOnLoad();

    // Table Title
    table.setTitle("table title");
    assertEquals("table title", table.getTitle());
    TableScaffolding scaffolding = table.getScaffolding();
    MaterialIcon tableIcon = table.getTableIcon();
    assertEquals(IconType.VIEW_LIST, tableIcon.getIconType());
    assertTrue(scaffolding.getInfoPanel().getElement().hasClassName(TableCssName.INFO_PANEL));
    assertTrue(scaffolding.getTable().getElement().hasClassName(TableCssName.TABLE));
    assertTrue(scaffolding.getTableBody().getElement().hasClassName(TableCssName.TABLE_BODY));
    assertTrue(scaffolding.getToolPanel().getElement().hasClassName(TableCssName.TOOL_PANEL));
    // Stretch Icon
    MaterialIcon stretchIcon = table.getStretchIcon();
    assertEquals(IconType.FULLSCREEN, stretchIcon.getIconType());
    assertEquals("stretch", stretchIcon.getId());
    // Column Menu Icon
    MaterialIcon columnMenuIcon = table.getColumnMenuIcon();
    assertEquals(IconType.MORE_VERT, columnMenuIcon.getIconType());
    assertEquals("columnToggle", columnMenuIcon.getId());
    assertTrue(scaffolding.getTopPanel().getElement().hasClassName(TableCssName.TOP_PANEL));
    // Dropdown Menu
    MaterialDropDown dropDown = table.getMenu();
    assertEquals(3, dropDown.getWidgetCount());
    int index = 0;
    for (Widget w : dropDown) {
        assertTrue(w instanceof MaterialCheckBox);
        MaterialCheckBox checkBox = (MaterialCheckBox) w;
        assertEquals(checkBox.getText(), table.getColumns().get(index).getName());
        index++;
    }
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:35,
代码来源:MaterialDataTableTest.java

示例5: drawRow

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
@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;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:61,
代码来源:BaseRenderer.java

示例6: setTableHeader

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
protected void setTableHeader(TableHeader tableHeader) {
    if(tableHeader.getSortIcon() == null) {
        tableHeader.setSortIcon(new MaterialIcon());
    }
    this.tableHeader = tableHeader;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:7,
代码来源:SortContext.java

示例7: getIconNext

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public MaterialIcon getIconNext() {
    return iconNext;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:4,
代码来源:PageActionsPanel.java

示例8: getIconPrev

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public MaterialIcon getIconPrev() {
    return iconPrev;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:4,
代码来源:PageActionsPanel.java

示例9: getStretchIcon

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public MaterialIcon getStretchIcon() {
    return stretchIcon;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:4,
代码来源:MaterialDataTable.java

示例10: getColumnMenuIcon

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public MaterialIcon getColumnMenuIcon() {
    return columnMenuIcon;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:4,
代码来源:MaterialDataTable.java

示例11: getTableIcon

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public MaterialIcon getTableIcon() {
    return tableIcon;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:4,
代码来源:MaterialDataTable.java

示例12: getIcon

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public MaterialIcon getIcon() {
    return icon;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:4,
代码来源:TableSubHeader.java

示例13: TableHeader

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public TableHeader(MaterialIcon sortIcon) {
    this();
    setSortIcon(sortIcon);
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:5,
代码来源:TableHeader.java

示例14: getSortIcon

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public MaterialIcon getSortIcon() {
    return sortIcon;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:4,
代码来源:TableHeader.java

示例15: testDrawRow

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public void testDrawRow() throws Exception {
    // given
    BaseRenderer<Person> renderer = new BaseRenderer<>();
    MaterialDataTable<Person> table = createTable();
    table.setUseRowExpansion(true);
    addSampleColumns(table);
    table.setSelectionType(SelectionType.SINGLE);
    table.setRenderer(renderer);

    AbstractDataView<Person> dataView = (AbstractDataView<Person>)table.getView();
    List<Column<Person, ?>> columns = dataView.getColumns();

    Person person = new Person(1, "John", "Doe", "123456", "Catergory");
    RowComponent<Person> rowComponent = dataView.getRowFactory().generate(dataView, person);

    // when
    TableRow tableRow = renderer.drawRow(dataView, rowComponent, dataView.getValueKey(person), columns, true);

    // then
    assertNotNull("TableRow should not be null.", tableRow);

    Style style = tableRow.getElement().getStyle();
    assertEquals(Style.Display.NONE.getCssName(), style.getDisplay());

    assertEquals(renderer.getExpectedRowHeight() + "px", style.getProperty("height"));
    assertEquals(renderer.getExpectedRowHeight() + "px", style.getProperty("maxHeight"));
    assertEquals(renderer.getExpectedRowHeight() + "px", style.getProperty("minHeight"));

    assertTrue(tableRow.getStyleName().contains(TableCssName.DATA_ROW));

    assertEquals("RowComponent widget is not the rendered TableRow", tableRow, rowComponent.getWidget());

    try {
        TableData selectionCell = (TableData)tableRow.getWidget(0);
        assertEquals("col0", selectionCell.getId());
        assertTrue(selectionCell.getStyleName().contains(TableCssName.SELECTION));
    } catch (ClassCastException ex) {
        throw new AssertionError("Could not cast selection cell to TableData");
    }

    int colOffset = dataView.getColumnOffset();
    assertEquals(4 + colOffset, tableRow.getWidgetCount());

    assertTrue(tableRow.hasExpansionColumn());
    TableData expandRow = tableRow.getExpansionColumn();
    assertEquals("colex", expandRow.getId());
    MaterialIcon expandIcon = (MaterialIcon)expandRow.getWidget(0);
    assertEquals("expand", expandIcon.getId());
    assertEquals("100%", expandIcon.getElement().getStyle().getWidth());
    assertEquals(IconType.KEYBOARD_ARROW_DOWN, expandIcon.getIconType());
    assertEquals(WavesType.LIGHT, expandIcon.getWaves());
    assertEquals(Style.Cursor.POINTER.getCssName(), expandIcon.getElement().getStyle().getCursor());
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material-table,
代码行数:54,
代码来源:BaseRendererTest.java

示例16: AbstractIconButton

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public AbstractIconButton(ButtonType type, String text, MaterialIcon icon) {
    super(type, text);

    this.icon = icon;
    ensureIconAttached();
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material,
代码行数:7,
代码来源:AbstractIconButton.java

示例17: getIcon

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
@Override
public MaterialIcon getIcon() {
    return icon;
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material,
代码行数:5,
代码来源:AbstractIconButton.java

示例18: testIcon

点赞 2

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
public void testIcon() {
    // UiBinder
    // given
    T widget = getWidget(false);

    // when / then
    MaterialIcon icon = widget.getIcon();
    assertNotNull(icon);

    icon.setIconType(IconType.POLYMER);
    assertEquals(IconType.POLYMER, icon.getIconType());

    icon.setIconSize(IconSize.LARGE);
    assertEquals(IconSize.LARGE, icon.getIconSize());
    icon.setIconSize(IconSize.MEDIUM);
    assertEquals(IconSize.MEDIUM, icon.getIconSize());
    icon.setIconSize(IconSize.SMALL);
    assertEquals(IconSize.SMALL, icon.getIconSize());
    icon.setIconSize(IconSize.TINY);
    assertEquals(IconSize.TINY, icon.getIconSize());

    icon.setIconPosition(IconPosition.RIGHT);
    icon.setIconPosition(IconPosition.LEFT);
    icon.setIconColor(Color.AMBER);

    icon.setIconPrefix(true);
    assertTrue(icon.isIconPrefix());
    icon.setIconPrefix(false);
    assertFalse(icon.isIconPrefix());

    icon.setIconFontSize(2, Style.Unit.PX);

    // Standard
    // given
    attachWidget();

    // when / then
    icon.setIconType(IconType.POLYMER);
    assertEquals(IconType.POLYMER.getCssName(), icon.getElement().getInnerHTML());

    icon.setIconSize(IconSize.LARGE);
    assertTrue(icon.getElement().hasClassName(IconSize.LARGE.getCssName()));
    icon.setIconSize(IconSize.MEDIUM);
    assertTrue(icon.getElement().hasClassName(IconSize.MEDIUM.getCssName()));
    icon.setIconSize(IconSize.SMALL);
    assertTrue(icon.getElement().hasClassName(IconSize.SMALL.getCssName()));
    icon.setIconSize(IconSize.TINY);
    assertTrue(icon.getElement().hasClassName(IconSize.TINY.getCssName()));

    icon.setIconPosition(IconPosition.RIGHT);
    assertTrue(icon.getElement().hasClassName(IconPosition.RIGHT.getCssName()));
    icon.setIconPosition(IconPosition.LEFT);
    assertTrue(icon.getElement().hasClassName(IconPosition.LEFT.getCssName()));
    icon.setIconColor(Color.AMBER);
    assertTrue(icon.getElement().hasClassName(Color.AMBER.getCssName() + "-text"));

    icon.setIconPrefix(true);
    assertTrue(icon.isIconPrefix());
    assertTrue(icon.getElement().hasClassName("prefix"));
    icon.setIconPrefix(false);
    assertFalse(icon.getElement().hasClassName("prefix"));

    icon.setIconFontSize(2, Style.Unit.PX);
    assertEquals("2px", icon.getElement().getStyle().getFontSize());
}
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material,
代码行数:66,
代码来源:AbstractIconButtonTest.java

示例19: getIcon

点赞 1

import gwt.material.design.client.ui.MaterialIcon; //导入依赖的package包/类
/**
 * Get the icon widget.
 */
MaterialIcon getIcon();
 

开发者ID:GwtMaterialDesign,
项目名称:gwt-material,
代码行数:5,
代码来源:HasIcon.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)