Java Code Examples for com.smartgwt.client.data.Record#getAttributeAsBoolean()

The following examples show how to use com.smartgwt.client.data.Record#getAttributeAsBoolean() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WorkflowTaskFormView.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private FormItem createFormItem(Record editedRecord, ValueType valueType, DisplayType displayType) {
    FormItem fi = createFormItem(displayType, editedRecord);

    Boolean required = editedRecord.getAttributeAsBoolean(WorkflowModelConsts.PARAMETER_REQUIRED);
    ArrayList<Validator> validators = new ArrayList<Validator>();
    if (required != null && required) {
        validators.add(new RequiredIfValidator(requiredFunc));
    }
    if (valueType == ValueType.NUMBER && displayType != DisplayType.CHECKBOX) {
        validators.add(new IsFloatValidator());
    }
    if (!validators.isEmpty()) {
        fi.setValidators(validators.toArray(new Validator[validators.size()]));
    }
    return fi;
}
 
Example 2
Source File: FolderSecurityPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Creates an array of all the right
 * 
 * @return the array of rights
 */
public GUIRight[] getRights() {
	int totalRecords = list.getRecordList().getLength();
	List<GUIRight> tmp = new ArrayList<GUIRight>();

	for (int i = 0; i < totalRecords; i++) {
		Record record = list.getRecordList().get(i);
		if (!record.getAttributeAsBoolean("read"))
			continue;

		GUIRight right = new GUIRight();

		right.setName(record.getAttributeAsString("entity"));
		right.setEntityId(Long.parseLong(record.getAttribute("entityId")));
		right.setPrint("true".equals(record.getAttributeAsString("print")));
		right.setWrite("true".equals(record.getAttributeAsString("write")));
		right.setDelete("true".equals(record.getAttributeAsString("delete")));
		right.setAdd("true".equals(record.getAttributeAsString("add")));
		right.setWorkflow("true".equals(record.getAttributeAsString("workflow")));
		right.setSign("true".equals(record.getAttributeAsString("sign")));
		right.setImport("true".equals(record.getAttributeAsString("import")));
		right.setExport("true".equals(record.getAttributeAsString("export")));
		right.setImmutable("true".equals(record.getAttributeAsString("immutable")));
		right.setRename("true".equals(record.getAttributeAsString("rename")));
		right.setSecurity("true".equals(record.getAttributeAsString("security")));
		right.setArchive("true".equals(record.getAttributeAsString("archive")));
		right.setDownload("true".equals(record.getAttributeAsString("download")));
		right.setCalendar("true".equals(record.getAttributeAsString("calendar")));
		right.setSubscription("true".equals(record.getAttributeAsString("subscription")));
		right.setPassword("true".equals(record.getAttributeAsString("password")));
		right.setMove("true".equals(record.getAttributeAsString("move")));
		right.setEmail("true".equals(record.getAttributeAsString("email")));
		right.setAutomation("true".equals(record.getAttributeAsString("automation")));

		tmp.add(right);
	}

	return tmp.toArray(new GUIRight[0]);
}
 
Example 3
Source File: ComparatorAssociationsDialog.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void onApply() {
	for (Record rec : associationsGrid.getRecordList().toArray()) {
		if (rec.getAttributeAsBoolean("selected")) {
			String id = rec.getAttributeAsString("id").trim();
			String selectedComparator = comparator.getValueAsString();

			Record record = srcGrid.find(new AdvancedCriteria("id", OperatorId.EQUALS, id));
			if (record != null) {
				record.setAttribute("comparator", selectedComparator);
				srcGrid.updateData(record);
			}
		}
	}
	destroy();
}
 
Example 4
Source File: ConverterAssociationsDialog.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void onApply() {
	for (Record rec : associationsGrid.getRecordList().toArray()) {
		if (rec.getAttributeAsBoolean("selected")) {
			String id = rec.getAttributeAsString("id").trim();
			String selectedConverter = converter.getValueAsString();

			Record record = srcGrid.find(new AdvancedCriteria("id", OperatorId.EQUALS, id));
			if (record != null) {
				record.setAttribute("converter", selectedConverter);
				srcGrid.updateData(record);
			}
		}
	}
	destroy();
}
 
Example 5
Source File: DigitalObjectEditor.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private DigitalObject findRecentSelection(DigitalObject... objects) {
    if (objects == null || objects.length == 0 || objects[0] == null) {
        return null;
    } else if (objects.length == 1) {
        return objects[0];
    }
    for (DigitalObject object : objects) {
        Record record = object.getRecord();
        Boolean isLastSelection = record.getAttributeAsBoolean(DigitalObjectChildrenEditor.LAST_CLICKED_ATTR);
        if (isLastSelection != null && isLastSelection) {
            return object;
        }
    }
    return null;
}