List of usage examples for com.google.gwt.user.client.ui CheckBox setValue
@Override public void setValue(Boolean value)
From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.batch.ImportBatchClassView.java
License:Open Source License
private void setChildItemsUI(final TreeItem childTree, final boolean checked, final Node parentNode) { List<Node> childList = parentNode.getChildren(); if (childTree.getChildCount() > 0) { for (int index = 0; index < childTree.getChildCount(); index++) { CheckBox checkBox = (CheckBox) childTree.getChild(index).getWidget(); if (checkBox.isEnabled()) { checkBox.setValue(checked); childList.get(index).getLabel().setMandatory(checked); }// w w w. j av a 2s . c om setChildItemsUI(childTree.getChild(index), checked, childList.get(index)); } } }
From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.documenttype.DocumentTypeView.java
License:Open Source License
/** * To set Fields List./* ww w . j av a2s . c o m*/ * * @param fields Collection<FieldTypeDTO> * @return List<Record> */ public List<Record> setFieldsList(Collection<FieldTypeDTO> fields) { List<Record> recordList = new LinkedList<Record>(); for (final FieldTypeDTO fieldTypeDTO : fields) { CheckBox isHidden = new CheckBox(); CheckBox isMultiLine = new CheckBox(); CheckBox isReadOnly = new CheckBox(); isHidden.setValue(fieldTypeDTO.isHidden()); isHidden.setEnabled(false); isMultiLine.setValue(fieldTypeDTO.isMultiLine()); isMultiLine.setEnabled(false); isReadOnly.setValue(fieldTypeDTO.getIsReadOnly()); isReadOnly.setEnabled(false); Record record = new Record(fieldTypeDTO.getIdentifier()); record.addWidget(fieldTypeListView.name, new Label(fieldTypeDTO.getName())); record.addWidget(fieldTypeListView.description, new Label(fieldTypeDTO.getDescription())); record.addWidget(fieldTypeListView.type, new Label(fieldTypeDTO.getDataType().name())); record.addWidget(fieldTypeListView.fdOrder, new Label(fieldTypeDTO.getFieldOrderNumber())); record.addWidget(fieldTypeListView.sampleValue, new Label(fieldTypeDTO.getSampleValue())); record.addWidget(fieldTypeListView.barcode, new Label(fieldTypeDTO.getBarcodeType())); record.addWidget(fieldTypeListView.isHidden, isHidden); record.addWidget(fieldTypeListView.isMultiLine, isMultiLine); record.addWidget(fieldTypeListView.isReadOnly, isReadOnly); recordList.add(record); } return recordList; }
From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.tableinfo.TableInfoView.java
License:Open Source License
private List<Record> setFieldsList(List<TableColumnInfoDTO> fields) { List<Record> recordList = new LinkedList<Record>(); for (final TableColumnInfoDTO tcInfoDTO : fields) { Record record = new Record(tcInfoDTO.getIdentifier()); CheckBox isRequired = new CheckBox(); CheckBox isMandatory = new CheckBox(); isRequired.setValue(tcInfoDTO.isRequired()); isRequired.setEnabled(false);/*from w w w . j a va2 s. co m*/ isMandatory.setValue(tcInfoDTO.isMandatory()); isMandatory.setEnabled(false); record.addWidget(tableColumnInfoListView.betweenLeft, new Label(tcInfoDTO.getBetweenLeft())); record.addWidget(tableColumnInfoListView.betweenRight, new Label(tcInfoDTO.getBetweenRight())); record.addWidget(tableColumnInfoListView.columnName, new Label(tcInfoDTO.getColumnName())); record.addWidget(tableColumnInfoListView.columnHeaderPattern, new Label(tcInfoDTO.getColumnHeaderPattern())); record.addWidget(tableColumnInfoListView.columnStartCoord, new Label(tcInfoDTO.getColumnStartCoordinate())); record.addWidget(tableColumnInfoListView.columnEndCoord, new Label(tcInfoDTO.getColumnEndCoordinate())); record.addWidget(tableColumnInfoListView.columnPattern, new Label(tcInfoDTO.getColumnPattern())); record.addWidget(tableColumnInfoListView.isRequired, isRequired); record.addWidget(tableColumnInfoListView.isMandatory, isMandatory); recordList.add(record); } return recordList; }
From source file:com.ephesoft.dcma.gwt.batchinstance.client.view.BatchInstanceView.java
License:Open Source License
private List<Record> createRecords(Collection<BatchInstanceDTO> batchInstanceDTOs) { List<Record> recordList = new LinkedList<Record>(); batchInstanceDTOMap.clear();//from ww w . j a v a 2s . com for (final BatchInstanceDTO batchInstanceDTO : batchInstanceDTOs) { CheckBox checkBox = new CheckBox(); checkBox.setValue(batchInstanceDTO.isRemote()); checkBox.setEnabled(false); Record record = new Record(batchInstanceDTO.getBatchIdentifier()); String[] priority = convertPriority(batchInstanceDTO.getPriority()); Label property = new Label(priority[0]); record.addWidget(batchInstanceListView.priority, property); property.setStyleName(priority[1]); record.addWidget(batchInstanceListView.batchId, new Label(batchInstanceDTO.getBatchIdentifier())); record.addWidget(batchInstanceListView.batchClassName, new Label(batchInstanceDTO.getBatchClassName())); record.addWidget(batchInstanceListView.batchName, new Label(batchInstanceDTO.getBatchName())); record.addWidget(batchInstanceListView.batchCreatedOn, new Label(batchInstanceDTO.getCreatedOn())); record.addWidget(batchInstanceListView.batchUpdatedOn, new Label(batchInstanceDTO.getUploadedOn())); record.addWidget(batchInstanceListView.currentUser, new Label(batchInstanceDTO.getCurrentUser())); record.addWidget(batchInstanceListView.status, new Label(batchInstanceDTO.getStatus())); record.addWidget(batchInstanceListView.isRemote, checkBox); recordList.add(record); batchInstanceDTOMap.put(batchInstanceDTO.getBatchIdentifier(), batchInstanceDTO); } if (recordList.isEmpty()) { disableButtons(); } return recordList; }
From source file:com.ephesoft.dcma.gwt.uploadbatch.client.view.UploadBatchView.java
License:Open Source License
public void toggleAllCheckBoxes(Boolean isSelect) { for (CheckBox fileCheckBox : allFilesBox) { fileCheckBox.setValue(isSelect); }//from w ww. j av a 2 s . c o m }
From source file:com.ephesoft.gxt.admin.client.view.regexbuilder.RegexFieldDetailView.java
License:Open Source License
/** * Checks or unchecks all the check boxes in range section based on the value passed. If <code>isChecked</code> is true then it * will checked all the checkboxes otherwise unchecked all the checkboxes. * /*from w w w . jav a2 s. c o m*/ * @param isChecked <code>true</code> value will checked all the checkboxes otherwise unchecked all the checkboxes. */ public void setCheckedTextRangeCheckBoxes(final boolean isChecked) { if (!CollectionUtil.isEmpty(textRangeCheckBoxes)) { for (CheckBox checkBox : textRangeCheckBoxes) { checkBox.setValue(isChecked); } } }
From source file:com.eternach.client.RichOptionGroupWidget.java
License:Apache License
@Override public void buildOptions(final UIDL uidl) { panel.clear();/* w ww. j av a 2 s . c o m*/ optionsEnabled.clear(); for (final Iterator<?> it = uidl.getChildIterator(); it.hasNext();) { boolean iconDisplayed = false; final UIDL opUidl = (UIDL) it.next(); CheckBox op; String itemHtml = opUidl.getStringAttribute("caption"); if (!htmlContentAllowed) { itemHtml = Util.escapeHTML(itemHtml); } final String icon = opUidl.getStringAttribute("icon"); if (icon != null && icon.length() != 0) { final String iconUrl = client.translateVaadinUri(icon); itemHtml = "<span style=\"white-space: normal;\">" + itemHtml + "</span><br/><img src=\"" + iconUrl + "\" class=\"" + Icon.CLASSNAME + "\" alt=\"\" />"; iconDisplayed = true; } if (isMultiselect()) { op = new VCheckBox(); } else { op = new RadioButton(paintableId, null, true); op.setStyleName("v-radiobutton"); } op.addStyleName(CLASSNAME_OPTION); op.setValue(opUidl.getBooleanAttribute("selected")); final boolean optionEnabled = !opUidl .getBooleanAttribute(OptionGroupConstants.ATTRIBUTE_OPTION_DISABLED); final boolean enabled = optionEnabled && !isReadonly() && isEnabled(); op.setEnabled(enabled); optionsEnabled.add(optionEnabled); setStyleName(op.getElement(), ApplicationConnection.DISABLED_CLASSNAME, !(optionEnabled && isEnabled())); op.addClickHandler(this); optionsToKeys.put(op, opUidl.getStringAttribute("key")); String description = opUidl.getStringAttribute("description-text"); if (description == null) { description = ""; } if (opUidl.getStringAttribute("description-icon") != null) { description += "<br/><img src=\"" + client.translateVaadinUri(opUidl.getStringAttribute("description-icon")) + "\"\\>"; } final FocusableFlexTable table = new FocusableFlexTable(); table.setWidget(0, 0, op); table.setHTML(0, 1, itemHtml); table.setCellPadding(0); table.setCellSpacing(0); panel.add(table); if (description != null && description.length() != 0) { elementsToDescription.put(table.getElement(), description); } if (iconDisplayed) { Util.sinkOnloadForImages(table.getElement()); table.addHandler(iconLoadHandler, LoadEvent.getType()); } } }
From source file:com.gmail.cjbooms.thesis.pythonappengine.client.menus.file.NewFileDialog.java
License:Open Source License
private HorizontalPanel createGitAddCheclBox() { Label label = new Label(""); CheckBox checkbox = new CheckBox("Add To GIT"); checkbox.setValue(true); checkbox.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { addToGIT = ((CheckBox) event.getSource()).getValue(); }//from w ww.j av a 2 s.com }); return createHorizontalHolder(checkbox, label); }
From source file:com.google.api.explorer.client.auth.AuthView.java
License:Apache License
/** * Rebuild the popup from scratch with all of the scopes that we have from the last time we were * presented.//from w w w. j ava 2s .c o m */ private void buildScopePopup() { scopePanel.clear(); additionalScopePanel.clear(); Set<TextBox> oldEditors = Sets.newLinkedHashSet(freeFormEditors); freeFormEditors.clear(); // Hide the service scopes label if there aren't any. hasScopesText.setVisible(!scopesFromDiscovery.isEmpty()); noScopesText.setVisible(scopesFromDiscovery.isEmpty()); // Show different text on the free-form scopes section when there are discovery scopes. optionalAdditionalScopes.setVisible(!scopesFromDiscovery.isEmpty()); for (final Map.Entry<String, AuthScope> scope : scopesFromDiscovery.entrySet()) { // Add the check box to the table. CheckBox scopeToggle = new CheckBox(); SafeHtmlBuilder safeHtml = new SafeHtmlBuilder(); safeHtml.appendEscaped(scope.getKey()).appendHtmlConstant("<br><span>") .appendEscaped(scope.getValue().getDescription()).appendHtmlConstant("</span>"); scopeToggle.setHTML(safeHtml.toSafeHtml()); scopeToggle.addStyleName(style.discoveryScopeSelector()); scopePanel.add(scopeToggle); // When the box is checked, add our scope to the selected list. scopeToggle.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { CheckBox checkBox = (CheckBox) event.getSource(); if (checkBox.getValue()) { selectedScopes.add(scope.getKey()); } else { selectedScopes.remove(scope.getKey()); } } }); // Enable the check box if the scope is selected. scopeToggle.setValue(selectedScopes.contains(scope.getKey())); } // Process any scopes that are extra. for (TextBox editor : oldEditors) { if (!editor.getValue().trim().isEmpty()) { addFreeFormEditorRow(editor.getValue(), true); } } // There should always be one empty editor. addFreeFormEditorRow("", false); }
From source file:com.google.api.explorer.client.parameter.schema.FieldsEditor.java
License:Apache License
/** * Sets the properties this field will have, if it is an object. *///from w w w. j a v a 2 s. c o m public void setProperties(Map<String, Schema> properties) { List<String> keys = Lists.newArrayList(properties.keySet()); Collections.sort(keys); HTMLPanel inner = new HTMLPanel(""); inner.getElement().getStyle().setPaddingLeft(20, Unit.PX); for (String childKey : keys) { final Schema property = properties.get(childKey); final Map<String, Schema> childProperties = property.getProperties(); final Schema items = property.getItems(); if (childProperties == null && items == null) { // This is a simple field CheckBox checkBox = new CheckBox(childKey); checkBox.setValue(root.getValue()); checkBox.setTitle(property.getDescription()); children.put(childKey, checkBox); checkBox.getElement().appendChild(Document.get().createBRElement()); inner.add(checkBox); } else { final FieldsEditor editor = new FieldsEditor(service, childKey); children.put(childKey, editor); inner.add(editor); if (childProperties != null) { editor.setProperties(childProperties); } else if (property.getRef() != null) { editor.setRef(property.getRef()); } else if (items != null) { if (items.getProperties() != null) { editor.setProperties(items.getProperties()); } else if (items.getRef() != null) { editor.setRef(items.getRef()); } } } } add(inner); }