Update View after command has changed model [message #676475] |
Sat, 04 June 2011 14:40  |
Eclipse User |
|
|
|
Hi,
i have a TreeView with a list of Projects and Persons in this Projects (leaf).
Now i want to make a new Project. I have a Command for that. This command opens a dialog to insert the details of the new Project. But how do i update the treeView now?
I do it like this currently:
NewProjectDialog dialog = new NewProjectDialog(window.getShell());
if (dialog.open() == Window.OK) {
Project project = dialog.getProject();
// Saving the new project in databank
dbModel = new DatabankModel();
dbModel.persistEntity(project);
dbModel.save();
// Update treeViewer
projects = new ProjectsModel();
view.getViewer().setInput(projects.getProjects());
}
but it seems a little ugly to me to update the view from the command?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05772 seconds