本文整理匯總了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;
}