Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » What is the idea behind ICodeRow / ILookupRow?
What is the idea behind ICodeRow / ILookupRow? [message #1431329] Thu, 25 September 2014 14:35 Go to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
ICodeRow / ILookupRow where introduced with Luna.

What is the idea behind those interfaces?

More precisely, I do not understand why there are some setters on the interface for some members (IconId, ExtKey, Value) and not for other (BackgroundColor, Font, ForegroundColor).

Not having the setters in the interface a good pratice. The API indicate that the object is an immutable object.

I do not think that the framework will react on a change of the Text Property when ILookupRow#setText(String) is called.

For Cell and ICell the concept is not exaclty the same:
In Tables we can call getCell() [Immutable version of the Cell] and getCellForUpdate() [Mutable version of the Cell].

Having a look at the implementation of AbstractCodeTypeWithGeneric.execOverwriteCode(ICodeRow<CODE_ID>, ICodeRow<CODE_ID>)
It is really strange to have to do the check "newCode instanceof CodeRow", only because some of the setters are not available.

When I see "X instanceOf Y" in the code I should write (as framework user), it rings a bell "something is not right"

Those ICodeRow and ILookupRow interfaces where introduced with Luna. It is a little bit confusing to add code that to not respect other patterns we have already in scout.


Re: What is the idea behind ICodeRow / ILookupRow? [message #1431348 is a reply to message #1431329] Thu, 25 September 2014 15:11 Go to previous messageGo to next message
Judith Gull is currently offline Judith GullFriend
Messages: 75
Registered: February 2010
Member
Hi Jérémie
Before Luna, code row and lookup row did not have anything in common, but were used for the same things. That's why the two interfaces ICodeRow extending ILookupRow were introduced.
Clearly, ILookupRow and ICodeRow are not intended to be immutable (because a lot of things can be change). I agree that the casting in bstractCodeTypeWithGeneric.execOverwriteCode is not a good implementation.
Please make a gerrit change with an improved solution.
Re: What is the idea behind ICodeRow / ILookupRow? [message #1431356 is a reply to message #1431348] Thu, 25 September 2014 15:23 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
This means I can add the missing setters?

* ILookupRow.setBackgroundColor(..)
* ILookupRow.setFont(..)
* ILookupRow.setForegroundColor(..)
Re: What is the idea behind ICodeRow / ILookupRow? [message #1431858 is a reply to message #1431356] Fri, 26 September 2014 08:33 Go to previous messageGo to next message
Judith Gull is currently offline Judith GullFriend
Messages: 75
Registered: February 2010
Member
Yes, I think that would make sense.
Re: What is the idea behind ICodeRow / ILookupRow? [message #1433713 is a reply to message #1431858] Mon, 29 September 2014 06:52 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
see: https://git.eclipse.org/r/34022
Previous Topic:ToolButton sometimes causes javascript error
Next Topic:Form Generator based on DB Table layout
Goto Forum:
  


Current Time: Thu Sep 26 06:44:49 GMT 2024

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

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

Back to the top