Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2016-05-04 07:17:04 +0000
committerGerrit Code Review @ Eclipse.org2016-05-12 15:05:35 +0000
commita58fd4ea17e841daa8b2a9a8462b16e9244e2bd3 (patch)
tree6a215665b91442fce653fa2e3936a6d208258bf4
parentefeca3c6b32becad454cc87f21a34f5377ce5b7e (diff)
downloadorg.eclipse.papyrus-a58fd4ea17e841daa8b2a9a8462b16e9244e2bd3.tar.gz
org.eclipse.papyrus-a58fd4ea17e841daa8b2a9a8462b16e9244e2bd3.tar.xz
org.eclipse.papyrus-a58fd4ea17e841daa8b2a9a8462b16e9244e2bd3.zip
Bug 489720: [Table] In Property View, Tables are not resized based on
the view size and layout option https://bugs.eclipse.org/bugs/show_bug.cgi?id=489720 Manage an utils class for the width calculation + JUnit test. Change-Id: I5903c9a3f7053c3a28ed8cf8a1bd1da9de3494b0 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java22
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/PapyrusTableSizeCalculation.java64
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.di2
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.notation35
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.uml5
-rw-r--r--tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/bugs/FillColumnsSizeTest.java134
-rwxr-xr-xtests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/AllTests.java4
7 files changed, 250 insertions, 16 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java
index 2f7d57ac55e..c0a2bcd3876 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/AbstractNattableWidgetManager.java
@@ -136,6 +136,7 @@ import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagemen
import org.eclipse.papyrus.infra.nattable.utils.LocationValue;
import org.eclipse.papyrus.infra.nattable.utils.NamedStyleConstants;
import org.eclipse.papyrus.infra.nattable.utils.NattableConfigAttributes;
+import org.eclipse.papyrus.infra.nattable.utils.PapyrusTableSizeCalculation;
import org.eclipse.papyrus.infra.nattable.utils.TableEditingDomainUtils;
import org.eclipse.papyrus.infra.nattable.utils.TableGridRegion;
import org.eclipse.papyrus.infra.nattable.utils.TableSelectionWrapper;
@@ -678,7 +679,7 @@ public abstract class AbstractNattableWidgetManager implements INattableModelMan
* @since 2.0
*/
public MenuManager createAndRegisterMenuManagerAndSelectionProvider(final NatTable natTable, final IWorkbenchPartSite site, ISelectionProvider selectionProvider) {
- final MenuManager menuManager = new MenuManager("#PopUp", "org.eclipse.papyrus.infra.nattable.widget.menu") ; //$NON-NLS-1$ //$NON-NLS-2$
+ final MenuManager menuManager = new MenuManager("#PopUp", "org.eclipse.papyrus.infra.nattable.widget.menu"); //$NON-NLS-1$ //$NON-NLS-2$
menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menuManager.setRemoveAllWhenShown(true);
return menuManager;
@@ -1461,21 +1462,10 @@ public abstract class AbstractNattableWidgetManager implements INattableModelMan
if (null != parent && !parent.isDisposed()) {
final int parentSize = parent.getSize().x;
- // Calculate the rows header width
- if(0 < parentSize){
- int headerWidth = 0;
- if (null != getRowHeaderLayerStack()) {
- for (int headerColumnIndex = 0; headerColumnIndex < getRowHeaderLayerStack().getColumnCount(); headerColumnIndex++) {
- headerWidth += getRowHeaderLayerStack().getColumnWidthByPosition(headerColumnIndex);
- }
- }
-
- // Remove the rows header size from the parent size
- final int allColumnsSize = parentSize - headerWidth;
-
- // Divide the width of all columns by the number of column to calculate the width by column
- final int columnSize = allColumnsSize / getBodyLayerStack().getColumnHideShowLayer().getColumnCount();
-
+ // Get the column width needed
+ final int columnSize = PapyrusTableSizeCalculation.getColumnFillWidth(this, parentSize);
+
+ if (0 < columnSize) {
// Affext the width to the column
for (int columnPosition = 0; columnPosition < getBodyLayerStack().getColumnHideShowLayer().getColumnCount(); columnPosition++) {
getBodyLayerStack().getBodyDataLayer().setColumnWidthByPosition(columnPosition, columnSize);
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/PapyrusTableSizeCalculation.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/PapyrusTableSizeCalculation.java
new file mode 100644
index 00000000000..cffd0228748
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/PapyrusTableSizeCalculation.java
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.nattable.utils;
+
+import org.eclipse.papyrus.infra.nattable.manager.table.AbstractNattableWidgetManager;
+
+/**
+ * This allows to manage the size calculation of header, rows and columns.
+ *
+ * @since 2.0
+ */
+public class PapyrusTableSizeCalculation {
+
+ /**
+ * Get the row header width of the current table.
+ *
+ * @param nattableModelManager The nattable model manager.
+ * @return The row header width.
+ */
+ public static int getRowHeaderWidth(final AbstractNattableWidgetManager nattableModelManager){
+ int headerWidth = 0;
+ if (null != nattableModelManager.getRowHeaderLayerStack()) {
+ for (int headerColumnIndex = 0; headerColumnIndex < nattableModelManager.getRowHeaderLayerStack().getColumnCount(); headerColumnIndex++) {
+ headerWidth += nattableModelManager.getRowHeaderLayerStack().getColumnWidthByPosition(headerColumnIndex);
+ }
+ }
+ return headerWidth;
+ }
+
+ /**
+ * This allows to calculate the column width when it is needed to fill the column to the parent.
+ *
+ * @param nattableWidgetManager The nattable model manager.
+ * @param parentSize The parent size.
+ * @return The optimized column width.
+ */
+ public static int getColumnFillWidth(final AbstractNattableWidgetManager nattableWidgetManager, final int parentSize){
+ int columnSize=0;
+
+ if(0 < parentSize){
+ int headerWidth = getRowHeaderWidth(nattableWidgetManager);
+
+ // Remove the rows header size from the parent size
+ final int allColumnsSize = parentSize - headerWidth;
+
+ // Divide the width of all columns by the number of column to calculate the width by column
+ columnSize = allColumnsSize / nattableWidgetManager.getBodyLayerStack().getColumnHideShowLayer().getColumnCount();
+ }
+
+ return columnSize;
+ }
+
+}
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.di b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.notation b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.notation
new file mode 100644
index 00000000000..6c30481bfe9
--- /dev/null
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.notation
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattable:Table xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:configuration="http://www.eclipse.org/papyrus/infra/viewpoints/configuration" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:nattable="http://www.eclipse.org/papyrus/nattable/model" xmlns:nattableaxis="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis" xmlns:nattableaxisconfiguration="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration" xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider" xmlns:nattableconfiguration="http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis http://www.eclipse.org/papyrus/nattable/model#//nattableaxis http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration http://www.eclipse.org/papyrus/nattable/model#//nattableaxisconfiguration http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider http://www.eclipse.org/papyrus/nattable/model#//nattableaxisprovider http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration http://www.eclipse.org/papyrus/nattable/model#//nattableconfiguration" xmi:id="_4XVfwBE6Eea1YZ-hukDkVA" name="GenericTable" currentRowAxisProvider="_4XVfwhE6Eea1YZ-hukDkVA" currentColumnAxisProvider="_4XVfwRE6Eea1YZ-hukDkVA">
+ <context xmi:type="uml:Model" href="FillColumnsSize.uml#_uyAkQBE6Eea1YZ-hukDkVA"/>
+ <owner xmi:type="uml:Model" href="FillColumnsSize.uml#_uyAkQBE6Eea1YZ-hukDkVA"/>
+ <prototype xmi:type="configuration:PapyrusSyncTable" href="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/genericTable.configuration#_Uz8agHDuEeWh-MssWmCB_A"/>
+ <tableConfiguration xmi:type="nattableconfiguration:TableConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#/"/>
+ <columnAxisProvidersHistory xmi:type="nattableaxisprovider:SlaveObjectAxisProvider" xmi:id="_4XVfwRE6Eea1YZ-hukDkVA" description="This axis provider provides available columns according to the rows of the table (features of the object displayed on the other axis)" name="UML Feature axis provider">
+ <axis xmi:type="nattableaxis:EStructuralFeatureAxis" xmi:id="_4skI6RE6Eea1YZ-hukDkVA">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ <element xmi:type="ecore:EAttribute" href="http://www.eclipse.org/uml2/5.0.0/UML#//NamedElement/name"/>
+ </axis>
+ <axis xmi:type="nattableaxis:EStructuralFeatureAxis" xmi:id="_4skI5hE6Eea1YZ-hukDkVA">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ <element xmi:type="ecore:EAttribute" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class/isActive"/>
+ </axis>
+ <axis xmi:type="nattableaxis:EStructuralFeatureAxis" xmi:id="_4skI-hE6Eea1YZ-hukDkVA">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ <element xmi:type="ecore:EAttribute" href="http://www.eclipse.org/uml2/5.0.0/UML#//Classifier/isAbstract"/>
+ </axis>
+ <axis xmi:type="nattableaxis:EStructuralFeatureAxis" xmi:id="_4skI4hE6Eea1YZ-hukDkVA">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ <element xmi:type="ecore:EAttribute" href="http://www.eclipse.org/uml2/5.0.0/UML#//NamedElement/visibility"/>
+ </axis>
+ </columnAxisProvidersHistory>
+ <rowAxisProvidersHistory xmi:type="nattableaxisprovider:MasterObjectAxisProvider" xmi:id="_4XVfwhE6Eea1YZ-hukDkVA" description="This axis provider contains the object dropped by the user into the table" name="DroppedElementAxisProvider">
+ <axis xmi:type="nattableaxis:EObjectAxis" xmi:id="_4shFkBE6Eea1YZ-hukDkVA">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@rowHeaderAxisConfiguration/@axisManagers.0"/>
+ <element xmi:type="uml:Class" href="FillColumnsSize.uml#_vzyKUBE6Eea1YZ-hukDkVA"/>
+ </axis>
+ <axis xmi:type="nattableaxis:EObjectAxis" xmi:id="_45fxoBE6Eea1YZ-hukDkVA">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@rowHeaderAxisConfiguration/@axisManagers.0"/>
+ <element xmi:type="uml:Class" href="FillColumnsSize.uml#_wQrhsBE6Eea1YZ-hukDkVA"/>
+ </axis>
+ </rowAxisProvidersHistory>
+</nattable:Table>
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.uml b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.uml
new file mode 100644
index 00000000000..67cb0807a43
--- /dev/null
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/resources/bugs/bug489720/FillColumnsSize.uml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_uyAkQBE6Eea1YZ-hukDkVA" name="RootElement">
+ <packagedElement xmi:type="uml:Class" xmi:id="_vzyKUBE6Eea1YZ-hukDkVA" name="Class1"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_wQrhsBE6Eea1YZ-hukDkVA" name="Class2"/>
+</uml:Model>
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/bugs/FillColumnsSizeTest.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/bugs/FillColumnsSizeTest.java
new file mode 100644
index 00000000000..6158969e843
--- /dev/null
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/bugs/FillColumnsSizeTest.java
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * Copyright (c) 2016 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.nattable.generic.tests.bugs;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.nebula.widgets.nattable.NatTable;
+import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
+import org.eclipse.papyrus.infra.nattable.common.editor.NatTableEditor;
+import org.eclipse.papyrus.infra.nattable.manager.table.AbstractNattableWidgetManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattablestyle.BooleanValueStyle;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattablestyle.NattablestyleFactory;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattablestyle.NattablestylePackage;
+import org.eclipse.papyrus.infra.nattable.utils.NamedStyleConstants;
+import org.eclipse.papyrus.infra.nattable.utils.PapyrusTableSizeCalculation;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.junit.utils.TableUtils;
+import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.uml2.uml.Model;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+/**
+ * This allows to manage the fill columns size tests.
+ */
+@PluginResource("resources/bugs/bug489720/FillColumnsSize.di") //$NON-NLS-1$
+public class FillColumnsSizeTest extends AbstractPapyrusTest {
+
+ /**
+ * The table name.
+ */
+ protected static final String TABLE_NAME = "GenericTable"; //$NON-NLS-1$
+
+ /**
+ * The papyrus fixture.
+ */
+ @Rule
+ public final PapyrusEditorFixture fixture = new PapyrusEditorFixture();
+
+ /**
+ * The nattable model manager.
+ */
+ protected INattableModelManager currentManager = null;
+
+ /**
+ * The nattable editor.
+ */
+ protected NatTableEditor editor;
+
+ /**
+ * Constructor.
+ */
+ public FillColumnsSizeTest() {
+ super();
+ }
+
+ /**
+ * Initialize.
+ */
+ @Before
+ public void init() {
+ // Get the model
+ final Model model = (Model) fixture.getModel();
+ Assert.assertNotNull("RootModel is null", model); //$NON-NLS-1$
+
+ // Get the table and open it
+ final Table mainTable = TableUtils.getNotationFirstTable(fixture.getModelSet(), TABLE_NAME);
+ fixture.getPageManager().openPage(mainTable);
+ fixture.flushDisplayEvents();
+
+ // Get the table and its manager
+ final IPageManager pageManager = fixture.getPageManager();
+ final List<Object> pages = pageManager.allPages();
+ pageManager.openPage(pages.get(0));
+ final IEditorPart part = fixture.getEditor().getActiveEditor();
+ Assert.assertTrue(part instanceof NatTableEditor);
+ editor = (NatTableEditor) part;
+ currentManager = (INattableModelManager) editor.getAdapter(INattableModelManager.class);
+ }
+
+ /**
+ * This allows to test the fill columns size.
+ *
+ * @throws Exception
+ * The exception
+ */
+ @Test
+ public void testFillColumnsSize() throws Exception {
+ // Set the named style
+ final BooleanValueStyle fillStyle = NattablestyleFactory.eINSTANCE.createBooleanValueStyle();
+ fillStyle.setName(NamedStyleConstants.FILL_COLUMNS_SIZE);
+ fillStyle.setBooleanValue(true);
+ final Command addStyle = new AddCommand(editor.getEditingDomain(), currentManager.getTable(), NattablestylePackage.eINSTANCE.getStyledElement_Styles(), Collections.singleton(fillStyle));
+ editor.getEditingDomain().getCommandStack().execute(addStyle);
+
+ // refresh the table to display the fill columns
+ ((NattableModelManager) currentManager).refreshNatTable();
+ fixture.flushDisplayEvents();
+
+ /// We need to calculate the needed column width
+ final NatTable nattable = currentManager.getAdapter(NatTable.class);
+ final int parentSize = nattable.getParent().getSize().x;
+
+ // Get the column width needed
+ final int columnSize = PapyrusTableSizeCalculation.getColumnFillWidth((AbstractNattableWidgetManager) currentManager, parentSize);
+
+ Assert.assertEquals("The size of first column have to be equals as needed", columnSize, currentManager.getBodyLayerStack().getBodyDataLayer().getColumnWidthByPosition(0)); //$NON-NLS-1$
+ Assert.assertEquals("The size of second column have to be equals as needed", columnSize, currentManager.getBodyLayerStack().getBodyDataLayer().getColumnWidthByPosition(1)); //$NON-NLS-1$
+ Assert.assertEquals("The size of third column have to be equals as needed", columnSize, currentManager.getBodyLayerStack().getBodyDataLayer().getColumnWidthByPosition(2)); //$NON-NLS-1$
+ Assert.assertEquals("The size of fourth column have to be equals as needed", columnSize, currentManager.getBodyLayerStack().getBodyDataLayer().getColumnWidthByPosition(3)); //$NON-NLS-1$
+ }
+
+}
diff --git a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/AllTests.java b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/AllTests.java
index f54aaffdaa7..cce285d9fde 100755
--- a/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/AllTests.java
+++ b/tests/junit/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.generic.tests/src/org/eclipse/papyrus/uml/nattable/generic/tests/tests/AllTests.java
@@ -20,6 +20,7 @@ import org.eclipse.papyrus.uml.nattable.generic.tests.bugs.AddElementsOnConnecte
import org.eclipse.papyrus.uml.nattable.generic.tests.bugs.AxisChangeIndexWithConfigurationTest;
import org.eclipse.papyrus.uml.nattable.generic.tests.bugs.AxisChangeIndexWithoutConfigurationTest;
import org.eclipse.papyrus.uml.nattable.generic.tests.bugs.EnumerationContentItemsTest;
+import org.eclipse.papyrus.uml.nattable.generic.tests.bugs.FillColumnsSizeTest;
import org.eclipse.papyrus.uml.nattable.generic.tests.bugs.InvertedAxisChangeIndexWithConfigurationTest;
import org.eclipse.papyrus.uml.nattable.generic.tests.bugs.InvertedAxisChangeIndexWithoutConfigurationTest;
import org.eclipse.papyrus.uml.nattable.generic.tests.bugs.OpenAndDeleteTest;
@@ -86,6 +87,9 @@ import org.junit.runners.Suite.SuiteClasses;
FilterNumericMatcherTest.class,
FilterUMLEnumerationMatcherTest.class,
CellEditorsConfigurationTest.class,
+
+ // Test the fillColumnsSize style
+ FillColumnsSizeTest.class,
// Stereotype inherited properties
StereotypeInheritDisplayTest.class,

Back to the top