Search in sources :

Example 1 with AntBuildModelBase

use of com.intellij.lang.ant.config.AntBuildModelBase in project intellij-community by JetBrains.

the class AntBuildFileNodeDescriptor method update.

public boolean update() {
    CompositeAppearance oldAppearance = myAppearance;
    myAppearance = new CompositeAppearance();
    myAppearance.getEnding().addText(myBuildFile.getPresentableName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    final AntBuildModelBase buildModel = myBuildFile.getModelIfRegistered();
    if (buildModel != null) {
        AntTargetNodeDescriptor.addShortcutText(buildModel.getDefaultTargetActionId(), myAppearance);
    }
    myAppearance.setIcon(AntIcons.Build);
    myName = myBuildFile.getPresentableName();
    return !Comparing.equal(myAppearance, oldAppearance);
}
Also used : AntBuildModelBase(com.intellij.lang.ant.config.AntBuildModelBase) CompositeAppearance(com.intellij.openapi.roots.ui.util.CompositeAppearance)

Example 2 with AntBuildModelBase

use of com.intellij.lang.ant.config.AntBuildModelBase in project intellij-community by JetBrains.

the class TreeView method getDescriptorForTaskNode.

@Nullable
private OpenFileDescriptor getDescriptorForTaskNode(MessageNode node) {
    final String[] text = node.getText();
    if (text == null || text.length == 0)
        return null;
    final String taskName = text[0];
    final TreeNode parentNode = node.getParent();
    if (!(parentNode instanceof MessageNode))
        return null;
    final MessageNode messageNode = (MessageNode) parentNode;
    if (messageNode.getType() != AntBuildMessageView.MessageType.TARGET)
        return null;
    final BuildTask task = ((AntBuildModelBase) myBuildFile.getModel()).findTask(messageNode.getText()[0], taskName);
    return (task == null) ? null : task.getOpenFileDescriptor();
}
Also used : BuildTask(com.intellij.lang.ant.config.impl.BuildTask) AntBuildModelBase(com.intellij.lang.ant.config.AntBuildModelBase) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

AntBuildModelBase (com.intellij.lang.ant.config.AntBuildModelBase)2 BuildTask (com.intellij.lang.ant.config.impl.BuildTask)1 CompositeAppearance (com.intellij.openapi.roots.ui.util.CompositeAppearance)1 Nullable (org.jetbrains.annotations.Nullable)1