-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to extend customization TreeSignleStepDebugPainterin in xml #686
Comments
If you want to override the selection painter - you don't need to override the component or add any custom annotatons. <style type="tree" id="custom-selection">
<painter>
<!-- Selection background painter -->
<selectionPainter class="package.path.to.TreeSignleStepDebugPainter">
<decorations>
<decoration opacity="0.75">
<WebShape round="0" />
<ColorBackground color="247,247,247" />
</decoration>
</decorations>
</selectionPainter>
</painter>
</style> Contents of the Also note that you can avoid having to specify @XStreamAlias( "TreeSignleStepDebugPainter" ) annotation and process that class via XmlUtils.processAnnotations( TreeSignleStepDebugPainter.class ); If you do so, the example from above would look like this: <style type="tree" id="custom-selection">
<painter>
<!-- Selection background painter -->
<selectionPainter class="TreeSignleStepDebugPainter">
<decorations>
<decoration opacity="0.75">
<WebShape round="0" />
<ColorBackground color="247,247,247" />
</decoration>
</decorations>
</selectionPainter>
</painter>
</style> |
Dear author, can your next version have this detailed DEOMO? About Painter custom XML |
Depending on what exactly you want to be in such demo - information might already exist in the styling introduction article: I will definitely be expanding demo app over time, but I doubt that it will ever be enough to answer all the possible questions about the styling aspects of WebLaF. That being said, if you have a particular example in mind that could be useful - feel free to suggest one, I'll do my best to add it to either wiki or demo application. Although "Painter custom XML" seems like a very abstract/broad topic. Can you elaborate? In case I may cover the question, here is a bit of a broad info on styling/painters and XML - In general - painter part of XML is nothing more than a representation of actual Here is one example: In the code I've posted above - /**
* Tree nodes selector painter.
* It can be provided to enable nodes multiselector.
*/
@DefaultPainter ( TreeSelectorPainter.class )
protected ITreeSelectorPainter selectorPainter; From that source you can see that if custom painter class is not specified - it points at the default one. Although in this particular case with /**
* Available decorations.
* Each decoration provides a visual representation of specific component state.
*/
protected Decorations<C, D> decorations; From here you can dive into
There could be some exceptions to this XML<->Object relation with some classes having custom XStream converters defined, like TL;DR: This is important because it is nearly impossible to showcase all of the possible uses and combinations of the styling system as it's whole point is to allow as much customization as you can possibly have over the component visuals and you are basically free to do anything to the component via it's style, although it may still be limited to an extent for a few select components at this time which haven't been updated to fully support styling. |
public class EditorTreePainter<C extends JTree, U extends WTreeUI, D extends IDecoration<C, D>> extends TreePainter<C, U, D> {
@DefaultPainter(TreeSignleStepDebugPainter.class)
protected ITreeSelectionPainter selectionPainter;
}
The text was updated successfully, but these errors were encountered: