Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Barbe2016-09-22 02:21:41 -0400
committerMarvin Mueller2016-10-31 08:54:53 -0400
commitec7e7ce4c7a78078fcf48409eb3d250c4145ea7f (patch)
tree2a3db72e44029eb0862284dbe2a35ed1956344d5
parent1345c2ca3f798cbb9665c93343251f48e0812b63 (diff)
downloadorg.eclipse.jubula.core-ec7e7ce4c7a78078fcf48409eb3d250c4145ea7f.tar.gz
org.eclipse.jubula.core-ec7e7ce4c7a78078fcf48409eb3d250c4145ea7f.tar.xz
org.eclipse.jubula.core-ec7e7ce4c7a78078fcf48409eb3d250c4145ea7f.zip
Fix for Bug 500672 - After added the first parameter to TC on DataSetView showed just the row number
Change-Id: I41a0dbe13e4d912b1e1aa25378d96214120dfb6f Signed-off-by: Kevin Barbe <kevin.barbe@bredex.de>
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/AbstractDataSetPage.java38
1 files changed, 28 insertions, 10 deletions
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 74a8a252b..9b21d7e64 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
@@ -159,6 +159,8 @@ public abstract class AbstractDataSetPage extends Page
private Long m_paramId;
/** The column's widths */
private int[] m_columnWidths;
+ /** The current parameters count */
+ private int m_columnCount;
/** Constants for the button actions */
private enum TestDataRowAction {
@@ -818,8 +820,12 @@ public abstract class AbstractDataSetPage extends Page
// create column for data set numer
TableColumn dataSetNumberCol = new TableColumn(table, SWT.NONE);
dataSetNumberCol.setText(Messages.DataSetViewControllerDataSetNumber);
- dataSetNumberCol.setWidth((m_columnWidths != null && m_columnWidths
- .length > 0) ? m_columnWidths[0] : DATASET_NUMBER_COLUMNWIDTH);
+ if ((m_columnWidths != null && m_columnWidths.length > 0)
+ && m_columnCount == table.getColumnCount()) {
+ dataSetNumberCol.setWidth(m_columnWidths[0]);
+ } else {
+ dataSetNumberCol.setWidth(DATASET_NUMBER_COLUMNWIDTH);
+ }
return dataSetNumberCol.getText();
}
@@ -830,13 +836,21 @@ public abstract class AbstractDataSetPage extends Page
final Table table = getTable();
final TableColumn[] columns = table.getColumns();
final int columnCount = columns.length;
- columns[0].setWidth((m_columnWidths != null && m_columnWidths.length
- > 0) ? m_columnWidths[0] : DATASET_NUMBER_COLUMNWIDTH);
+ if ((m_columnWidths != null && m_columnWidths.length > 0)
+ && m_columnCount == columns.length) {
+ columns[0].setWidth(m_columnWidths[0]);
+ } else {
+ columns[0].setWidth(DATASET_NUMBER_COLUMNWIDTH);
+ }
for (int i = 1; i < columnCount; i++) {
final TableColumn column = columns[i];
column.pack();
- column.setWidth((m_columnWidths != null && m_columnWidths.length
- > i) ? m_columnWidths[i] : COLUMN_WIDTH);
+ if ((m_columnWidths != null && m_columnWidths.length > i)
+ && m_columnCount == columns.length) {
+ column.setWidth(m_columnWidths[i]);
+ } else {
+ column.setWidth(COLUMN_WIDTH);
+ }
}
}
@@ -857,6 +871,7 @@ public abstract class AbstractDataSetPage extends Page
for (TableColumn column : tableColumns) {
m_columnWidths[i++] = column.getWidth();
}
+ m_columnCount = tableColumns.length;
}
} else {
m_paramId = getParamInterfaceObj().getId();
@@ -869,16 +884,19 @@ public abstract class AbstractDataSetPage extends Page
columnProperties[0] = initDataSetColumn();
// create columns for parameter
int i = 1;
+ int parameterListSize = getParamInterfaceObj().getParameterListSize();
for (IParamDescriptionPO descr : getParamInterfaceObj()
.getParameterList()) {
TableColumn column = new TableColumn(table, SWT.NONE);
String columnName = descr.getName();
column.setText(columnName);
columnProperties[i] = columnName;
- if (m_columnWidths == null || m_columnWidths.length <= i) {
- if (column.getWidth() < COLUMN_WIDTH) {
- column.setWidth(COLUMN_WIDTH);
- }
+ if (m_columnWidths == null
+ || m_columnWidths.length <= i
+ /* This has to be parameterListSize + 1 because the "#"
+ * column is not included within parameterList */
+ || m_columnCount != (parameterListSize + 1)) {
+ column.setWidth(COLUMN_WIDTH);
} else {
column.setWidth(m_columnWidths[i]);
}

Back to the top