Editable TableViewer with background color [message #1073131] |
Wed, 24 July 2013 03:35  |
Eclipse User |
|
|
|
Hello everyone,
i want to use tableviewer with colored cells like in rap demo example.
The difference between this example and my table is that my cells are editable.
My table styles are SWT.VIRTUAL | SWT.BORDER | SWT.FULL_SELECTION.
The columns are colored, but when i edit an cell the color change to default color (gray / white). How can i keep my individual cell color after editing an column?
Best Regards,
Christian
|
|
|
|
Re: Editable TableViewer with background color [message #1074148 is a reply to message #1073624] |
Fri, 26 July 2013 03:39   |
Eclipse User |
|
|
|
Hello Ivan,
here are three screenshots. In first picture you see an example table with two columns.

The second column is editable and hast another background color. When i edit this field it changes its color to mouseover (second picture).

After when i select another cell it changes its color to default color (third picture).

I set color in ColumnLabelProvider on update event:
table.addEditingColumn("editable field",
150,
new ColumnLabelProvider() {
@Override
public void update(ViewerCell cell) {
super.update(cell);
DemoObj element = (DemoObj)cell.getElement();
cell.setText(element.getEditableField());
cell.setBackground(new Color(Display.getCurrent(), 123, 123,123));
}
},
Best Regards,
Christian
Attachment: picture1.png
(Size: 10.30KB, Downloaded 684 times)
Attachment: picture2.png
(Size: 10.58KB, Downloaded 656 times)
Attachment: picture3.png
(Size: 10.75KB, Downloaded 657 times)
|
|
|
Re: Editable TableViewer with background color [message #1074160 is a reply to message #1074148] |
Fri, 26 July 2013 03:56   |
Eclipse User |
|
|
|
Hi Christian,
I don't have an answer in hand. Please open a bugzilla with yours
snippet attached to it and we will investigate the cause.
Thanks,
Ivan
On 7/26/2013 10:39 AM, Christian Wrobel wrote:
> Hello Ivan,
>
> here are three screenshots. In first picture you see an example table with two columns.
>
>
>
> The second column is editable and hast another background color. When i edit this field it changes its color to mouseover (second picture).
>
>
> After when i select another cell it changes its color to default color (third picture).
>
>
>
> I set color in ColumnLabelProvider on update event:
>
>
> table.addEditingColumn("editable field",
> 150,
> new ColumnLabelProvider() {
>
> @Override
> public void update(ViewerCell cell) {
> super.update(cell);
> DemoObj element = (DemoObj)cell.getElement();
>
> cell.setText(element.getEditableField());
>
> cell.setBackground(new Color(Display.getCurrent(), 123, 123,123));
>
> }
> },
>
>
>
> Best Regards,
> Christian
>
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.16253 seconds