oxy-label()

<oXygen/> general issues.
LBarth
Posts: 26
Joined: Mon Mar 04, 2013 1:42 pm

oxy-label()

Post by LBarth » Mon Mar 04, 2013 1:46 pm

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

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: oxy-label()

Post by Radu » Mon Mar 04, 2013 2:55 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: oxy-label()

Post by SSC » Tue Mar 05, 2013 12:04 pm

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
Simon Scholz
vogella GmbH
http://www.vogella.com

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: oxy-label()

Post by Radu » Tue Mar 05, 2013 12:38 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: oxy-label()

Post by SSC » Tue Mar 05, 2013 4:08 pm

Hi Radu,

ok, I see :)

Looking forward to the next 14.2 minor bug fix release.

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: oxy-label()

Post by SSC » Thu Mar 14, 2013 4:34 pm

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
Simon Scholz
vogella GmbH
http://www.vogella.com

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: oxy-label()

Post by Radu » Thu Mar 14, 2013 4:39 pm

Hi Simon,

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

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: oxy-label()

Post by SSC » Thu Mar 14, 2013 4:45 pm

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
Simon Scholz
vogella GmbH
http://www.vogella.com

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: oxy-label()

Post by Radu » Thu Mar 14, 2013 4:58 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: oxy-label()

Post by SSC » Wed Mar 20, 2013 12:22 pm

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
Simon Scholz
vogella GmbH
http://www.vogella.com

alex_jitianu
Posts: 705
Joined: Wed Nov 16, 2005 11:11 am

Re: oxy-label()

Post by alex_jitianu » Wed Mar 20, 2013 3:34 pm

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

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: oxy-label()

Post by Radu » Mon Jun 10, 2013 10:59 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: oxy-label()

Post by Radu » Thu Aug 15, 2013 12:51 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply