cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to set coloured text from Data Utility?

TDT
14-Alexandrite
14-Alexandrite

How to set coloured text from Data Utility?

Is there any method available to set the coloured text from Data Utility?

ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
22-Sapphire I
(To:TDT)

Hi @TDT 

yes you can. 

The method is to define your own CSS style then add a style to the AbstractGuiComponent

 

for example add own CSS style with your color to a  xtheme-windchill.css

name MYCOLOR

.MYCOLOR {
color: red;
font-weight: bold;
}

and you set a style by .addStyleClass method in the DataUtility.

guiComponent.addStyleClass("MYCOLOR");

PetrH

View solution in original post

2 REPLIES 2
HelesicPetr
22-Sapphire I
(To:TDT)

Hi @TDT 

yes you can. 

The method is to define your own CSS style then add a style to the AbstractGuiComponent

 

for example add own CSS style with your color to a  xtheme-windchill.css

name MYCOLOR

.MYCOLOR {
color: red;
font-weight: bold;
}

and you set a style by .addStyleClass method in the DataUtility.

guiComponent.addStyleClass("MYCOLOR");

PetrH

ANNA_02
14-Alexandrite
(To:TDT)

This article has a similar use-case, refer - https://www.ptc.com/en/support/article/CS354557

Announcements

Top Tags