Package es.java.otro.model

Examples of es.java.otro.model.Feed


    log.debug("init FeedServiceImpl");
  }
 
  @Override
  public void test() {
    feedDao.addFeed(new Feed());

  }
View Full Code Here


   * .lang.Object)
   */
  @Override
  public Object[] getElements(Object inputElement) {
    if (inputElement instanceof Feed) {
      Feed feed = (Feed) inputElement;
      return feed.getEntries().toArray();
    } else {
      return new Object[0];
    }
  }
View Full Code Here

  public Object[] getChildren(Object parentElement) {
    if (parentElement instanceof Root) {
      Root root = (Root) parentElement;
      return root.getFeeds().toArray();
    } else if (parentElement instanceof Feed) {
      Feed feed = (Feed) parentElement;
      return feed.getEntries().toArray();
    } else {
      return new Object[0];
    }
  }
View Full Code Here

  public boolean hasChildren(Object element) {
    if (element instanceof Root) {
      Root root = (Root) element;
      return !root.getFeeds().isEmpty();
    } else if (element instanceof Feed) {
      Feed feed = (Feed) element;
      return !feed.getEntries().isEmpty();
    } else
      return false;
  }
View Full Code Here

  }

  @Override
  public String getText(Object element) {
    if (element instanceof Feed) {
      Feed feed = (Feed) element;
      return feed.getName();
    } else if (element instanceof Root) {
      return "Feeds";
    } else if (element instanceof Entry) {
      Entry entry = (Entry) element;
      return entry.getTitle();
View Full Code Here

      //  browser.openURL(new URL("http://www.eclipse.org"));

      UrlDialog url = new UrlDialog(HandlerUtil.getActiveShell(event));
      url.open();
      String feedUrl = url.getUrl();
      Feed f = RssUtil.createFeed(feedUrl);
      Root.getInstance().addFeed(f);
    } catch ( Exception e) {
        e.printStackTrace();
       
    }
View Full Code Here

public class DeleteFeedAction extends ActionDelegate {
  private ISelection selection;
  @Override
  public void run(IAction action) {
    System.out.println();;
    Feed feed = (Feed) ((StructuredSelection)selection).getFirstElement();
    feed.getRoot().removeFeed(feed);
  }
View Full Code Here

    } catch (Exception e) {
      MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Load Error", "Unable to load "
          +feedUrl+" ("+e.getMessage()+")");
     
    }
    Feed f = null;
    if (feed != null) {
      feed.getEntries();
      f = new Feed();
      f.setName(feed.getTitle());
      f.setUrl(feed.getLink());
      for (Iterator it = feed.getEntries().iterator(); it.hasNext();) {
        SyndEntry entry = (SyndEntry) it.next();
        Entry modelEntry = new Entry();
        modelEntry.setTitle(entry.getTitle());
        modelEntry.setUrl(entry.getLink());
        modelEntry.setPublishDate(entry.getPublishedDate());
        modelEntry.setAuthor(entry.getAuthor());
        modelEntry.setHtml(entry.getDescription().getValue());
        f.addEntry(modelEntry);

      }
    }
    return f;
  }
View Full Code Here

TOP

Related Classes of es.java.otro.model.Feed

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.