Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Hartmann2016-08-08 05:11:39 -0400
committerMarvin Mueller2016-09-02 03:09:37 -0400
commit5219b6a4ea49663712d7f48bc0e99bc6ed1a24f5 (patch)
tree02c00947592706fbb9fa7939c1dbced0b5f5c649
parent6ba893fea869a24ed802eda7136c815e9e649257 (diff)
downloadorg.eclipse.jubula.core-5219b6a4ea49663712d7f48bc0e99bc6ed1a24f5.tar.gz
org.eclipse.jubula.core-5219b6a4ea49663712d7f48bc0e99bc6ed1a24f5.tar.xz
org.eclipse.jubula.core-5219b6a4ea49663712d7f48bc0e99bc6ed1a24f5.zip
Fix for bug 499362: Small synchronization bug between OMEditor and TCEditor
Change-Id: I8242a2f8842de8f365503d85eab30b76699f8c5d Signed-off-by: Miklos Hartmann <miklos.hartmann@z-consulting.eu> (cherry picked from commit 6d8491dc68390d1fc4ae5db6a4b3614ac1f12014)
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java2
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/ObjectMappingMultiPageEditor.java11
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTreeItemHandlerOMEditor.java10
3 files changed, 19 insertions, 4 deletions
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java
index 648b39295..5e81b2d11 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/persistence/EditSupport.java
@@ -490,8 +490,8 @@ public class EditSupport {
m_workVersion = workVersion;
m_compMapper.setCompNameCache(
new ComponentNamesDecorator(getSession()));
- m_compMapper.setContext(m_workVersion);
m_workVersion = m_session.merge(m_workVersion);
+ m_compMapper.setContext(m_workVersion);
} catch (PersistenceException e) {
final String msg = Messages.ReinitOfSessionFailed;
log.error(msg);
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/ObjectMappingMultiPageEditor.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/ObjectMappingMultiPageEditor.java
index 2b25b4795..e2b3e94d9 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/ObjectMappingMultiPageEditor.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/ObjectMappingMultiPageEditor.java
@@ -1232,6 +1232,7 @@ public class ObjectMappingMultiPageEditor extends MultiPageEditorPart
IAUTMainPO aut = (IAUTMainPO)obj;
if (getAut().equals(aut)) {
cleanupNames();
+ synchronizeViewers();
}
break;
case IObjectMappingObserver.EVENT_COMPONENT_MAPPED :
@@ -1245,6 +1246,16 @@ public class ObjectMappingMultiPageEditor extends MultiPageEditorPart
default:
}
}
+
+ /**
+ * Synchronizes the Viewers with the Edit Support after the latter changes
+ */
+ public void synchronizeViewers() {
+ final IObjectMappingPO om = getAut().getObjMap();
+ m_compNameTreeViewer.setInput(om.getUnmappedLogicalCategory());
+ m_uiElementTreeViewer.setInput(om.getUnmappedTechnicalCategory());
+ m_mappedComponentTreeViewer.setInput(om.getMappedCategory());
+ }
/**
* {@inheritDoc}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTreeItemHandlerOMEditor.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTreeItemHandlerOMEditor.java
index b67eef483..3d6f4924d 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTreeItemHandlerOMEditor.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/delete/DeleteTreeItemHandlerOMEditor.java
@@ -112,6 +112,7 @@ public class DeleteTreeItemHandlerOMEditor
if (toDelete.length > 0) {
editor.getEditorHelper().setDirty(true);
editor.cleanupNames();
+ editor.synchronizeViewers();
}
return lastParent;
}
@@ -139,7 +140,8 @@ public class DeleteTreeItemHandlerOMEditor
lastParent = editor.getOmEditorBP().deleteAssociation(
(IObjectMappingAssoziationPO)toDelete);
editor.getEditorHelper().setDirty(true);
- editor.cleanupNames();
+ editor.cleanupNames();
+ editor.synchronizeViewers();
}
} else if (toDelete instanceof IComponentNamePO) {
delete = MessageDialog.openConfirm(getActiveShell(),
@@ -149,7 +151,8 @@ public class DeleteTreeItemHandlerOMEditor
lastParent = editor.getOmEditorBP().deleteCompName(
(IComponentNamePO)toDelete);
editor.getEditorHelper().setDirty(true);
- editor.cleanupNames();
+ editor.cleanupNames();
+ editor.synchronizeViewers();
}
} else if (toDelete instanceof IObjectMappingCategoryPO) {
delete = MessageDialog.openConfirm(getActiveShell(),
@@ -159,7 +162,8 @@ public class DeleteTreeItemHandlerOMEditor
lastParent = editor.getOmEditorBP().deleteCategory(
(IObjectMappingCategoryPO)toDelete);
editor.getEditorHelper().setDirty(true);
- editor.cleanupNames();
+ editor.cleanupNames();
+ editor.synchronizeViewers();
}
}
return lastParent;

Back to the top