public void actionPerformed(ActionEvent e)
{
BloggingPreferences bloggingPreferences = GlobalModel.SINGLETON.getUserPreferences().getBloggingPreferences();
if (type.isAvailable() && bloggingPreferences.getBlogsCount() > 0)
{
GlobalController controller = GlobalController.SINGLETON;
TargetBlog targetBlog = bloggingPreferences.getDefaultBlog();
String templateName = e.getActionCommand();
if (!Templates.isExisting(templateName))
{
templateName = targetBlog.getTemplateName();
// See if the user wants to change the template dynamically
if ((e.getModifiers() & KeyEvent.SHIFT_MASK) != 0 && type.isTemplateChangeSupported())
{
// Ask for mode in a popup menu and repeat the event
MainFrame frame = controller.getMainFrame();
Point point = MouseInfo.getPointerInfo().getLocation();
SwingUtilities.convertPointFromScreen(point, frame);
JPopupMenu menu = new JPopupMenu();
Collection<Template> templates = Templates.getUserTemplates().values();
for (Template template : templates)
{
menu.add(new PostToBlogTemplateAction(template.getName()));
}
menu.show(frame, (int)point.getX(), (int)point.getY());
return;
}
}
AbstractPostEditor editor;
MainFrame frame = controller.getMainFrame();
FeatureManager fm = controller.getFeatureManager();
boolean isRichEditor = bloggingPreferences.isRichEditor() || !fm.isPtbAdvanced();
if (fm.isPtbAdvanced())
{
PostEditorAdv edAdv = new PostEditorAdv(frame, isRichEditor);
java.util.List<TargetBlog> blogs = bloggingPreferences.getBlogs();