Java 类com.intellij.uiDesigner.editor.UIFormEditor 实例源码

项目:intellij-ce-playground    文件:BoundIconRenderer.java   
@Override
@Nullable
public AnAction getClickAction() {
  return new AnAction() {
    @Override
    public void actionPerformed(AnActionEvent e) {
      List<PsiFile> formFiles = getBoundFormFiles();
      if (formFiles.size() > 0) {
        final VirtualFile virtualFile = formFiles.get(0).getVirtualFile();
        if (virtualFile == null) {
          return;
        }
        Project project = myElement.getProject();
        FileEditor[] editors = FileEditorManager.getInstance(project).openFile(virtualFile, true);
        if (myElement instanceof PsiField) {
          for (FileEditor editor: editors) {
            if (editor instanceof UIFormEditor) {
              ((UIFormEditor)editor).selectComponent(((PsiField) myElement).getName());
            }
          }
        }
      }
    }
  };
}
项目:tools-idea    文件:BoundIconRenderer.java   
@Nullable
public AnAction getClickAction() {
  return new AnAction() {
    public void actionPerformed(AnActionEvent e) {
      List<PsiFile> formFiles = getBoundFormFiles();
      if (formFiles.size() > 0) {
        final VirtualFile virtualFile = formFiles.get(0).getVirtualFile();
        if (virtualFile == null) {
          return;
        }
        Project project = myElement.getProject();
        FileEditor[] editors = FileEditorManager.getInstance(project).openFile(virtualFile, true);
        if (myElement instanceof PsiField) {
          for (FileEditor editor: editors) {
            if (editor instanceof UIFormEditor) {
              ((UIFormEditor)editor).selectComponent(((PsiField) myElement).getName());
            }
          }
        }
      }
    }
  };
}
项目:consulo-ui-designer    文件:BoundIconRenderer.java   
@Nullable
public AnAction getClickAction() {
  return new AnAction() {
    public void actionPerformed(AnActionEvent e) {
      List<PsiFile> formFiles = getBoundFormFiles();
      if (formFiles.size() > 0) {
        final VirtualFile virtualFile = formFiles.get(0).getVirtualFile();
        if (virtualFile == null) {
          return;
        }
        Project project = myElement.getProject();
        FileEditor[] editors = FileEditorManager.getInstance(project).openFile(virtualFile, true);
        if (myElement instanceof PsiField) {
          for (FileEditor editor: editors) {
            if (editor instanceof UIFormEditor) {
              ((UIFormEditor)editor).selectComponent(((PsiField) myElement).getName());
            }
          }
        }
      }
    }
  };
}
项目:intellij-ce-playground    文件:FormEditingUtil.java   
/**
 * @return {@link com.intellij.uiDesigner.designSurface.GuiEditor} from the context. Can be <code>null</code>.
 */
@Nullable
public static GuiEditor getEditorFromContext(@NotNull final DataContext context) {
  final FileEditor editor = PlatformDataKeys.FILE_EDITOR.getData(context);
  if (editor instanceof UIFormEditor) {
    return ((UIFormEditor)editor).getEditor();
  }
  else {
    return GuiEditor.DATA_KEY.getData(context);
  }
}
项目:intellij-ce-playground    文件:ReloadCustomComponentsAction.java   
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) return;
  LoaderFactory.getInstance(project).clearClassLoaderCache();
  final FileEditor[] fileEditors = FileEditorManager.getInstance(project).getAllEditors();
  for(FileEditor editor: fileEditors) {
    if (editor instanceof UIFormEditor) {
      ((UIFormEditor) editor).getEditor().readFromFile(true);
    }
  }
}
项目:intellij-ce-playground    文件:FormElementNavigatable.java   
public void navigate(boolean requestFocus) {
  if (!myVirtualFile.isValid()) return;
  OpenFileDescriptor descriptor = new OpenFileDescriptor(myProject, myVirtualFile);
  final List<FileEditor> fileEditors = FileEditorManager.getInstance(myProject).openEditor(descriptor, requestFocus);
  if (myComponentId != null) {
    for(FileEditor editor: fileEditors) {
      if (editor instanceof UIFormEditor) {
        ((UIFormEditor) editor).selectComponentById(myComponentId);
        break;
      }
    }
  }
}
项目:intellij-ce-playground    文件:AbstractToolWindowManager.java   
@Nullable
@Override
protected DesignerEditorPanelFacade getDesigner(FileEditor editor) {
  if (editor instanceof UIFormEditor) {
    UIFormEditor formEditor = (UIFormEditor)editor;
    return formEditor.getEditor();
  }
  return null;
}
项目:tools-idea    文件:FormEditingUtil.java   
/**
 * @return {@link com.intellij.uiDesigner.designSurface.GuiEditor} from the context. Can be <code>null</code>.
 */
@Nullable
public static GuiEditor getEditorFromContext(@NotNull final DataContext context) {
  final FileEditor editor = PlatformDataKeys.FILE_EDITOR.getData(context);
  if (editor instanceof UIFormEditor) {
    return ((UIFormEditor)editor).getEditor();
  }
  else {
    return GuiEditor.DATA_KEY.getData(context);
  }
}
项目:tools-idea    文件:UIDesignerToolWindowManager.java   
@Nullable
public UIFormEditor getActiveFormFileEditor() {
  FileEditor[] fileEditors = myFileEditorManager.getSelectedEditors();
  for (FileEditor fileEditor : fileEditors) {
    if (fileEditor instanceof UIFormEditor) {
      return (UIFormEditor)fileEditor;
    }
  }
  return null;
}
项目:tools-idea    文件:ReloadCustomComponentsAction.java   
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(PlatformDataKeys.PROJECT);
  if (project == null) return;
  LoaderFactory.getInstance(project).clearClassLoaderCache();
  final FileEditor[] fileEditors = FileEditorManager.getInstance(project).getAllEditors();
  for(FileEditor editor: fileEditors) {
    if (editor instanceof UIFormEditor) {
      ((UIFormEditor) editor).getEditor().readFromFile(true);
    }
  }
}
项目:tools-idea    文件:FormElementNavigatable.java   
public void navigate(boolean requestFocus) {
  if (!myVirtualFile.isValid()) return;
  OpenFileDescriptor descriptor = new OpenFileDescriptor(myProject, myVirtualFile);
  final List<FileEditor> fileEditors = FileEditorManager.getInstance(myProject).openEditor(descriptor, requestFocus);
  if (myComponentId != null) {
    for(FileEditor editor: fileEditors) {
      if (editor instanceof UIFormEditor) {
        ((UIFormEditor) editor).selectComponentById(myComponentId);
        break;
      }
    }
  }
}
项目:consulo-ui-designer    文件:FormEditingUtil.java   
/**
 * @return {@link com.intellij.uiDesigner.designSurface.GuiEditor} from the context. Can be <code>null</code>.
 */
@Nullable
public static GuiEditor getEditorFromContext(@NotNull final DataContext context)
{
    final FileEditor editor = context.getData(PlatformDataKeys.FILE_EDITOR);
    if(editor instanceof UIFormEditor)
    {
        return ((UIFormEditor) editor).getEditor();
    }
    else
    {
        return context.getData(GuiEditor.DATA_KEY);
    }
}
项目:consulo-ui-designer    文件:ReloadCustomComponentsAction.java   
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) return;
  LoaderFactory.getInstance(project).clearClassLoaderCache();
  final FileEditor[] fileEditors = FileEditorManager.getInstance(project).getAllEditors();
  for(FileEditor editor: fileEditors) {
    if (editor instanceof UIFormEditor) {
      ((UIFormEditor) editor).getEditor().readFromFile(true);
    }
  }
}
项目:consulo-ui-designer    文件:FormElementNavigatable.java   
public void navigate(boolean requestFocus) {
  if (!myVirtualFile.isValid()) return;
  OpenFileDescriptor descriptor = new OpenFileDescriptor(myProject, myVirtualFile);
  final List<FileEditor> fileEditors = FileEditorManager.getInstance(myProject).openEditor(descriptor, requestFocus);
  if (myComponentId != null) {
    for(FileEditor editor: fileEditors) {
      if (editor instanceof UIFormEditor) {
        ((UIFormEditor) editor).selectComponentById(myComponentId);
        break;
      }
    }
  }
}
项目:consulo-ui-designer    文件:AbstractToolWindowManager.java   
@Nullable
@Override
protected DesignerEditorPanelFacade getDesigner(FileEditor editor)
{
    if(editor instanceof UIFormEditor)
    {
        UIFormEditor formEditor = (UIFormEditor) editor;
        return formEditor.getEditor();
    }
    return null;
}
项目:intellij-ce-playground    文件:GuiEditor.java   
@NotNull
public UIFormEditor getEditor() {
  return myEditor;
}
项目:intellij-ce-playground    文件:ComponentTree.java   
public void setFormEditor(final UIFormEditor formEditor) {
  myFormEditor = formEditor;
}
项目:tools-idea    文件:UIDesignerToolWindowManager.java   
@Nullable
public GuiEditor getActiveFormEditor() {
  UIFormEditor formEditor = getActiveFormFileEditor();
  return formEditor == null ? null : formEditor.getEditor();
}
项目:tools-idea    文件:UIDesignerToolWindowManager.java   
public void selectionChanged(@NotNull FileEditorManagerEvent event) {
  UIFormEditor newEditor = event.getNewEditor() instanceof UIFormEditor ? (UIFormEditor)event.getNewEditor() : null;
  processFileEditorChange(newEditor);
}
项目:tools-idea    文件:ComponentTree.java   
public void setFormEditor(final UIFormEditor formEditor) {
  myFormEditor = formEditor;
}
项目:consulo-ui-designer    文件:GuiEditor.java   
@NotNull
public UIFormEditor getEditor()
{
    return myEditor;
}
项目:consulo-ui-designer    文件:ComponentTree.java   
public void setFormEditor(final UIFormEditor formEditor)
{
    myFormEditor = formEditor;
}