Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.IFolderChild


  @Test
  public void testMaxClauseCountForQuery() throws Exception {
    int maxClauseCount = BooleanQuery.getMaxClauseCount();
    BooleanQuery.setMaxClauseCount(3);

    IFolderChild root = fFactory.createFolder(null, null, "Root");
    IFeed feed1 = DynamicDAO.save(fFactory.createFeed(null, new URI("http://www.feed.com/feed1.xml")));
    IFeed feed2 = DynamicDAO.save(fFactory.createFeed(null, new URI("http://www.feed.com/feed2.xml")));
    IFeed feed3 = DynamicDAO.save(fFactory.createFeed(null, new URI("http://www.feed.com/feed3.xml")));
    IFeed feed4 = DynamicDAO.save(fFactory.createFeed(null, new URI("http://www.feed.com/feed4.xml")));
View Full Code Here


              item.setChecked(false);
            }

            /* Normal selection behavior otherwise */
            else {
              IFolderChild folderChild = (IFolderChild) item.getData();
              setChildsChecked(folderChild, item.getChecked(), false, true);
              cache(folderChild, item.getChecked());

              if (!item.getChecked())
                setParentsChecked(folderChild, false, true);
View Full Code Here

      return composite;
    }

    private void onCreateNewsBin() {
      IFolderChild selectedFolderChild = null;
      IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection();
      if (!selection.isEmpty()) {
        Object element = selection.getFirstElement();
        if (element instanceof IFolderChild)
          selectedFolderChild = (IFolderChild) element;
      }

      IFolder folder = (IFolder) ((selectedFolderChild instanceof IFolder) ? selectedFolderChild : null);
      IMark position = null;
      if (folder == null && selectedFolderChild != null && selectedFolderChild instanceof IMark) {
        folder = selectedFolderChild.getParent();
        position = (IMark) selectedFolderChild;
      }

      NewNewsBinAction action = new NewNewsBinAction(getShell(), folder, position);
      action.run(null);
View Full Code Here

   * @return a {@link Pair} of location as {@link IFolder} and position as
   * {@link IFolderChild} or <code>null</code> if no position can be determined.
   */
  public static Pair<IFolder, IFolderChild> getLocationAndPosition(IStructuredSelection selection) {
    IFolder folder = null;
    IFolderChild position = null;

    /* Check Selection */
    if (!selection.isEmpty()) {
      Object firstElement = selection.getFirstElement();
      if (firstElement instanceof IFolder)
View Full Code Here

    /* Return early if hidden */
    if (!fViewSite.getPage().isPartVisible(this))
      return;

    /* Change Set if required */
    IFolderChild child = element;
    while (child.getParent() != null)
      child = child.getParent();

    if (!fSelectedBookMarkSet.equals(child))
      changeSet((IFolder) child);

    /* Set Selection */
 
View Full Code Here

    fConditionLabel = new Link(this, SWT.NONE);
    fConditionLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
    fConditionLabel.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        IFolderChild selectedChild = null;
        if (e.text != null && e.text.length() > 0)
          selectedChild = fSelection.get(Integer.valueOf(e.text));

        onChangeCondition(selectedChild);
      }
View Full Code Here

        str.append(bookmark.getName()).append("\n\n"); //$NON-NLS-1$
      }

      /* Any other Folder Child */
      else if (selectedObject instanceof IFolderChild) {
        IFolderChild folderchild = (IFolderChild) selectedObject;
        str.append(folderchild.getName()).append("\n"); //$NON-NLS-1$
      }

      /* Entity Group */
      else if (selectedObject instanceof EntityGroup) {
        EntityGroup entitygroup = (EntityGroup) selectedObject;
View Full Code Here

    IFolder parentFolder = null;
    boolean requireSave = false;
    boolean on = (location == ViewerDropAdapter.LOCATION_ON);

    IFolderChild position = dropTarget != null ? (IFolderChild) dropTarget : null;

    /* Fix invalid Position */
    if (on && dropTarget instanceof IFolder)
      position = null;

    Boolean after = (location == ViewerDropAdapter.LOCATION_AFTER);
    if (position == null)
      after = null;

    /* Target is a Folder */
    if (dropTarget instanceof IFolder) {
      IFolder dropFolder = (IFolder) dropTarget;

      /* Target is the exact Folder */
      if (on)
        parentFolder = (IFolder) dropTarget;

      /* Target is below or above of the Folder */
      else
        parentFolder = dropFolder.getParent();
    }

    /* Target is a Mark */
    else if (dropTarget instanceof IMark) {
      IMark dropMark = (IMark) dropTarget;
      parentFolder = dropMark.getParent();
    }

    /* Require a Parent-Folder */
    if (parentFolder == null)
      return;

    /* Separate into Reparented FolderChildren and Re-Orders */
    List<IFolderChild> childReordering = null;
    List<ReparentInfo<IFolderChild, IFolder>> reparenting = null;

    /* For each dragged Object */
    for (Object object : draggedObjects) {

      /* Dragged Folder or Mark */
      if (object instanceof IFolder || object instanceof IMark) {
        IFolderChild draggedFolderChild = (IFolderChild) object;

        /* Reparenting to new Parent */
        if (!draggedFolderChild.getParent().equals(parentFolder)) {
          if (reparenting == null)
            reparenting = new ArrayList<ReparentInfo<IFolderChild, IFolder>>(draggedObjects.size());

          ReparentInfo<IFolderChild, IFolder> reparentInfo = ReparentInfo.create(draggedFolderChild, parentFolder, position, after);
          reparenting.add(reparentInfo);
View Full Code Here

TOP

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

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.