Package tvbrowser.extras.favoritesplugin.core

Examples of tvbrowser.extras.favoritesplugin.core.Favorite


    });
    return result;
  }

  public Object createDataObject(Object obj) {
    Favorite fav = (Favorite)obj;
    fav.setRemindAfterDownload(mCheckOnUpdateCb.isSelected());
    if (mReminderCb.isSelected()) {
      fav.getReminderConfiguration().setReminderServices(new String[]{ReminderConfiguration.REMINDER_DEFAULT});
    }
    else {
      fav.getReminderConfiguration().setReminderServices(new String[]{});
    }
    return fav;
  }
View Full Code Here


    mTimePeriodChooser.setEnabled(mTimeCb.isSelected());

  }

  public Object createDataObject(Object obj) {
    Favorite fav = (Favorite)obj;
    if (mChannelCb.isSelected()) {
      fav.getLimitationConfiguration().setChannels(mChannelArr);
    }
    if (mTimeCb.isSelected()) {
      fav.getLimitationConfiguration().setTime(mTimePeriodChooser.getFromTime(), mTimePeriodChooser.getToTime());
    }
    if (mDayOfWeekCb.isSelected()) {
      int dayOfWeek = ((Integer)mDayOfWeekCombo.getSelectedItem()).intValue();
      fav.getLimitationConfiguration().setDayLimit(dayOfWeek);
      if (!mTimeCb.isSelected()) {
        fav.getLimitationConfiguration().setTime(0, 24*60-1);
      }
    }
    return obj;
  }
View Full Code Here

      return new ActionMenu(action);
    }
    else {
      ContextMenuAction[] subItems = new ContextMenuAction[favArr.length];
      for (int i=0; i<subItems.length; i++) {
        final Favorite fav = favArr[i];
        subItems[i] = new ContextMenuAction(favArr[i].getName());
        subItems[i].setSmallIcon(FavoritesPlugin.getFavoritesIcon(16));
        subItems[i].setActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e) {
            FavoritesPlugin.getInstance().showExcludeProgramsDialog(fav, program);
View Full Code Here

      return new ActionMenu(action);
    }
    else {
      ContextMenuAction[] subItems = new ContextMenuAction[favArr.length];
      for (int i=0; i<subItems.length; i++) {
        final Favorite fav = favArr[i];
        subItems[i] = new ContextMenuAction(favArr[i].getName());
        subItems[i].setSmallIcon(FavoritesPlugin.getFavoritesIcon(16));
        subItems[i].setActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e) {
            FavoritesPlugin.getInstance().showManageFavoritesDialog(fav);
View Full Code Here

      return new ActionMenu(action);
    }
    else {
      ContextMenuAction[] subItems = new ContextMenuAction[favArr.length];
      for (int i=0; i<subItems.length; i++) {
        final Favorite fav = favArr[i];
        subItems[i] = new ContextMenuAction(favArr[i].getName());
        subItems[i].setSmallIcon(FavoritesPlugin.getFavoritesIcon(16));
        subItems[i].setActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e) {
            FavoritesPlugin.getInstance().editFavorite(fav);
View Full Code Here

        return new ActionMenu(action);
      }
      else {
        ContextMenuAction[] subItems = new ContextMenuAction[favArr.length];
        for (int i=0; i<subItems.length; i++) {
          final Favorite fav = favArr[i];
          subItems[i] = new ContextMenuAction(favArr[i].getName());
          subItems[i].setSmallIcon(FavoritesPlugin.getFavoritesIcon(16));
          subItems[i].setActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e) {
              FavoritesPlugin.getInstance().askAndDeleteFavorite(fav);
View Full Code Here

      }

      ContextMenuAction[] reactivateAction = new ContextMenuAction[fromList.size()];

      for(int i = 0; i < fromList.size(); i++) {
        final Favorite fav = fromList.get(i);
        reactivateAction[i] = new ContextMenuAction(fav.getName());
        reactivateAction[i].setSmallIcon(FavoritesPlugin.getFavoritesIcon(16));
        reactivateAction[i].setActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            fav.removeFromBlackList(program);
          }
        });
      }

      if(!fromList.isEmpty()) {
View Full Code Here

      ScrollableJPanel panel = new ScrollableJPanel();
      panel.setBorder(BorderFactory.createEmptyBorder(0,1,0,1));
      panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));

      for(Favorite fav : errorFavorites) {
        final Favorite finalFav = fav;
        panel.add(UiUtilities.createHtmlHelpTextArea("<a href=\"#link\">" + fav.getName() + "</a>",new HyperlinkListener() {
          public void hyperlinkUpdate(HyperlinkEvent e) {
            if(e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
              editFavorite(finalFav);
            }
View Full Code Here

  }

  private void showCreateFavoriteWizardInternal(Program program, String actor,
      String topic) {
    Window parent = UiUtilities.getLastModalChildOf(MainFrame.getInstance());
    Favorite favorite;
    if (isUsingExpertMode()) {
      favorite = new AdvancedFavorite(program != null ? program.getTitle() : "");
      EditFavoriteDialog dlg = new EditFavoriteDialog(parent, favorite);
      UiUtilities.centerAndShow(dlg);
      if (!dlg.getOkWasPressed()) {
        favorite = null;
      }

    } else {
      WizardHandler handler;
      TypeWizardStep initialStep = new TypeWizardStep(program);
      if (topic != null) {
        initialStep.setTopic(topic);
      } else if (actor != null) {
        initialStep.setActor(actor);
      }
      handler = new WizardHandler(parent, initialStep);
      favorite = (tvbrowser.extras.favoritesplugin.core.Favorite)handler.show();
    }

    if (favorite != null) {
      try {
        favorite.updatePrograms();
        FavoriteTreeModel.getInstance().addFavorite(favorite);

        if(ManageFavoritesDialog.getInstance() != null) {
          ManageFavoritesDialog.getInstance().addFavorite(favorite, null);
        }

      }catch (TvBrowserException exc) {
        ErrorHandler.handle(mLocalizer.msg("couldNotUpdateFavorites","Could not update favorites."), exc);
      }

      if (program != null && favorite.getPrograms().length == 0 && !favorite.isRemindAfterDownload()) {
        Object[] options = {mLocalizer.msg("btn.notifyMe","Notify Me"), mLocalizer.msg("btn.editFavorite","Edit Favorite"), mLocalizer.msg("btn.ignore","Ignore")};
        int option = JOptionPane.showOptionDialog(parent, mLocalizer.msg("dlg.noMatchingPrograms","Currently no program matches the newly created favorite.\n\nDo you want TV-Browser to notify you when any program matches this favorite?"),
                  mLocalizer.msg("dlg.title.information","Information"),
                  JOptionPane.YES_NO_OPTION,
                  JOptionPane.INFORMATION_MESSAGE,
                  null,
                  options,
                  options[0]);
        if (option == JOptionPane.YES_OPTION) {
         favorite.setRemindAfterDownload(true);
        }
        else if (option == JOptionPane.NO_OPTION) {
          editFavorite(favorite);
        }
      }

      else if (program != null && !favorite.contains(program)) {
        // only show a warning for non matching favorites if the program is older than today
        if (program.getDate().compareTo(new devplugin.Date()) >= 0) {
          Object[] options = {mLocalizer.msg("btn.editFavorite","Edit Favorite"), mLocalizer.msg("btn.ignore","Ignore")};
          if (JOptionPane.showOptionDialog(parent, mLocalizer.msg("dlg.programDoesntMatch","The currently selected program does not belong to the newly created favorite.\n\nDo you want to edit the favorite?"),
              mLocalizer.msg("dlg.title.warning","Warning"),
View Full Code Here

        changeProgramList((Favorite)mFavoritesList.getSelectedValue());
      }
    }
    else {
      if(mFavoriteTree != null && mFavoriteTree.getSelectionPath() != null) {
        Favorite fav = ((FavoriteNode)mFavoriteTree.getSelectionPath().getLastPathComponent()).getFavorite();

        if(fav != null) {
          enableButtons(true);
          changeProgramList(fav);
          mDeleteBt.setEnabled(true);
View Full Code Here

TOP

Related Classes of tvbrowser.extras.favoritesplugin.core.Favorite

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.