Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Inherit colors in Table (possibly List and Tree, too)
Inherit colors in Table (possibly List and Tree, too) [message #638188] Wed, 10 November 2010 11:24 Go to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hello,

we have a tableviewer with some columns that have a different font color
using the column label provider to show a disabled state in some cases.
Now the issue we face is, that this color is overwritten by
"TableItem:hover", "TableItem:selected", and "TableItem:selected:unfocused".
If we set the font color to inherit or transparent (btw. is there any
differnce between this?) we would expect, that the color is take from the
table
as defined in the column label provider. But this does not happen. It is
always black.

Is this a bug that I should report, or is this just not possible right now,
so that I should specify this as a feature request?

Regards,
Markus
Re: Inherit colors in Table (possibly List and Tree, too) [message #638387 is a reply to message #638188] Thu, 11 November 2010 07:24 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Markus,
without a code snippet to reproduce the problem I can't say anything
about it. Could you open a bugzilla and attach a code snippet there?
Thanks,
Ivan

On 10.11.2010 1:24 PM, Markus Kr�ger wrote:
> Hello,
>
> we have a tableviewer with some columns that have a different font color
> using the column label provider to show a disabled state in some cases.
> Now the issue we face is, that this color is overwritten by
> "TableItem:hover", "TableItem:selected", and "TableItem:selected:unfocused".
> If we set the font color to inherit or transparent (btw. is there any
> differnce between this?) we would expect, that the color is take from the
> table
> as defined in the column label provider. But this does not happen. It is
> always black.
>
> Is this a bug that I should report, or is this just not possible right now,
> so that I should specify this as a feature request?
>
> Regards,
> Markus
>
>
Re: Inherit colors in Table (possibly List and Tree, too) [message #638516 is a reply to message #638387] Thu, 11 November 2010 14:42 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
done: https://bugs.eclipse.org/bugs/show_bug.cgi?id=330004

"Ivan Furnadjiev" <ivan@eclipsesource.com> schrieb im Newsbeitrag
news:ibg5gn$2v2$1@news.eclipse.org...
> Hi Markus,
> without a code snippet to reproduce the problem I can't say anything about
> it. Could you open a bugzilla and attach a code snippet there?
> Thanks,
> Ivan
>
> On 10.11.2010 1:24 PM, Markus Kr?ger wrote:
>> Hello,
>>
>> we have a tableviewer with some columns that have a different font color
>> using the column label provider to show a disabled state in some cases.
>> Now the issue we face is, that this color is overwritten by
>> "TableItem:hover", "TableItem:selected", and
>> "TableItem:selected:unfocused".
>> If we set the font color to inherit or transparent (btw. is there any
>> differnce between this?) we would expect, that the color is take from the
>> table
>> as defined in the column label provider. But this does not happen. It is
>> always black.
>>
>> Is this a bug that I should report, or is this just not possible right
>> now,
>> so that I should specify this as a feature request?
>>
>> Regards,
>> Markus
>>
>>
Re: Inherit colors in Table (possibly List and Tree, too) [message #660871 is a reply to message #638188] Tue, 22 March 2011 08:13 Go to previous messageGo to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Hi RAP-creators and users!

I currently have to solve this issue for my application. I have marked single cells of a table item with background colors. Those colors are very important. But everytime the user hovers a row, the background colors of those cells are reset to white.

In my application this is no option and with the open bug 330004 I already tried to "hack" the RAP CSS rules and delete the underlying basic TableItem:hover

But this did not work out. I guess the event is still triggered and the processor takes the "upper" defined color in TableItem. And when I deleted even this rule, the color of Table was used. Basically I was not able to remove the hover effect by editing the underlying RAP CSS.

Can you give any hint where else I could remove it? Thing is, that I definitley have to...

Maybe I could hack a processor that renders the CSS rules to the widgets. So when it gets to a TableItem with a hover effect, that I simply suppress it. But I don't even know, if RAP works that way...

Best regards,
Bassspieler
Re: Inherit colors in Table (possibly List and Tree, too) [message #660882 is a reply to message #660871] Tue, 22 March 2011 08:42 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Bassspieler,
could you post your complete Table CSS definitions?
Best,
Ivan

On 3/22/2011 10:13 AM, Bassspieler wrote:
> Hi RAP-creators and users!
>
> I currently have to solve this issue for my application. I have marked
> single cells of a table item with background colors. Those colors are
> very important. But everytime the user hovers a row, the background
> colors of those cells are reset to white.
>
> In my application this is no option and with the open bug 330004 I
> already tried to "hack" the RAP CSS rules and delete the underlying
> basic TableItem:hover
>
> But this did not work out. I guess the event is still triggered and
> the processor takes the "upper" defined color in TableItem. And when I
> deleted even this rule, the color of Table was used. Basically I was
> not able to remove the hover effect by editing the underlying RAP CSS.
>
> Can you give any hint where else I could remove it? Thing is, that I
> definitley have to...
>
> Maybe I could hack a processor that renders the CSS rules to the
> widgets. So when it gets to a TableItem with a hover effect, that I
> simply suppress it. But I don't even know, if RAP works that way...
>
> Best regards,
> Bassspieler
Re: Inherit colors in Table (possibly List and Tree, too) [message #660890 is a reply to message #660882] Tue, 22 March 2011 09:23 Go to previous messageGo to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
I hope I got you right. I am not using CSS in my application, because I have to mark single cells. So I paint them via ColumnLabelProviders in-code.

I "hacked" this CSS file of RAP:

Plugin: org.eclipse.rap.rwt
Package: org.eclipse.swt.internal.widgets.tablekit

The code I hoped, it would work was:

/*******************************************************************************
 * Copyright (c) 2008, 2011 Innoopract Informationssysteme GmbH.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Innoopract Informationssysteme GmbH - initial API and implementation
 *     EclipseSource - ongoing development
 ******************************************************************************/

/* Table default theme */

Table {
  background-image: none;
  color: #4a4a4a;
  border: none;
}

Table[BORDER] {
  border: 1px solid #a4a4a4;
}

TableItem {
  color: inherit;
  text-decoration: none;
}

TableItem:selected {
  color: white;
  background-color: #00589f;
}

TableItem:selected:unfocused {
  background-color: #959595;
  color: #ffffff;
}

TableColumn {
  background-color: #f8f8ff;
  padding: 1px 2px;
  background-image: gradient(
    linear, left top, left bottom,
    from( #fbfcfd ),
    to( #ececec )
  );
  color: #666666;
  font: 12px Verdana, "Lucida Sans", Arial, Helvetica, sans-serif;
  border-bottom:none;
}

TableColumn:hover {
  background-image: gradient(
    linear, left top, left bottom,
    from( #f4f5f6 ),
    to( #e6e6e6 )
  );
  border-bottom: none;
}

TableColumn-SortIndicator {
  background-image: none;
}

TableColumn-SortIndicator:up {
  background-image: url( resource/widget/rap/column/sort-indicator-up.png );
}

TableColumn-SortIndicator:down {
  background-image: url( resource/widget/rap/column/sort-indicator-down.png );
}

Table-Cell {
  spacing: 3px;
  padding: 4px 3px 3px 3px;
}

Table-GridLine {
  color: #dedede;
}

Table-GridLine:horizontal {
  color: transparent;
}

Table-Checkbox {
  /* 
  For backward compatibility we have to keep the width property.
  Deprecated, use "margin" instead.
  */
  width: 21px;
  margin: 0px;
  background-image: url( resource/widget/rap/button/check-unselected.png );
}

Table-Checkbox:hover {
  background-image: url( resource/widget/rap/button/check-unselected-hover.png );
}

Table-Checkbox:checked {
  background-image: url( resource/widget/rap/button/check-selected.png );
}

Table-Checkbox:checked:hover {
  background-image: url( resource/widget/rap/button/check-selected-hover.png );
}

Table-Checkbox:checked:grayed {
  background-image: url( resource/widget/rap/button/check-grayed.png );
}

Table-Checkbox:checked:grayed:hover {
  background-image: url( resource/widget/rap/button/check-grayed-hover.png );
}
Re: Inherit colors in Table (possibly List and Tree, too) [message #660993 is a reply to message #660871] Tue, 22 March 2011 15:33 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

You wont be able to fix this with an css-hack.
I will try to find a way to enable this, but it proably can only be done
with a javascript hack, which i dont recommand (since it might not work
with future versions of RAP.)

Greetings,
Tim

Am 22.03.2011 09:13, schrieb Bassspieler:
> Hi RAP-creators and users!
>
> I currently have to solve this issue for my application. I have marked
> single cells of a table item with background colors. Those colors are
> very important. But everytime the user hovers a row, the background
> colors of those cells are reset to white.
>
> In my application this is no option and with the open bug 330004 I
> already tried to "hack" the RAP CSS rules and delete the underlying
> basic TableItem:hover
>
> But this did not work out. I guess the event is still triggered and the
> processor takes the "upper" defined color in TableItem. And when I
> deleted even this rule, the color of Table was used. Basically I was not
> able to remove the hover effect by editing the underlying RAP CSS.
>
> Can you give any hint where else I could remove it? Thing is, that I
> definitley have to...
>
> Maybe I could hack a processor that renders the CSS rules to the
> widgets. So when it gets to a TableItem with a hover effect, that I
> simply suppress it. But I don't even know, if RAP works that way...
>
> Best regards,
> Bassspieler
Re: Inherit colors in Table (possibly List and Tree, too) [message #661096 is a reply to message #638188] Wed, 23 March 2011 07:37 Go to previous messageGo to next message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
That would be nice. I am well aware that this solution would mean, that I have to patch the next update again and that this could be more difficult. But I must somehow be able to get those colored single cells...

Thank you in advance,
Bassspieler
Re: Inherit colors in Table (possibly List and Tree, too) [message #661145 is a reply to message #661096] Wed, 23 March 2011 11:25 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

First, i must again make clear for anyone who reads this, that this is a
complete hack with no guarantee to work as expected, especially with any
future version of RAP, and we are NOT recommanding to use this but wait
for the "official" solution instead.

That beeing said:
- Create a new bundle or use an existing one for this.
- Create a new javascript file and register it as a resource
as described in our guide for custom-widget developer.
(Help->RAP Developer Guide->Advanced Topics->Custom
Widgets->"Registering the javascript files")
- In the file paste these lines:
------
org.eclipse.swt.widgets.TableItem.prototype._drawColors = function() {
return this._parent.getEnabled();
}
-----
- Save the file and add the bundle to your lauch-config. Done.

Again, this is a risky thing to do and will perhaps not always have
exactly the results you want to, but it will work with current CVS HEAD.

Greetings,
Tim


Am 23.03.2011 08:37, schrieb Bassspieler:
> That would be nice. I am well aware that this solution would mean, that
> I have to patch the next update again and that this could be more
> difficult. But I must somehow be able to get those colored single cells...
>
> Thank you in advance,
> Bassspieler
icon14.gif  Re: Inherit colors in Table (possibly List and Tree, too) [message #661310 is a reply to message #638188] Thu, 24 March 2011 07:27 Go to previous message
Bassspieler  is currently offline Bassspieler Friend
Messages: 40
Registered: April 2010
Location: Germany
Member
Thanks, a lot!

[Updated on: Thu, 24 March 2011 07:28]

Report message to a moderator

Previous Topic:Performance
Next Topic:Using UICallback for all Server Operations
Goto Forum:
  


Current Time: Fri Apr 26 22:16:29 GMT 2024

Powered by FUDForum. Page generated in 0.03885 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top