Examples of Feed


Examples of org.wiztools.commons.feed.Feed

    public void testGetFeed() throws Exception {
        System.out.println("getFeed");

        URL url = new File("src/test/resources/wiztools-atom.xml").toURI().toURL();
        FeedExecuter instance = new AbderaFeedExecuter();
        Feed result = instance.getFeed(url);
        List<FeedEntry> outEntries = result.getEntries();
        for(FeedEntry entry : outEntries){
            System.out.println("\n\n\t title: "+ entry.getTitle());
        }
        assertEquals(result.getEntries().size(), 9);
    }
View Full Code Here

Examples of unify.data.Feed

          //Unused
          break;
        case TableModelEvent.UPDATE:
          ArrayList<Feed> feeds = new ArrayList<Feed>();
          feeds.addAll(Settings.getInstance().getFeeds());
          Feed feed = feeds.get(row);
          String value = (String) feedTableModel.getValueAt(row, col);
          if(col==0 && !value.isEmpty()) {
            feed.setLabel(value);
          }
          else if(col==1 && !value.isEmpty()) {
            try {
              new URL(value);
              feed.setLink(value);
            }
            catch (MalformedURLException exception) {
              JOptionPane.showMessageDialog(frame, value + " is not a valid url, please try again.", "Warning: Invalid url", JOptionPane.ERROR_MESSAGE);
            }
          }
          else if(col==2) {
            try {
              feed.setPriority(Integer.parseInt(value));
            }
            catch (NumberFormatException exception) {
              JOptionPane.showMessageDialog(frame, value + " is not an integer, please try again.", "Warning: Not an integer", JOptionPane.ERROR_MESSAGE);
            }
          }
          updateFeedTable(true);
          break;
        case TableModelEvent.DELETE:
          //Unused
          break;
        }
      }
    });

    feedTable.getColumnModel().getColumn(1).setPreferredWidth(300);

    JPanel feedSettingsButtonPanel = new JPanel();
    GridBagConstraints gbc_feedSettingsButtonPanel = new GridBagConstraints();
    gbc_feedSettingsButtonPanel.weightx = 0.1;
    gbc_feedSettingsButtonPanel.fill = GridBagConstraints.BOTH;
    gbc_feedSettingsButtonPanel.gridx = 0;
    gbc_feedSettingsButtonPanel.gridy = 1;
    feedSettingsPanel.add(feedSettingsButtonPanel, gbc_feedSettingsButtonPanel);

    JButton btnAddFeed = new JButton("Add Feed");
    btnAddFeed.addMouseListener(new MouseAdapter() {
      public void mouseClicked(MouseEvent e) {
        String inputLabel = JOptionPane.showInputDialog(frame, "Enter the feed name: ");
        String inputURL = JOptionPane.showInputDialog(frame, "Enter the feed URL: ");
        String inputPriority = JOptionPane.showInputDialog(frame, "Enter the feed priority: ");
        try {
          new URL(inputURL);
          int priority = Integer.parseInt(inputPriority);
          Feed feed = new Feed(inputLabel, inputURL, priority);
          Settings.getInstance().addFeed(feed);
          updateFeedTable(true);
        } catch (MalformedURLException ex) {
          JOptionPane.showMessageDialog(frame, inputURL + " is not a valid url, please try again.", "Warning: Invalid url", JOptionPane.ERROR_MESSAGE);
        } catch (NumberFormatException ex) {
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.