Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Line Break in LabelHandle text used in CellHandle
femibyte
Hi folks, can someone tell me how I can specify a line break in a Label item that I'm using as a column header in a Table ?<br />
<br />
For example, if the header is : <strong class='bbc'><pre class='_prettyXprint _lang-auto _linenums:0'>Jun 2011</pre></strong><br />
I'd like it to show up as<br />
<br />
<strong class='bbc'><pre class='_prettyXprint _lang-auto _linenums:0'>Jun
2011</pre></strong><br />
<br />
in the header column.<br />
<br />
The header column code looks like this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>LabelHandle label = elementFactory.newLabel( (String)reportCols.get(i) );
label.setText(reportCol);
label.setWidth(columnWidth);
CellHandle cell = (CellHandle) tblHdrRow1.getCells().get(i);
cell.getContent().add(label);</pre>
<br />
Thanks for your help in advance.
Find more posts tagged with
Comments
mwilliams
Try something like:
label.setText(reportCol.replace(" ","\n");
femibyte
Thanks a lot. That worked.
mwilliams
You're welcome!
anonymoose
<p>Is there a setting in the eclipse plugin that can accomplish the same thing? I couldn't find it in Label's properties.</p>