Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2012-05-21 09:51:28 +0000
committerMarkus Tiede2012-05-21 09:51:28 +0000
commitb742cfc7d55e00e68d8c5f9fa6ef358f06fc7811 (patch)
treee3f91fe857b8c36a5968d321e9523374d6eaccfb
parentaed8074fd8193230ccd8fffa064643875153260b (diff)
downloadorg.eclipse.jubula.core-b742cfc7d55e00e68d8c5f9fa6ef358f06fc7811.tar.gz
org.eclipse.jubula.core-b742cfc7d55e00e68d8c5f9fa6ef358f06fc7811.tar.xz
org.eclipse.jubula.core-b742cfc7d55e00e68d8c5f9fa6ef358f06fc7811.zip
Fix for issue 380111.
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/ExtractTestCaseHandler.java8
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/NewCategoryHandler.java10
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/SaveAsNewTestCaseHandler.java8
3 files changed, 26 insertions, 0 deletions
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/ExtractTestCaseHandler.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/ExtractTestCaseHandler.java
index 515477be3..101921c77 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/ExtractTestCaseHandler.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/ExtractTestCaseHandler.java
@@ -21,6 +21,7 @@ import javax.persistence.PersistenceException;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jubula.client.core.businessprocess.ParamNameBP;
import org.eclipse.jubula.client.core.businessprocess.ParamNameBPDecorator;
import org.eclipse.jubula.client.core.businessprocess.TreeOpsBP;
@@ -40,9 +41,11 @@ import org.eclipse.jubula.client.core.persistence.PersistenceManager;
import org.eclipse.jubula.client.core.persistence.Persistor;
import org.eclipse.jubula.client.core.persistence.TransactionSupport;
import org.eclipse.jubula.client.core.persistence.TransactionSupport.ITransactAction;
+import org.eclipse.jubula.client.ui.rcp.controllers.MultipleTCBTracker;
import org.eclipse.jubula.client.ui.rcp.controllers.PMExceptionHandler;
import org.eclipse.jubula.client.ui.rcp.editors.AbstractTestCaseEditor;
import org.eclipse.jubula.client.ui.rcp.i18n.Messages;
+import org.eclipse.jubula.client.ui.rcp.views.TestCaseBrowser;
import org.eclipse.jubula.client.ui.utils.ErrorHandlingUtil;
import org.eclipse.jubula.tools.exception.Assert;
import org.eclipse.jubula.tools.exception.JBException;
@@ -178,6 +181,11 @@ public class ExtractTestCaseHandler extends AbstractRefactorHandler {
.getSpecTestCase();
DataEventDispatcher.getInstance().fireDataChangedListener(
newSpecTc, DataState.Added, UpdateState.all);
+ TestCaseBrowser tcb = MultipleTCBTracker.getInstance().getMainTCB();
+ if (tcb != null) {
+ tcb.getTreeViewer().setSelection(
+ new StructuredSelection(newSpecTc), true);
+ }
return extractionRet;
} catch (PMException e) {
PMExceptionHandler.handlePMExceptionForMasterSession(e);
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/NewCategoryHandler.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/NewCategoryHandler.java
index 7334eb7d2..f61553ee4 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/NewCategoryHandler.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/NewCategoryHandler.java
@@ -13,6 +13,7 @@ package org.eclipse.jubula.client.ui.rcp.handlers;
import java.util.Iterator;
import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.jubula.client.core.constants.InitialValueConstants;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
@@ -34,8 +35,11 @@ import org.eclipse.jubula.client.ui.rcp.Plugin;
import org.eclipse.jubula.client.ui.rcp.controllers.PMExceptionHandler;
import org.eclipse.jubula.client.ui.rcp.dialogs.InputDialog;
import org.eclipse.jubula.client.ui.rcp.i18n.Messages;
+import org.eclipse.jubula.client.ui.rcp.views.TestCaseBrowser;
import org.eclipse.jubula.client.ui.utils.DialogUtils;
import org.eclipse.jubula.tools.exception.ProjectDeletedException;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
/**
@@ -73,6 +77,7 @@ public class NewCategoryHandler extends AbstractNewHandler {
ProjectDeletedException {
final INodePO categoryParent = getParentNode(event);
+ IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
InputDialog dialog = new InputDialog(
getActiveShell(),
Messages.CreateNewCategoryActionCatTitle,
@@ -105,6 +110,11 @@ public class NewCategoryHandler extends AbstractNewHandler {
.getCmdHandleChild(categoryParent, category));
DataEventDispatcher.getInstance().fireDataChangedListener(category,
DataState.Added, UpdateState.all);
+ if (activePart instanceof TestCaseBrowser) {
+ TestCaseBrowser tcb = (TestCaseBrowser) activePart;
+ tcb.getTreeViewer().setSelection(
+ new StructuredSelection(category), true);
+ }
}
dialog.close();
}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/SaveAsNewTestCaseHandler.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/SaveAsNewTestCaseHandler.java
index a2e567a4d..c6a98cd38 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/SaveAsNewTestCaseHandler.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/SaveAsNewTestCaseHandler.java
@@ -21,6 +21,7 @@ import javax.persistence.EntityManager;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jubula.client.core.businessprocess.ParamNameBP;
import org.eclipse.jubula.client.core.businessprocess.ParamNameBPDecorator;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
@@ -46,7 +47,9 @@ import org.eclipse.jubula.client.core.persistence.TransactionSupport;
import org.eclipse.jubula.client.core.persistence.TransactionSupport.ITransactAction;
import org.eclipse.jubula.client.core.utils.ModelParamValueConverter;
import org.eclipse.jubula.client.core.utils.RefToken;
+import org.eclipse.jubula.client.ui.rcp.controllers.MultipleTCBTracker;
import org.eclipse.jubula.client.ui.rcp.controllers.PMExceptionHandler;
+import org.eclipse.jubula.client.ui.rcp.views.TestCaseBrowser;
import org.eclipse.jubula.tools.exception.ProjectDeletedException;
/**
@@ -288,6 +291,11 @@ public class SaveAsNewTestCaseHandler extends AbstractRefactorHandler {
DataEventDispatcher.getInstance().fireDataChangedListener(
newSpecTC, DataState.Added, UpdateState.all);
+ TestCaseBrowser tcb = MultipleTCBTracker.getInstance().getMainTCB();
+ if (tcb != null) {
+ tcb.getTreeViewer().setSelection(
+ new StructuredSelection(newSpecTC), true);
+ }
}
return null;
}

Back to the top