FolderClickListener ignores "selectable" in appFoldersTree #PL-5950

This commit is contained in:
Yuriy Artamonov 2015-09-15 15:01:44 +00:00
parent 1ae33f5821
commit 8d888e4f4f

View File

@ -37,6 +37,7 @@ import com.haulmont.cuba.web.toolkit.ui.CubaTimer;
import com.haulmont.cuba.web.toolkit.ui.CubaTree;
import com.vaadin.event.Action;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.ui.*;
import org.apache.commons.io.FileUtils;
@ -620,16 +621,18 @@ public class CubaFoldersPane extends VerticalLayout {
protected class FolderClickListener implements ItemClickEvent.ItemClickListener {
@Override
public void itemClick(ItemClickEvent event) {
Folder folder = (Folder) event.getItemId();
if (getItemClickable(folder)) {
openFolder((AbstractSearchFolder) event.getItemId());
} else if (isItemExpandable(folder)) {
Component tree = event.getComponent();
if (tree instanceof Tree) {
if (((Tree) tree).isExpanded(folder))
((Tree) tree).collapseItem(folder);
else
((Tree) tree).expandItem(folder);
if (event.getButton() == MouseEventDetails.MouseButton.LEFT) {
Folder folder = (Folder) event.getItemId();
if (getItemClickable(folder)) {
openFolder((AbstractSearchFolder) event.getItemId());
} else if (isItemExpandable(folder)) {
Component tree = event.getComponent();
if (tree instanceof Tree) {
if (((Tree) tree).isExpanded(folder))
((Tree) tree).collapseItem(folder);
else
((Tree) tree).expandItem(folder);
}
}
}
}