Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IPreference


      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putLongs(value);
    fPreferenceDAO.save(pref);
  }
View Full Code Here


      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putLongs(values);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putStrings(value);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

      delete(key);
      return;
    }

    /* Save to DB */
    IPreference pref = fPreferenceDAO.loadOrCreate(key);
    pref.putStrings(values);
    fPreferenceDAO.save(pref);
  }
View Full Code Here

    else if (entity instanceof ISearchCondition) {
      ISearchCondition searchCond = (ISearchCondition) entity;
      modelEvent = new SearchConditionEvent(searchCond, root);
    }
    else if (entity instanceof IPreference) {
      IPreference pref = (IPreference) entity;
      modelEvent = new PreferenceEvent(pref);
    }
    else if (entity instanceof ISearch) {
      ISearch search = (ISearch) entity;
      modelEvent = new SearchEvent(search, root);
View Full Code Here

   * Bookmark Set, or the currently selected Bookmark Set otherwise.
   * @throws PersistenceException in case of an error while loading.
   */
  public static IFolder getSelectedParent(IFolder folder) throws PersistenceException {
    String selectedBookMarkSetPref = BookMarkExplorer.getSelectedBookMarkSetPref(getWindow());
    IPreference preference = DynamicDAO.getDAO(IPreferenceDAO.class).load(selectedBookMarkSetPref);
    if (preference != null) {
      Long selectedRootFolderID = preference.getLong();

      /* Check if available Parent is still valid */
      if (folder != null) {
        if (hasParent(folder, new FolderReference(selectedRootFolderID)))
          return folder;
View Full Code Here

   * org.rssowl.core.internal.persist.dao.AbstractPersistableDAO#doSave(org.
   * rssowl.core.persist.IPersistable)
   */
  @Override
  protected void doSave(IPreference entity) {
    IPreference pref = load(entity.getKey());
    if (pref != null && pref != entity)
      throw new UniqueConstraintException("key", entity); //$NON-NLS-1$

    super.doSave(entity);
  }
View Full Code Here

  /*
   * @see
   * org.rssowl.core.persist.dao.IPreferenceDAO#loadOrCreate(java.lang.String)
   */
  public IPreference loadOrCreate(String key) throws PersistenceException {
    IPreference pref = load(key);
    if (pref == null)
      return Owl.getModelFactory().createPreference(key);

    return pref;
  }
View Full Code Here

      modelEvent = new LabelEvent(oldLabel, label, root);
    } else if (entity instanceof ISearchCondition) {
      ISearchCondition searchCond = (ISearchCondition) entity;
      modelEvent = new SearchConditionEvent(searchCond, root);
    } else if (entity instanceof IPreference) {
      IPreference pref = (IPreference) entity;
      modelEvent = new PreferenceEvent(pref);
    } else if (entity instanceof ISearch) {
      ISearch search = (ISearch) entity;
      modelEvent = new SearchEvent(search, root);
    } else if (entity instanceof ISearchFilter) {
View Full Code Here

   */
  public boolean getBoolean(String key) {
    synchronized (fCache) {

      /* Consult Cache */
      IPreference cachedPref = fCache.get(key);
      if (cachedPref != null && cachedPref.getBoolean() != null)
        return cachedPref.getBoolean();

      /* Consult the Persistence Layer */
      IPreference pref = load(key);
      if (pref != null && pref.getBoolean() != null) {
        fCache.put(key, pref);
        return pref.getBoolean();
      }

      /* Ask Parent */
      boolean parentValue = fParent.getBoolean(key);

      /* Cache value from parent */
      pref = Owl.getModelFactory().createPreference(key);
      pref.putBooleans(parentValue);
      fCache.put(key, pref);

      return parentValue;
    }
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.IPreference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.