com.google.gwt.user.client.ui.Hidden Java Examples

The following examples show how to use com.google.gwt.user.client.ui.Hidden. 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: CourseNumbersSuggestBox.java    From unitime with Apache License 2.0 6 votes vote down vote up
private String getConfiguration() {
	String conf = iConfiguration;
	for (MatchResult matcher = iRegExp.exec(conf); matcher != null; matcher = iRegExp.exec(conf)) {
		Element element = DOM.getElementById(matcher.getGroup(1));
		String value = "";
		if ("select".equalsIgnoreCase(element.getTagName())) {
			ListBox list = ListBox.wrap(element);
			for (int i = 0; i < list.getItemCount(); i++) {
				if (list.isItemSelected(i))
					value += (value.isEmpty() ? "" : ",") + list.getValue(i);
			}
		} else if ("input".equalsIgnoreCase(element.getTagName())) {
			TextBox text = TextBox.wrap(element);
			value = text.getText();
		} else {
			Hidden hidden = Hidden.wrap(element);
			value = hidden.getValue();
		}
		conf = conf.replace("${" + matcher.getGroup(1) + "}", value);
	}
	return conf;
}
 
Example #2
Source File: InstructorAvailabilityWidget.java    From unitime with Apache License 2.0 5 votes vote down vote up
public void insert(final RootPanel panel) {
	RPC.execute(InstructorAvailabilityRequest.load(null), new AsyncCallback<InstructorAvailabilityModel>() {
		@Override
		public void onFailure(Throwable caught) {
			UniTimeNotifications.error(caught);
		}

		@Override
		public void onSuccess(final InstructorAvailabilityModel model) {
			if (panel.getElement().getFirstChildElement() != null) {
				iPattern = Hidden.wrap(panel.getElement().getFirstChildElement());
				model.setPattern(iPattern.getValue());
			
				addValueChangeHandler(new ValueChangeHandler<RoomInterface.RoomSharingModel>() {
					@Override
					public void onValueChange(ValueChangeEvent<RoomSharingModel> event) {
						iPattern.setValue(event.getValue().toString());
					}
				});
				iEditable = true;
			} else {
				String pattern = panel.getElement().getInnerText().trim();
				panel.getElement().setInnerText(null);
				model.setPattern(pattern);
				iEditable = false;
			}
			
			setModel(model);

			panel.add(InstructorAvailabilityWidget.this);
			panel.setVisible(true);				
		}
	});
}