Index: TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/EditSubCorpus.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/EditSubCorpus.java	(revision 0)
+++ TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/EditSubCorpus.java	(revision 3560)
@@ -0,0 +1,77 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.searchengine.cqp.rcp.handlers.base;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.searchengine.cqp.corpus.Subcorpus;
+import org.txm.searchengine.cqp.rcp.editor.SubcorpusEditor;
+
+/**
+ * Command which creates a subcorpus from a Corpus
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ * 
+ */
+public class EditSubCorpus extends BaseAbstractHandler {
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		
+		if (!this.checkCorpusEngine()) {
+			return false;
+		}
+		
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		if (selection == null) {
+			System.out.println(TXMUIMessages.noSelectionForColon + HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActiveEditor());
+			return null;
+		}
+		
+		if (selection.getFirstElement() instanceof Subcorpus) {
+			return edit((Subcorpus) selection.getFirstElement());
+		} else {
+			return null;
+		}
+	}
+	
+	public static Object edit(Subcorpus sub) throws ExecutionException {
+		
+		return TXMEditor.openEditor(sub, SubcorpusEditor.class.getName());
+	}	
+}

Property changes on: TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/EditSubCorpus.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/EditPartition.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/EditPartition.java	(revision 0)
+++ TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/EditPartition.java	(revision 3560)
@@ -0,0 +1,84 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.searchengine.cqp.rcp.handlers.base;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.searchengine.cqp.rcp.editor.PartitionEditor;
+
+/**
+ * Command that creates a Partition from a Corpus.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ */
+public class EditPartition extends BaseAbstractHandler {
+		
+	/*
+	 * (non-Javadoc)
+	 * @see
+	 * org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands
+	 * .ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		
+		if (!this.checkCorpusEngine()) {
+			return false;
+		}
+
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		if (selection == null) {
+			System.out.println(TXMUIMessages.noSelectionForColon + HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActiveEditor());
+			return null;
+		}
+		
+		if (selection.getFirstElement() instanceof Partition) {
+			return edit((Partition) selection.getFirstElement());
+		} else {
+			return null;
+		}
+	}
+	
+	/**
+	 * 
+	 * @param event
+	 * @return
+	 * @throws ExecutionException
+	 */
+	public static Object edit(Partition part) throws ExecutionException {
+		
+		return TXMEditor.openEditor(part, PartitionEditor.class.getName());
+	}
+}

Property changes on: TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/EditPartition.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.searchengine.cqp.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.rcp/plugin.xml	(revision 3559)
+++ TXM/trunk/org.txm.searchengine.cqp.rcp/plugin.xml	(revision 3560)
@@ -54,6 +54,31 @@
             id="org.txm.searchengine.cqp.rcp.handlers.base.Intersection"
             name="%command.name.3">
       </command>
+      <command
+            defaultHandler="org.txm.searchengine.cqp.rcp.handlers.base.EditPartition"
+            id="org.txm.searchengine.cqp.rcp.handlers.base.EditPartition"
+            name="Edit">
+         <commandParameter
+               id="CorpusParameter"
+               name="%commandParameter.name.0"
+               optional="true">
+         </commandParameter>
+      </command>
+      <command
+            defaultHandler="org.txm.searchengine.cqp.rcp.handlers.base.EditSubCorpus"
+            id="org.txm.searchengine.cqp.rcp.handlers.base.EditSubCorpus"
+            name="Edit">
+         <commandParameter
+               id="CorpusParameter"
+               name="%commandParameter.name.0"
+               optional="true">
+         </commandParameter>
+         <commandParameter
+               id="edit"
+               name="%commandParameter.name"
+               optional="true">
+         </commandParameter>
+      </command>
    </extension>
    <extension
          point="org.eclipse.ui.preferencePages">
@@ -163,6 +188,38 @@
       <menuContribution
             locationURI="popup:org.txm.rcp.views.corpora.CorporaView?after=org.txm.rcp.corporaview.corpus.manage">
          <command
+               commandId="org.txm.searchengine.cqp.rcp.handlers.base.EditSubCorpus"
+               icon="platform:/plugin/org.txm.rcp/icons/functions/pencil.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <and>
+                  <reference
+                        definitionId="OneSubCorpusSelected">
+                  </reference>
+                  <reference
+                        definitionId="ExpertEnabled">
+                  </reference>
+               </and>
+            </visibleWhen>
+         </command>
+         <command
+               commandId="org.txm.searchengine.cqp.rcp.handlers.base.EditPartition"
+               icon="platform:/plugin/org.txm.rcp/icons/functions/pencil.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <and>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="ExpertEnabled">
+                  </reference>
+               </and>
+            </visibleWhen>
+         </command>
+         <command
                commandId="org.txm.searchengine.cqp.rcp.handlers.base.CreateSubCorpus"
                icon="icons/functions/subcorpus.png"
                style="push">
@@ -239,6 +296,38 @@
       <menuContribution
             locationURI="menu:menu.corpus?after=menu.corpus.build">
          <command
+               commandId="org.txm.searchengine.cqp.rcp.handlers.base.EditSubCorpus"
+               icon="platform:/plugin/org.txm.rcp/icons/functions/pencil.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <and>
+                  <reference
+                        definitionId="OneSubCorpusSelected">
+                  </reference>
+                  <reference
+                        definitionId="ExpertEnabled">
+                  </reference>
+               </and>
+            </visibleWhen>
+         </command>
+         <command
+               commandId="org.txm.searchengine.cqp.rcp.handlers.base.EditPartition"
+               icon="platform:/plugin/org.txm.rcp/icons/functions/pencil.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <and>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="ExpertEnabled">
+                  </reference>
+               </and>
+            </visibleWhen>
+         </command>
+         <command
                commandId="org.txm.searchengine.cqp.rcp.handlers.base.CreateSubCorpus"
                icon="icons/functions/subcorpus.png"
                style="push">
@@ -314,6 +403,38 @@
       <menuContribution
             locationURI="toolbar:org.txm.rcp.toolbarcorpus?after=org.txm.rcp.toolbarcorpus.corpus">
          <command
+               commandId="org.txm.searchengine.cqp.rcp.handlers.base.EditSubCorpus"
+               icon="platform:/plugin/org.txm.rcp/icons/functions/pencil.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <and>
+                  <reference
+                        definitionId="OneSubCorpusSelected">
+                  </reference>
+                  <reference
+                        definitionId="ExpertEnabled">
+                  </reference>
+               </and>
+            </visibleWhen>
+         </command>
+         <command
+               commandId="org.txm.searchengine.cqp.rcp.handlers.base.EditPartition"
+               icon="platform:/plugin/org.txm.rcp/icons/functions/pencil.png"
+               style="push">
+            <visibleWhen
+                  checkEnabled="false">
+               <and>
+                  <reference
+                        definitionId="OnePartitionSelected">
+                  </reference>
+                  <reference
+                        definitionId="ExpertEnabled">
+                  </reference>
+               </and>
+            </visibleWhen>
+         </command>
+         <command
                commandId="org.txm.searchengine.cqp.rcp.handlers.base.CreateSubCorpus"
                icon="icons/functions/subcorpus.png"
                style="push">
