X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.nattable%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fnattable%2FGENatTableThemeConfiguration.java;h=80882b46cc0148290c19309a16a9809ce346468d;hb=97e8b055b8ad16f1d799c81898fee075780a5a83;hp=bcb8bba53a445da1172ffebca139e83bd6486ee5;hpb=e02b8761385c8b353cccabab32897353f764cac6;p=simantics%2Fplatform.git 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..80882b46c 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,25 +1,80 @@ -package org.simantics.browsing.ui.nattable; - -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.util.GUIHelper; - -public class GENatTableThemeConfiguration extends ModernNatTableThemeConfiguration{ - - public GENatTableThemeConfiguration(GETreeData treeData) { - super(); - this.oddRowBgColor = GUIHelper.getColor(250, 250, 250); - this.defaultCellPainter = - new GEStyler(treeData, - new GEIconPainter( - new PaddingDecorator( - new TextPainter(), - 0, - 5, - 0, - 5, - false))); - } - -} +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, int style) { + super(); + this.oddRowBgColor = GUIHelper.getColor(250, 250, 250); + this.defaultCellPainter = + new GEStyler(treeData, + new GEIconPainter( + new PaddingDecorator( + new TextPainter(), + 0, + 5, + 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)); + } + +}