本文整理汇总了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());
}
}
示例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);
}
示例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();
}
}
示例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;
}