本文整理汇总了Java中com.intellij.uiDesigner.FormEditingUtil.showPopupUnderComponent方法的典型用法代码示例。如果您正苦于以下问题:Java FormEditingUtil.showPopupUnderComponent方法的具体用法?Java FormEditingUtil.showPopupUnderComponent怎么用?Java FormEditingUtil.showPopupUnderComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.uiDesigner.FormEditingUtil
的用法示例。
在下文中一共展示了FormEditingUtil.showPopupUnderComponent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
Processor<ComponentItem> processor = new Processor<ComponentItem>() {
public boolean process(final ComponentItem selectedValue) {
if (selectedValue != null) {
myLastCreatedComponent = selectedValue;
editor.getMainProcessor().startInsertProcessor(selectedValue, getCreateLocation(editor, selection));
}
return true;
}
};
PaletteListPopupStep step = new PaletteListPopupStep(editor, myLastCreatedComponent, processor,
UIDesignerBundle.message("create.component.title"));
final ListPopup listPopup = JBPopupFactory.getInstance().createListPopup(step);
if (selection.size() > 0) {
FormEditingUtil.showPopupUnderComponent(listPopup, selection.get(0));
}
else {
listPopup.showInCenterOf(editor.getRootContainer().getDelegee());
}
}
示例2: actionPerformed
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
final ListPopup groupPopup = JBPopupFactory.getInstance()
.createActionGroupPopup(UIDesignerBundle.message("surround.with.popup.title"), myActionGroup, e.getDataContext(),
JBPopupFactory.ActionSelectionAid.ALPHA_NUMBERING, true);
final JComponent component = (JComponent)e.getData(PlatformDataKeys.CONTEXT_COMPONENT);
if (component instanceof ComponentTree) {
groupPopup.show(JBPopupFactory.getInstance().guessBestPopupLocation(component));
}
else {
RadComponent selComponent = selection.get(0);
FormEditingUtil.showPopupUnderComponent(groupPopup, selComponent);
}
}
示例3: actionPerformed
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
final DefaultActionGroup actionGroup = prepareActionGroup(selection);
final JComponent selectedComponent = selection.get(0).getDelegee();
final DataContext context = DataManager.getInstance().getDataContext(selectedComponent);
final JBPopupFactory factory = JBPopupFactory.getInstance();
final ListPopup popup = factory.createActionGroupPopup(UIDesignerBundle.message("create.listener.title"), actionGroup, context,
JBPopupFactory.ActionSelectionAid.NUMBERING, true);
FormEditingUtil.showPopupUnderComponent(popup, selection.get(0));
}
示例4: actionPerformed
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
Processor<ComponentItem> processor = new Processor<ComponentItem>() {
public boolean process(final ComponentItem selectedValue) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Runnable runnable = new Runnable() {
public void run() {
for(RadComponent c: selection) {
if (!morphComponent(editor, c, selectedValue)) break;
}
editor.refreshAndSave(true);
}
};
CommandProcessor.getInstance().executeCommand(editor.getProject(), runnable, UIDesignerBundle.message("morph.component.command"), null);
editor.getGlassLayer().requestFocus();
}
});
return true;
}
};
PaletteListPopupStep step = new PaletteListPopupStep(editor, myLastMorphComponent, processor,
UIDesignerBundle.message("morph.component.title"));
step.hideNonAtomic();
if (selection.size() == 1) {
step.hideComponentClass(selection.get(0).getComponentClassName());
}
final ListPopup listPopup = JBPopupFactory.getInstance().createListPopup(step);
FormEditingUtil.showPopupUnderComponent(listPopup, selection.get(0));
}
示例5: showNavigatePopup
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public static void showNavigatePopup(final RadComponent component, final boolean showIfEmpty) {
final DefaultActionGroup actionGroup = prepareActionGroup(component);
if (actionGroup != null && actionGroup.getChildrenCount() == 0 && showIfEmpty) {
actionGroup.add(new MyNavigateAction(UIDesignerBundle.message("navigate.to.listener.empty"), null));
}
if (actionGroup != null && actionGroup.getChildrenCount() > 0) {
final DataContext context = DataManager.getInstance().getDataContext(component.getDelegee());
final JBPopupFactory factory = JBPopupFactory.getInstance();
final ListPopup popup = factory.createActionGroupPopup(UIDesignerBundle.message("navigate.to.listener.title"), actionGroup, context,
JBPopupFactory.ActionSelectionAid.NUMBERING, true);
FormEditingUtil.showPopupUnderComponent(popup, component);
}
}