Exemplo n.º 1
0
 public void tagDataOrderedByName(Callback<TagData> callback) {
   query(
       callback,
       Query.select(TagData.PROPERTIES)
           .where(Criterion.and(TagData.DELETION_DATE.eq(0), TagData.NAME.isNotNull()))
           .orderBy(Order.asc(Functions.upper(TagData.NAME))));
 }
Exemplo n.º 2
0
 private static void setShowFeaturedLists() {
   // Show featured lists if necessary
   boolean showFeaturedLists = false;
   TodorooCursor<TagData> featLists =
       PluginServices.getTagDataService()
           .query(
               Query.select(TagData.ID)
                   .where(Functions.bitwiseAnd(TagData.FLAGS, TagData.FLAG_FEATURED).gt(0))
                   .limit(1));
   try {
     showFeaturedLists = featLists.getCount() > 0;
   } finally {
     featLists.close();
   }
   Preferences.setBoolean(
       FeaturedListFilterExposer.PREF_SHOULD_SHOW_FEATURED_LISTS, showFeaturedLists);
 }
Exemplo n.º 3
0
 /** @return tasks that are not hidden at current time */
 public static Criterion isVisible() {
   return Task.HIDE_UNTIL.lt(Functions.now());
 }
Exemplo n.º 4
0
 /** @return tasks that are due within the next 72 hours */
 public static Criterion dueSoon() {
   return Criterion.and(
       TaskCriteria.activeAndVisible(),
       Task.DUE_DATE.gt(0),
       Task.DUE_DATE.lt(Functions.fromNow(3 * DateUtilities.ONE_DAY)));
 }
Exemplo n.º 5
0
 /** @return tasks that have not yet been completed or deleted */
 public static Criterion activeAndVisible() {
   return Criterion.and(
       Task.COMPLETION_DATE.eq(0),
       Task.DELETION_DATE.eq(0),
       Task.HIDE_UNTIL.lt(Functions.now()));
 }
Exemplo n.º 6
0
 /** @return tasks completed before a given unixtime */
 public static Criterion completed() {
   return Criterion.and(Task.COMPLETION_DATE.gt(0), Task.COMPLETION_DATE.lt(Functions.now()));
 }
Exemplo n.º 7
0
 /** @return tasks that are due after a certain unixtime */
 public static Criterion dueAfterNow() {
   return Task.DUE_DATE.gt(Functions.now());
 }
Exemplo n.º 8
0
 /** @return tasks that are due before a certain unixtime */
 public static Criterion dueBeforeNow() {
   return Criterion.and(Task.DUE_DATE.gt(0), Task.DUE_DATE.lt(Functions.now()));
 }
Exemplo n.º 9
0
 /** @return tasks that are hidden at the current time */
 public static Criterion isHidden() {
   return Task.HIDE_UNTIL.gt(Functions.now());
 }