Author: sdzmitrovich
Date: 2008-04-02 12:22:17 -0400 (Wed, 02 Apr 2008)
New Revision: 7270
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.properties
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1373
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-04-02 16:07:01 UTC (rev
7269)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-04-02 16:22:17 UTC (rev
7270)
@@ -46,7 +46,11 @@
<provisionalDefinition
type="showintarget"
value="org.eclipse.jdt.ui.PackageExplorer"
- target="org.eclipse.jst.jsp.core.jspsource"/>
+ target="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"/>
+ <provisionalDefinition
+ type="showintarget"
+ value="org.jboss.tools.jst.web.ui.navigator.WebProjectsView"
+ target="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"/>
<provisionalDefinition
type="preferencepages"
value="org.eclipse.wst.sse.ui.preferences.jsp.occurrences"
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.properties 2008-04-02
16:07:01 UTC (rev 7269)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPEditorMessages.properties 2008-04-02
16:22:17 UTC (rev 7270)
@@ -1,4 +1,5 @@
JSPMultiPageEditor.TabLabel.VisualSource = Visual/Source
JSPMultiPageEditor.TabLabel.Visual = Visual
JSPMultiPageEditor.TabLabel.Source = Source
-JSPMultiPageEditor.TabLabel.Preview = Preview
\ No newline at end of file
+JSPMultiPageEditor.TabLabel.Preview = Preview
+JSPMultiPageEditor.ContextMenu.ShowInMenu = Show In
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-04-02
16:07:01 UTC (rev 7269)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-04-02
16:22:17 UTC (rev 7270)
@@ -16,6 +16,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextListener;
@@ -57,6 +60,7 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.actions.ContributionItemFactory;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
@@ -127,6 +131,8 @@
import org.w3c.dom.Node;
import org.w3c.dom.Text;
+import com.sun.org.apache.xpath.internal.operations.Minus;
+
/**
* @author Jeremy
*
@@ -150,6 +156,8 @@
protected SourceEditorPageContext pageContext = null;
private TextEditorDropProviderImpl textEditorDropProvider;
+
+ private static final String SHOW_IN_MENU =
"JSPMultiPageEditor.ContextMenu.ShowInMenu"; //$NON-NLS-1$
public JSPTextEditor(JSPMultiPageEditor parentEditor) {
JspEditorPlugin.getDefault().initDefaultPluginPreferences();
@@ -1202,4 +1210,31 @@
}
return false;
}
+
+ @Override
+ public void editorContextMenuAboutToShow(IMenuManager menu) {
+
+ super.editorContextMenuAboutToShow(menu);
+
+ /*
+ * added by Dmitrovich Sergey JBIDE-1373 so as StructuredTextEditor
+ * create context menu by hard code. The easiest way to add "show in"
+ * menu is insert to prepared by
+ * StructuredTextEditorStructuredTextEditor
+ */
+
+ MenuManager showInSubMenu = new MenuManager(getShowInMenuLabel());
+ showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN
+ .create(getEditorSite().getWorkbenchWindow()));
+ menu.insertBefore(ITextEditorActionConstants.GROUP_COPY, new Separator(
+ ITextEditorActionConstants.GROUP_SHOW_IN));
+ menu.appendToGroup(ITextEditorActionConstants.GROUP_SHOW_IN,
+ showInSubMenu);
+
+ }
+
+ private String getShowInMenuLabel() {
+
+ return JSPEditorMessages.getString(SHOW_IN_MENU);
+ }
}