當前位置: 首頁>>代碼示例>>Java>>正文


Java FormEditingUtil.showPopupUnderComponent方法代碼示例

本文整理匯總了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());
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:CreateComponentAction.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:SurroundPopupAction.java

示例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));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:CreateListenerAction.java

示例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));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:MorphAction.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:ListenerNavigateButton.java


注:本文中的com.intellij.uiDesigner.FormEditingUtil.showPopupUnderComponent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。