@Override public boolean supportGoInto() { return getData() instanceof Container; }
@Nullable @Override public Resource apply(@Nullable Node input) { checkNotNull(input); checkState(input instanceof ResourceNode); return ((ResourceNode) input).getData(); } };
@Nullable @Override public Resource apply(@Nullable Node input) { checkNotNull(input); checkState(input instanceof ResourceNode); return ((ResourceNode) input).getData(); } };
@Nullable @Override public Resource apply(@Nullable Node input) { checkNotNull(input); checkState(input instanceof ResourceNode); return ((ResourceNode) input).getData(); } };
@Nullable @Override public Resource apply(@Nullable Node input) { checkNotNull(input); checkState(input instanceof ResourceNode); return ((ResourceNode) input).getData(); } };
@Nullable @Override public Resource apply(@Nullable Node input) { checkNotNull(input); checkState(input instanceof ResourceNode); return ((ResourceNode) input).getData(); } };
@Override public String getName() { return getData().getName(); }
@Override public boolean isLeaf() { return getData().getResourceType() == Resource.FILE; }
protected boolean isSourceOrPackage(ResourceNode node) { return node.getData().getParentWithMarker(SourceFolderMarker.ID).isPresent(); }
private int getClassIndex(Node node) { if (node instanceof ResourceNode && (((ResourceNode) node).getData().getResourceType() == FOLDER || ((ResourceNode) node).getData().getResourceType() == PROJECT)) { return 1; } if (node instanceof ResourceNode && ((ResourceNode) node).getData().getResourceType() == FILE) { return 2; } if (node instanceof SyntheticNode<?>) { return 3; } return 0; }
private ResourceNode getRootResourceNode(Path path) { return (ResourceNode) tree.getRootNodes() .stream() .filter(node -> node instanceof ResourceNode) .filter(node -> ((ResourceNode) node).getData().getLocation().isPrefixOf(path)) .findFirst() .orElse(null); } }
private ResourceNode getNodeByPath(Path path) { return (ResourceNode) tree.getNodeStorage() .getAll() .stream() .filter(node -> node instanceof ResourceNode) .filter(node -> ((ResourceNode) node).getData().getLocation().equals(path)) .findFirst() .orElse(null); }
private boolean isNodeServesLocation(Node node, Path location) { return node instanceof ResourceNode && ((ResourceNode) node).getData().getLocation().equals(location); }
@Override public void onSelectionChanged(SelectionChangedEvent event) { final List<Node> selection = event.getSelection(); if (selection == null || selection.isEmpty()) { delegate.onPathSelected(Path.ROOT); return; } final Node head = selection.get(0); if (head instanceof ResourceNode) { final Path path = ((ResourceNode) head).getData().getLocation(); delegate.onPathSelected(path); } } });
private void acceptButtonClicked() { List<Node> nodes = tree.getSelectionModel().getSelectedNodes(); if (nodes.isEmpty()) { return; } Node selectedNode = nodes.get(0); if (selectedNode instanceof ResourceNode) { final Resource resource = ((ResourceNode) selectedNode).getData(); delegate.setSelectedNode(resource, resolveFQN(resource)); } hide(); } }
private void acceptButtonClicked() { List<Node> nodes = tree.getSelectionModel().getSelectedNodes(); if (nodes.isEmpty()) { return; } Node selectedNode = nodes.get(0); delegate.setSelectedNode(((ResourceNode) selectedNode).getData().getLocation().toString()); hide(); } }
@Override public void onMarkerChanged(MarkerChangedEvent event) { if (event.getMarker().getType().equals(CutResourceMarker.ID) && getData().equals(event.getResource())) { resourceIsCut = event.getStatus() != Marker.REMOVED; } } });
private void acceptButtonClicked() { List<Node> nodes = tree.getSelectionModel().getSelectedNodes(); if (nodes.isEmpty()) { return; } Node selectedNode = nodes.get(0); if (selectedNode instanceof ResourceNode) { delegate.setSelectedPath(((ResourceNode) selectedNode).getData().getLocation().toString()); } hide(); } }
@Override public void onMarkerChanged(MarkerChangedEvent event) { final Tree tree = view.getTree(); for (Node node : tree.getNodeStorage().getAll()) { if (node instanceof ResourceNode && ((ResourceNode) node) .getData() .getLocation() .equals(event.getResource().getLocation())) { tree.refresh(node); } } }