APISonar


com.intellij.openapi.fileTypes.InternalStdFileTypes.JAVA

> com > intellij > openapi > fileTypes > InternalStdFileTypes > JAVA
com APIs intellij APIs openapi APIs fileTypes APIs InternalStdFileTypes APIs JAVA APIs

Example 1
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    final EditorTextField editorTextField = new EditorTextField((String) value, myProject, InternalStdFileTypes.JAVA) {
            @Override
            protected boolean shouldHaveBorder() {
              return false;
            }
          };
    myDocument = editorTextField.getDocument();
    if (myDocument != null) {
      for (DocumentListener listener : myListeners) {
        editorTextField.addDocumentListener(listener);
      }
    }
    return editorTextField;
  }
Example 2
public ReferenceEditorWithBrowseButton(final ActionListener browseActionListener,
                                         final Project project,
                                         final Function<String, Document> factory,
                                         String text) {
    this(browseActionListener, new EditorTextField(factory.fun(text), project, InternalStdFileTypes.JAVA), factory);
  }
Example 3
public NameSuggestionsField(Project project) {
    super(new BorderLayout());
    myProject = project;
    myComboBoxModel = new MyComboBoxModel();
    final ComboBox comboBox = new ComboBox(myComboBoxModel,-1);
    myComponent = comboBox;
    add(myComponent, BorderLayout.CENTER);
    setupComboBox(comboBox, InternalStdFileTypes.JAVA);
  }
Example 4
public boolean accept(VirtualFile file) {
    if (file instanceof VirtualFileWindow) return false;

    if (myAddedClasses.contains(file) || myTreeAccessAllowed) return false;

    FileType fileType = file.getFileType();
    return (fileType == InternalStdFileTypes.JAVA || fileType == InternalStdFileTypes.CLASS) && !file.getName().equals("package-info.java");
  }
Example 5
private static boolean isEditable(VirtualFile file, final boolean checkboxState) {
    FileType type = file.getFileType();
    if (!checkboxState && type == InternalStdFileTypes.JAVA) return false;
    return type != InternalStdFileTypes.CLASS;
  }
Example 6
private static void setupCaret(final RangeMarker caretMarker, String fileText) {
    if (caretMarker != null) {
      int caretLine = StringUtil.offsetToLineNumber(fileText, caretMarker.getStartOffset());
      int caretCol = EditorUtil.calcColumnNumber(null, myEditor.getDocument().getText(),
                                                 myEditor.getDocument().getLineStartOffset(caretLine), caretMarker.getStartOffset(),
                                                 CodeStyleSettingsManager.getSettings(getProject()).getIndentOptions(InternalStdFileTypes.JAVA).TAB_SIZE);
      LogicalPosition pos = new LogicalPosition(caretLine, caretCol);
      myEditor.getCaretModel().moveToLogicalPosition(pos);
    }
  }
Example 7
private static void checkCaretPosition(final RangeMarker caretMarker, String newFileText, String message) {
    if (caretMarker != null) {
      int caretLine = StringUtil.offsetToLineNumber(newFileText, caretMarker.getStartOffset());
      //int caretCol = caretMarker.getStartOffset() - StringUtil.lineColToOffset(newFileText, caretLine, 0);
      int caretCol = EditorUtil.calcColumnNumber(null, newFileText,
                                                 StringUtil.lineColToOffset(newFileText, caretLine, 0),
                                                 caretMarker.getStartOffset(),
                                                 CodeStyleSettingsManager.getSettings(getProject()).getIndentOptions(InternalStdFileTypes.JAVA).TAB_SIZE);

      assertEquals(getMessage("caretLine", message), caretLine, myEditor.getCaretModel().getLogicalPosition().line);
      assertEquals(getMessage("caretColumn", message), caretCol, myEditor.getCaretModel().getLogicalPosition().column);
    }
  }
Example 8
public static boolean isApplicableFor(@NotNull VirtualFile file) {
    if (file.isDirectory()) return false;
    FileType originalType = FileTypeManager.getInstance().getFileTypeByFileName(file.getName());
    return !originalType.isBinary() && originalType != PlainTextFileType.INSTANCE && originalType != InternalStdFileTypes.JAVA;
  }
Example 9
private static boolean isFileUnderSourceRoot(@Nonnull Project project, @Nonnull VirtualFile file) {
    ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex();
    if (InternalStdFileTypes.JAVA == file.getFileType()) {
      return index.isInSource(file) && !index.isInLibrarySource(file);
    } else {
      return index.isInContent(file) && !index.isInLibrarySource(file) ;
    }
  }