Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Where Can I find the complete document of CSS properties of certain Widget.
Where Can I find the complete document of CSS properties of certain Widget. [message #1822273] Tue, 03 March 2020 01:41 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 43
Registered: July 2011
Member
Is there a complete up-to-date document?
Or can I programmatically get all available CSS properties?
Or can I find complete set of properties in GITHUB src code?

For example, I now uses CLabel. but I don't know what properties are available.
There is some document in the web but I want up-to-date complete document.

---

Actually I am not using e4 RCP.
I tweaked a bit and uses it with Standalone SWT/JFace.

---

Thank you very much in advance.
Re: Where Can I find the complete document of CSS properties of certain Widget. [message #1822274 is a reply to message #1822273] Tue, 03 March 2020 01:52 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 43
Registered: July 2011
Member
More specifically, I just need the implementation of this code.

public static List<String> getAllAvailableCSSProperties(Widget w) {
	CSSSWTEngineImpl engine = getEngine(w.getDisplay());
	Element element = engine.getElement(w);
	
	 //TODO
	throw new UnsupportedOperationException();
}
Re: Where Can I find the complete document of CSS properties of certain Widget. [message #1822303 is a reply to message #1822274] Tue, 03 March 2020 15:27 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
Have a look at the CSS spy:

https://marketplace.eclipse.org/content/eclipse-4-tools-css-spy
https://download.eclipse.org/e4/snapshots/org.eclipse.e4.tools/latest/
Re: Where Can I find the complete document of CSS properties of certain Widget. [message #1822323 is a reply to message #1822303] Wed, 04 March 2020 04:12 Go to previous message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 43
Registered: July 2011
Member
Thank you for the response.
But for some reason, CSS spy didn't work for standalone SWT/JFace.

I tried the following code ant it produces a decent prop list.
Although I still don't know all of the produced props listed by this method would work.

	public static void printAllAvailableProperties(Widget w) {
		var engine = getEngine(w.getDisplay());
		
		var element = engine.getElement(w);
		
		var sb = new StringBuilder();
		sb.append("WidgetClassName : " + w.getClass().getSimpleName() + "\n");
		sb.append("ElementAdapter : " + element.getClass().getSimpleName() + "\n");
		sb.append("AvailableProperties : \n");
		
		var propList = engine.getCSSProperties(element);
		
		for(String p : propList) {
			if( p != null ) {
				sb.append(p);
				
				var compProp = engine.getCSSCompositePropertiesNames(p);
				
				if( compProp != null ) {
					sb.append(" " + Arrays.toString(compProp));	
				}
				
				sb.append("\n");
			}
		}
		
		System.out.println(sb.toString());
	}


WidgetClassName : CLabel
ElementAdapter : CompositeElement
AvailableProperties : 
cursor
margin
visibility
color
font-weight
font-size
font-stretch
font-style
margin-right
background-color
margin-left
swt-background-mode
text-transform
font-variant
font-adjust
background [background-attachment, background-color, background-image, background-position, background-repeat]
font-family
margin-top
background-image
margin-bottom
font [font-style, font-variant, font-weight, font-size, font-family]
text-align
swt-alignment

[Updated on: Wed, 04 March 2020 05:13]

Report message to a moderator

Previous Topic:Specify theme-specific preferences via CSS
Next Topic:How to change the language of Minimize/Maximize button in a PartStack?
Goto Forum:
  


Current Time: Tue Apr 23 08:43:47 GMT 2024

Powered by FUDForum. Page generated in 0.03406 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top