Examples of IPreference


Examples of org.rssowl.core.persist.IPreference

        }
      };
      fDao.addEntityListener(prefListener);

      /* Add some Preferences */
      IPreference pref = fFactory.createPreference(key1);
      pref.putBooleans(value1);
      fDao.save(pref);

      pref = fFactory.createPreference(key2);
      pref.putIntegers(value2);
      fDao.save(pref);

      pref = fFactory.createPreference(key3);
      pref.putStrings(value3);
      fDao.save(pref);

      pref = fFactory.createPreference(key4);
      pref.putStrings(value4);
      fDao.save(pref);

      /* Update some Preferences */
      pref = fDao.loadOrCreate(key1);
      pref.putBooleans(false);
      fDao.save(pref);

      pref = fDao.loadOrCreate(key2);
      pref.putIntegers(0);
      fDao.save(pref);

      pref = fDao.loadOrCreate(key3);
      pref.putStrings("updated_value");
      fDao.save(pref);

      pref = fDao.loadOrCreate(key4);
      pref.putStrings("4", "3", "2", "1");
      fDao.save(pref);

      /* Delete some Preferences */
      fDao.delete(key1);
      fDao.delete(key2);
View Full Code Here

Examples of org.rssowl.core.persist.IPreference

   *
   * @throws Exception
   */
  @Test
  public void testSaveSingleEntryStringArray() throws Exception {
    IPreference pref = fFactory.createPreference("Foo");
    pref.putStrings("Bar");
    fDao.save(pref);
    fDao.load(pref.getKey()).getStrings();
  }
View Full Code Here

Examples of org.rssowl.core.persist.IPreference

   *
   * @throws Exception
   */
  @Test
  public void testSaveStringsDuplicate() throws Exception {
    IPreference pref = fFactory.createPreference("Foo");
    pref.putStrings("1", "2", "3", "1", "2", "3");
    fDao.save(pref);
    pref = fDao.loadOrCreate("Foo");
    pref.putStrings("1", "2", "3", "1", "2", "3");
    fDao.save(pref);
  }
View Full Code Here

Examples of org.rssowl.core.persist.IPreference

   *
   * @throws Exception
   */
  @Test
  public void testSaveArrayWithDuplicateStrings() throws Exception {
    IPreference pref = fFactory.createPreference("Foo");
    pref.putStrings("1", "2", "3", "1", "2", "3");
    fDao.save(pref);
  }
View Full Code Here

Examples of org.rssowl.core.persist.IPreference

   * @throws Exception
   */
  @Test
  public void testUpdateArray() throws Exception {
    String key = "Foo";
    IPreference pref = fFactory.createPreference(key);
    pref.putStrings("1", "2", "3", "1", "2", "3");
    fDao.save(pref);
    String[] updatedStrings = new String[] { "1", "3", "2" };
    pref.putStrings(updatedStrings);
    fDao.save(pref);
    String[] savedStrings = fDao.load(key).getStrings();
    assertArrayEquals(updatedStrings, savedStrings);
  }
View Full Code Here

Examples of org.rssowl.core.persist.IPreference

    if (!Owl.TESTING) {
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {

          /* First check wether this action is required */
          IPreference firstStartToken = fPrefsDAO.load(FIRST_START_TOKEN);
          if (firstStartToken != null)
            return;

          onFirstStartup();

View Full Code Here

Examples of org.rssowl.core.persist.IPreference

    if (!InternalOwl.TESTING) {
      SafeRunner.run(new LoggingSafeRunnable() {
        public void run() throws Exception {

          /* First check wether this action is required */
          IPreference firstStartToken = fPrefsDAO.load(FIRST_START_TOKEN);
          if (firstStartToken != null)
            return;

          onFirstStartup();

View Full Code Here

Examples of org.rssowl.core.persist.IPreference

    /* Update Set Actions */
    fViewSite.getActionBars().getToolBarManager().find(PREVIOUS_SET_ACTION).update(IAction.ENABLED);
    fViewSite.getActionBars().getToolBarManager().find(NEXT_SET_ACTION).update(IAction.ENABLED);

    /* Save the new selected Set in Preferences */
    IPreference pref = fPrefDAO.loadOrCreate(getSelectedBookMarkSetPref(fViewSite.getWorkbenchWindow()));
    pref.putLongs(fSelectedBookMarkSet.getId());
    fPrefDAO.save(pref);
  }
View Full Code Here

Examples of org.rssowl.core.persist.IPreference

      i++;
    }
    /* Add the ID of the current selected Set to make it Unique */
    String key = PREF_EXPANDED_NODES + fSelectedBookMarkSet.getId();

    IPreference pref = fPrefDAO.loadOrCreate(key);
    pref.putLongs(elements);
    fPrefDAO.save(pref);
  }
View Full Code Here

Examples of org.rssowl.core.persist.IPreference

    fFaviconsEnabled = !fGlobalPreferences.getBoolean(DefaultPreferences.BE_DISABLE_FAVICONS);
    fFilterType = BookMarkFilter.Type.values()[fGlobalPreferences.getInteger(DefaultPreferences.BE_FILTER_TYPE)];
    fGroupingType = BookMarkGrouping.Type.values()[fGlobalPreferences.getInteger(DefaultPreferences.BE_GROUP_TYPE)];

    String selectedBookMarkSetPref = getSelectedBookMarkSetPref(fViewSite.getWorkbenchWindow());
    IPreference pref = fPrefDAO.load(selectedBookMarkSetPref);
    Assert.isTrue(fRootFolders.size() > 0, Messages.BookMarkExplorer_ERROR_NO_SET_FOUND);
    if (pref != null)
      fSelectedBookMarkSet = new FolderReference(pref.getLong().longValue()).resolve();
    else {
      fSelectedBookMarkSet = getRootFolderAt(0);

      /* Save this to make sure subsequent calls succeed */
      pref = Owl.getModelFactory().createPreference(selectedBookMarkSetPref);
      pref.putLongs(fSelectedBookMarkSet.getId());
      fPrefDAO.save(pref);
    }

    /* Expanded Elements */
    loadExpandedElements();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.