Author: dvinnichek
Date: 2010-10-29 05:41:18 -0400 (Fri, 29 Oct 2010)
New Revision: 26124
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.properties
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java
Log:
add vpe preferences to right-click popup
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.properties 2010-10-29 09:36:18 UTC (rev
26123)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.properties 2010-10-29 09:41:18 UTC (rev
26124)
@@ -13,7 +13,7 @@
exportUserTagsTemplatesWizardDescription=Export User specified tag templates to the local
file system
importUserTagsTemplatesWizardName=User specified tag templates
importUserTagsTemplatesWizardDescription=Import User specified tag templates from the
local file system
-vpe.menu.name=Vpe Menu
+vpe.menu.preferences=Vpe Preferences
vpe.toolbar.preferences=Preferences
vpe.toolbar.refresh=Refresh
vpe.toolbar.page_design_options=Page Design Options
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2010-10-29 09:36:18 UTC (rev 26123)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2010-10-29 09:41:18 UTC (rev 26124)
@@ -165,6 +165,16 @@
<extension
point="org.eclipse.ui.menus">
<menuContribution
+
locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor.source.EditorContext?after=paste">
+ <separator
+ name="org.jboss.tools.insertGroup" visible="true"
>
+ </separator>
+ <dynamic
+
class="org.jboss.tools.vpe.editor.menu.InsertContributionItem"
+
id="org.jboss.tools.vpe.editor.menu.InsertContributionItem">
+ </dynamic>
+ </menuContribution>
+ <menuContribution
locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor.source.EditorContext?after=paste">
<separator
name="org.jboss.tools.insertGroup" visible="true"
>
@@ -175,6 +185,13 @@
</dynamic>
</menuContribution>
<menuContribution
+
locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor.source.EditorContext?after=org.jboss.tools.vpe.editor.menu.InsertContributionItem">
+ <dynamic
+
class="org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem"
+
id="org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem">
+ </dynamic>
+ </menuContribution>
+ <menuContribution
locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor.source.EditorContext?after=org.jboss.tools.vpe.editor.menu.InsertContributionItem">
<dynamic
class="org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem"
@@ -182,10 +199,13 @@
</dynamic>
</menuContribution>
<menuContribution
-
locationURI="menu:sourceMenuId?after=org.jboss.tools.jst.jsp.menus.i18">
+ locationURI="popup:org.eclipse.ui.popup.any?after=additions">
+ <separator
+ name="org.jboss.tools.separator.vpePrefs" visible="true"
>
+ </separator>
<menu
- id="org.jboss.tools.vpe.menus.VpeMenu"
- label="%vpe.menu.name"
+ id="org.jboss.tools.vpe.menus.VpePreferences"
+ label="%vpe.menu.preferences"
mnemonic="M">
<command
commandId="org.jboss.tools.vpe.commands.preferencesCommand"
@@ -313,29 +333,8 @@
</visibleWhen>
</command>
</menuContribution>
- </extension>
+ </extension>
<extension
- point="org.eclipse.ui.menus">
- <menuContribution
-
locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor.source.EditorContext?after=paste">
- <separator
- name="org.jboss.tools.insertGroup" visible="true"
>
- </separator>
- <dynamic
-
class="org.jboss.tools.vpe.editor.menu.InsertContributionItem"
-
id="org.jboss.tools.vpe.editor.menu.InsertContributionItem">
- </dynamic>
- </menuContribution>
- <menuContribution
-
locationURI="popup:org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor.source.EditorContext?after=org.jboss.tools.vpe.editor.menu.InsertContributionItem">
- <dynamic
-
class="org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem"
-
id="org.jboss.tools.vpe.editor.menu.SetupTemplateContributionItem">
- </dynamic>
- </menuContribution>
- </extension>
-
- <extension
point="org.eclipse.ui.exportWizards">
<wizard
id="org.jboss.tools.vpe.editor.wizards.ExportUserTagsTemplatesMenuWizard"
@@ -346,9 +345,8 @@
%exportUserTagsTemplatesWizardDescription
</description>
</wizard>
- </extension>
-
- <extension
+ </extension>
+ <extension
point="org.eclipse.ui.importWizards">
<wizard
id="org.jboss.tools.vpe.editor.wizards.ImportUserTagsTemplatesMenuWizard"
@@ -387,6 +385,4 @@
class="org.jboss.tools.vpe.handlers.ShowBundleAsELHandler"
commandId="org.jboss.tools.vpe.commands.showBundleAsELCommand"/>
</extension>
-
-
</plugin>
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java 2010-10-29
09:36:18 UTC (rev 26123)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java 2010-10-29
09:41:18 UTC (rev 26124)
@@ -19,7 +19,9 @@
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.menus.IMenuService;
import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.jboss.tools.jst.jsp.i18n.ExternalizeStringsContributionItem;
@@ -28,10 +30,10 @@
import org.jboss.tools.vpe.editor.VpeEditorPart;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.jboss.tools.vpe.editor.menu.action.ComplexAction;
import org.jboss.tools.vpe.editor.menu.action.EditAttributesAction;
import org.jboss.tools.vpe.editor.menu.action.SelectThisTagAction;
import org.jboss.tools.vpe.editor.menu.action.StripTagAction;
-import org.jboss.tools.vpe.editor.menu.action.ComplexAction;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.template.IZoomEventManager;
import org.jboss.tools.vpe.editor.util.SelectionUtil;
@@ -46,6 +48,9 @@
* @author yradtsevich (based on the implementation of MenuCreationHelper)
*/
public class VpeMenuCreator {
+
+ private static final String VPE_PREFERENCES_MENU_URI =
"popup:org.eclipse.ui.popup.any?after=additions"; //$NON-NLS-1$
+
private final MenuManager menuManager;
private final VpeMenuUtil vpeMenuUtil;
private final Node node;
@@ -90,13 +95,13 @@
menuManager.add(new InsertContributionItem(node));
addIfEnabled(new StripTagAction(node));
/*
- *
https://jira.jboss.org/browse/JBIDE-7222
- * Adding ExternalizeStrings dialog to the VPE context menu
+ *
https://jira.jboss.org/browse/JBIDE-7222 Adding ExternalizeStrings
+ * dialog to the VPE context menu
*/
- if (ExternalizeStringsUtils.isSelectionCorrect(
- vpeMenuUtil.getSelection())) {
+ if (ExternalizeStringsUtils.isSelectionCorrect(vpeMenuUtil
+ .getSelection())) {
menuManager.add(new ExternalizeStringsContributionItem());
- }
+ }
addSeparator();
if (topLevelMenu) {
addZoomActions();
@@ -108,11 +113,25 @@
addIfEnabled(new DumpMappingAction());
addIfEnabled(new TestAction());
}
+
addSeparator();
+ addVpePreferences();
+
+ addSeparator();
addCutCopyPasteActions(topLevelMenu);
}
/**
+ * Adds vpe preferences.
+ */
+ private void addVpePreferences() {
+ IMenuService menuService = (IMenuService) PlatformUI.getWorkbench()
+ .getService(IMenuService.class);
+ menuService.populateContributionManager(menuManager,
+ VPE_PREFERENCES_MENU_URI);
+ }
+
+ /**
* Creates the Cut, Copy and Paste actions.
*/
private void addCutCopyPasteActions(boolean topLevelMenu) {
@@ -227,8 +246,7 @@
final MozillaEditor visualEditor = vpeMenuUtil.getMozillaEditor();
DOMTreeDumper dumper = new DOMTreeDumper(
VpeDebug.VISUAL_DUMP_PRINT_HASH);
- dumper
- .setIgnoredAttributes(VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES);
+ dumper.setIgnoredAttributes(VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES);
dumper.dumpToStream(System.out, visualEditor.getDomDocument());
}
@@ -257,8 +275,7 @@
if (nodeMapping != null) {
DOMTreeDumper dumper = new DOMTreeDumper(
VpeDebug.VISUAL_DUMP_PRINT_HASH);
- dumper
- .setIgnoredAttributes(VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES);
+ dumper.setIgnoredAttributes(VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES);
dumper.dumpNode(nodeMapping.getVisualNode());
}
}
@@ -293,7 +310,8 @@
IZoomEventManager zoomEventManager = ((VpeEditorPart) vpeMenuUtil
.getEditor().getVisualEditor()).getController()
.getZoomEventManager();
- ZoomActionMenuManager manager = new ZoomActionMenuManager(zoomEventManager);
+ ZoomActionMenuManager manager = new ZoomActionMenuManager(
+ zoomEventManager);
menuManager.add(manager);
}
}