本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例5: getFileType
@NotNull
@Override
protected FileType getFileType() {
if (getDefaultLanguage() != null) {
FileType assocType = getDefaultLanguage().getAssociatedFileType();
if (assocType != null) {
return assocType;
}
}
return StdFileTypes.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;
}
示例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);
}
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例12: NameSuggestionsField
public NameSuggestionsField(String[] nameSuggestions, Project project) {
this(nameSuggestions, project, StdFileTypes.JAVA);
}
示例13: JavaCodeFragmentTableCellEditor
public JavaCodeFragmentTableCellEditor(final Project project) {
super(project, StdFileTypes.JAVA);
}
示例14: getDefaultFileType
@Override
public LanguageFileType getDefaultFileType(LanguageFileType currentDefaultFileType) {
return StdFileTypes.JAVA;
}
示例15: getFileType
@NotNull
protected final FileType getFileType() {
return StdFileTypes.JAVA;
}