Page 1 of 1

oxy-label()

Posted: Mon Mar 04, 2013 1:46 pm
by LBarth
Hi,

Is there a way to apply bold font-weight to the oxy_label() function ?
If not is it scheduled for later versions of oXygen ?

Best regards,
Lionel

Re: oxy-label()

Posted: Mon Mar 04, 2013 2:55 pm
by Radu
Hi Lionel,

We have future plans for allowing more properties to be defined on oxy_label.
I'll update this post when this happens.

Regards,
Radu

Re: oxy-label()

Posted: Tue Mar 05, 2013 12:04 pm
by SSC
Hello Radu,

is this oxy_label() function also available in a StylesFilter?
So that I can distinguish between the CSS content by for instance changing its color?

Could you please explain how it can be used?
Currently I add new CSS content like that:

Code: Select all


StaticContent[] existingMixedContent = styles.getMixedContent();
StaticContent[] newStaticContent = mergeStaticContents(existingMixedContent,
new StringContent("New Content"));
styles.setProperty(Styles.KEY_MIXED_CONTENT,
newStaticContent);
It would be nice if the style of the existingMixedContent could stay the same and the new StringContent("New Content") could be styled separately like it is done with the oxy_label() function.

Best regards,

Simon

Re: oxy-label()

Posted: Tue Mar 05, 2013 12:38 pm
by Radu
Hi Simon,

Actually one class which implements StaticContent is called ro.sync.ecss.css.LabelContent which takes a map of properties on the constructor but right now it is obfuscated in our JAR library. I'll fix this in our code and try to push the changes in the next 14.2 minor bug fix release.

Regards,
Radu

Re: oxy-label()

Posted: Tue Mar 05, 2013 4:08 pm
by SSC
Hi Radu,

ok, I see :)

Looking forward to the next 14.2 minor bug fix release.

Best regards,

Simon

Re: oxy-label()

Posted: Thu Mar 14, 2013 4:34 pm
by SSC
Hi,

Well done, the ro.sync.ecss.css.LabelContent works. :)

Just one little enhancement would be great for the LabelContent class.
Could you provide some constants in your LabelContent class for the Map, which is passed to the LabelContent?
That would be better than putting plain Strings as keys to the Map.

I mean those keys defined here:
http://www.oxygenxml.com/doc/ug-oxygen/ ... ction.html

So it would for you be easier to modify the keys without breaking code of customers and I do not have to define those constants myself or always have to lookup the http://www.oxygenxml.com/doc/ug-oxygen/ ... ction.html manual.

Best regards,

Simon

Re: oxy-label()

Posted: Thu Mar 14, 2013 4:39 pm
by Radu
Hi Simon,

You should find constants in the ro.sync.ecss.css.functions.LabelCSSConstants class which should also be not obfuscated.

Regards,
Radu

Re: oxy-label()

Posted: Thu Mar 14, 2013 4:45 pm
by SSC
Hi Radu,

unfortunately it seems that the ro.sync.ecss.css.functions.LabelCSSConstants are obfuscated. :(
Could you please also make the LabelCSSConstants non obfuscated?

Best regards,

Simon

Re: oxy-label()

Posted: Thu Mar 14, 2013 4:58 pm
by Radu
Hi Simon,

Right, sorry about that, it was already exposed in our source code. I also added it as exposed on the 14.2 branch so if we make another minor release kit the interface will be not obfuscated in it.

Regards,
Radu

Re: oxy-label()

Posted: Wed Mar 20, 2013 12:22 pm
by SSC
Hello Radu,

in some cases we add a line break to the :BEFORE content.

Code: Select all

public static final String SYSTEM_LINE_BREAK = System.getProperty("line.separator"); //$NON-NLS-1$
When I passed text with line breaks to the ro.sync.ecss.css.StringContent.StringContent("text with line breaks") those line breaks are shown, like it is expected.

But when I use the ro.sync.ecss.css.LabelContent, the line break are not shown.

Code: Select all


Map<String, Object> labelContentMap = new HashMap<String, Object>();
labelContentMap.put("text", "text with line breaks");
labelContentMap.put("color", this.color);
LabelContent labelContent = new LabelContent(labelContentMap);
Could be please fix this problem, so that the ro.sync.ecss.css.LabelContent also supports line breaks?

Best regards,

Simon

Re: oxy-label()

Posted: Wed Mar 20, 2013 3:34 pm
by alex_jitianu
Hi,

I've added an improvement request to enable line breaks support in oxy_label. Until then, as a workaround, you could split the text by line breaks and create a LabelContent for each token and a StringContent for each line break, like this:

Code: Select all


StaticContent[] content = new StaticContent[] {
new LabelContent(token1Properties),
new StringContent("\n"),
new LabelContent(token2Properties)};
styles.setProperty(Styles.KEY_MIXED_CONTENT, content);
Best regards,
Alex

Re: oxy-label()

Posted: Mon Jun 10, 2013 10:59 am
by Radu
Hi Simon,

Oxygen 15.0 was just released and should allow an oxy-label to split on multiple lines if it has new lines in it.
You'll probably receive a notification email for the new release in a couple of days.

Regards,
Radu

Re: oxy-label()

Posted: Thu Aug 15, 2013 12:51 pm
by Radu
Just to update the thread:

The initial post in this thread was about being able to add more styles like font-weight to the oxy_label and that also became possible in Oxygen 15.0.

http://www.oxygenxml.com/doc/ug-oxygen/ ... ction.html

Regards,
Radu