private static void fillGroup(final AntBuildFile buildFile, final DefaultActionGroup group, final AntConfiguration antConfiguration) { final AntBuildModelBase model = (AntBuildModelBase)buildFile.getModel(); if (model.getDefaultTargetName() != null) { DefaultActionGroup subgroup = new DefaultActionGroup(); subgroup.add(getOrCreateAction(buildFile, TargetAction.DEFAULT_TARGET_NAME, new String[]{TargetAction.DEFAULT_TARGET_NAME}, null, model.getDefaultTargetActionId())); group.add(subgroup); } final Set<String> addedTargetNames = StringSetSpinAllocator.alloc(); try { addGroupOfTargets(buildFile, model.getFilteredTargets(), addedTargetNames, group); addGroupOfTargets(buildFile, antConfiguration.getMetaTargets(buildFile), addedTargetNames, group); } finally { StringSetSpinAllocator.dispose(addedTargetNames); } }
private @Nullable 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(); }
@Override public AntBuildModelBase getModel() { return (AntBuildModelBase) myAntConfiguration.getModel(this); }
@Override @Nullable public AntBuildModelBase getModelIfRegistered() { return (AntBuildModelBase) myAntConfiguration.getModelIfRegistered(this); }