use of com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetailError in project buck by facebook.
the class BuckToolWindowFactory method createBuildInfoPanel.
private JComponent createBuildInfoPanel(Project project) {
Tree result = new Tree(BuckUIManager.getInstance(project).getTreeModel());
result.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
Tree tree = (Tree) e.getComponent();
int selRow = tree.getRowForLocation(e.getX(), e.getY());
TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());
if (selRow != -1 && e.getClickCount() == 2) {
TreeNode node = (TreeNode) selPath.getLastPathComponent();
if (node.isLeaf()) {
BuckTreeNodeDetail buckNode = (BuckTreeNodeDetail) node;
if (buckNode instanceof BuckTreeNodeDetailError) {
BuckToolWindowFactory.this.handleClickOnError((BuckTreeNodeDetailError) buckNode);
}
}
}
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
});
result.setCellRenderer(new BuckTreeCellRenderer());
result.setShowsRootHandles(false);
result.setRowHeight(0);
JBScrollPane treeView = new JBScrollPane(result);
return treeView;
}
Aggregations