Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2016-06-15 07:23:09 -0400
committerNicolas FAUVERGUE2016-06-16 04:31:32 -0400
commit08b2aa17fd2e606d29fbe6a7ab92ca5e807f21ec (patch)
tree801bc5140bc37c1bc9c3aa2874dd393555c81dee
parent3e9e8ce978ea0a840eaf7963e3057c612be55541 (diff)
downloadorg.eclipse.papyrus-08b2aa17fd2e606d29fbe6a7ab92ca5e807f21ec.tar.gz
org.eclipse.papyrus-08b2aa17fd2e606d29fbe6a7ab92ca5e807f21ec.tar.xz
org.eclipse.papyrus-08b2aa17fd2e606d29fbe6a7ab92ca5e807f21ec.zip
Bug 496167: [Table][Tests] Table Style error is caught durring common
table tests https://bugs.eclipse.org/bugs/show_bug.cgi?id=496167 The table seems to be not existing, so the table configuration doesn't exists anymore. Change-Id: Ia26eb1385af89d19b2f3960ec64e8f3a08b1f818 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/utils/TableHelper.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableHelper.java
index f6b0297f19a..d1fc49c6271 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableHelper.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/TableHelper.java
@@ -132,14 +132,17 @@ public class TableHelper {
* the display style to use for the table, the return value is never <code>null</code>
*/
public static final DisplayStyle getTableDisplayStyle(final Table table) {
- TableDisplayStyle displayStyle = (TableDisplayStyle) table.getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle());
- if (displayStyle == null) {
- displayStyle = (TableDisplayStyle) table.getTableConfiguration().getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle());
- }
- if (displayStyle != null) {
- return displayStyle.getDisplayStyle();
+ DisplayStyle result = DisplayStyle.NORMAL;
+ if (null != table) {
+ TableDisplayStyle displayStyle = (TableDisplayStyle) table.getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle());
+ if (null == displayStyle && null != table.getTableConfiguration()) {
+ displayStyle = (TableDisplayStyle) table.getTableConfiguration().getStyle(NattablestylePackage.eINSTANCE.getTableDisplayStyle());
+ }
+ if (displayStyle != null) {
+ result = displayStyle.getDisplayStyle();
+ }
}
- return DisplayStyle.NORMAL;
+ return result;
}

Back to the top