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]);
}
}
}
}