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


Java FormEditingUtil.getSelectedComponents方法代码示例

本文整理汇总了Java中com.intellij.uiDesigner.FormEditingUtil.getSelectedComponents方法的典型用法代码示例。如果您正苦于以下问题:Java FormEditingUtil.getSelectedComponents方法的具体用法?Java FormEditingUtil.getSelectedComponents怎么用?Java FormEditingUtil.getSelectedComponents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.uiDesigner.FormEditingUtil的用法示例。


在下文中一共展示了FormEditingUtil.getSelectedComponents方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public final void actionPerformed(final AnActionEvent e) {
  final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());
  if (editor != null) {
    final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(editor);
    if (myModifying) {
      if (!editor.ensureEditable()) return;
    }
    Runnable runnable = new Runnable() {
      public void run() {
        actionPerformed(editor, selection, e);
        if (myModifying) {
          editor.refreshAndSave(true);
        }
      }
    };
    if (getCommandName() != null) {
      CommandProcessor.getInstance().executeCommand(editor.getProject(), runnable, getCommandName(), null);
    }
    else {
      runnable.run();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AbstractGuiEditorAction.java

示例2: update

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public final void update(AnActionEvent e) {
  GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());
  if (editor == null) {
    e.getPresentation().setVisible(false);
    e.getPresentation().setEnabled(false);
  }
  else {
    e.getPresentation().setVisible(true);
    e.getPresentation().setEnabled(true);
    final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(editor);
    update(editor, selection, e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AbstractGuiEditorAction.java

示例3: getBestPopupPosition

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
@Nullable
public Point getBestPopupPosition() {
  final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(myEditor);
  if (selection.size() > 0) {
    final RadComponent component = selection.get(0);
    final Rectangle bounds = component.getBounds();
    int bottom = bounds.height > 4 ? bounds.y+bounds.height-4 : bounds.y;
    int left = bounds.width > 4 ? bounds.x+4 : bounds.x;
    Point pnt = new Point(left, bottom);  // the location needs to be within the component
    return SwingUtilities.convertPoint(component.getParent().getDelegee(), pnt, this);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:GlassLayer.java

示例4: getErrorInfos

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
@NotNull protected ErrorInfo[] getErrorInfos() {
  final ArrayList<RadComponent> list = FormEditingUtil.getSelectedComponents(getEditor());
  if (list.size() != 1) {
    return ErrorInfo.EMPTY_ARRAY;
  }
  return ErrorAnalyzer.getAllErrorsForComponent(list.get(0));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:QuickFixManagerImpl.java

示例5: getErrorBounds

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
protected Rectangle getErrorBounds() {
  final ArrayList<RadComponent> list = FormEditingUtil.getSelectedComponents(getEditor());
  if (list.size() != 1) {
    return null;
  }
  RadComponent c = list.get(0);
  return SwingUtilities.convertRectangle(c.getDelegee().getParent(),
                                         c.getBounds(),
                                         getEditor().getGlassLayer());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:QuickFixManagerImpl.java

示例6: getState

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
@NotNull
public FileEditorState getState(@NotNull final FileEditorStateLevel ignored) {
  final Document document = FileDocumentManager.getInstance().getCachedDocument(myFile);
  long modificationStamp = document != null ? document.getModificationStamp() : myFile.getModificationStamp();
  final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(myEditor);
  final String[] ids = new String[selection.size()];
  for (int i = ids.length - 1; i >= 0; i--) {
    ids[i] = selection.get(i).getId();
  }
  return new MyEditorState(modificationStamp, ids);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:UIFormEditor.java


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