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


Java StdFileTypes.JAVA属性代码示例

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


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

示例1: getTableCellEditorComponent

@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
  final EditorTextField editorTextField = new EditorTextField((String) value, myProject, StdFileTypes.JAVA) {
          @Override
          protected boolean shouldHaveBorder() {
            return false;
          }
        };
  myDocument = editorTextField.getDocument();
  if (myDocument != null) {
    for (DocumentListener listener : myListeners) {
      editorTextField.addDocumentListener(listener);
    }
  }
  return editorTextField;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:StringTableCellEditor.java

示例2: isRelevantFile

static boolean isRelevantFile(@NotNull VirtualFile file) {
  FileType fileType = file.getFileType();
  if (fileType == StdFileTypes.JAVA) {
    return false;
  }

  if (isRelevantFileType(fileType)) {
    return true;
  } else {
    VirtualFile parent = file.getParent();
    if (parent != null) {
      String parentName = parent.getName();
      if (parentName.startsWith(FD_RES_RAW)) {
        return true;
      }
    }
  }

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

示例3: createParametersPanel

@Nullable
private JPanel createParametersPanel () {
  myThisClassesMap = MoveInstanceMembersUtil.getThisClassesToMembers(myMethod);
  myOldClassParameterNameFields = new HashMap<PsiClass, EditorTextField>();
  if (myThisClassesMap.size() == 0) return null;
  JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true));
  for (PsiClass aClass : myThisClassesMap.keySet()) {
    final String text = RefactoringBundle.message("move.method.this.parameter.label", aClass.getName());
    panel.add(new TitledSeparator(text, null));

    String suggestedName = MoveInstanceMethodHandler.suggestParameterNameForThisClass(aClass);
    final EditorTextField field = new EditorTextField(suggestedName, getProject(), StdFileTypes.JAVA);
    field.setMinimumSize(new Dimension(field.getPreferredSize()));
    myOldClassParameterNameFields.put(aClass, field);
    panel.add(field);
  }
  panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MoveInstanceMethodDialog.java

示例4: isJavaSourceFile

public static boolean isJavaSourceFile(@NotNull Project project, @NotNull VirtualFile file) {
  FileTypeManager fileTypeManager = FileTypeManager.getInstance();
  if (file.isDirectory() || file.getFileType() != StdFileTypes.JAVA || fileTypeManager.isFileIgnored(file)) {
    return false;
  }
  ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
  return fileIndex.isUnderSourceRootOfType(file, JavaModuleSourceRootTypes.SOURCES) || fileIndex.isInLibrarySource(file);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:FileIndexUtil.java

示例5: getFileType

@NotNull
@Override
protected FileType getFileType() {
  if (getDefaultLanguage() != null) {
    FileType assocType = getDefaultLanguage().getAssociatedFileType();
    if (assocType != null) {
      return assocType;
    }
  }
  return StdFileTypes.JAVA;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CustomizableLanguageCodeStylePanel.java

示例6: handleSemicolon

private static boolean handleSemicolon(Editor editor, FileType fileType) {
  if (fileType != StdFileTypes.JAVA) return false;
  int offset = editor.getCaretModel().getOffset();
  if (offset == editor.getDocument().getTextLength()) return false;

  char charAt = editor.getDocument().getCharsSequence().charAt(offset);
  if (charAt != ';') return false;

  EditorModificationUtil.moveCaretRelatively(editor, 1);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JavaTypedHandler.java

示例7: ReferenceEditorComboWithBrowseButton

public ReferenceEditorComboWithBrowseButton(final ActionListener browseActionListener,
                                            final String text,
                                            @NotNull final Project project,
                                            boolean toAcceptClasses,
                                            final JavaCodeFragment.VisibilityChecker visibilityChecker, final String recentsKey) {
  super(new EditorComboBox(JavaReferenceEditorUtil.createDocument(StringUtil.isEmpty(text) ? "" : text, project, toAcceptClasses, visibilityChecker), project, StdFileTypes.JAVA),
        browseActionListener);
  final List<String> recentEntries = RecentsManager.getInstance(project).getRecentEntries(recentsKey);
  if (recentEntries != null) {
    setHistory(ArrayUtil.toStringArray(recentEntries));
  }
  if (text != null && text.length() > 0) {
    prependItem(text);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ReferenceEditorComboWithBrowseButton.java

示例8: AbstractJavaInplaceIntroducer

public AbstractJavaInplaceIntroducer(final Project project,
                                     Editor editor,
                                     PsiExpression expr,
                                     PsiVariable localVariable,
                                     PsiExpression[] occurrences,
                                     TypeSelectorManagerImpl typeSelectorManager, String title) {
  super(project, editor, expr, localVariable, occurrences, title, StdFileTypes.JAVA);
  myTypeSelectorManager = typeSelectorManager;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AbstractJavaInplaceIntroducer.java

示例9: isRelevantFileType

static boolean isRelevantFileType(@NotNull FileType fileType) {
  if (fileType == StdFileTypes.JAVA) { // fail fast for vital file type
    return false;
  }
  return fileType == StdFileTypes.XML ||
         (fileType.isBinary() && fileType == FileTypeManager.getInstance().getFileTypeByExtension(EXT_PNG));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:PsiProjectListener.java

示例10: isApplicableFor

public static boolean isApplicableFor(@NotNull VirtualFile file) {
  if (!(file instanceof VirtualFileWithId) || file.isDirectory()) return false;
  FileType originalType = FileTypeManager.getInstance().getFileTypeByFileName(file.getName());
  return !originalType.isBinary() && originalType != FileTypes.PLAIN_TEXT && originalType != StdFileTypes.JAVA;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:EnforcedPlainTextFileTypeManager.java

示例11: getPlace

@Nullable
private static PlaceInDocument getPlace(AnActionEvent event) {
  final Project project = event.getData(CommonDataKeys.PROJECT);
  if(project == null) {
    return null;
  }

  PsiElement method = null;
  Document document = null;

  if (ActionPlaces.PROJECT_VIEW_POPUP.equals(event.getPlace()) ||
      ActionPlaces.STRUCTURE_VIEW_POPUP.equals(event.getPlace()) ||
      ActionPlaces.FAVORITES_VIEW_POPUP.equals(event.getPlace()) ||
      ActionPlaces.NAVIGATION_BAR_POPUP.equals(event.getPlace())) {
    final PsiElement psiElement = event.getData(CommonDataKeys.PSI_ELEMENT);
    if(psiElement instanceof PsiMethod) {
      final PsiFile containingFile = psiElement.getContainingFile();
      if (containingFile != null) {
        method = psiElement;
        document = PsiDocumentManager.getInstance(project).getDocument(containingFile);
      }
    }
  }
  else {
    Editor editor = event.getData(CommonDataKeys.EDITOR);
    if(editor == null) {
      editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
    }
    if (editor != null) {
      document = editor.getDocument();
      PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document);
      if (file != null) {
        final VirtualFile virtualFile = file.getVirtualFile();
        FileType fileType = virtualFile != null ? virtualFile.getFileType() : null;
        if (StdFileTypes.JAVA == fileType || StdFileTypes.CLASS  == fileType) {
          method = findMethod(project, editor);
        }
      }
    }
  }

  return method != null ? new PlaceInDocument(document, method.getTextOffset()) : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:ToggleMethodBreakpointAction.java

示例12: NameSuggestionsField

public NameSuggestionsField(String[] nameSuggestions, Project project) {
  this(nameSuggestions, project, StdFileTypes.JAVA);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:NameSuggestionsField.java

示例13: JavaCodeFragmentTableCellEditor

public JavaCodeFragmentTableCellEditor(final Project project) {
  super(project, StdFileTypes.JAVA);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:JavaCodeFragmentTableCellEditor.java

示例14: getDefaultFileType

@Override
public LanguageFileType getDefaultFileType(LanguageFileType currentDefaultFileType) {
  return StdFileTypes.JAVA;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JavaStructuralSearchProfile.java

示例15: getFileType

@NotNull
protected final FileType getFileType() {
  return StdFileTypes.JAVA;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JavaDocFormattingPanel.java


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