|
|
|
|
|
|
Re: Is it possible to create CustomColumns for tables? [message #1725743 is a reply to message #1725422] |
Mon, 07 March 2016 11:57 |
|
The easiest approach would be to use html and appLinks.
To do this, you need to allow html for your string column by setting htmlEnabled to true.
@Override
protected boolean getConfiguredHtmlEnabled() {
return true;
}
Then you create your html and set the cell value as you would do with ordinary text.
String cellValue = HTML.appLink("editRef", TEXTS.get("Edit")).toHtml();
If the link gets clicked the callback exeAppLinkAction is executed.
@Override
protected void execAppLinkAction(String ref) {
MessageBoxes.createOk().withBody(ref + " has been clicked.").show();
}
The html builder and the property htmlEnabled is new with neon. With an older version you have to build the html string by your own and make sure that the content is encoded, if necessary. Instead of the setting the property just ensure that the html string starts with <html>. Furthermore execAppLinkAction was called execHyperlinkAction. This worked for swing and rap ui, not swt.
With neon, you have even more possibilities: You could use custom css classes if you just need a different look, use a bean column with java beans as value and custom JavaScript code or even create a custom column as it is possible for fields.
We will provide further documentation about these features in the near future.
|
|
|
Powered by
FUDForum. Page generated in 0.03717 seconds