protected void parseItems(XmlPullParser parser) throws XmlPullParserException, IOException { ReportedData data = new ReportedData(); data.addColumn(new ReportedData.Column("JID", "jid", FormField.Type.text_single)); if (column.getVariable().equals(name)) { exists = true; break; ReportedData.Column column = new ReportedData.Column(name, name, FormField.Type.text_single); data.addColumn(column);
String label = column.getLabel(); columnnames.add(label);
List<String> columnList = new ArrayList<>(); for ( final Column column : data.getColumns() ) { String label = column.getLabel(); columnList.add(label); String tableValue = (String)resultsTable.getTableHeader().getColumnModel().getColumn(i).getHeaderValue(); for ( final Column column : data.getColumns() ) { if (column.getLabel().equals(tableValue)) { tableValue = column.getVariable(); break;
/** * Creates a new ReportedData based on the returned dataForm from a search *(namespace "jabber:iq:search"). * * @param dataForm the dataForm returned from a search (namespace "jabber:iq:search"). */ private ReportedData(DataForm dataForm) { // Add the columns to the report based on the reported data fields for (FormField field : dataForm.getReportedData().getFields()) { columns.add(new Column(field.getLabel(), field.getVariable(), field.getType())); } // Add the rows to the report based on the form's items for (Item item : dataForm.getItems()) { List<Field> fieldList = new ArrayList<>(columns.size()); for (FormField field : item.getFields()) { // The field is created with all the values of the data form's field List<CharSequence> values = new ArrayList<>(); values.addAll(field.getValues()); fieldList.add(new Field(field.getVariable(), values)); } rows.add(new Row(fieldList)); } // Set the report's title this.title = dataForm.getTitle(); }