Examples of IGuide


Examples of com.salas.bb.domain.IGuide

     *
     * @return previous guide.
     */
    IGuide getPrevGuide(IGuide currentGuide)
    {
        IGuide prev = currentGuide;

        if (guidesSet == null)
        {
            LOG.warning(Strings.error("guide.set.not.registered"));
        } else
View Full Code Here

Examples of com.salas.bb.domain.IGuide

     * @return number of feeds were actually added.
     */
    static int appendGuide(URL baseURL, OPMLGuide opmlGuide, String uniqueTitle,
                           GuidesSet guidesSet)
    {
        IGuide guide = Helper.createGuide(baseURL, opmlGuide, null);
        guide.setTitle(uniqueTitle);
        String icon = guide.getIconKey();
        if (StringUtils.isEmpty(icon))
        {
            icon = getUnusedIcon(guidesSet);
            guide.setIconKey(icon);
        }

        // Replace feeds with existing -- sharing
        replaceFeedsWithShares(guidesSet, guide);

        // Finally add the guide
        guidesSet.add(guide);

        GlobalController.SINGLETON.getPoller().update(guide);

        return guide.getFeedsCount();
    }
View Full Code Here

Examples of com.salas.bb.domain.IGuide

        if (GlobalController.SINGLETON.checkForNewSubscription()) return;

        URL lnk = link;
        if (lnk != null)
        {
            final IGuide guide = GlobalModel.SINGLETON.getSelectedGuide();
            if (!(guide instanceof StandardGuide))
            {
                throw new IllegalArgumentException(Strings.error("invalid.guide.type"));
            }
View Full Code Here

Examples of com.salas.bb.domain.IGuide

                    break;
                default:
                    boolean cont;

                    // We can't delete dynamic direct feeds
                    IGuide guide = GlobalModel.SINGLETON.getSelectedGuide();
                    List<IGuide> otherGuides = getOtherParentGuides(feed, guide);

                    boolean noQuestions = ((event.getModifiers() & KeyEvent.SHIFT_MASK) != 0);
                    if (otherGuides.size() > 0)
                    {
                        String guidesList = "\n";
                        int i = 0;
                        for (i = 0; i < 3 && i < otherGuides.size(); i++)
                        {
                            IGuide g = otherGuides.get(i);
                            guidesList += "    - " + StringUtils.excerpt(g.getTitle(), 30) + "\n";
                        }
                        if (i < otherGuides.size()) guidesList += "    - \u2026\n";

                        String btnFromThisOnly = Strings.message("deletefeed.dialog.this.only");
                        String btnFromAllGuides = Strings.message("deletefeed.dialog.everywhere");
View Full Code Here

Examples of com.salas.bb.domain.IGuide

     * @param listURL URL of the list or <code>NULL</code> for no URL.
     */
    public static void subscribe(URL listURL)
    {
        GlobalModel model = GlobalController.SINGLETON.getModel();
        IGuide selectedGuide = model.getSelectedGuide();
        StandardGuide[] guides = model.getGuidesSet().getStandardGuides(null);

        SubscribeToReadingListDialog dialog = new SubscribeToReadingListDialog(
            GlobalController.SINGLETON.getMainFrame());
        dialog.open(guides, selectedGuide, listURL == null ? null : listURL.toString());
View Full Code Here

Examples of com.salas.bb.domain.IGuide

     * @param e action event details object.
     */
    public void actionPerformed(ActionEvent e)
    {
        final IFeed feed = GlobalModel.SINGLETON.getSelectedFeed();
        final IGuide guide = GlobalModel.SINGLETON.getSelectedGuide();

        // Reorderings are allowed only for standard guides
        if (!(guide instanceof StandardGuide)) return;

        StandardGuide sguide = (StandardGuide)guide;

        final GuideModel model = GlobalModel.SINGLETON.getGuideModel();

        // Move channel up one step if it's not already top-most.
        final int index = model.indexOf(feed);
        if (feed != null && index > 0)
        {
            // Get real index
            IFeed entry = (IFeed)model.getElementAt(index - 1);
            int realIndex = guide.indexOf(entry);

            // This selection clearing is mandatory. When we kill the last channel in the list
            // by moving it up selection moves out of bounds. To prevent this error we
            // need to disable selection prior to moving channel.
            list.clearSelection();
View Full Code Here

Examples of com.salas.bb.domain.IGuide

            public void onClassColorChanged(int cl, Color oldColor, Color newColor)
            {
                guidesList.repaint();
                if (oldColor == null || newColor == null)
                {
                    IGuide sel = GlobalModel.SINGLETON.getSelectedGuide();
                    if (sel != null) guidesList.setSelectedValue(sel, false);
                }
            }
        });
View Full Code Here

Examples of com.salas.bb.domain.IGuide

        {
            if (GlobalController.SINGLETON.checkForNewSubscription()) return;

            GlobalModel mdl = GlobalModel.SINGLETON;
            final GlobalController controller = GlobalController.SINGLETON;
            IGuide guide = null;

            int index = guidesList.locationToIndex(location);
            if (index != -1)
            {
                guide = mdl.getGuidesSet().getGuideAt(index);
View Full Code Here

Examples of com.salas.bb.domain.IGuide

        public void valueChanged(ListSelectionEvent e)
        {
            if (!e.getValueIsAdjusting() && !callbackSelection)
            {
                // Find out last selected guide index
                IGuide prevGuide = GlobalModel.SINGLETON.getSelectedGuide();
                int oldIndex = prevGuide == null ? -1 : indexOf(guidesList.getModel(), prevGuide);

                // Find out new selection index
                int selIndex = ListSelectionManager.evaluateSelectionIndex(guidesList, oldIndex);

                // Get new selected guide and update models
                ListModel model = guidesList.getModel();
                IGuide guide = selIndex == -1 ? null : (IGuide)model.getElementAt(selIndex);

                if (DNDListContext.isDragging())
                {
                    DNDListContext.setDestination(guide);
                } else
View Full Code Here

Examples of com.salas.bb.domain.IGuide

                int insertPosition = source.getInsertPosition();
                Object[] guidesI = object.getItems();

                if (insertPosition >= 0 && guidesI.length > 0)
                {
                    IGuide currentSelection = GlobalModel.SINGLETON.getSelectedGuide();
                    int oldSelectionIndex = currentSelection == null
                        ? -1 : model.indexOf(currentSelection);

                    boolean selectedGuideMoved = false;

                    // We need to translate insert position into guide set coordinates
                    if (insertPosition < guidesListModel.getSize())
                    {
                        IGuide after = (IGuide)guidesListModel.getElementAt(insertPosition);
                        insertPosition = model.indexOf(after);
                    } else if (guidesListModel.getSize() > 0)
                    {
                        IGuide before = (IGuide)guidesListModel.getElementAt(insertPosition - 1);
                        insertPosition = model.indexOf(before) + 1;
                    } else insertPosition = 0;

                    // Move selected guides now
                    int index = insertPosition;
                    for (int i = 0; i < guidesI.length; i++)
                    {
                        IGuide guide = (IGuide)guidesI[guidesI.length - i - 1];

                        int currentIndex = model.indexOf(guide);
                        if (currentIndex < index) index--;
                        selectedGuideMoved |= currentIndex == oldSelectionIndex;
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.