Example #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))));
 }
 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);
 }
Example #3
0
 /** @return tasks that are not hidden at current time */
 public static Criterion isVisible() {
   return Task.HIDE_UNTIL.lt(Functions.now());
 }
Example #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)));
 }
Example #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()));
 }
Example #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()));
 }
Example #7
0
 /** @return tasks that are due after a certain unixtime */
 public static Criterion dueAfterNow() {
   return Task.DUE_DATE.gt(Functions.now());
 }
Example #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()));
 }
Example #9
0
 /** @return tasks that are hidden at the current time */
 public static Criterion isHidden() {
   return Task.HIDE_UNTIL.gt(Functions.now());
 }