当前位置: 首页>>代码示例>>Java>>正文


Java HaxeNamedElementNode类代码示例

本文整理汇总了Java中com.intellij.plugins.haxe.ide.HaxeNamedElementNode的典型用法代码示例。如果您正苦于以下问题:Java HaxeNamedElementNode类的具体用法?Java HaxeNamedElementNode怎么用?Java HaxeNamedElementNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HaxeNamedElementNode类属于com.intellij.plugins.haxe.ide包,在下文中一共展示了HaxeNamedElementNode类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addElementsToProcessFrom

import com.intellij.plugins.haxe.ide.HaxeNamedElementNode; //导入依赖的package包/类
public void addElementsToProcessFrom(@Nullable final Collection<HaxeNamedElementNode> selectedElements) {
  if (selectedElements == null) {
    return;
  }
  for (HaxeNamedElementNode el : selectedElements) {
    addElementToProcess((T)el.getPsiElement());
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:9,代码来源:BaseCreateMethodsFix.java

示例2: invoke

import com.intellij.plugins.haxe.ide.HaxeNamedElementNode; //导入依赖的package包/类
@Override
public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) {
  if (!FileModificationService.getInstance().prepareFileForWrite(file)) return;
  final HaxeClass haxeClass =
    PsiTreeUtil.getParentOfType(file.findElementAt(editor.getCaretModel().getOffset()), HaxeClassDeclaration.class);
  if (haxeClass == null) return;

  final List<HaxeNamedComponent> candidates = new ArrayList<HaxeNamedComponent>();
  collectCandidates(haxeClass, candidates);

  List<HaxeNamedElementNode> selectedElements = Collections.emptyList();
  if (ApplicationManager.getApplication().isUnitTestMode()) {
    selectedElements = ContainerUtil.map(candidates, new Function<HaxeNamedComponent, HaxeNamedElementNode>() {
      @Override
      public HaxeNamedElementNode fun(HaxeNamedComponent namedComponent) {
        return new HaxeNamedElementNode(namedComponent);
      }
    });
  }
  else if (!candidates.isEmpty()) {
    final MemberChooser<HaxeNamedElementNode> chooser =
      createMemberChooserDialog(project, haxeClass, candidates, getTitle());
    chooser.show();
    selectedElements = chooser.getSelectedElements();
  }

  final BaseCreateMethodsFix createMethodsFix = createFix(haxeClass);
  doInvoke(project, editor, file, selectedElements, createMethodsFix);
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:30,代码来源:BaseHaxeGenerateHandler.java

示例3: doInvoke

import com.intellij.plugins.haxe.ide.HaxeNamedElementNode; //导入依赖的package包/类
protected void doInvoke(final Project project,
                        final Editor editor,
                        final PsiFile file,
                        final Collection<HaxeNamedElementNode> selectedElements,
                        final BaseCreateMethodsFix createMethodsFix) {
  Runnable runnable = new Runnable() {
    public void run() {
      createMethodsFix.addElementsToProcessFrom(selectedElements);
      createMethodsFix.beforeInvoke(project, editor, file);

      ApplicationManager.getApplication().runWriteAction(new Runnable() {
        public void run() {
          try {
            createMethodsFix.invoke(project, editor, file);
          }
          catch (IncorrectOperationException ex) {
            Logger.getInstance(getClass().getName()).error(ex);
          }
        }
      });
    }
  };

  if (CommandProcessor.getInstance().getCurrentCommand() == null) {
    CommandProcessor.getInstance().executeCommand(project, runnable, getClass().getName(), null);
  }
  else {
    runnable.run();
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:31,代码来源:BaseHaxeGenerateHandler.java

示例4: createMemberChooserDialog

import com.intellij.plugins.haxe.ide.HaxeNamedElementNode; //导入依赖的package包/类
protected MemberChooser<HaxeNamedElementNode> createMemberChooserDialog(final Project project,
                                                                        final HaxeClass haxeClass,
                                                                        final Collection<HaxeNamedComponent> candidates,
                                                                        String title) {
  final MemberChooser<HaxeNamedElementNode> chooser = new MemberChooser<HaxeNamedElementNode>(
    ContainerUtil.map(candidates, new Function<HaxeNamedComponent, HaxeNamedElementNode>() {
      @Override
      public HaxeNamedElementNode fun(HaxeNamedComponent namedComponent) {
        return new HaxeNamedElementNode(namedComponent);
      }
    }).toArray(new HaxeNamedElementNode[candidates.size()]), false, true, project, false) {

    protected void init() {
      super.init();
      myTree.addTreeSelectionListener(new TreeSelectionListener() {
        public void valueChanged(final TreeSelectionEvent e) {
          setOKActionEnabled(myTree.getSelectionCount() > 0);
        }
      });
    }

    protected JComponent createCenterPanel() {
      final JComponent superComponent = super.createCenterPanel();
      final JComponent optionsComponent = getOptionsComponent(haxeClass, candidates);
      if (optionsComponent == null) {
        return superComponent;
      }
      else {
        final JPanel panel = new JPanel(new BorderLayout());
        panel.add(superComponent, BorderLayout.CENTER);
        panel.add(optionsComponent, BorderLayout.SOUTH);
        return panel;
      }
    }
  };

  chooser.setTitle(title);
  chooser.setCopyJavadocVisible(false);
  return chooser;
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:41,代码来源:BaseHaxeGenerateHandler.java


注:本文中的com.intellij.plugins.haxe.ide.HaxeNamedElementNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。