use of com.google.gwt.user.cellview.client.CellTree in project che by eclipse.
the class MoveViewImpl method setTreeOfDestinations.
/** {@inheritDoc} */
@Override
public void setTreeOfDestinations(List<JavaProject> projects) {
final SingleSelectionModel<Object> selectionModel = new SingleSelectionModel<>();
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
Object object = selectionModel.getSelectedObject();
if (object instanceof JavaProject) {
JavaProject project = (JavaProject) object;
delegate.setMoveDestinationPath(project.getPath(), project.getPath());
}
if (object instanceof PackageFragmentRoot) {
PackageFragmentRoot fragmentRoot = (PackageFragmentRoot) object;
delegate.setMoveDestinationPath(fragmentRoot.getPath(), fragmentRoot.getProjectPath());
}
if (object instanceof PackageFragment) {
PackageFragment fragment = (PackageFragment) object;
delegate.setMoveDestinationPath(fragment.getPath(), fragment.getProjectPath());
}
}
});
CellTree tree = new CellTree(new ProjectsAndPackagesModel(projects, selectionModel, resources), null, cellTreeResources);
tree.setAnimationEnabled(true);
treePanel.clear();
treePanel.add(tree);
}
Aggregations