Results 1 to 3 of 3
Thread: GMF Model & Table View
- 10-28-2012, 04:20 PM #1
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
GMF Model & Table View
I have been given this task and would appreciate it if someone helped really. I built a Graphical Model through GMF, which is as follows;

As you see one of the nodes in the model has been selected. The task here is to create an eclipse view with a table, which will be automatically updated upon the selection of a so-called "City Node". As you may guess from the model, the table should contain path costs to all of the cities. I will later expand my solution to include a modified Dijkstra Algorithm but right now i am stuck in the creation of a table view.
I tried to build it using a TableViewer but it seems fairly complex since we need to set the input of the table on ContentProvider, but the twist here is that since we need a SelectionListener to obtain the City Coordinates(as it was ordered to calculate path-costs through the distance between two connected cities divided by the max speed, which was indicated on the connecting streets in the graph) and also the currently selected city, the path-costs need to be automatically calculated and displayed in the table upon the receipt of a click-event. This means that we somehow need to update the input which is gonna be handed to ContentProvider on every selection change.
For further information, i get the current selection through selectionChanged method of ISelectionListener interface and inside this method i put the city information in an arraylist. However although i declared this arraylist outside of the method as public, i can not seem to access its members from outside of the method and thus can not pass them to contentProvider. Consequently the input of the table can not be updated. I tried to write this post as simple as possible and i hope you guys can help me. As i can not foresee now what should be done, i would really appreciate it. Thanks in advance.
- 10-28-2012, 05:29 PM #2
Re: GMF Model & Table View
Cross posted
eclipse plugin - GMF Model & Table View - Stack Overflow
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 10-28-2012, 05:40 PM #3
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
MVC help (Model - View - Controller)
By AcousticBruce in forum New To JavaReplies: 3Last Post: 08-21-2012, 09:30 PM -
How exactly does a view listen to the model in MVC?
By AWJustAGuy in forum AWT / SwingReplies: 3Last Post: 04-29-2012, 09:01 AM -
Copy Default table model to another default table model?
By greatmajestics in forum AWT / SwingReplies: 2Last Post: 04-28-2010, 04:08 PM -
How to repaint.refresh the table (table model) with combo box selection envent
By man4ish in forum AWT / SwingReplies: 1Last Post: 01-08-2010, 06:19 AM -
mvc-model view controller
By hannes in forum AWT / SwingReplies: 5Last Post: 01-08-2010, 05:52 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks