Java 类com.intellij.lang.ant.config.AntBuildTargetBase 实例源码

项目:consulo-apache-ant    文件:AntBuildActionGroup.java   
private static void addGroupOfTargets(final AntBuildFile buildFile,
                                      final AntBuildTarget[] targets,
                                      final Set<String> addedTargetNames,
                                      final DefaultActionGroup group) {
  final DefaultActionGroup subgroup = new DefaultActionGroup();
  for (final AntBuildTarget target : targets) {
    final String displayName = target.getName();
    if (addedTargetNames.contains(displayName)) {
      continue;
    }
    addedTargetNames.add(displayName);
    final String[] targetsToRun = (target instanceof MetaTarget) ? ((MetaTarget)target).getTargetNames() : new String[]{displayName};
    subgroup.add(getOrCreateAction(buildFile, displayName, targetsToRun, target.getNotEmptyDescription(),
                                   ((AntBuildTargetBase)target).getActionId()));
  }
  if (subgroup.getChildrenCount() > 0) {
    group.add(subgroup);
  }
}
项目:intellij-ce-playground    文件:BuildTask.java   
public BuildTask(final AntBuildTargetBase target, final AntDomElement task) {
  myTarget = target;
  myName = task.getXmlElementName();
  final DomTarget domTarget = DomTarget.getTarget(task);
  if (domTarget != null) {
    myOffset = domTarget.getTextOffset();
  }
  else {
    myOffset = task.getXmlTag().getTextOffset();
  }
}
项目:tools-idea    文件:BuildTask.java   
public BuildTask(final AntBuildTargetBase target, final AntDomElement task) {
  myTarget = target;
  myName = task.getXmlElementName();
  final DomTarget domTarget = DomTarget.getTarget(task);
  if (domTarget != null) {
    myOffset = domTarget.getTextOffset();
  }
  else {
    myOffset = task.getXmlTag().getTextOffset();
  }
}
项目:consulo-apache-ant    文件:AntExplorer.java   
private static AntBuildTarget[] getTargetObjectsFromPaths(TreePath[] paths) {
  final List<AntBuildTargetBase> targets = new ArrayList<AntBuildTargetBase>();
  for (final TreePath path : paths) {
    final Object userObject = ((DefaultMutableTreeNode)path.getLastPathComponent()).getUserObject();
    if (!(userObject instanceof AntTargetNodeDescriptor)) {
      continue;
    }
    final AntBuildTargetBase target = ((AntTargetNodeDescriptor)userObject).getTarget();
    targets.add(target);

  }
  return targets.toArray(new AntBuildTargetBase[targets.size()]);
}
项目:consulo-apache-ant    文件:AntExplorer.java   
private void popupInvoked(final Component comp, final int x, final int y) {
  Object userObject = null;
  final TreePath path = myTree.getSelectionPath();
  if (path != null) {
    final DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
    if (node != null) {
      userObject = node.getUserObject();
    }
  }
  final DefaultActionGroup group = new DefaultActionGroup();
  group.add(new RunAction());
  group.add(new CreateMetaTargetAction());
  group.add(new RemoveMetaTargetsOrBuildFileAction());
  group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE));
  group.add(new AntGroupManagerActionGroup(null, myTree));
  group.add(new RemoveGroupsAction(myTree));
  if (userObject instanceof AntBuildFileNodeDescriptor) {
    group.add(new RemoveBuildFileAction(this));
  }
  if (userObject instanceof AntTargetNodeDescriptor) {
    final AntBuildTargetBase target = ((AntTargetNodeDescriptor)userObject).getTarget();
    final DefaultActionGroup executeOnGroup =
      new DefaultActionGroup(AntBundle.message("ant.explorer.execute.on.action.group.name"), true);
    executeOnGroup.add(new ExecuteOnEventAction(target, ExecuteBeforeCompilationEvent.getInstance()));
    executeOnGroup.add(new ExecuteOnEventAction(target, ExecuteAfterCompilationEvent.getInstance()));
    executeOnGroup.addSeparator();
    executeOnGroup.add(new ExecuteBeforeRunAction(target));
    group.add(executeOnGroup);
    group.add(new AssignShortcutAction(target.getActionId()));
  }
  group.add(myAntBuildFilePropertiesAction);
  final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.ANT_EXPLORER_POPUP, group);
  popupMenu.getComponent().show(comp, x, y);
}
项目:consulo-apache-ant    文件:BuildTask.java   
public BuildTask(final AntBuildTargetBase target, final AntDomElement task) {
  myTarget = target;
  myName = task.getXmlElementName();
  final DomTarget domTarget = DomTarget.getTarget(task);
  if (domTarget != null) {
    myOffset = domTarget.getTextOffset();
  }
  else {
    myOffset = task.getXmlTag().getTextOffset();
  }
}
项目:intellij-ce-playground    文件:TreeView.java   
@Nullable
private OpenFileDescriptor getDescriptorForTargetNode(MessageNode node) {
  final String targetName = node.getText()[0];
  final AntBuildTargetBase target = (AntBuildTargetBase)myBuildFile.getModel().findTarget(targetName);
  return (target == null) ? null : target.getOpenFileDescriptor();
}
项目:tools-idea    文件:TreeView.java   
@Nullable
private OpenFileDescriptor getDescriptorForTargetNode(MessageNode node) {
  final String targetName = node.getText()[0];
  final AntBuildTargetBase target = (AntBuildTargetBase)myBuildFile.getModel().findTarget(targetName);
  return (target == null) ? null : target.getOpenFileDescriptor();
}
项目:consulo-apache-ant    文件:AntTargetNodeDescriptor.java   
public AntTargetNodeDescriptor(final Project project, final NodeDescriptor parentDescriptor, final AntBuildTargetBase target) {
  super(project, parentDescriptor);
  myTarget = target;
  myHighlightedText = new CompositeAppearance();
}
项目:consulo-apache-ant    文件:AntTargetNodeDescriptor.java   
public AntBuildTargetBase getTarget() {
  return myTarget;
}
项目:consulo-apache-ant    文件:AntExplorer.java   
public ExecuteOnEventAction(final AntBuildTargetBase target, final ExecutionEvent executionEvent) {
  super(executionEvent.getPresentableName());
  myTarget = target;
  myExecutionEvent = executionEvent;
}
项目:consulo-apache-ant    文件:TreeView.java   
@Nullable
private OpenFileDescriptor getDescriptorForTargetNode(MessageNode node) {
  final String targetName = node.getText()[0];
  final AntBuildTargetBase target = (AntBuildTargetBase)myBuildFile.getModel().findTarget(targetName);
  return (target == null) ? null : target.getOpenFileDescriptor();
}