Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IFolder


      return false;
    }

    /* Update Folder */
    if (entity instanceof IFolder) {
      IFolder folder = (IFolder) entity;

      /* Name */
      if (!folder.getName().equals(fNameInput.getText())) {
        folder.setName(fNameInput.getText());
        entitiesToSave.add(folder);
      }
    }

    /* Update BookMark */
 
View Full Code Here


    /* Reload if required */
    if (fReloadRequired && fEntities.size() == 1)
      Controller.getDefault().reloadQueued((IBookMark) fEntities.get(0), getWorkbenchShell());

    /* Reparent if necessary */
    IFolder sameParent = getSameParent(fEntities);
    if (sameParent != null && sameParent != fFolderChooser.getFolder()) {
      List<ReparentInfo<IFolderChild, IFolder>> reparenting = new ArrayList<ReparentInfo<IFolderChild, IFolder>>();
      for (IEntity entity : fEntities) {
        /* Check BookMark and Folder */
        if (entity instanceof IBookMark || entity instanceof IFolder) {
View Full Code Here

    return str.toString();
  }

  private IBookMark createBookMark(IFeed feed) throws PersistenceException {
    IFolder folder = DynamicDAO.save(Owl.getModelFactory().createFolder(null, null, "Root"));

    return DynamicDAO.save(Owl.getModelFactory().createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "BookMark"));
  }
View Full Code Here

  /**
   * @throws Exception
   */
  @Test
  public final void testEntityScope() throws Exception {
    IFolder folder = DynamicDAO.save(fFactory.createFolder(null, null, "Root"));
    IFeed feed = fFactory.createFeed(null, new URI("http://www.link.com"));
    feed = DynamicDAO.save(feed);
    fFactory.createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "BookMark");
    folder = DynamicDAO.save(folder);

View Full Code Here

    return null;
  }

  private List<IFolder> processBody(Element body) {
    IFolder folder = Owl.getModelFactory().createFolder(null, null, "Imported from OPML");

    /* Interpret Children */
    List<?> feedChildren = body.getChildren();
    for (Iterator<?> iter = feedChildren.iterator(); iter.hasNext();) {
      Element child = (Element) iter.next();
View Full Code Here

  /**
   * @throws Exception
   */
  @Test
  public final void testEntityScopeChangeWithGC() throws Exception {
    IFolder folder = DynamicDAO.save(fFactory.createFolder(null, null, "Root"));
    IFeed feed = fFactory.createFeed(null, new URI("http://www.link.com"));
    feed = DynamicDAO.save(feed);
    folder = DynamicDAO.save(folder);

    IPreferenceScope entityScope = Owl.getPreferenceService().getEntityScope(folder);
View Full Code Here

   */
  @Test
  public final void testEntityScopeUpdateEvents() throws Exception {
    BookMarkListener bookmarkListener = null;
    try {
      IFolder folder = DynamicDAO.save(fFactory.createFolder(null, null, "Root"));
      IFeed feed = fFactory.createFeed(null, new URI("http://www.link.com"));
      feed = DynamicDAO.save(feed);
      fFactory.createBookMark(null, folder, new FeedLinkReference(feed.getLink()), "BookMark");
      folder = DynamicDAO.save(folder);

      final int eventsCounter[] = new int[] { 0 };
      bookmarkListener = new BookMarkAdapter() {
        @Override
        public void entitiesUpdated(Set<BookMarkEvent> events) {
          eventsCounter[0]++;
        }
      };
      DynamicDAO.addEntityListener(IBookMark.class, bookmarkListener);

      IMark mark = folder.getMarks().get(0);

      IPreferenceScope bookmarkScope = Owl.getPreferenceService().getEntityScope(mark);
      bookmarkScope.putString("key10", "value1");
      bookmarkScope.flush();

View Full Code Here

  private void importDefaults(List<ILabel> labels) throws PersistenceException, InterpreterException, ParserException {

    /* Import Default Feeds */
    InputStream inS = getClass().getResourceAsStream("/default_feeds.xml"); //$NON-NLS-1$;
    List<? extends IEntity> types = Owl.getInterpreter().importFrom(inS);
    IFolder imported = (IFolder) types.get(0);
    imported.setName("Default"); //$NON-NLS-1$

    /* Create Default SearchMarks */
    String newsEntityName = INews.class.getName();

    /* SearchCondition: New and Updated News */
 
View Full Code Here

      /* Import from File */
      File file = new File(fileName);
      InputStream inS = new FileInputStream(file);
      List<? extends IEntity> types = Owl.getInterpreter().importFrom(inS);
      IFolder importedContainer = (IFolder) types.get(0);

      /* Load the current selected Set */
      Long selectedFolderID = fPrefsDAO.load(BookMarkExplorer.PREF_SELECTED_BOOKMARK_SET).getLong();
      IFolder rootFolder = fFolderDAO.load(selectedFolderID);

      /* Reparent all imported folders into selected Set */
      List<IFolder> folders = importedContainer.getFolders();
      for (IFolder folder : folders) {
        folder.setParent(rootFolder);
        rootFolder.addFolder(folder, null, null);
      }

      /* Reparent all imported marks into selected Set */
      List<IMark> marks = importedContainer.getMarks();
      for (IMark mark : marks) {
        mark.setParent(rootFolder);
        rootFolder.addMark(mark, null, null);
      }

      /* Save Set */
      fFolderDAO.save(rootFolder);
    } catch (Exception e) {
View Full Code Here

    return tasks;
  }

  @SuppressWarnings("unused")
  private void createSavedSearches() {
    IFolder folder = Owl.getModelFactory().createFolder(null, null, "Default");
    IModelFactory factory = Owl.getModelFactory();

    /* Create Default SearchMarks */
    String newsEntityName = INews.class.getName();

View Full Code Here

TOP

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

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.