rpgoldman / europa-pso

Automatically exported from code.google.com/p/europa-pso
0 stars 0 forks source link

Simplify cross-view notification using built-in listeners? #123

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Note the changes that had to be made to SolverModelSWT.java in r6282.  It would 
be cleaner to not have to specify particular views here.  Instead, can we have 
any views that care about updates register with the solver?

I was also wonderingf if there are other ways to simplify the updates regarding 
solver changes and model changes.  I had to add a fair amount of code to 
DetailsView to keep up to date with those.  For example, I wonder if there's a 
way to not need the code in 'setModel' which is basically duplicated from 
GanttView.

Original issue reported on code.google.com by tristanb...@gmail.com on 30 Mar 2011 at 7:41

GoogleCodeExporter commented 8 years ago
View-specific code in SolverModelSWT is not necessary. If suffices that 
DetailsView implements SolverModelView. By declaring this interface you 
registered for changes of the current model. Solvers change for the same view 
if there are multiple Europa sessions running in parallel, hence the need for 
setModel().

Original comment by kichkaylo@gmail.com on 19 Apr 2011 at 4:40

GoogleCodeExporter commented 8 years ago
I was confused about the SolverModelSWT.  I've removed that view-specific code 
which I agree isn't necessary.

The other stuff now seems less important.  I wonder if you could have a 
listener that combines SolverListener with a 'solverChanged' method (ie instead 
of listening to a specific solver, they're listening to something more 
generic).  However,  this might be a terrible idea :). 

For now I'm going to close the ticket.

Original comment by tristanb...@gmail.com on 21 Apr 2011 at 4:38