/** * Sets the int value of the property with the specified ID. * * @param id The property's ID * @param value The property's value. * * @see #setProperty(int, long, Object) * @see #getProperty */ public void setProperty(final int id, final int value) { setProperty(id, Variant.VT_I4, value); }
/** * Sets the boolean value of the property with the specified ID. * * @param id The property's ID * @param value The property's value. * * @see #setProperty(int, long, Object) * @see #getProperty */ public void setProperty(final int id, final boolean value) { setProperty(id, Variant.VT_BOOL, value); }
/** * Sets the string value of the property with the specified ID. * * @param id The property's ID * @param value The property's value. */ public void setProperty(final int id, final String value) { setProperty(id, Variant.VT_LPSTR, value); }
/** * Sets the codepage. * * @param codepage the codepage */ public void setCodepage(final int codepage) { setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2, codepage); } }
/** * Sets the long value of the property with the specified ID. * * @param id The property's ID * @param value The property's value. * * @see #setProperty(int, long, Object) * @see #getProperty */ public void setProperty(final int id, final long value) { setProperty(id, Variant.VT_I8, value); }
/** * Sets the value of the boolean property with the specified * ID. * * @param id The property's ID * @param value The property's value * * @see #setProperty(int, long, Object) * @see #getProperty * @see Variant */ @SuppressWarnings("unused") protected void setPropertyBooleanValue(final int id, final boolean value) { setProperty(id, Variant.VT_BOOL, value); }
/** * Sets this section's properties. Any former values are overwritten. * * @param properties This section's new properties. */ public void setProperties(final Property[] properties) { this.properties.clear(); for (Property p : properties) { setProperty(p); } }
/** * Sets the creation time. * * @param createDateTime The creation time to set. */ public void setCreateDateTime(final Date createDateTime) { getFirstSection().setProperty(PropertyIDMap.PID_CREATE_DTM, Variant.VT_FILETIME, createDateTime); }
/** * Sets the total time spent in editing the document. * * @param time The time to set. */ public void setLastSaveDateTime(final Date time) { final Section s = getFirstSection(); s .setProperty(PropertyIDMap.PID_LASTSAVE_DTM, Variant.VT_FILETIME, time); }
/** * Sets the presentation format. * * @param presentationFormat The presentation format to set. */ public void setPresentationFormat(final String presentationFormat) { getFirstSection().setProperty(PropertyIDMap.PID_PRESFORMAT, presentationFormat); }
/** * Sets the lastPrinted. * * @param lastPrinted The lastPrinted to set. */ public void setLastPrinted(final Date lastPrinted) { getFirstSection().setProperty(PropertyIDMap.PID_LASTPRINTED, Variant.VT_FILETIME, lastPrinted); }
@SuppressWarnings("SameParameterValue") void set1stProperty(long id, byte[] value) { getFirstSection().setProperty((int)id, value); }
/** * Sets the category. * * @param category The category to set. */ public void setCategory(final String category) { getFirstSection().setProperty(PropertyIDMap.PID_CATEGORY, category); }
/** * Sets the thumbnail. * * @param thumbnail The thumbnail to set. */ public void setThumbnail(final byte[] thumbnail) { getFirstSection().setProperty(PropertyIDMap.PID_THUMBNAIL, /* FIXME: */ Variant.VT_LPSTR, thumbnail); }
void set1stProperty(long id, int value) { getFirstSection().setProperty((int)id, value); }
void set1stProperty(long id, String value) { getFirstSection().setProperty((int)id, value); }
void set1stProperty(long id, boolean value) { getFirstSection().setProperty((int)id, value); }
/** * Sets the value and the variant type of the property with the * specified ID. If a property with this ID is not yet present in * the section, it will be added. An already present property with * the specified ID will be overwritten. A default mapping will be * used to choose the property's type. * * @param id The property's ID. * @param variantType The property's variant type. * @param value The property's value. * * @see #setProperty(int, String) * @see #getProperty * @see Variant */ @SuppressWarnings("deprecation") public void setProperty(final int id, final long variantType, final Object value) { setProperty(new Property(id, variantType, value)); }
/** * Sets the total time spent in editing the document. * * @param time The time to set. */ public void setEditTime(final long time) { final Date d = Filetime.filetimeToDate(time); getFirstSection().setProperty(PropertyIDMap.PID_EDITTIME, Variant.VT_FILETIME, d); }
/** * Sets the custom properties. * * @param customProperties The custom properties */ public void setCustomProperties(final CustomProperties customProperties) { ensureSection2(); final Section section = getSections().get(1); final Map<Long,String> dictionary = customProperties.getDictionary(); // section.clear(); /* Set the codepage. If both custom properties and section have a * codepage, the codepage from the custom properties wins, else take the * one that is defined. If none is defined, take ISO-8859-1. */ int cpCodepage = customProperties.getCodepage(); if (cpCodepage < 0) { cpCodepage = section.getCodepage(); } if (cpCodepage < 0) { cpCodepage = Property.DEFAULT_CODEPAGE; } customProperties.setCodepage(cpCodepage); section.setCodepage(cpCodepage); section.setDictionary(dictionary); for (CustomProperty p : customProperties.properties()) { section.setProperty(p); } }