public void setStyleName(Date d, String styleName, boolean add) { // Code is easier to maintain if surrounded by " ", and on all browsers // this is a no-op. styleName = " " + styleName + " "; String key = genKey(d); String current = info.get(key); if (add) { if (current == null) { info.put(key, styleName); } else if (current.indexOf(styleName) == -1) { info.put(key, current + styleName); } } else { if (current != null) { String newValue = current.replaceAll(styleName, ""); if (newValue.trim().length() == 0) { info.remove(key); } else { info.put(key, newValue); } } } }
public void setStyleName(Date d, String styleName, boolean add) { // Code is easier to maintain if surrounded by " ", and on all browsers // this is a no-op. styleName = " " + styleName + " "; String key = genKey(d); String current = info.get(key); if (add) { if (current == null) { info.put(key, styleName); } else if (current.indexOf(styleName) == -1) { info.put(key, current + styleName); } } else { if (current != null) { String newValue = current.replaceAll(styleName, ""); if (newValue.trim().length() == 0) { info.remove(key); } else { info.put(key, newValue); } } } }
public void setStyleName(Date d, String styleName, boolean add) { // Code is easier to maintain if surrounded by " ", and on all browsers // this is a no-op. styleName = " " + styleName + " "; String key = genKey(d); String current = info.get(key); if (add) { if (current == null) { info.put(key, styleName); } else if (current.indexOf(styleName) == -1) { info.put(key, current + styleName); } } else { if (current != null) { String newValue = current.replaceAll(styleName, ""); if (newValue.trim().length() == 0) { info.remove(key); } else { info.put(key, newValue); } } } }
public String getStyleName(Date d) { return info.get(genKey(d)); }
public String getStyleName(Date d) { return info.get(genKey(d)); }
/** * Gets the style associated with a date (does not include styles set via * {@link #addTransientStyleToDates}). * * @param date the date * @return the styles associated with this date */ public String getStyleOfDate(Date date) { return styler.getStyleName(date); }
/** * Add a style name to the given dates. */ public void addStyleToDates(String styleName, Date date) { styler.setStyleName(date, styleName, true); if (isDateVisible(date)) { getView().addStyleToDate(styleName, date); } }
/** * Gets the style associated with a date (does not include styles set via * {@link #addTransientStyleToDates}). * * @param date the date * @return the styles associated with this date */ public String getStyleOfDate(Date date) { return styler.getStyleName(date); }
/** * Removes the styleName from the given dates (even if it is transient). */ public void removeStyleFromDates(String styleName, Date date) { styler.setStyleName(date, styleName, false); if (isDateVisible(date)) { getView().removeStyleFromDate(styleName, date); } }
/** * Add a style name to the given dates. */ public void addStyleToDates(String styleName, Date date) { styler.setStyleName(date, styleName, true); if (isDateVisible(date)) { getView().addStyleToDate(styleName, date); } }
/** * Removes the styleName from the given dates (even if it is transient). */ public void removeStyleFromDates(String styleName, Date date) { styler.setStyleName(date, styleName, false); if (isDateVisible(date)) { getView().removeStyleFromDate(styleName, date); } }
public String getStyleName(Date d) { return info.get(genKey(d)); }
/** * Gets the style associated with a date (does not include styles set via * {@link #addTransientStyleToDates}). * * @param date the date * @return the styles associated with this date */ public String getStyleOfDate(Date date) { return styler.getStyleName(date); }
/** * Removes the styleName from the given dates (even if it is transient). */ public void removeStyleFromDates(String styleName, Date date) { styler.setStyleName(date, styleName, false); if (isDateVisible(date)) { getView().removeStyleFromDate(styleName, date); } }
/** * Add a style name to the given dates. */ public void addStyleToDates(String styleName, Date date) { styler.setStyleName(date, styleName, true); if (isDateVisible(date)) { getView().addStyleToDate(styleName, date); } }