Search in sources :

Example 1 with CellTree

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);
}
Also used : PackageFragment(org.eclipse.che.ide.ext.java.shared.dto.model.PackageFragment) JavaProject(org.eclipse.che.ide.ext.java.shared.dto.model.JavaProject) PackageFragmentRoot(org.eclipse.che.ide.ext.java.shared.dto.model.PackageFragmentRoot) SingleSelectionModel(com.google.gwt.view.client.SingleSelectionModel) CellTree(com.google.gwt.user.cellview.client.CellTree) SelectionChangeEvent(com.google.gwt.view.client.SelectionChangeEvent)

Aggregations

CellTree (com.google.gwt.user.cellview.client.CellTree)1 SelectionChangeEvent (com.google.gwt.view.client.SelectionChangeEvent)1 SingleSelectionModel (com.google.gwt.view.client.SingleSelectionModel)1 JavaProject (org.eclipse.che.ide.ext.java.shared.dto.model.JavaProject)1 PackageFragment (org.eclipse.che.ide.ext.java.shared.dto.model.PackageFragment)1 PackageFragmentRoot (org.eclipse.che.ide.ext.java.shared.dto.model.PackageFragmentRoot)1