Search in sources :

Example 6 with BuckTreeNodeDetail

use of com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetail in project buck by facebook.

the class BuckEventsConsumer method consumeParseRuleStart.

@Override
public void consumeParseRuleStart(long timestamp) {
    mParseFilesStartTimestamp = timestamp;
    // start may be called before of after progress update
    if (BuckEventsConsumer.this.mParseProgress == null) {
        BuckEventsConsumer.this.mParseProgress = new BuckTreeNodeDetail(mCurrentBuildRootElement, BuckTreeNodeDetail.DetailType.INFO, "Current file parsing progress: " + Math.round(mParseProgressValue * 100) + "%");
        BuckEventsConsumer.this.mCurrentBuildRootElement.addChild(mParseProgress);
        ApplicationManager.getApplication().invokeLater(new Runnable() {

            @Override
            public void run() {
                BuckEventsConsumer.this.mTreeModel.reload();
            }
        });
    }
}
Also used : BuckTreeNodeDetail(com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetail)

Example 7 with BuckTreeNodeDetail

use of com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetail in project buck by facebook.

the class BuckEventsConsumer method consumeBuildStart.

@Override
public void consumeBuildStart(long timestamp) {
    mMainBuildStartTimestamp = timestamp;
    if (BuckEventsConsumer.this.mBuildProgress == null) {
        BuckEventsConsumer.this.mBuildProgress = new BuckTreeNodeDetail(BuckEventsConsumer.this.mCurrentBuildRootElement, BuckTreeNodeDetail.DetailType.INFO, "Current build progress: " + Math.round(mBuildProgressValue * 100) + "%");
        // start may be called before of after progress update
        BuckEventsConsumer.this.mCurrentBuildRootElement.addChild(mBuildProgress);
        ApplicationManager.getApplication().invokeLater(new Runnable() {

            @Override
            public void run() {
                BuckEventsConsumer.this.mTreeModel.reload();
            }
        });
    }
}
Also used : BuckTreeNodeDetail(com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetail)

Example 8 with BuckTreeNodeDetail

use of com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetail in project buck by facebook.

the class DetailNodeRenderer method render.

@Override
public Component render(Object value) {
    BuckTreeNodeDetail node = (BuckTreeNodeDetail) value;
    Icon icon = AllIcons.Ide.Info_notifications;
    if (node.getType() == BuckTreeNodeDetail.DetailType.ERROR) {
        icon = AllIcons.Ide.Error;
    } else if (node.getType() == BuckTreeNodeDetail.DetailType.WARNING) {
        icon = AllIcons.Ide.Warning_notifications;
    }
    String message = "<html><pre style='margin:0px'>" + HtmlEscapers.htmlEscaper().escape(node.getDetail()) + "</pre></html>";
    JBLabel result = new JBLabel(message, icon, SwingConstants.HORIZONTAL);
    result.setToolTipText("<pre>" + node.getDetail() + "</pre>");
    return result;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) Icon(javax.swing.Icon) BuckTreeNodeDetail(com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetail)

Example 9 with BuckTreeNodeDetail

use of com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetail in project buck by facebook.

the class FileErrorNodeRenderer method render.

@Override
public Component render(Object value) {
    JBLabel result = new JBLabel(((BuckTreeNodeFileError) value).getFilePath(), AllIcons.Ide.Warning_notifications, SwingConstants.HORIZONTAL);
    BuckTreeNodeFileError buckNode = (BuckTreeNodeFileError) value;
    for (int i = 0; i < buckNode.getChildCount(); i++) {
        BuckTreeNodeDetail childNode = (BuckTreeNodeDetail) buckNode.getChildAt(i);
        if (childNode.getType() == BuckTreeNodeDetail.DetailType.ERROR) {
            result.setIcon(AllIcons.Ide.Error);
            result.setForeground(Color.RED);
            break;
        }
    }
    return result;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) BuckTreeNodeFileError(com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeFileError) BuckTreeNodeDetail(com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetail)

Aggregations

BuckTreeNodeDetail (com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetail)9 JBLabel (com.intellij.ui.components.JBLabel)2 BuckTreeNodeDetailError (com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeDetailError)1 BuckTreeNodeFileError (com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeFileError)1 BuckTreeCellRenderer (com.facebook.buck.intellij.ideabuck.ui.tree.renderers.BuckTreeCellRenderer)1 CompilerErrorItem (com.facebook.buck.intellij.ideabuck.ui.utils.CompilerErrorItem)1 ErrorExtractor (com.facebook.buck.intellij.ideabuck.ui.utils.ErrorExtractor)1 JBScrollPane (com.intellij.ui.components.JBScrollPane)1 Tree (com.intellij.ui.treeStructure.Tree)1 MouseEvent (java.awt.event.MouseEvent)1 MouseListener (java.awt.event.MouseListener)1 Icon (javax.swing.Icon)1 TreeNode (javax.swing.tree.TreeNode)1 TreePath (javax.swing.tree.TreePath)1