Package com.salas.bb.core

Examples of com.salas.bb.core.GlobalModel


    public void actionPerformed(ActionEvent e)
    {
        GlobalController controller = GlobalController.SINGLETON;
        IFeedDisplay feedDisplay = controller.getMainFrame().getArticlesListPanel().getFeedView();

        GlobalModel model = GlobalModel.SINGLETON;
        final IArticle selectedArticle = model.getSelectedArticle();

        boolean articleWasSelected = feedDisplay.selectPreviousArticle(INavigationModes.MODE_UNREAD);

        if (selectedArticle != null)
        {
            // Mark an article as read and update stats
            GlobalController.readArticles(true,
                model.getSelectedGuide(),
                model.getSelectedFeed(),
                selectedArticle);

            // Focus traversal is asynchronous. During the next article selection
            // it was moved to the next article, but when current article will be
            // removed the focus will be forwarded away from the display. We need
View Full Code Here


     * @param e action event details object.
     */
    public void actionPerformed(ActionEvent e)
    {
        final GlobalController controller = GlobalController.SINGLETON;
        final GlobalModel model = controller.getModel();

        if (model != null)
        {
            final IGuide currentGuide = model.getSelectedGuide();
            final GuidesSet cgs = model.getGuidesSet();

            IGuide guide = findNextGuideWithUnread(cgs, currentGuide);

            // EDT !!!
            if (guide != null) GlobalController.SINGLETON.selectGuide(guide, false);
View Full Code Here

     *
     * @param e event object.
     */
    public void actionPerformed(ActionEvent e)
    {
        GlobalModel model = GlobalModel.SINGLETON;

        // Get the lead article
        IArticle lead = model.getSelectedArticle();
        if (lead == null) return;

        // Get the state of the lead, invert it and populate
        boolean newState = !lead.isPinned();

        GlobalController.pinArticles(newState,
            model.getSelectedGuide(),
            model.getSelectedFeed(),
            model.getSelectedArticles());
    }
View Full Code Here

     *
     * @param e action event details object.
     */
    public void actionPerformed(ActionEvent e)
    {
        GlobalModel model = GlobalModel.SINGLETON;
        IArticle[] articles = model.getSelectedArticles();
        if (articles == null || articles.length == 0) return;

        int i = 0;
        URL[] urls = new URL[articles.length];
        for (IArticle article : articles) urls[i++] = article.getLink();

        boolean hrefFormat = model.getUserPreferences().isCopyLinksInHrefFormat();

        CommonUtils.copyURLsToClipboard(urls, hrefFormat);
    }
View Full Code Here

     *
     * @param event original event object.
     */
    protected void doAction(ActionEvent event)
    {
        GlobalModel model = GlobalModel.SINGLETON;
        GlobalController.readArticles(true,
            model.getSelectedGuide(),
            model.getSelectedFeed(),
            model.getSelectedArticles());
    }
View Full Code Here

    }

    /** Invoked when an action occurs. */
    public void actionPerformed(ActionEvent e)
    {
        GlobalModel model = GlobalModel.SINGLETON;
        GlobalController controller = GlobalController.SINGLETON;
        GuidesList guidesList = controller.getMainFrame().getGudiesPanel().getGuidesList();

        GuidesSet set = model.getGuidesSet();

        IGuide selectedGuide = model.getSelectedGuide();

        sortGuidesSet(set);

        if (selectedGuide != null)
        {
View Full Code Here

     *
     * @param event original event object.
     */
    public void actionPerformed(ActionEvent event)
    {
        GlobalModel model = GlobalModel.SINGLETON;
        final IGuide guide = model.getSelectedGuide();
        if (guide != null)
        {
            boolean oldPublishingEnabled = guide.isPublishingEnabled();

            GuidesSet set = model.getGuidesSet();
            MainFrame mainFrame = GlobalController.SINGLETON.getMainFrame();

            // Figure out if the publishing limit is already hit
            FeatureManager featureManager = GlobalController.SINGLETON.getFeatureManager();
            int pubLimit = featureManager.getPublicationLimit();
            boolean pubLimitReached = pubLimit > -1 && set.countPublishedGuides() >= pubLimit;

            boolean actAvailable = model.getServicePreferences().isAccountInformationEntered();
            EditGuideDialog dialog = new EditGuideDialog(mainFrame, actAvailable, pubLimit, pubLimitReached);
            dialog.open(set, guide);

            if (!dialog.hasBeenCanceled())
            {
View Full Code Here

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

        GlobalController.readFeeds(true, model.getSelectedGuide(), feed);
        super.actionPerformed(e);
    }
View Full Code Here

         * Performs an action when triggered.
         */
        protected void doAction()
        {
            IArticle article = getArticle();
            GlobalModel model = GlobalModel.SINGLETON;

            // Mark an article as read and update stats
            GlobalController.readArticles(true,
                model.getSelectedGuide(),
                model.getSelectedFeed(),
                article);

            super.doAction();

            IFeed feed = HTMLArticleDisplay.this.article.getFeed();
View Full Code Here

            IArticle article = display.getArticle();
            if (article != null) articles.add(article);
        }

        // Mark articles as read and update statistics
        GlobalModel model = GlobalModel.SINGLETON;
        GlobalController.readArticles(markAsRead,
            model.getSelectedGuide(),
            model.getSelectedFeed(),
            articles.toArray(new IArticle[articles.size()]));
    }
View Full Code Here

TOP

Related Classes of com.salas.bb.core.GlobalModel

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.