Java Code Examples for org.apache.wicket.markup.html.list.ListItem#iterator()

The following examples show how to use org.apache.wicket.markup.html.list.ListItem#iterator() . 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: ModalGeoPickerPage.java    From ontopia with Apache License 2.0 5 votes vote down vote up
private void findFields() {
  MarkupContainer container = this;
  while (!(container instanceof FieldInstancesPanel))
    container = container.getParent();

  FieldInstancesPanel parent = (FieldInstancesPanel) container;
  ListView<FieldInstanceModel> listView = parent.getFieldList();
  Iterator<? extends ListItem<FieldInstanceModel>> itfim = listView.iterator();
  while (itfim.hasNext()) {
    ListItem<FieldInstanceModel> li = itfim.next();
    FieldInstance fi = li.getModelObject().getFieldInstance();
    FieldAssignment fa = fi.getFieldAssignment();
    FieldDefinition fd = fa.getFieldDefinition();
    if (fd.getFieldType() != FieldDefinition.FIELD_TYPE_OCCURRENCE)
      continue;
    OccurrenceField of = (OccurrenceField)fd;
    OccurrenceType ot = of.getOccurrenceType();
    if (ot == null)
      continue;
    Collection<LocatorIF> psis = ot.getTopicIF().getSubjectIdentifiers();

    if (psis.contains(PSI.ON_LATITUDE) ||
        psis.contains(PSI.ON_LONGITUDE)) {
      Iterator<? extends Component> it = li.iterator();
      while (it.hasNext()) {
        Object component = it.next();
        if (component instanceof FieldInstanceOccurrencePanel) {
          FieldInstanceOccurrencePanel fiop = (FieldInstanceOccurrencePanel) component;
          if (psis.contains(PSI.ON_LONGITUDE))
            lngpan = fiop;
          else
            latpan = fiop;
        }
      }
    }
  }
}
 
Example 2
Source File: DynamicParameterRuntimePanel.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
private void enableItem(ListItem<QueryParameter> item, IModel dynamicModel, AjaxRequestTarget target) {
    Iterator it = item.iterator();
    while (it.hasNext()) {
        Component component = (Component) it.next();
        if (component.isVisible()) {
        	if (!component.getId().startsWith("dynamic")) {
        		component.setEnabled(!(Boolean) dynamicModel.getObject());
        		if (target != null) {
        			target.add(component);
        		}
        	}            	            	            		            	
        }
    }
}