diff options
author | Nicolas FAUVERGUE | 2016-03-04 22:43:41 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-03-16 14:11:15 +0000 |
commit | 60d7fd9c851b50308fa5cc400e1625ac83f571c8 (patch) | |
tree | 117dc504a332c01c69ab3fc3cbf8999100ca624f | |
parent | 78d0a8cedeb58aa3b1c7ae8624cdc8bf54004434 (diff) | |
download | org.eclipse.papyrus-60d7fd9c851b50308fa5cc400e1625ac83f571c8.tar.gz org.eclipse.papyrus-60d7fd9c851b50308fa5cc400e1625ac83f571c8.tar.xz org.eclipse.papyrus-60d7fd9c851b50308fa5cc400e1625ac83f571c8.zip |
Bug 489047: [Table] NPE with Tree Table (used in Property View)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=489047
Avoid the null pointer with the index row header layer and increase the
nattable parent composite in the properties view because of the left are
slider.
Change-Id: I63ba1a8b6ef7ac14be30117f3bd98e603198c313
Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
2 files changed, 6 insertions, 3 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/TreeNattableModelManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/TreeNattableModelManager.java index 688933f4aa8..6daf13c0562 100644 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/TreeNattableModelManager.java +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/TreeNattableModelManager.java @@ -431,8 +431,10 @@ public class TreeNattableModelManager extends NattableModelManager implements IT Composite sliderLeftComposite = new Composite(sliderComposite, SWT.NONE) { @Override public Point computeSize(int wHint, int hHint, boolean changed) { - int width = ((ClientAreaAdapter) left.getClientAreaProvider()).getWidth() - + getRowHeaderLayerStack().getIndexRowHeaderLayer().getWidth(); + int width = ((ClientAreaAdapter) left.getClientAreaProvider()).getWidth(); + if(null != getRowHeaderLayerStack() && null != getRowHeaderLayerStack().getIndexRowHeaderLayer()){ + width += getRowHeaderLayerStack().getIndexRowHeaderLayer().getWidth(); + } return new Point(width, scrollbarHeight); } }; diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java index 458fa81de1f..8ad00736b26 100644 --- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java +++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java @@ -269,7 +269,8 @@ public class NattablePropertyEditor extends AbstractPropertyEditor { // Add these values and add some extra to have correct displays final int headerHeight = natTableWidget.getPreferredHeight() - nattableManager.getBodyLayerStack().getRowHideShowLayer().getPreferredHeight(); final int bodyHeight = nattableManager.getBodyLayerStack().getRowHideShowLayer().getHeight(); - final int extra = 20; + // 16px must be added because of the left area slider + final int extra = 20 + 16; data.minimumHeight = headerHeight + bodyHeight + extra; self.setLayoutData(data); |