Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2016-03-04 22:43:41 +0000
committerGerrit Code Review @ Eclipse.org2016-03-16 14:11:15 +0000
commit60d7fd9c851b50308fa5cc400e1625ac83f571c8 (patch)
tree117dc504a332c01c69ab3fc3cbf8999100ca624f
parent78d0a8cedeb58aa3b1c7ae8624cdc8bf54004434 (diff)
downloadorg.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>
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/TreeNattableModelManager.java6
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java3
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);

Back to the top