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=c1551274e48902138de4286ffcb0db5aaf5ad922;hp=bcb8bba53a445da1172ffebca139e83bd6486ee5;hb=ea1129b29fa21633cfc1df0d6a04b4bcb521b008;hpb=8ada31c956ee02aef38627ba4deaaae3eecb623a 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..c1551274e 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,82 @@ -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(); + TextPainter cellTextPainter = new TextPainter(); + cellTextPainter.setTrimText(false); + this.oddRowBgColor = GUIHelper.getColor(250, 250, 250); + this.defaultCellPainter = + new GEStyler(treeData, + new GEIconPainter( + new PaddingDecorator( + cellTextPainter, + 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)); + } + +}