• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MaterialCheckBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setupHeaderSelectionBox

import gwt.material.design.client.ui.MaterialCheckBox; //导入依赖的package包/类
protected void setupHeaderSelectionBox() {
    // Setup select all checkbox
    TableHeader th = new TableHeader();
    th.setId("col0");
    th.setStyleName(TableCssName.SELECTION);
    if(selectionType.equals(SelectionType.MULTIPLE)) {
        new MaterialCheckBox(th.getElement());

        // Select all row click bind
        // This will also update the check status of check all input.
        JQueryElement selectAll = $(th).find("label");
        selectAll.off("." + id);
        selectAll.on("tap." + id + " click." + id, (e) -> {
            JQueryElement input = $("input", th);

            boolean marked = Js.isTrue(input.prop("checked")) ||
                             Js.isTrue(input.prop("indeterminate"));

            selectAllRows(!marked || hasDeselectedRows(true));
            return false;
        });
    }
    addHeader(0, th);
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-table,代码行数:25,代码来源:AbstractDataView.java


示例2: drawSelectionCell

import gwt.material.design.client.ui.MaterialCheckBox; //导入依赖的package包/类
@Override
public TableData drawSelectionCell() {
    TableData checkBox = new TableData();
    checkBox.setId("col0");
    checkBox.setStyleName(TableCssName.SELECTION);
    new MaterialCheckBox(checkBox.getElement());
    checkBox.addClickHandler(event -> {
        event.getNativeEvent().preventDefault();
    });
    return checkBox;
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-table,代码行数:12,代码来源:BaseRenderer.java


示例3: onInsertColumn

import gwt.material.design.client.ui.MaterialCheckBox; //导入依赖的package包/类
@Override
public void onInsertColumn(InsertColumnEvent<T> event) {
    int beforeIndex = event.getBeforeIndex();
    Column<T, ?> column = event.getColumn();
    String header = event.getHeader();

    SetupHandler handler = e -> {
        int index = beforeIndex + getView().getColumnOffset();
        String ref = getView().getId() + "-col" + index;

        MaterialCheckBox toggleBox = new MaterialCheckBox(new ListItem().getElement());
        JQueryElement input = $(toggleBox).find("input");
        input.attr("id", ref);

        JQueryElement label = $(toggleBox).find("label");
        label.text(column.getName());
        label.attr("for", ref);

        toggleBox.setValue(true);
        menu.add(toggleBox);

        // We will hide the empty header menu items
        if (header.isEmpty()) {
            toggleBox.setVisible(false);
        }

        setupMenu();
        reindexToggles();
    };

    if(getView().isSetup()) {
        handler.onSetup(null);
    } else {
        addSetupHandler(handler);
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-table,代码行数:37,代码来源:MaterialDataTable.java


示例4: drawSelectionCell

import gwt.material.design.client.ui.MaterialCheckBox; //导入依赖的package包/类
@Override
public TableData drawSelectionCell() {
    TableData td = new TableData();
    td.setId("col0");
    MaterialCheckBox checkBox = new MaterialCheckBox(td.getElement());
    checkBox.setType(CheckBoxType.FILLED);
    return td;
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-table,代码行数:9,代码来源:CustomRenderer.java


示例5: testStructure

import gwt.material.design.client.ui.MaterialCheckBox; //导入依赖的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


示例6: createCoreModules

import gwt.material.design.client.ui.MaterialCheckBox; //导入依赖的package包/类
private void createCoreModules(EnumSet<CoreModule> enabledModules) {
	coreModules.clearContents();
	for (CoreModule coreModule : CoreModule.values()) {
		MaterialCheckBox check = new MaterialCheckBox();
		check.setText(coreModule.getDisplayText());
		check.setValue(enabledModules.contains(coreModule));
		coreModules.addContent(check);
	}
}
 
开发者ID:lukelast,项目名称:gwt-module-config,代码行数:10,代码来源:HomeViewImpl.java


示例7: onSelectionFileDropdown

import gwt.material.design.client.ui.MaterialCheckBox; //导入依赖的package包/类
@UiHandler({"dpFile", "dpNew", "dpView", "dpEdit", "dpFormat"})
void onSelectionFileDropdown(SelectionEvent<Widget> selection) {
    if(selection.getSelectedItem() instanceof MaterialLink){
        MaterialToast.fireToast("Triggered : " + ((MaterialLink)selection.getSelectedItem()).getText());
    }else if(selection.getSelectedItem() instanceof MaterialCheckBox){
        MaterialToast.fireToast("Checked : " + ((MaterialCheckBox)selection.getSelectedItem()).getText());
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:9,代码来源:MenuBarView.java


示例8: onSelectionMode

import gwt.material.design.client.ui.MaterialCheckBox; //导入依赖的package包/类
@UiHandler("dpMode")
void onSelectionMode(SelectionEvent<Widget> selection) {
    for(Widget w : dpMode.getItems()){
        if(w instanceof MaterialCheckBox){
            ((MaterialCheckBox) w).setValue(false);
        }
    }
    if(selection.getSelectedItem() instanceof MaterialCheckBox){
        ((MaterialCheckBox) selection.getSelectedItem()).setValue(true);
        MaterialToast.fireToast("Checked : " + ((MaterialCheckBox) selection.getSelectedItem()).getText());
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:13,代码来源:MenuBarView.java


示例9: pushUItoXml

import gwt.material.design.client.ui.MaterialCheckBox; //导入依赖的package包/类
private void pushUItoXml() {
	GwtModuleDataModel data = new GwtModuleDataModel();
	data.getModuleName().from(moduleName);
	data.getEntryPoint().from(entryPoint);
	data.getCollapseAllProperties().from(collapseProperties);
	stackTrace.to(data);
	data.getRpcSerializeFinalFields().from(serializeFinalFields);
	data.getRpcSuppressFinalFieldWarnings().from(suppressNonStaticFinalFieldWarnings);

	data.getUserAgents().setComment(userAgent.getComment());
	EnumSet<UserAgent> agents = data.getUserAgents().getValue();
	if (userAgentIe8.getValue()) {
		agents.add(UserAgent.IE8);
	}
	if (userAgentIe9.getValue()) {
		agents.add(UserAgent.IE9);
	}
	if (userAgentIe10.getValue()) {
		agents.add(UserAgent.IE10);
	}
	if (userAgentGecko1_8.getValue()) {
		agents.add(UserAgent.GECKO);
	}
	if (userAgentSafari.getValue()) {
		agents.add(UserAgent.SAFARI);
	}

	data.getCssResourceStyle().setComment(cssResourceStyle.getComment());
	data.getCssResourceStyle().setValue(cssResourceStyleValue.getSelectedValue());

	data.getCoreModules().setComment(coreModules.getComment());
	data.getCoreModules().getValue().clear();
	for (Widget widget : coreModules.getContents()) {
		if (widget instanceof MaterialCheckBox) {
			MaterialCheckBox check = (MaterialCheckBox) widget;
			if (check.getValue()) {
				data.getCoreModules().getValue().add(CoreModule.fromDisplayText(check.getText()));
			}
		}
	}

	xml.setText(data.toXml());
}
 
开发者ID:lukelast,项目名称:gwt-module-config,代码行数:44,代码来源:HomeViewImpl.java



注:本文中的gwt.material.design.client.ui.MaterialCheckBox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TransactionalException类代码示例发布时间:2022-05-22
下一篇:
Java GridSLM类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap