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

项目:intellij-ce-playground    文件: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 MakeAntRunConfigurationAction());
  group.add(new RemoveMetaTargetsOrBuildFileAction());
  group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE));
  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);
}
项目:tools-idea    文件: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));
  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    文件: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);
}