/** {@inheritDoc} */ @Override public String convert(Node node) { return node.getName(); } }
@Override public boolean isNodeValid(Node node) { return node.getName().endsWith(JAR); }
@Override public Promise<List<Node>> intercept(Node parent, List<Node> children) { List<Node> nodes = new ArrayList<>(); for (Node node : children) { if (!node.getName().startsWith(".")) { nodes.add(node); } } return promises.resolve(nodes); }
@Override public Promise<List<Node>> intercept(Node parent, List<Node> children) { List<Node> nodes = new ArrayList<>(); for (Node child : children) { if (!child.isLeaf() || child.getName().endsWith(JAVA_SOURCE)) { nodes.add(child); } } return Promises.resolve(nodes); }
@Override public Promise<List<Node>> intercept(Node parent, List<Node> children) { List<Node> nodes = new ArrayList<>(); for (Node child : children) { if (!child.isLeaf() || child.getName().endsWith(JAR)) { nodes.add(child); } } return Promises.resolve(nodes); }
private RepositoryNode findNode(String repositoryName) { for (Node node : repositoriesList.getNodeStorage().getAll()) { if (repositoryName.equals(node.getName())) { return (RepositoryNode) node; } } return null; } }
@Override @Nullable public String getSelectedRepository() { List<Node> selection = repositoriesList.getSelectionModel().getSelectedNodes(); if (selection.isEmpty()) { return null; } return selection.get(0).getName(); }
.filter( node -> node.getName().toLowerCase().startsWith(searchRequest.toString().toLowerCase())) .findFirst(); Optional<Node> containsOptional = .filter( node -> node.getName().toLowerCase().contains(searchRequest.toString().toLowerCase())) .findFirst(); Optional<Node> matchesOptional = filteredNodes .stream() .filter(node -> node.getName().toLowerCase().matches(getSearchPattern())) .findFirst();
String name = node.getName(); String innerText = item.getInnerText();
@Override public Element render(Node node, String domID, Tree.Joint joint, int depth) { Element element = super.render(node, domID, joint, depth); element.setAttribute("name", node.getName()); if (node instanceof ResourceNode) { element.setAttribute( "path", ((ResourceNode) node).getData().getLocation().toString()); } if (node instanceof HasAttributes && ((HasAttributes) node).getAttributes().containsKey(CUSTOM_BACKGROUND_FILL)) { element .getFirstChildElement() .getStyle() .setBackgroundColor( ((HasAttributes) node).getAttributes().get(CUSTOM_BACKGROUND_FILL).get(0)); } return element; } });
@Inject public ChangesListPresenter( ChangesListView view, ComparePresenter comparePresenter, ChangesPanelPresenter changesPanelPresenter) { this.comparePresenter = comparePresenter; this.view = view; this.changesPanelPresenter = changesPanelPresenter; this.changesPanelPresenter.setFileNodeDoubleClickHandler( (path, status) -> this.onCompareClicked()); this.view.setDelegate(this); SelectionChangedHandler handler = event -> { Node node = getFirst(event.getSelection(), null); if (node == null) { return; } if (node instanceof ChangedFolderNode) { ChangesListPresenter.this.view.setEnableCompareButton(false); return; } ChangesListPresenter.this.view.setEnableCompareButton(true); ChangesListPresenter.this.file = node.getName(); }; ChangesPanelView changesPanelView = changesPanelPresenter.getView(); changesPanelView.addSelectionHandler(handler); this.view.setChangesPanelView(changesPanelView); }
@Override public Element render(N node, String domID, Tree.Joint joint, int depth) { if (node instanceof HasNewPresentation) { NewNodePresentation presentation = ((HasNewPresentation) node).getPresentation(); return renderNewPresentation(presentation, domID, joint, depth); } else if (node instanceof HasPresentation) { NodePresentation presentation = ((HasPresentation) node).getPresentation(false); return renderGenericPresentation(presentation, domID, joint, depth); } else { NodePresentation presentation = new NodePresentation(); presentation.setPresentableText(node.getName()); return renderGenericPresentation(presentation, domID, joint, depth); } }
private void createRepositoriesList() { NodeStorage nodeStorage = new NodeStorage(); NodeLoader nodeLoader = new NodeLoader(); repositoriesList = new Tree(nodeStorage, nodeLoader); repositoriesList.getElement().getStyle().setProperty("maxHeight", "200px"); repositoriesList .getNodeStorage() .addSortInfo(new StoreSortInfo(Comparator.comparing(Node::getName), SortDir.ASC)); SelectionModel selectionModel = repositoriesList.getSelectionModel(); selectionModel.setSelectionMode(SelectionModel.Mode.SINGLE); selectionModel.addSelectionChangedHandler( event -> { Node node = getFirst(event.getSelection(), null); if (node == null) { delegate.onRepositorySelectionChanged(null); } else { delegate.onRepositorySelectionChanged(node.getName()); } }); }
@Override public Element render(Node node, String domID, Tree.Joint joint, int depth) { Element element = super.render(node, domID, joint, depth); element.setAttribute("name", node.getName()); if (node instanceof ResourceNode) { element.setAttribute( "path", ((ResourceNode) node).getData().getLocation().toString()); element.setAttribute( "project", ((ResourceNode) node) .getData() .getRelatedProject() .get() .getLocation() .toString()); } if (node instanceof HasAttributes && ((HasAttributes) node).getAttributes().containsKey(CUSTOM_BACKGROUND_FILL)) { element .getFirstChildElement() .getStyle() .setBackgroundColor( ((HasAttributes) node).getAttributes().get(CUSTOM_BACKGROUND_FILL).get(0)); } return element; } });
for (NodeDescriptor removed : removedNodes) { if (!tree.getNodeStorage().remove(removed.getNode())) { Log.info(this.getClass(), "Failed to remove node: " + removed.getNode().getName());
@Override public Element render( final Node node, final String domID, final Tree.Joint joint, final int depth) { // Initialize HTML elements. final Element rootContainer = super.render(node, domID, joint, depth); final Element nodeContainer = rootContainer.getFirstChildElement(); final Element checkBoxElement = new CheckBox().getElement(); final InputElement checkBoxInputElement = (InputElement) checkBoxElement.getElementsByTagName("input").getItem(0); final Path nodePath = node instanceof ChangedFileNode ? Path.valueOf(node.getName()) : ((ChangedFolderNode) node).getPath(); setCheckBoxState(nodePath, checkBoxInputElement); setCheckBoxClickHandler(nodePath, checkBoxElement, checkBoxInputElement.isChecked()); // Paste check-box element to node container. nodeContainer.insertAfter(checkBoxElement, nodeContainer.getFirstChild()); return rootContainer; }
Element element = super.render(node, domID, joint, depth); element.setAttribute("name", node.getName());
if (resource.isProject()) { notificationManager.notify( locale.projectRemoved(node.getName()), SUCCESS, NOT_EMERGE_MODE);