Search in sources :

Example 1 with NodePresentation

use of org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation in project che by eclipse.

the class AbstractPresentationNode method getPresentation.

@Override
public NodePresentation getPresentation(boolean update) {
    if (nodePresentation == null) {
        nodePresentation = new NodePresentation();
        updatePresentation(nodePresentation);
    }
    if (update) {
        updatePresentation(nodePresentation);
    }
    return nodePresentation;
}
Also used : NodePresentation(org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation)

Example 2 with NodePresentation

use of org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation in project che by eclipse.

the class TestResultGroupNode method getPresentation.

@Override
public NodePresentation getPresentation(boolean update) {
    if (nodePresentation == null) {
        nodePresentation = new NodePresentation();
        updatePresentation(nodePresentation);
    }
    if (update) {
        updatePresentation(nodePresentation);
    }
    return nodePresentation;
}
Also used : NodePresentation(org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation)

Example 3 with NodePresentation

use of org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation in project che by eclipse.

the class TestResultMethodNode method getPresentation.

@Override
public NodePresentation getPresentation(boolean update) {
    if (nodePresentation == null) {
        nodePresentation = new NodePresentation();
        updatePresentation(nodePresentation);
    }
    if (update) {
        updatePresentation(nodePresentation);
    }
    return nodePresentation;
}
Also used : NodePresentation(org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation)

Example 4 with NodePresentation

use of org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation in project che by eclipse.

the class FindResultGroupNode method getChildrenImpl.

/** {@inheritDoc} */
@Override
protected Promise<List<Node>> getChildrenImpl() {
    List<Node> fileNodes = new ArrayList<>();
    for (Resource resource : findResults) {
        if (resource.getResourceType() != FILE) {
            continue;
        }
        FileNode node = nodeFactory.newFileNode((File) resource, null);
        NodePresentation presentation = node.getPresentation(true);
        presentation.setInfoText(resource.getLocation().toString());
        presentation.setInfoTextWrapper(Pair.of("(", ")"));
        presentation.setInfoTextCss("color:" + getEditorInfoTextColor() + ";font-size: 11px");
        fileNodes.add(node);
    }
    //sort nodes by file name
    Collections.sort(fileNodes, new NameComparator());
    return Promises.resolve(fileNodes);
}
Also used : NodePresentation(org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation) FileNode(org.eclipse.che.ide.resources.tree.FileNode) Node(org.eclipse.che.ide.api.data.tree.Node) ResourceNode(org.eclipse.che.ide.resources.tree.ResourceNode) AbstractTreeNode(org.eclipse.che.ide.api.data.tree.AbstractTreeNode) ArrayList(java.util.ArrayList) Resource(org.eclipse.che.ide.api.resources.Resource) FileNode(org.eclipse.che.ide.resources.tree.FileNode) NameComparator(org.eclipse.che.ide.ui.smartTree.compare.NameComparator)

Example 5 with NodePresentation

use of org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation in project che by eclipse.

the class FindResultGroupNode method getPresentation.

/** {@inheritDoc} */
@Override
public NodePresentation getPresentation(boolean update) {
    if (nodePresentation == null) {
        nodePresentation = new NodePresentation();
        updatePresentation(nodePresentation);
    }
    if (update) {
        updatePresentation(nodePresentation);
    }
    return nodePresentation;
}
Also used : NodePresentation(org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation)

Aggregations

NodePresentation (org.eclipse.che.ide.ui.smartTree.presentation.NodePresentation)10 ArrayList (java.util.ArrayList)1 AbstractTreeNode (org.eclipse.che.ide.api.data.tree.AbstractTreeNode)1 Node (org.eclipse.che.ide.api.data.tree.Node)1 Resource (org.eclipse.che.ide.api.resources.Resource)1 FileNode (org.eclipse.che.ide.resources.tree.FileNode)1 ResourceNode (org.eclipse.che.ide.resources.tree.ResourceNode)1 NameComparator (org.eclipse.che.ide.ui.smartTree.compare.NameComparator)1