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

项目:hybris-integration-intellij-idea-plugin    文件:DefaultAntConfigurator.java   
private void createMetaTargets(final AntBuildFileBase buildFile) {
    Arrays.stream(metaTargets).forEach(meta -> {
        final ExecuteCompositeTargetEvent event = new ExecuteCompositeTargetEvent(meta);
        if (antConfiguration.getTargetForEvent(event) == null) {
            antConfiguration.setTargetForEvent(buildFile, event.getMetaTargetName(), event);
        }
    });
}
项目:intellij-ce-playground    文件:SaveMetaTargetDialog.java   
public SaveMetaTargetDialog(final Component parent,
                            final ExecuteCompositeTargetEvent event,
                            final AntConfigurationBase antConfiguration,
                            final AntBuildFile buildFile) {
  super(parent, true);
  myInitialEvent = event;
  myAntConfiguration = antConfiguration;
  myBuildFile = buildFile;
  setModal(true);
  init();
}
项目:intellij-ce-playground    文件:SaveMetaTargetDialog.java   
protected void doOKAction() {
  final ExecuteCompositeTargetEvent eventObject = createEventObject();
  if (myAntConfiguration.getTargetForEvent(eventObject) == null) {
    myAntConfiguration.setTargetForEvent(myBuildFile, eventObject.getMetaTargetName(), eventObject);
    super.doOKAction();
  }
  else {
    Messages.showInfoMessage(getContentPane(), AntBundle.message("save.meta.data.such.sequence.of.targets.already.exists.error.message"),
                             getTitle());
  }
}
项目:intellij-ce-playground    文件:SaveMetaTargetDialog.java   
private ExecuteCompositeTargetEvent createEventObject() {
  final ListModel model = myTargetList.getModel();
  final int size = model.getSize();
  final String[] names = ArrayUtil.newStringArray(size);
  for (int idx = 0; idx < size; idx++) {
    names[idx] = (String)model.getElementAt(idx);
  }
  final ExecuteCompositeTargetEvent event = new ExecuteCompositeTargetEvent(names);
  event.setPresentableName(myTfName.getText().trim());
  return event;
}
项目:tools-idea    文件:SaveMetaTargetDialog.java   
public SaveMetaTargetDialog(final Component parent,
                            final ExecuteCompositeTargetEvent event,
                            final AntConfigurationBase antConfiguration,
                            final AntBuildFile buildFile) {
  super(parent, true);
  myInitialEvent = event;
  myAntConfiguration = antConfiguration;
  myBuildFile = buildFile;
  setModal(true);
  init();
}
项目:tools-idea    文件:SaveMetaTargetDialog.java   
protected void doOKAction() {
  final ExecuteCompositeTargetEvent eventObject = createEventObject();
  if (myAntConfiguration.getTargetForEvent(eventObject) == null) {
    myAntConfiguration.setTargetForEvent(myBuildFile, eventObject.getMetaTargetName(), eventObject);
    super.doOKAction();
  }
  else {
    Messages.showInfoMessage(getContentPane(), AntBundle.message("save.meta.data.such.sequence.of.targets.already.exists.error.message"),
                             getTitle());
  }
}
项目:tools-idea    文件:SaveMetaTargetDialog.java   
private ExecuteCompositeTargetEvent createEventObject() {
  final ListModel model = myTargetList.getModel();
  final int size = model.getSize();
  final String[] names = ArrayUtil.newStringArray(size);
  for (int idx = 0; idx < size; idx++) {
    names[idx] = (String)model.getElementAt(idx);
  }
  final ExecuteCompositeTargetEvent event = new ExecuteCompositeTargetEvent(names);
  event.setPresentableName(myTfName.getText().trim());
  return event;
}
项目:consulo-apache-ant    文件:AntExplorer.java   
public void actionPerformed(AnActionEvent e) {
  final AntBuildFile buildFile = getCurrentBuildFile();
  final String[] targets = getTargetNamesFromPaths(myTree.getSelectionPaths());
  final ExecuteCompositeTargetEvent event = new ExecuteCompositeTargetEvent(targets);
  final SaveMetaTargetDialog dialog = new SaveMetaTargetDialog(myTree, event, AntConfigurationBase.getInstance(myProject), buildFile);
  dialog.setTitle(e.getPresentation().getText());
  dialog.show();
  if (dialog.isOK()) {
    myBuilder.queueUpdate();
    myTree.repaint();
  }
}
项目:consulo-apache-ant    文件:AntExplorer.java   
private void doAction() {
  final TreePath[] paths = myTree.getSelectionPaths();
  if (paths == null) {
    return;
  }
  try {
    // try to remove build file
    if (paths.length == 1) {
      final DefaultMutableTreeNode node = (DefaultMutableTreeNode)paths[0].getLastPathComponent();
      if (node.getUserObject() instanceof AntBuildFileNodeDescriptor) {
        final AntBuildFileNodeDescriptor descriptor = (AntBuildFileNodeDescriptor)node.getUserObject();
        if (descriptor.getBuildFile().equals(getCurrentBuildFile())) {
          removeBuildFile();
          return;
        }
      }
    }
    // try to remove meta targets
    final AntBuildTarget[] targets = getTargetObjectsFromPaths(paths);
    final AntConfigurationBase antConfiguration = AntConfigurationBase.getInstance(myProject);
    for (final AntBuildTarget buildTarget : targets) {
      if (buildTarget instanceof MetaTarget) {
        for (final ExecutionEvent event : antConfiguration.getEventsForTarget(buildTarget)) {
          if (event instanceof ExecuteCompositeTargetEvent) {
            antConfiguration.clearTargetForEvent(event);
          }
        }
      }
    }
  }
  finally {
    myBuilder.queueUpdate();
    myTree.repaint();
  }
}
项目:consulo-apache-ant    文件:SaveMetaTargetDialog.java   
public SaveMetaTargetDialog(final Component parent,
                            final ExecuteCompositeTargetEvent event,
                            final AntConfigurationBase antConfiguration,
                            final AntBuildFile buildFile) {
  super(parent, true);
  myInitialEvent = event;
  myAntConfiguration = antConfiguration;
  myBuildFile = buildFile;
  setModal(true);
  init();
}
项目:consulo-apache-ant    文件:SaveMetaTargetDialog.java   
protected void doOKAction() {
  final ExecuteCompositeTargetEvent eventObject = createEventObject();
  if (myAntConfiguration.getTargetForEvent(eventObject) == null) {
    myAntConfiguration.setTargetForEvent(myBuildFile, eventObject.getMetaTargetName(), eventObject);
    super.doOKAction();
  }
  else {
    Messages.showInfoMessage(getContentPane(), AntBundle.message("save.meta.data.such.sequence.of.targets.already.exists.error.message"),
                             getTitle());
  }
}
项目:consulo-apache-ant    文件:SaveMetaTargetDialog.java   
private ExecuteCompositeTargetEvent createEventObject() {
  final ListModel model = myTargetList.getModel();
  final int size = model.getSize();
  final String[] names = ArrayUtil.newStringArray(size);
  for (int idx = 0; idx < size; idx++) {
    names[idx] = (String)model.getElementAt(idx);
  }
  final ExecuteCompositeTargetEvent event = new ExecuteCompositeTargetEvent(names);
  event.setPresentableName(myTfName.getText().trim());
  return event;
}