Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Mueller2016-03-11 05:05:49 -0500
committerMarvin Mueller2016-03-11 05:05:54 -0500
commit02dec9671fd08bfbb15d10b179118e88cbde7891 (patch)
tree6046b8be8014e8b61d149caae9d731f7c3c68383
parent1f538bfff2915e607190a1143058d9d9bfdda120 (diff)
downloadorg.eclipse.jubula.core-8.2.2.055.tar.gz
org.eclipse.jubula.core-8.2.2.055.tar.xz
org.eclipse.jubula.core-8.2.2.055.zip
Non-sprint task - Fix for Bug 489370v8.2.2.0558.2.2
Deleted @Version annotation for DataCellPO to remove support for OptimisticLock. Also fixed that the DataSetPage might change data even the workversion could not be locked. see http://eclip.se/489370 Change-Id: I2be771273f97d652d7339db1898f340ac6d8ad43
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/DataCellPO.java20
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/JBEditorHelper.java2
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java98
3 files changed, 59 insertions, 61 deletions
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/DataCellPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/DataCellPO.java
index ce796a2b3..d85379506 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/DataCellPO.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/DataCellPO.java
@@ -7,7 +7,6 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
-import javax.persistence.Version;
/**
* Representing data values, see http://bugs.eclipse.org/488218
@@ -27,9 +26,6 @@ class DataCellPO implements IDataCellPO {
*/
private Long m_parentProjectId = null;
- /** Persistence (JPA / EclipseLink) version id */
- private transient Integer m_version;
-
/**
* Constructor for JPA
*/
@@ -76,17 +72,13 @@ class DataCellPO implements IDataCellPO {
this.m_id = id;
}
- /** {@inheritDoc} */
- @Version
- public Integer getVersion() {
- return m_version;
- }
-
- /**
- * @param version the version
+ /**
+ * Version is not used for optimistic locking for this class.
+ * @return <code>0</code>
*/
- void setVersion(Integer version) {
- m_version = version;
+ @Transient
+ public Integer getVersion() {
+ return 0;
}
/** {@inheritDoc} */
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/JBEditorHelper.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/JBEditorHelper.java
index 89eb5547a..05cf97f72 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/JBEditorHelper.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/JBEditorHelper.java
@@ -100,6 +100,8 @@ public class JBEditorHelper implements ILockedObjects,
}
/**
+ * Requests the editable state and displays a message when
+ * the state is not {@link EditableState#OK}
* @return the editable state
*/
public EditableState requestEditableState() {
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java
index 80ecf9e43..f1e8dfa10 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java
@@ -473,30 +473,32 @@ public abstract class AbstractDataSetPage extends Page
final int rowCount = getParamInterfaceObj().getDataManager()
.getDataSetCount();
final AbstractJBEditor editor = (AbstractJBEditor)m_currentPart;
- editor.getEditorHelper().requestEditableState();
- if (getParamInterfaceObj() instanceof IExecTestCasePO) {
- ITDManager man = ((IExecTestCasePO)getParamInterfaceObj())
- .resolveTDReference();
- if (!man.equals(getTableViewer().getInput())) {
- getTableViewer().setInput(man);
+ if (editor.getEditorHelper().requestEditableState()
+ == JBEditorHelper.EditableState.OK) {
+ if (getParamInterfaceObj() instanceof IExecTestCasePO) {
+ ITDManager man = ((IExecTestCasePO)getParamInterfaceObj())
+ .resolveTDReference();
+ if (!man.equals(getTableViewer().getInput())) {
+ getTableViewer().setInput(man);
+ }
}
- }
- ITDManager tdman = getParamInterfaceObj().getDataManager();
- if (fromIndex >= 0 && fromIndex < rowCount
- && toIndex >= 0 && toIndex < rowCount) {
- IDataSetPO selectedDataSet = tdman.getDataSet(fromIndex);
- if (fromIndex > toIndex) {
- tdman.insertDataSet(selectedDataSet, toIndex);
- tdman.removeDataSet(fromIndex + 1);
- } else {
- tdman.insertDataSet(selectedDataSet, toIndex + 1);
- tdman.removeDataSet(fromIndex);
+ ITDManager tdman = getParamInterfaceObj().getDataManager();
+ if (fromIndex >= 0 && fromIndex < rowCount
+ && toIndex >= 0 && toIndex < rowCount) {
+ IDataSetPO selectedDataSet = tdman.getDataSet(fromIndex);
+ if (fromIndex > toIndex) {
+ tdman.insertDataSet(selectedDataSet, toIndex);
+ tdman.removeDataSet(fromIndex + 1);
+ } else {
+ tdman.insertDataSet(selectedDataSet, toIndex + 1);
+ tdman.removeDataSet(fromIndex);
+ }
+ getTableCursor().setSelection(toIndex,
+ getTableCursor().getColumn());
+ getTableViewer().refresh();
+ DataEventDispatcher.getInstance().fireParamChangedListener();
+ editor.getEditorHelper().setDirty(true);
}
- getTableCursor().setSelection(toIndex,
- getTableCursor().getColumn());
- getTableViewer().refresh();
- DataEventDispatcher.getInstance().fireParamChangedListener();
- editor.getEditorHelper().setDirty(true);
}
}
@@ -525,31 +527,33 @@ public abstract class AbstractDataSetPage extends Page
*/
private void insertDataSet(int row) {
final AbstractJBEditor editor = (AbstractJBEditor)m_currentPart;
- editor.getEditorHelper().requestEditableState();
- if (getParamInterfaceObj() instanceof IExecTestCasePO) {
- ITDManager man = ((IExecTestCasePO)getParamInterfaceObj())
- .resolveTDReference();
- if (!man.equals(getTableViewer().getInput())) {
- getTableViewer().setInput(man);
+ if (editor.getEditorHelper().requestEditableState()
+ == JBEditorHelper.EditableState.OK) {
+ if (getParamInterfaceObj() instanceof IExecTestCasePO) {
+ ITDManager man = ((IExecTestCasePO)getParamInterfaceObj())
+ .resolveTDReference();
+ if (!man.equals(getTableViewer().getInput())) {
+ getTableViewer().setInput(man);
+ }
}
+ if (row > -1) {
+ getParamBP().addDataSet(getParamInterfaceObj(), row);
+ } else {
+ // if first data set is added
+ addDataSet();
+ }
+ editor.getEditorHelper().setDirty(true);
+ getTableViewer().refresh();
+ int rowToSelect = row;
+ if (rowToSelect == -1) {
+ rowToSelect = getTable().getItemCount();
+ } else {
+ getTableCursor().setSelection(rowToSelect, 1);
+ setFocus();
+ }
+ getTable().setSelection(rowToSelect);
+ DataEventDispatcher.getInstance().fireParamChangedListener();
}
- if (row > -1) {
- getParamBP().addDataSet(getParamInterfaceObj(), row);
- } else {
- // if first data set is added
- addDataSet();
- }
- editor.getEditorHelper().setDirty(true);
- getTableViewer().refresh();
- int rowToSelect = row;
- if (rowToSelect == -1) {
- rowToSelect = getTable().getItemCount();
- } else {
- getTableCursor().setSelection(rowToSelect, 1);
- setFocus();
- }
- getTable().setSelection(rowToSelect);
- DataEventDispatcher.getInstance().fireParamChangedListener();
}
/**
@@ -1040,7 +1044,7 @@ public abstract class AbstractDataSetPage extends Page
*/
private void setValueToModel(Object value, AbstractJBEditor editor,
int paramIndex, int dsNumber) {
- if (editor.getEditorHelper().requestEditableState()
+ if (editor.getEditorHelper().requestEditableState()
== JBEditorHelper.EditableState.OK) {
ParamNameBPDecorator mapper = editor.getEditorHelper()
.getEditSupport().getParamMapper();
@@ -1304,7 +1308,7 @@ public abstract class AbstractDataSetPage extends Page
if (editor == null) {
return;
}
- if (editor.getEditorHelper().requestEditableState()
+ if (editor.getEditorHelper().requestEditableState()
== JBEditorHelper.EditableState.OK) {
if (getParamInterfaceObj() instanceof IExecTestCasePO) {
ITDManager man = ((IExecTestCasePO)getParamInterfaceObj())

Back to the top