commit | bb9d1c9a9871d0869e06f3bf8209ff51b2f208a5 | [log] [tgz] |
---|---|---|
author | Edwin Park <esp1@cornell.edu> | Thu Jun 06 15:50:56 2013 -0400 |
committer | Edwin Park <esp1@cornell.edu> | Thu Jun 06 15:50:56 2013 -0400 |
tree | d22b581666fd9212f4d162b84e94703c846d4cf7 | |
parent | 36a525bc7d97b9432507afff42323960680d9046 [diff] |
use elvis operator
diff --git a/org.eclipse.nebula.widgets.nattable.core.example/src/org/eclipse/nebula/widgets/nattable/core/example/index/node/AbstractIndexNode.xtend b/org.eclipse.nebula.widgets.nattable.core.example/src/org/eclipse/nebula/widgets/nattable/core/example/index/node/AbstractIndexNode.xtend index 45a0a96..05b7957 100644 --- a/org.eclipse.nebula.widgets.nattable.core.example/src/org/eclipse/nebula/widgets/nattable/core/example/index/node/AbstractIndexNode.xtend +++ b/org.eclipse.nebula.widgets.nattable.core.example/src/org/eclipse/nebula/widgets/nattable/core/example/index/node/AbstractIndexNode.xtend
@@ -11,10 +11,7 @@ } override getDisplayName() { - if (displayName != null) - displayName - else - path.substring(path.lastIndexOf('/') + 1) + displayName ?: path.substring(path.lastIndexOf('/') + 1) } } \ No newline at end of file
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/core/layer/cell/impl/TextCellPainter.xtend b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/core/layer/cell/impl/TextCellPainter.xtend index e52428f..56267d7 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/core/layer/cell/impl/TextCellPainter.xtend +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/core/layer/cell/impl/TextCellPainter.xtend
@@ -8,11 +8,7 @@ class TextCellPainter implements CellPainter { override paintCell(Cell cell, PixelArea cellPaintArea, GraphicsContext gc) { - val text = - if (cell.dataValue != null) - cell.dataValue.toString - else - "" + val text = cell.dataValue?.toString ?: "" val centerX = cellPaintArea.width.doubleValue / 2 val centerY = cellPaintArea.height.doubleValue / 2