/** * Returns whether it has the letter(s) or integer position of the column. * * @return whether it has the letter(s) or integer position of the column */ public boolean hasIndex() { return getIndex() != null; }
/** * Returns whether it has the displayed value of the cell. * * @return whether it has the displayed value of the cell */ public boolean hasValue() { return getValue() != null; }
/** * Immutable constructor. * * @param index letter(s) or integer position of the column. * @param name user defined name of the column. * @param value displayed value of the cell. */ public Field(String index, String name, String value) { super(); setIndex(index); setName(name); setValue(value); setImmutable(true); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } Field other = (Field) obj; return eq(index, other.index) && eq(name, other.name) && eq(value, other.value); }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(RecordEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(RecordEntry.class, Field.getDefaultDescription(false, true)); }
/** * Returns whether it has the user defined name of the column. * * @return whether it has the user defined name of the column */ public boolean hasName() { return getName() != null; }
private XmlElement getRow(ListItemEntry item) { XmlElement element = RendererUtils.getEntryElement(item, "tr"); for (Field field : item.getFields()) { String val; if (field.getValue() == null || field.getValue().equals("")) { val = " "; //Equivalent to but XML compliant } else if (field.getValue().equals("on")) { val = "\u2713"; //Checkmark } else { val = field.getValue(); } XmlElement cell = new XmlElement("td"); cell.setAttribute("class", "gs:field"); cell.setAttribute("title", field.getIndex()); cell.addXml(val); element.addElement(cell); } XmlElement authorCell = new XmlElement("td"); element.addElement(authorCell.addElement( RendererUtils.getAuthorElement(item))); XmlElement revisionCell = new XmlElement("td"); XmlElement updatedCell = new XmlElement("td"); element.addElement(updatedCell.addElement( RendererUtils.getUpdatedElement(item))); element.addElement(revisionCell.addElement( RendererUtils.getRevisionElement(item))); return element; } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!sameClassAs(obj)) { return false; } Field other = (Field) obj; return eq(index, other.index) && eq(name, other.name) && eq(value, other.value); }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(ListItemEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(ListItemEntry.class, Field.getDefaultDescription(false, true)); }
/** * Returns whether it has the user defined name of the column. * * @return whether it has the user defined name of the column */ public boolean hasName() { return getName() != null; }
/** * Immutable constructor. * * @param index letter(s) or integer position of the column. * @param name user defined name of the column. * @param value displayed value of the cell. */ public Field(String index, String name, String value) { super(); setIndex(index); setName(name); setValue(value); setImmutable(true); }
/** * Returns whether it has the letter(s) or integer position of the column. * * @return whether it has the letter(s) or integer position of the column */ public boolean hasIndex() { return getIndex() != null; }
/** * Returns whether it has the displayed value of the cell. * * @return whether it has the displayed value of the cell */ public boolean hasValue() { return getValue() != null; }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(RecordEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(RecordEntry.class, Field.getDefaultDescription(false, true)); }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(ListItemEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(ListItemEntry.class, Field.getDefaultDescription(false, true)); }