Java Code Examples for javafx.scene.Node#getPseudoClassStates()

The following examples show how to use javafx.scene.Node#getPseudoClassStates() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FxDump.java    From FxDock with Apache License 2.0 4 votes vote down vote up
protected void dump(Node n)
{
	SB sb = new SB(4096);
	sb.nl();
	
	while(n != null)
	{
		sb.a(CKit.getSimpleName(n));
		
		String id = n.getId();
		if(CKit.isNotBlank(id))
		{
			sb.a(" #");
			sb.a(id);
		}
		
		for(String s: n.getStyleClass())
		{
			sb.a(" .").a(s);
		}
		
		for(PseudoClass c: n.getPseudoClassStates())
		{
			sb.a(" :").a(c);
		}
		
		sb.nl();
		
		if(n instanceof Text)
		{
			sb.sp(4);
			sb.a("text: ");
			sb.a(TextTools.escapeControlsForPrintout(((Text)n).getText()));
			sb.nl();
		}
		
		CList<CssMetaData<? extends Styleable,?>> md = new CList<>(n.getCssMetaData());
		sort(md);
		
		for(CssMetaData d: md)
		{
			String k = d.getProperty();
			Object v = d.getStyleableProperty(n).getValue();
			if(shouldShow(v))
			{
				Object val = describe(v);
				sb.sp(4).a(k);
				sb.sp().a(val);
				if(d.isInherits())
				{
					sb.a(" *");
				}
				sb.nl();
			}
		}
		
		n = n.getParent();
	}
	D.print(sb);
}