本文整理汇总了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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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++;
}
}
示例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);
}
}
示例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());
}
}
示例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());
}
}
示例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());
}