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.