X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.nattable%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fnattable%2FGENatTableThemeConfiguration.java;h=41d5f2e4617bfe6b628e881186371e3a811d0fb5;hp=bcb8bba53a445da1172ffebca139e83bd6486ee5;hb=145a2884933f2ffdd48d6835729e58f1152d274e;hpb=bd5bc6e45f700e755b61bd112631796631330ecb diff --git a/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GENatTableThemeConfiguration.java b/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GENatTableThemeConfiguration.java index bcb8bba53..41d5f2e46 100644 --- a/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GENatTableThemeConfiguration.java +++ b/bundles/org.simantics.browsing.ui.nattable/src/org/simantics/browsing/ui/nattable/GENatTableThemeConfiguration.java @@ -1,13 +1,19 @@ package org.simantics.browsing.ui.nattable; +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundPainter; import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter; import org.eclipse.nebula.widgets.nattable.painter.cell.decorator.PaddingDecorator; import org.eclipse.nebula.widgets.nattable.style.theme.ModernNatTableThemeConfiguration; +import org.eclipse.nebula.widgets.nattable.tree.painter.IndentedTreeImagePainter; +import org.eclipse.nebula.widgets.nattable.tree.painter.TreeImagePainter; +import org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeEnum; import org.eclipse.nebula.widgets.nattable.util.GUIHelper; public class GENatTableThemeConfiguration extends ModernNatTableThemeConfiguration{ - public GENatTableThemeConfiguration(GETreeData treeData) { + public GENatTableThemeConfiguration(GETreeData treeData, int style) { super(); this.oddRowBgColor = GUIHelper.getColor(250, 250, 250); this.defaultCellPainter = @@ -20,6 +26,55 @@ public class GENatTableThemeConfiguration extends ModernNatTableThemeConfigurati 0, 5, false))); + + TreeImagePainter treeImagePainter = + new TreeImagePainter( + false, + GUIHelper.getImage("right"), //$NON-NLS-1$ + GUIHelper.getImage("right_down"), //$NON-NLS-1$ + GUIHelper.getImageByURL("transparent", + FileLocator.find(Activator.getDefault().getBundle(), + new Path("images/transparent.png"), null))); //$NON-NLS-1$ + this.treeStructurePainter = + new BackgroundPainter( + new PaddingDecorator( + new IndentedTreeImagePainter( + 10, + null, + CellEdgeEnum.LEFT, + treeImagePainter, + false, + 2, + true), + 0, + 5, + 0, + 5, + false)); + TreeImagePainter treeSelectionImagePainter = + new TreeImagePainter( + false, + GUIHelper.getImage("right_inv"), //$NON-NLS-1$ + GUIHelper.getImage("right_down_inv"), //$NON-NLS-1$ + GUIHelper.getImageByURL("transparent", + FileLocator.find(Activator.getDefault().getBundle(), + new Path("images/transparent.png"), null))); //$NON-NLS-1$ + this.treeStructureSelectionPainter = + new BackgroundPainter( + new PaddingDecorator( + new IndentedTreeImagePainter( + 10, + null, + CellEdgeEnum.LEFT, + treeSelectionImagePainter, + false, + 2, + true), + 0, + 5, + 0, + 5, + false)); } }