Hello, i'm trying to update a Model for GEF and have the changes shown in the view i've created. Currently no change I make is being reflected in the view, i'm using the following approach to update the model and am wondering if its the right approach to take:
Display.getDefault().asyncExec(new Runnable() {
public void run() {
String viewId = "beat.views.BeatView";
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow mainWindow = workbench
.getActiveWorkbenchWindow();
try {
BeatView view = (BeatView) mainWindow.getActivePage()
.showView(viewId);
BeatEditPart beatEditPart = (BeatEditPart)view.getGraphicalViewer().getContents();
BeatModel beatModel = (BeatModel)beatEditPart.getModel();
beatModel.setObjects(model);
} catch (PartInitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});