Java Code Examples for com.google.gwt.user.client.ui.CheckBox#getValue()

The following examples show how to use com.google.gwt.user.client.ui.CheckBox#getValue() . 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: ExtendedScrollTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * getAllSelectedPaths
 *
 * @return
 */
public List<String> getAllSelectedPaths() {
	List<String> paths = new ArrayList<String>();
	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);
		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTDocument) {
				paths.add(((GWTDocument) obj).getPath());
			} else if (obj instanceof GWTFolder) {
				paths.add(((GWTFolder) obj).getPath());
			} else if (obj instanceof GWTMail) {
				paths.add(((GWTMail) obj).getPath());
			}
		}
	}
	return paths;
}
 
Example 2
Source File: ExtendedScrollTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * getAllSelectedUUIDs
 */
public List<String> getAllSelectedUUIDs() {
	List<String> uuidList = new ArrayList<String>();

	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);

		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTDocument) {
				uuidList.add(((GWTDocument) obj).getUuid());
			} else if (obj instanceof GWTFolder) {
				uuidList.add(((GWTFolder) obj).getUuid());
			} else if (obj instanceof GWTMail) {
				uuidList.add(((GWTMail) obj).getUuid());
			}
		}
	}

	return uuidList;
}
 
Example 3
Source File: ExtendedScrollTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * getAllSelectedDocumentsUUIDs
 */
public List<String> getAllSelectedDocumentsUUIDs() {
	List<String> uuidList = new ArrayList<String>();

	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);

		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTDocument) {
				uuidList.add(((GWTDocument) obj).getUuid());
			}
		}
	}

	return uuidList;
}
 
Example 4
Source File: ExtendedScrollTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * getAllSelectedDocumentsPaths
 */
public List<String> getAllSelectedDocumentsPaths() {
	List<String> pathList = new ArrayList<String>();

	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);

		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTDocument) {
				pathList.add(((GWTDocument) obj).getPath());
			}
		}
	}

	return pathList;
}
 
Example 5
Source File: ExtendedScrollTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * getAllSelectedMailUUIDs
 */
public List<String> getAllSelectedMailUUIDs() {
	List<String> uuidList = new ArrayList<String>();

	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);

		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTMail) {
				uuidList.add(((GWTMail) obj).getUuid());
			}
		}
	}

	return uuidList;
}
 
Example 6
Source File: ExtendedScrollTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * getAllSelectedPdfDocuments
 *
 * @return
 */
public List<GWTDocument> getAllSelectedPdfDocuments() {
	List<GWTDocument> docs = new ArrayList<GWTDocument>();
	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);
		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTDocument) {
				GWTDocument doc = (GWTDocument) obj;
				if (doc.getMimeType().equals("application/pdf")) {
					docs.add(doc);
				}
			}
		}
	}
	return docs;
}
 
Example 7
Source File: RoomGroupEdit.java    From unitime with Apache License 2.0 6 votes vote down vote up
protected void fillFutureFlags(UpdateRoomGroupRequest request) {
	if (iProperties.hasFutureSessions()) {
		for (AcademicSessionInterface session: iProperties.getFutureSessions()) {
			CheckBox ch = iFutureSessionsToggles.get(session.getId());
			if (ch != null) {
				Integer flags = RoomCookie.getInstance().getFutureFlags(session.getId());
				if (ch.getValue()) {
					request.addFutureSession(session.getId());
					if (flags == null)
						RoomCookie.getInstance().setFutureFlags(session.getId(), FutureOperation.getFlagDefaultsEnabled());
				} else {
					if (flags != null)
						RoomCookie.getInstance().setFutureFlags(session.getId(), null);
				}
			}
		}
	}
}
 
Example 8
Source File: RoomFeatureEdit.java    From unitime with Apache License 2.0 6 votes vote down vote up
protected void fillFutureFlags(UpdateRoomFeatureRequest request) {
	if (iProperties.hasFutureSessions()) {
		for (AcademicSessionInterface session: iProperties.getFutureSessions()) {
			CheckBox ch = iFutureSessionsToggles.get(session.getId());
			if (ch != null) {
				Integer flags = RoomCookie.getInstance().getFutureFlags(session.getId());
				if (ch.getValue()) {
					request.addFutureSession(session.getId());
					if (flags == null)
						RoomCookie.getInstance().setFutureFlags(session.getId(), FutureOperation.getFlagDefaultsEnabled());
				} else {
					if (flags != null)
						RoomCookie.getInstance().setFutureFlags(session.getId(), null);
				}
			}
		}
	}
}
 
Example 9
Source File: RoomEdit.java    From unitime with Apache License 2.0 6 votes vote down vote up
protected String generateAlsoUpdateMessage(boolean includeWhenNoFlags) {
	if ((iRoom.getUniqueId() == null && iProperties.hasFutureSessions()) || iRoom.hasFutureRooms()) {
		List<String> ret = new ArrayList<String>();
		for (int i = 1; i < iApplyTo.getRowCount(); i++) {
			CheckBox ch = (CheckBox)iApplyTo.getWidget(i, 0);
			if (ch.getValue()) {
				int flags = 0;
				for (FutureOperation op: FutureOperation.values()) {
					CheckBox x = (CheckBox)iApplyTo.getWidget(i, 6 + op.ordinal());
					if (x.getValue())
						flags = op.set(flags);
				}
				if (flags == 0 && !includeWhenNoFlags) continue;
				ret.add(iApplyTo.getData(i).getSession().getLabel());
			}
		}
		if (!ret.isEmpty())
			return ToolBox.toString(ret);
	}
	return null;
}
 
Example 10
Source File: CourseFinderMultipleCourses.java    From unitime with Apache License 2.0 6 votes vote down vote up
public boolean selectCourse(CourseAssignment course) {
	for (int r = 0; r < iCourses.getRowCount(); r++) {
		CourseAssignment ca = iCourses.getData(r);
		if (iCourses.getWidget(r, 0) instanceof CheckBox && ca != null && course.equals(ca)) {
			CheckBox c = (CheckBox)iCourses.getWidget(r, 0);
			boolean changed = false;
			if (!c.getValue()) {
				c.setValue(true, true);
				changed = true;
			}
			if (iCourses.getSelectedRow() < 0) {
				iCourses.setSelected(r, true);
				updateCourseDetails();
			}
			return changed;
		}
	}
	return false;
}
 
Example 11
Source File: RoomGroupEdit.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected String generateAlsoUpdateMessage() {
	if (!iProperties.hasFutureSessions()) return null;
	List<String> ret = new ArrayList<String>();
	for (AcademicSessionInterface session: iProperties.getFutureSessions()) {
		CheckBox ch = iFutureSessionsToggles.get(session.getId());
		if (ch != null && ch.getValue()) {
			ret.add(session.getLabel());
		}
	}
	if (!ret.isEmpty())
		return ToolBox.toString(ret);
	return null;
}
 
Example 12
Source File: RoomFeatureEdit.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected String generateAlsoUpdateMessage() {
	if (!iProperties.hasFutureSessions()) return null;
	List<String> ret = new ArrayList<String>();
	for (AcademicSessionInterface session: iProperties.getFutureSessions()) {
		CheckBox ch = iFutureSessionsToggles.get(session.getId());
		if (ch != null && ch.getValue()) {
			ret.add(session.getLabel());
		}
	}
	if (!ret.isEmpty())
		return ToolBox.toString(ret);
	return null;
}
 
Example 13
Source File: RoomEdit.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected void futureChanged() {
	if ((iRoom.getUniqueId() == null && iProperties.hasFutureSessions()) || iRoom.hasFutureRooms()) {
		for (int i = 1; i < iApplyTo.getRowCount(); i++) {
			CheckBox ch = (CheckBox)iApplyTo.getWidget(i, 0);
			if (ch.getValue()) {
				iEventStatus.setHint(MESSAGES.eventStatusHint(iRoom.hasSessionName() ? iRoom.getSessionName() : iProperties.getAcademicSessionName()));
				return;
			}
		}
	}
	iEventStatus.clearHint();
}
 
Example 14
Source File: EventMeetingTable.java    From unitime with Apache License 2.0 5 votes vote down vote up
public boolean hasSelection() {
	for (int row = 1; row < getRowCount(); row++) {
		Widget w =  getWidget(row, 0);
		if (w != null && w instanceof CheckBox) {
			CheckBox ch = (CheckBox)w;
			if (ch.getValue()) return true;
		}
	}
	return false;
}
 
Example 15
Source File: ChangeGradeModesDialog.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected void submitUpdateEnabled() {
	for (CheckBox ch: iDisclaimers)
		if (!ch.getValue()) {
			iButtons.setEnabled("submit", false, true);
			return;
		}
	iButtons.setEnabled("submit", true, true);
}