return;
}
result = model.getGraphModel().getHierarchicalGraph(view);
} else {
FilterProcessor processor = new FilterProcessor();
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
result = (HierarchicalGraph) processor.process((AbstractQueryImpl) query, graphModel);
}
final HierarchicalGraph graphView = result;
new Thread(new Runnable() {
public void run() {
ProgressTicketProvider progressProvider = Lookup.getDefault().lookup(ProgressTicketProvider.class);
ProgressTicket ticket = null;
if (progressProvider != null) {
ticket = progressProvider.createTicket("Export to workspace", null);
}
Progress.start(ticket);
ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
Workspace newWorkspace = pc.duplicateWorkspace(pc.getCurrentWorkspace());
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel(newWorkspace);
graphModel.clear();
graphModel.pushFrom(graphView);
Progress.finish(ticket);
String workspaceName = newWorkspace.getLookup().lookup(WorkspaceInformation.class).getName();
//StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(FilterControllerImpl.class, "FilterController.exportToNewWorkspace.status", workspaceName));
}
}, "Export filter to workspace").start();