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


Java StdFileTypes.GUI_DESIGNER_FORM属性代码示例

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


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

示例1: checkHardcodedCharsetFileType

@NotNull
static Pair<Charset, String> checkHardcodedCharsetFileType(@NotNull VirtualFile virtualFile) {
  FileType fileType = virtualFile.getFileType();
  if (fileType.isBinary()) return Pair.create(null, "binary file");
  // in lesser IDEs all special file types are plain text so check for that first
  if (fileType == FileTypes.PLAIN_TEXT) return Pair.create(null, null);
  if (fileType == StdFileTypes.GUI_DESIGNER_FORM) return Pair.create(CharsetToolkit.UTF8_CHARSET, "IDEA GUI Designer form");
  if (fileType == StdFileTypes.IDEA_MODULE) return Pair.create(CharsetToolkit.UTF8_CHARSET, "IDEA module file");
  if (fileType == StdFileTypes.IDEA_PROJECT) return Pair.create(CharsetToolkit.UTF8_CHARSET, "IDEA project file");
  if (fileType == StdFileTypes.IDEA_WORKSPACE) return Pair.create(CharsetToolkit.UTF8_CHARSET, "IDEA workspace file");

  if (fileType == StdFileTypes.PROPERTIES) return Pair.create(virtualFile.getCharset(), ".properties file");

  if (fileType == StdFileTypes.XML || fileType == StdFileTypes.JSPX) {
    return Pair.create(virtualFile.getCharset(), "XML file");
  }
  return Pair.create(null, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:EncodingUtil.java

示例2: processReferencesInFiles

private static boolean processReferencesInFiles(List<PsiFile> files,
                                                PsiManager psiManager, String baseName,
                                                PsiElement element,
                                                LocalSearchScope filterScope,
                                                Processor<PsiReference> processor) {
  psiManager.startBatchFilesProcessingMode();

  try {
    for (PsiFile file : files) {
      ProgressManager.checkCanceled();

      if (file.getFileType() != StdFileTypes.GUI_DESIGNER_FORM) continue;
      if (!processReferences(processor, file, baseName, element, filterScope)) return false;
    }
  }
  finally {
    psiManager.finishBatchFilesProcessingMode();
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FormReferencesSearcher.java

示例3: getUsageType

@Nullable
public UsageType getUsageType(PsiElement element) {
  final PsiFile psiFile = element.getContainingFile();
  if (psiFile.getFileType() == StdFileTypes.GUI_DESIGNER_FORM) {
    return FORM_USAGE_TYPE;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:FormUsageTypeProvider.java

示例4: processReferencesInUIForms

private static boolean processReferencesInUIForms(final Processor<PsiReference> processor,
                                                  PsiManager psiManager,
                                                  final Property property,
                                                  final GlobalSearchScope globalSearchScope,
                                                  final LocalSearchScope filterScope) {
  final Project project = psiManager.getProject();

  final GlobalSearchScope scope = GlobalSearchScope.projectScope(project).intersectWith(globalSearchScope);
  String name = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
    @Override
    public String compute() {
      return property.getName();
    }
  });
  if (name == null) return true;

  psiManager.startBatchFilesProcessingMode();

  try {
    CommonProcessors.CollectProcessor<VirtualFile> collector = new CommonProcessors.CollectProcessor<VirtualFile>() {
      @Override
      protected boolean accept(VirtualFile virtualFile) {
        return virtualFile.getFileType() == StdFileTypes.GUI_DESIGNER_FORM;
      }
    };
    ((PsiSearchHelperImpl)PsiSearchHelper.SERVICE.getInstance(project)).processFilesWithText(
      scope, UsageSearchContext.IN_PLAIN_TEXT, true, name, collector
    );
    
    for (final VirtualFile vfile:collector.getResults()) {
      ProgressManager.checkCanceled();

      PsiFile file = ApplicationManager.getApplication().runReadAction(new Computable<PsiFile>() {
        @Override
        public PsiFile compute() {
          return PsiManager.getInstance(project).findFile(vfile);
        }
      });
      if (!processReferences(processor, file, name, property, filterScope)) return false;
    }
  }
  finally {
    psiManager.finishBatchFilesProcessingMode();
  }

  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:FormReferencesSearcher.java

示例5: getInputFilter

@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
  return new DefaultFileTypeSpecificInputFilter(StdFileTypes.GUI_DESIGNER_FORM);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FormClassIndex.java

示例6: modify

@NotNull
public Collection<AbstractTreeNode> modify(@NotNull AbstractTreeNode parent, @NotNull Collection<AbstractTreeNode> children, ViewSettings settings) {
  if (parent.getValue() instanceof Form) return children;

  // Optimization. Check if there are any forms at all.
  boolean formsFound = false;
  for (AbstractTreeNode node : children) {
    if (node.getValue() instanceof PsiFile) {
      PsiFile file = (PsiFile)node.getValue();
      if (file.getFileType() == StdFileTypes.GUI_DESIGNER_FORM) {
        formsFound = true;
        break;
      }
    }
  }

  if (!formsFound) return children;

  Collection<AbstractTreeNode> result = new LinkedHashSet<AbstractTreeNode>(children);
  ProjectViewNode[] copy = children.toArray(new ProjectViewNode[children.size()]);
  for (ProjectViewNode element : copy) {
    PsiClass psiClass = null;
    if (element.getValue() instanceof PsiClass) {
      psiClass = (PsiClass)element.getValue();
    }
    else if (element.getValue() instanceof PsiClassOwner) {
      final PsiClass[] psiClasses = ((PsiClassOwner) element.getValue()).getClasses();
      if (psiClasses.length == 1) {
        psiClass = psiClasses[0];
      }
    }
    if (psiClass == null) continue;
    String qName = psiClass.getQualifiedName();
    if (qName == null) continue;
    List<PsiFile> forms;
    try {
      forms = FormClassIndex.findFormsBoundToClass(myProject, qName);
    }
    catch (ProcessCanceledException e) {
      continue;
    }
    Collection<BasePsiNode<? extends PsiElement>> formNodes = findFormsIn(children, forms);
    if (!formNodes.isEmpty()) {
      Collection<PsiFile> formFiles = convertToFiles(formNodes);
      Collection<BasePsiNode<? extends PsiElement>> subNodes = new ArrayList<BasePsiNode<? extends PsiElement>>();
      //noinspection unchecked
      subNodes.add((BasePsiNode<? extends PsiElement>) element);
      subNodes.addAll(formNodes);
      result.add(new FormNode(myProject, new Form(psiClass, formFiles), settings, subNodes));
      result.remove(element);
      result.removeAll(formNodes);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:55,代码来源:FormMergerTreeStructureProvider.java

示例7: isValid

public boolean isValid(){
  //TODO[anton,vova] fire when changed
  return
    FileDocumentManager.getInstance().getDocument(myFile) != null &&
    myFile.getFileType() == StdFileTypes.GUI_DESIGNER_FORM;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:UIFormEditor.java

示例8: accept

public boolean accept(@NotNull final Project project, @NotNull final VirtualFile file){
  return
    file.getFileType() == StdFileTypes.GUI_DESIGNER_FORM &&
    !StdFileTypes.GUI_DESIGNER_FORM.isBinary() &&
    (ModuleUtil.findModuleForFile(file, project) != null || file instanceof LightVirtualFile);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:UIFormEditorProvider.java


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