Java 类com.intellij.uiDesigner.GuiDesignerConfiguration 实例源码

项目:intellij-ce-playground    文件:CreateDialogAction.java   
@NotNull
protected PsiElement[] create(final String newName, final PsiDirectory directory) throws IncorrectOperationException {
  PsiFile sourceFile = PsiFileFactory.getInstance(directory.getProject())
    .createFileFromText(newName + ".java", createClassBody(newName, myRecentGenerateOK, myRecentGenerateCancel, myRecentGenerateMain));
  sourceFile = (PsiFile)directory.add(sourceFile);

  JavaCodeStyleManager.getInstance(directory.getProject()).shortenClassReferences(sourceFile);
  CodeStyleManager.getInstance(directory.getProject()).reformat(sourceFile);

  final PsiPackage aPackage = JavaDirectoryService.getInstance().getPackage(directory);
  final String packageName = aPackage.getQualifiedName();
  final String fqClassName = packageName.length() == 0 ? newName : packageName + "." + newName;

  final String formBody = createFormBody(fqClassName, "/com/intellij/uiDesigner/NewDialog.xml",
                                         GuiDesignerConfiguration.getInstance(directory.getProject()).DEFAULT_LAYOUT_MANAGER);
  final PsiFile formFile = PsiFileFactory.getInstance(directory.getProject()).createFileFromText(newName + ".form", formBody);
  PsiElement createdFile = directory.add(formFile);

  PsiClass[] classes = ((PsiJavaFile)sourceFile).getClasses();
  return new PsiElement[]{createdFile, classes[0]};
}
项目:tools-idea    文件:CreateDialogAction.java   
@NotNull
protected PsiElement[] create(final String newName, final PsiDirectory directory) throws IncorrectOperationException {
  PsiFile sourceFile = PsiFileFactory.getInstance(directory.getProject())
    .createFileFromText(newName + ".java", createClassBody(newName, myRecentGenerateOK, myRecentGenerateCancel, myRecentGenerateMain));
  sourceFile = (PsiFile)directory.add(sourceFile);

  JavaCodeStyleManager.getInstance(directory.getProject()).shortenClassReferences(sourceFile);
  CodeStyleManager.getInstance(directory.getProject()).reformat(sourceFile);

  final PsiPackage aPackage = JavaDirectoryService.getInstance().getPackage(directory);
  final String packageName = aPackage.getQualifiedName();
  final String fqClassName = packageName.length() == 0 ? newName : packageName + "." + newName;

  final String formBody = createFormBody(fqClassName, "/com/intellij/uiDesigner/NewDialog.xml",
                                         GuiDesignerConfiguration.getInstance(directory.getProject()).DEFAULT_LAYOUT_MANAGER);
  final PsiFile formFile = PsiFileFactory.getInstance(directory.getProject()).createFileFromText(newName + ".form", formBody);
  PsiElement createdFile = directory.add(formFile);

  PsiClass[] classes = ((PsiJavaFile)sourceFile).getClasses();
  return new PsiElement[]{createdFile, classes[0]};
}
项目:consulo-ui-designer    文件:CreateDialogAction.java   
@NotNull
protected PsiElement[] create(final String newName, final PsiDirectory directory) throws IncorrectOperationException {
  PsiFile sourceFile = PsiFileFactory.getInstance(directory.getProject())
    .createFileFromText(newName + ".java", createClassBody(newName, myRecentGenerateOK, myRecentGenerateCancel, myRecentGenerateMain));
  sourceFile = (PsiFile)directory.add(sourceFile);

  JavaCodeStyleManager.getInstance(directory.getProject()).shortenClassReferences(sourceFile);
  CodeStyleManager.getInstance(directory.getProject()).reformat(sourceFile);

  final PsiJavaPackage aPackage = JavaDirectoryService.getInstance().getPackage(directory);
  final String packageName = aPackage.getQualifiedName();
  final String fqClassName = packageName.length() == 0 ? newName : packageName + "." + newName;

  final String formBody = createFormBody(fqClassName, "/com/intellij/uiDesigner/NewDialog.xml",
                                         GuiDesignerConfiguration.getInstance(directory.getProject()).DEFAULT_LAYOUT_MANAGER);
  final PsiFile formFile = PsiFileFactory.getInstance(directory.getProject()).createFileFromText(newName + ".form", formBody);
  PsiElement createdFile = directory.add(formFile);

  PsiClass[] classes = ((PsiJavaFile)sourceFile).getClasses();
  return new PsiElement[]{createdFile, classes[0]};
}
项目:intellij-ce-playground    文件:CreateFormAction.java   
protected void doOKAction() {
  if (myCreateBoundClassCheckbox.isSelected()) {
    myLastClassName = myClassNameTextField.getText();
  }
  else {
    myLastClassName = null;
  }
  myLastLayoutManager = myBaseLayoutManagerCombo.getSelectedName();
  GuiDesignerConfiguration.getInstance(myProject).DEFAULT_LAYOUT_MANAGER = myLastLayoutManager;
  final String inputString = myFormNameTextField.getText().trim();
  if (myValidator.checkInput(inputString) && myValidator.canClose(inputString)) {
    close(OK_EXIT_CODE);
  }
  close(OK_EXIT_CODE);
}
项目:intellij-ce-playground    文件:LayoutManagerRegistry.java   
public static RadLayoutManager createDefaultGridLayoutManager(Project project) {
  final String defaultLayoutManager = GuiDesignerConfiguration.getInstance(project).DEFAULT_LAYOUT_MANAGER;
  if (defaultLayoutManager.equals(UIFormXmlConstants.LAYOUT_GRIDBAG)) {
    return new RadGridBagLayoutManager();
  }
  else if (defaultLayoutManager.equals(UIFormXmlConstants.LAYOUT_FORM)) {
    return new RadFormLayoutManager();
  }
  else {
    return new RadGridLayoutManager();
  }
}
项目:tools-idea    文件:CreateFormAction.java   
protected void doOKAction() {
  if (myCreateBoundClassCheckbox.isSelected()) {
    myLastClassName = myClassNameTextField.getText();
  }
  else {
    myLastClassName = null;
  }
  myLastLayoutManager = myBaseLayoutManagerCombo.getSelectedName();
  GuiDesignerConfiguration.getInstance(myProject).DEFAULT_LAYOUT_MANAGER = myLastLayoutManager;
  final String inputString = myFormNameTextField.getText().trim();
  if (myValidator.checkInput(inputString) && myValidator.canClose(inputString)) {
    close(OK_EXIT_CODE);
  }
  close(OK_EXIT_CODE);
}
项目:tools-idea    文件:LayoutManagerRegistry.java   
public static RadLayoutManager createDefaultGridLayoutManager(Project project) {
  final String defaultLayoutManager = GuiDesignerConfiguration.getInstance(project).DEFAULT_LAYOUT_MANAGER;
  if (defaultLayoutManager.equals(UIFormXmlConstants.LAYOUT_GRIDBAG)) {
    return new RadGridBagLayoutManager();
  }
  else if (defaultLayoutManager.equals(UIFormXmlConstants.LAYOUT_FORM)) {
    return new RadFormLayoutManager();
  }
  else {
    return new RadGridLayoutManager();
  }
}
项目:consulo-ui-designer    文件:CreateFormAction.java   
protected void doOKAction() {
  if (myCreateBoundClassCheckbox.isSelected()) {
    myLastClassName = myClassNameTextField.getText();
  }
  else {
    myLastClassName = null;
  }
  myLastLayoutManager = myBaseLayoutManagerCombo.getSelectedName();
  GuiDesignerConfiguration.getInstance(myProject).DEFAULT_LAYOUT_MANAGER = myLastLayoutManager;
  final String inputString = myFormNameTextField.getText().trim();
  if (myValidator.checkInput(inputString) && myValidator.canClose(inputString)) {
    close(OK_EXIT_CODE);
  }
  close(OK_EXIT_CODE);
}
项目:consulo-ui-designer    文件:LayoutManagerRegistry.java   
public static RadLayoutManager createDefaultGridLayoutManager(Project project) {
  final String defaultLayoutManager = GuiDesignerConfiguration.getInstance(project).DEFAULT_LAYOUT_MANAGER;
  if (defaultLayoutManager.equals(UIFormXmlConstants.LAYOUT_GRIDBAG)) {
    return new RadGridBagLayoutManager();
  }
  else if (defaultLayoutManager.equals(UIFormXmlConstants.LAYOUT_FORM)) {
    return new RadFormLayoutManager();
  }
  else {
    return new RadGridLayoutManager();
  }
}
项目:intellij-ce-playground    文件:GridCaptionPanel.java   
private boolean canResizeCells() {
  return GuiDesignerConfiguration.getInstance(myEditor.getProject()).RESIZE_HEADERS &&
         mySelectedContainer != null &&
         mySelectedContainer.getGridLayoutManager().canResizeCells();
}
项目:tools-idea    文件:GridCaptionPanel.java   
private boolean canResizeCells() {
  return GuiDesignerConfiguration.getInstance(myEditor.getProject()).RESIZE_HEADERS &&
         mySelectedContainer != null &&
         mySelectedContainer.getGridLayoutManager().canResizeCells();
}
项目:consulo-ui-designer    文件:GridCaptionPanel.java   
private boolean canResizeCells()
{
    return GuiDesignerConfiguration.getInstance(myEditor.getProject()).RESIZE_HEADERS &&
            mySelectedContainer != null &&
            mySelectedContainer.getGridLayoutManager().canResizeCells();
}
项目:consulo-ui-designer    文件:FormSourceCodeGenerator.java   
public FormSourceCodeGenerator(@NotNull final Project project)
{
    myProject = project;
    myErrors = new ArrayList<FormErrorInfo>();
    myConfiguration = GuiDesignerConfiguration.getInstance(project);
}