Author: mareshkau
Date: 2010-11-26 10:44:07 -0500 (Fri, 26 Nov 2010)
New Revision: 26982
Added:
trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/commands/
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/commands/sidebyside/
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/commands/sidebyside/SideBySideHandler.java
Removed:
trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/src/org/jboss/tools/common/ui/sidebyside/handlers/SideBySideHandler.java
Modified:
trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/plugin.xml
trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.ui/build.properties
trunk/common/plugins/org.jboss.tools.common.ui/plugin.properties
Log:
https://jira.jboss.org/browse/JBIDE-6083
Modified: trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2010-11-26
15:37:40 UTC (rev 26981)
+++ trunk/common/plugins/org.jboss.tools.common.ui/META-INF/MANIFEST.MF 2010-11-26
15:44:07 UTC (rev 26982)
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.jboss.tools.common.ui
+Bundle-SymbolicName: org.jboss.tools.common.ui;singleton:=true
Bundle-Version: 3.2.0.qualifier
Require-Bundle: org.eclipse.osgi,
org.jboss.tools.common,
Modified: trunk/common/plugins/org.jboss.tools.common.ui/build.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/build.properties 2010-11-26 15:37:40
UTC (rev 26981)
+++ trunk/common/plugins/org.jboss.tools.common.ui/build.properties 2010-11-26 15:44:07
UTC (rev 26982)
@@ -2,4 +2,5 @@
bin.includes = META-INF/,\
plugin.properties,\
.,\
- about.html
+ about.html,\
+ plugin.xml
Modified: trunk/common/plugins/org.jboss.tools.common.ui/plugin.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/plugin.properties 2010-11-26 15:37:40
UTC (rev 26981)
+++ trunk/common/plugins/org.jboss.tools.common.ui/plugin.properties 2010-11-26 15:44:07
UTC (rev 26982)
@@ -1,3 +1,5 @@
#Properties file for org.jboss.tools.common.ui
Bundle-Vendor.0 = JBoss by Red Hat
-Bundle-Name.0 = JBoss Tools Common UI Plug-in
\ No newline at end of file
+Bundle-Name.0 = JBoss Tools Common UI Plug-in
+command.newEditor.sidebyside.description = Open New Editor Side By Side for Active
Editor
+command.newEditor.sidebyside.name = New Editor (Side By Side)
Added: trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml (rev
0)
+++ trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml 2010-11-26 15:44:07 UTC (rev
26982)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ description="%command.newEditor.sidebyside.description"
+ name="%command.newEditor.sidebyside.name"
+ categoryId="org.eclipse.ui.category.window"
+ id="org.jboss.tools.sidebyside.newEditor">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ commandId="org.jboss.tools.sidebyside.newEditor"
+
class="org.jboss.tools.common.ui.commands.sidebyside.SideBySideHandler">
+ <enabledWhen>
+ <with
+ variable="activeEditor">
+ <instanceof
+ value="org.eclipse.ui.IEditorPart">
+ </instanceof>
+ </with>
+ </enabledWhen>
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.jboss.tools.sidebyside.newEditor"
+ contextId="org.eclipse.ui.contexts.window"
+ sequence="M1+8"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
+ </key>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="menu:window?after=newEditor">
+ <command
+ label="%command.newEditor.sidebyside.name"
+ commandId="org.jboss.tools.sidebyside.newEditor"
+ mnemonic="S"
+ id="org.jboss.tools.sidebyside.menus.newEditor">
+ </command>
+ </menuContribution>
+ </extension>
+</plugin>
Property changes on: trunk/common/plugins/org.jboss.tools.common.ui/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/commands/sidebyside/SideBySideHandler.java
(from rev 26976,
trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/src/org/jboss/tools/common/ui/sidebyside/handlers/SideBySideHandler.java)
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/commands/sidebyside/SideBySideHandler.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/commands/sidebyside/SideBySideHandler.java 2010-11-26
15:44:07 UTC (rev 26982)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.ui.commands.sidebyside;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.EditorSashContainer;
+import org.eclipse.ui.internal.EditorStack;
+import org.eclipse.ui.internal.ILayoutContainer;
+import org.eclipse.ui.internal.LayoutPart;
+import org.eclipse.ui.internal.PartPane;
+import org.eclipse.ui.internal.PartSashContainer;
+import org.eclipse.ui.internal.PartSite;
+import org.eclipse.ui.internal.PartStack;
+import org.eclipse.ui.internal.WorkbenchPage;
+import org.eclipse.ui.internal.handlers.NewEditorHandler;
+
+/**
+ * Handler which split active editor vertically
+ * @see
https://jira.jboss.org/browse/JBIDE-6083
+ * @author mareshkau
+ */
+public class SideBySideHandler extends NewEditorHandler {
+
+ /**
+ * the command has been executed, so extract extract the needed information
+ * from the application context.
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ super.execute(event);
+ splitEditorArea();
+ return null;
+ }
+
+ private void splitEditorArea() {
+ IWorkbenchPage workbenchPage = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ IWorkbenchPart part = workbenchPage.getActivePart();
+ PartPane partPane = ((PartSite) part.getSite()).getPane();
+ LayoutPart layoutPart = partPane.getPart();
+
+ // Get PartPane that correspond to the active editor
+ PartPane currentEditorPartPane = ((PartSite) workbenchPage
+ .getActiveEditor().getSite()).getPane();
+ EditorSashContainer editorSashContainer = null;
+ ILayoutContainer rootLayoutContainer = layoutPart.getContainer();
+ if (rootLayoutContainer instanceof LayoutPart) {
+ ILayoutContainer editorSashLayoutContainer = ((LayoutPart) rootLayoutContainer)
+ .getContainer();
+ if (editorSashLayoutContainer instanceof EditorSashContainer) {
+ editorSashContainer = ((EditorSashContainer) editorSashLayoutContainer);
+ }
+ }
+ /*
+ * Create a new part stack (i.e. a workbook) to home the
+ * currentEditorPartPane which hold the active editor
+ */
+ PartStack newPart = createStack(editorSashContainer);
+
+ editorSashContainer.stack(currentEditorPartPane, newPart);
+ if (rootLayoutContainer instanceof LayoutPart) {
+ ILayoutContainer cont = ((LayoutPart) rootLayoutContainer)
+ .getContainer();
+ if (cont instanceof PartSashContainer) {
+ // "Split" the editor area by adding the new part
+ ((PartSashContainer) cont).add(newPart);
+ }
+ }
+ }
+
+ /**
+ * A method to create a part stack container (a new workbook)
+ *
+ * @param editorSashContainer
+ * the <code>EditorSashContainer</code> to set for the returned
+ * <code>PartStack</code>
+ * @return a new part stack container
+ */
+ private PartStack createStack(EditorSashContainer editorSashContainer) {
+ WorkbenchPage workbenchPage = (WorkbenchPage) PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ EditorStack newWorkbook = EditorStack.newEditorWorkbook(
+ editorSashContainer, workbenchPage);
+ return newWorkbook;
+ }
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/commands/sidebyside/SideBySideHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/plugin.xml 2010-11-26
15:37:40 UTC (rev 26981)
+++ trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/plugin.xml 2010-11-26
15:44:07 UTC (rev 26982)
@@ -14,7 +14,7 @@
point="org.eclipse.ui.handlers">
<handler
commandId="org.jboss.tools.sidebyside.newEditor"
-
class="org.jboss.tools.common.ui.sidebyside.handlers.SideBySideHandler">
+
class="org.jboss.tools.common.ui.commands.sidebyside.SideBySideHandler">
<enabledWhen>
<with
variable="activeEditor">
Deleted:
trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/src/org/jboss/tools/common/ui/sidebyside/handlers/SideBySideHandler.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/src/org/jboss/tools/common/ui/sidebyside/handlers/SideBySideHandler.java 2010-11-26
15:37:40 UTC (rev 26981)
+++
trunk/common/plugins/org.jboss.tools.common.ui.sidebyside/src/org/jboss/tools/common/ui/sidebyside/handlers/SideBySideHandler.java 2010-11-26
15:44:07 UTC (rev 26982)
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.ui.sidebyside.handlers;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.EditorSashContainer;
-import org.eclipse.ui.internal.EditorStack;
-import org.eclipse.ui.internal.ILayoutContainer;
-import org.eclipse.ui.internal.LayoutPart;
-import org.eclipse.ui.internal.PartPane;
-import org.eclipse.ui.internal.PartSashContainer;
-import org.eclipse.ui.internal.PartSite;
-import org.eclipse.ui.internal.PartStack;
-import org.eclipse.ui.internal.WorkbenchPage;
-import org.eclipse.ui.internal.handlers.NewEditorHandler;
-
-/**
- * Handler which split active editor vertically
- * @see
https://jira.jboss.org/browse/JBIDE-6083
- * @author mareshkau
- */
-public class SideBySideHandler extends NewEditorHandler {
-
- /**
- * the command has been executed, so extract extract the needed information
- * from the application context.
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- super.execute(event);
- splitEditorArea();
- return null;
- }
-
- private void splitEditorArea() {
- IWorkbenchPage workbenchPage = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage();
- IWorkbenchPart part = workbenchPage.getActivePart();
- PartPane partPane = ((PartSite) part.getSite()).getPane();
- LayoutPart layoutPart = partPane.getPart();
-
- // Get PartPane that correspond to the active editor
- PartPane currentEditorPartPane = ((PartSite) workbenchPage
- .getActiveEditor().getSite()).getPane();
- EditorSashContainer editorSashContainer = null;
- ILayoutContainer rootLayoutContainer = layoutPart.getContainer();
- if (rootLayoutContainer instanceof LayoutPart) {
- ILayoutContainer editorSashLayoutContainer = ((LayoutPart) rootLayoutContainer)
- .getContainer();
- if (editorSashLayoutContainer instanceof EditorSashContainer) {
- editorSashContainer = ((EditorSashContainer) editorSashLayoutContainer);
- }
- }
- /*
- * Create a new part stack (i.e. a workbook) to home the
- * currentEditorPartPane which hold the active editor
- */
- PartStack newPart = createStack(editorSashContainer);
-
- editorSashContainer.stack(currentEditorPartPane, newPart);
- if (rootLayoutContainer instanceof LayoutPart) {
- ILayoutContainer cont = ((LayoutPart) rootLayoutContainer)
- .getContainer();
- if (cont instanceof PartSashContainer) {
- // "Split" the editor area by adding the new part
- ((PartSashContainer) cont).add(newPart);
- }
- }
- }
-
- /**
- * A method to create a part stack container (a new workbook)
- *
- * @param editorSashContainer
- * the <code>EditorSashContainer</code> to set for the returned
- * <code>PartStack</code>
- * @return a new part stack container
- */
- private PartStack createStack(EditorSashContainer editorSashContainer) {
- WorkbenchPage workbenchPage = (WorkbenchPage) PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage();
- EditorStack newWorkbook = EditorStack.newEditorWorkbook(
- editorSashContainer, workbenchPage);
- return newWorkbook;
- }
-}