private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mCellElement.getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mCellElement.getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniquePercentageStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mElement.getAutomaticStyles(); do { unique_name = String.format("p%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; } }
private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mCellElement.getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mCellElement.getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mCellElement.getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mElement.getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniquePercentageStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mElement.getAutomaticStyles(); do { unique_name = String.format("p%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; } }
private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mElement.getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = mCellElement.getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = drawingShape.getOdfElement() .getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniqueDateStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = drawingShape.getOdfElement() .getAutomaticStyles(); do { unique_name = String.format("d%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniqueTimeStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = getDrawControl() .getOdfElement().getAutomaticStyles(); do { unique_name = String.format("t%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
private String getUniqueTimeStyleName() { String unique_name; OdfOfficeAutomaticStyles styles = getDrawControl() .getOdfElement().getAutomaticStyles(); do { unique_name = String.format("t%06x", (int) (Math.random() * 0xffffff)); } while (styles.getDateStyle(unique_name) != null); return unique_name; }
/** * Set the format of this date field. Date format pattern is the same as * {@link java.text.SimpleDateFormat SimpleDateFormat}. * * @param formatString * the format string of this date. * @see java.text.SimpleDateFormat */ public void formatDate(String formatString) { SimpleDateFormat simpleFormat = new SimpleDateFormat(DEFAULT_DATE_VALUE_FORMAT); String sValue = dateElement.getTextDateValueAttribute(); try { Date simpleDate = simpleFormat.parse(sValue); SimpleDateFormat newFormat = new SimpleDateFormat(formatString); dateElement.setTextContent(newFormat.format(simpleDate)); OdfFileDom dom = (OdfFileDom) dateElement.getOwnerDocument(); OdfOfficeAutomaticStyles styles = dom.getAutomaticStyles(); OdfNumberDateStyle dataStyle = styles.getDateStyle(dateElement.getStyleDataStyleNameAttribute()); dataStyle.buildFromFormat(formatString); } catch (ParseException e) { Logger.getLogger(DateField.class.getName()).log(Level.SEVERE, e.getMessage(), e); } }
/** * Set the format of this date field. Date format pattern is the same as * {@link java.text.SimpleDateFormat SimpleDateFormat}. * * @param formatString * the format string of this date. * @see java.text.SimpleDateFormat */ public void formatDate(String formatString) { SimpleDateFormat simpleFormat = new SimpleDateFormat(DEFAULT_DATE_VALUE_FORMAT); String sValue = dateElement.getTextDateValueAttribute(); try { Date simpleDate = simpleFormat.parse(sValue); SimpleDateFormat newFormat = new SimpleDateFormat(formatString); dateElement.setTextContent(newFormat.format(simpleDate)); OdfFileDom dom = (OdfFileDom) dateElement.getOwnerDocument(); OdfOfficeAutomaticStyles styles = null; if (dom instanceof OdfContentDom) { styles = ((OdfContentDom) dom).getAutomaticStyles(); } else if (dom instanceof OdfStylesDom) { styles = ((OdfStylesDom) dom).getAutomaticStyles(); } OdfNumberDateStyle dataStyle = styles.getDateStyle(dateElement.getStyleDataStyleNameAttribute()); dataStyle.buildFromFormat(formatString); } catch (ParseException e) { Logger.getLogger(DateField.class.getName()).log(Level.SEVERE, e.getMessage(), e); } }
/** * Set the format of this date field. Date format pattern is the same as * {@link java.text.SimpleDateFormat SimpleDateFormat}. * * @param formatString * the format string of this date. * @see java.text.SimpleDateFormat */ public void formatDate(String formatString) { SimpleDateFormat simpleFormat = new SimpleDateFormat(DEFAULT_DATE_VALUE_FORMAT); String sValue = dateElement.getTextDateValueAttribute(); try { Date simpleDate = simpleFormat.parse(sValue); SimpleDateFormat newFormat = new SimpleDateFormat(formatString); dateElement.setTextContent(newFormat.format(simpleDate)); OdfFileDom dom = (OdfFileDom) dateElement.getOwnerDocument(); OdfOfficeAutomaticStyles styles = null; if (dom instanceof OdfContentDom) { styles = ((OdfContentDom) dom).getAutomaticStyles(); } else if (dom instanceof OdfStylesDom) { styles = ((OdfStylesDom) dom).getAutomaticStyles(); } OdfNumberDateStyle dataStyle = styles.getDateStyle(dateElement.getStyleDataStyleNameAttribute()); dataStyle.buildFromFormat(formatString); } catch (ParseException e) { Logger.getLogger(DateField.class.getName()).log(Level.SEVERE, e.getMessage(), e); } }
String name = getDataDisplayStyleName(); OdfNumberDateStyle style = drawingShape.getOdfElement() .getAutomaticStyles().getDateStyle(name); if (style == null) { style = ((OdfSchemaDocument) mDocument).getDocumentStyles() String name = getDataDisplayStyleName(); OdfNumberDateStyle style = drawingShape.getOdfElement() .getAutomaticStyles().getDateStyle(name); if (style == null) { style = ((OdfSchemaDocument) mDocument).getDocumentStyles()
OdfNumberDateStyle style = mCellElement.getAutomaticStyles().getDateStyle(name); if (style == null) { style = mDocument.getDocumentStyles().getDateStyle(name);
OdfNumberDateStyle style = mCellElement.getAutomaticStyles().getDateStyle(name); if (style == null) { style = mDocument.getDocumentStyles().getDateStyle(name);