Examples of ITaggable


Examples of com.salas.bb.domain.ITaggable

     */
    void addMissingTagsFromTaggable(Object object)
    {
        if (object instanceof ITaggable)
        {
            ITaggable taggable = (ITaggable)object;
            String[] userTags = taggable.getUserTags();
            if (userTags != null) addMissingTags(userTags);
        }
    }
View Full Code Here

Examples of com.salas.bb.domain.ITaggable

    {
        if (property.equals(IArticle.PROP_PINNED) && ((Boolean)newValue) &&
            prefs.isPinTagging() && StringUtils.isNotEmpty(prefs.getPinTags()) &&
            article instanceof ITaggable)
        {
            ITaggable tarticle = (ITaggable)article;
            String pinTags = prefs.getPinTags();

            // Merge tags
            String[] tags = tarticle.getUserTags();
            tags = mergeTags(tags, pinTags);

            // Create a description
            String description = tarticle.getTitle();
            if (StringUtils.isEmpty(description)) description = "No Description";

            // Set tags and the description
            tarticle.setUserTags(tags);
            tarticle.setTagsDescription(description);
            tarticle.setUnsavedUserTags(true);
        }
    }
View Full Code Here

Examples of com.salas.bb.domain.ITaggable

            initComponents();

            if (aTaggables.length == 1 && taggablesCount == 1)
            {
                ITaggable taggable = taggables[0];

                String title = taggable.getTitle();
                String description = taggable.getTagsDescription();
                String extended = taggable.getTagsExtended();
                String[] tags = taggable.getUserTags();
                String[] sharedTags = taggable.getSharedTags();
                String[] authorTags = taggable.getAuthorTags();

                setTaggableData(title, taggable.getTaggableLink().toString(),
                    description, extended, tags);

                final String flattenedTagString = createSummary(sharedTags, authorTags, false);
                final int fontStyle = isTagLabelItalics(sharedTags) ? Font.ITALIC : Font.PLAIN;
                lbSharedTags.setText(flattenedTagString);
                lbSharedTags.setToolTipText(flattenedTagString);
                lbSharedTags.setFont(lbSharedTags.getFont().deriveFont(fontStyle));

                if (autoLoad && sharedTags == null) fetchTagsAction.actionPerformed(null);

                super.open();

                if (!hasBeenCanceled()) propagateChanges(taggable, description, extended, tags);
            } else
            {
                // Multi-taggable management
                String[] descriptions = new String[taggablesCount];
                String[] extendeds = new String[taggablesCount];
                String[][] tags = new String[taggablesCount][];

                // Save original values
                for (int i = 0; i < taggables.length; i++)
                {
                    ITaggable taggable = taggables[i];
                    descriptions[i] = taggable.getTagsDescription();
                    extendeds[i] = taggable.getTagsExtended();
                    tags[i] = taggable.getUserTags();
                }

                setTaggableData(MessageFormat.format(Strings.message("tags.multitagging.title"),
                    Integer.toString(taggablesCount)),
                    null,
                    Strings.message("tags.multitagging.description"),
                    "", new String[0]);

                tfDescription.setEditable(false);
                btnFetch.setEnabled(false);

                super.open();

                if (!hasBeenCanceled())
                {
                    for (int i = 0; i < taggables.length; i++)
                    {
                        ITaggable taggable = taggables[i];
                        propagateChanges(taggable, descriptions[i], extendeds[i], tags[i]);
                    }
                }
            }
        }
View Full Code Here

Examples of com.salas.bb.domain.ITaggable

        /**
         * Loads shared tags, converts them into summary line and displays.
         */
        private void loadSharedTagsAndDisplay()
        {
            final ITaggable taggable = taggables[0];

            tagsStorage.loadSharedTags(taggable);
            String[] sharedTags = taggable.getSharedTags();
            String[] authorTags = taggable.getAuthorTags();

            // Get desired text and style for the label, return to EDT and update the label
            final String sharedTagsSummary = createSummary(sharedTags, authorTags, true);
            final int  fontStyle = isTagLabelItalics(sharedTags) ? Font.ITALIC : Font.PLAIN;
            SwingUtilities.invokeLater(new Runnable()
            {
                public void run()
                {
                    lbSharedTags.setText(sharedTagsSummary);
                    lbSharedTags.setFont(lbSharedTags.getFont().deriveFont(fontStyle));
                    lbSharedTags.setToolTipText(sharedTagsSummary);

                    // Update user tags if necessary
                    if (StringUtils.isEmpty(tfTags.getText()))
                    {
                        String[] tags = taggable.getUserTags();
                        if (tags != null && tags.length > 0)
                        {
                            tfTags.setText(StringUtils.join(tags, " "));
                        }
                    }
View Full Code Here

Examples of com.salas.bb.domain.ITaggable

     * @throws ClassCastException       if target is not supported.
     * @throws IllegalArgumentException if operation is not supported.
     */
    public boolean match(Object target, IComparisonOperation operation, String value)
    {
        ITaggable taggable = getTaggableObject(target);

        boolean matching = false;

        if (taggable != null && StringUtils.isNotEmpty(value))
        {
            String[] tags = taggable.getUserTags();
            String tagsString = tags == null ? "" : StringUtils.join(tags, " ");

            matching = operation.match(tagsString, value);
        }

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.