本文整理汇总了Java中com.intellij.openapi.fileTypes.StdFileTypes.XHTML属性的典型用法代码示例。如果您正苦于以下问题:Java StdFileTypes.XHTML属性的具体用法?Java StdFileTypes.XHTML怎么用?Java StdFileTypes.XHTML使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.openapi.fileTypes.StdFileTypes
的用法示例。
在下文中一共展示了StdFileTypes.XHTML属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
@Override
public void update(AnActionEvent event) {
super.update(event);
Presentation presentation = event.getPresentation();
PsiElement psiElement = CommonDataKeys.PSI_FILE.getData(event.getDataContext());
boolean flag = psiElement instanceof XmlFile;
presentation.setVisible(flag);
boolean value = psiElement instanceof XmlFile;
if (value) {
final PsiFile containingFile = psiElement.getContainingFile();
if (containingFile!=null &&
(containingFile.getFileType() == StdFileTypes.XML ||
containingFile.getFileType() == StdFileTypes.XHTML
)) {
value = containingFile.getUserData(runningValidationKey) == null;
} else {
value = false;
}
}
presentation.setEnabled(value);
if (ActionPlaces.isPopupPlace(event.getPlace())) {
presentation.setVisible(value);
}
}
示例2: getInputFilter
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
return new DefaultFileTypeSpecificInputFilter(StdFileTypes.HTML, StdFileTypes.XHTML) {
@Override
public boolean acceptInput(@NotNull final VirtualFile file) {
return file.isInLocalFileSystem();
}
};
}
示例3: canPutAt
@Override
public boolean canPutAt(@NotNull final VirtualFile file, final int line, @NotNull Project project) {
final PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
// JSPX supports jvm debugging, but not in XHTML files
if (psiFile == null || psiFile.getViewProvider().getFileType() == StdFileTypes.XHTML) {
return false;
}
if (!StdFileTypes.CLASS.equals(psiFile.getFileType()) && !DebuggerUtils.isBreakpointAware(psiFile)) {
return false;
}
final Document document = FileDocumentManager.getInstance().getDocument(file);
if (document == null) return false;
final Ref<Class<? extends JavaLineBreakpointTypeBase>> result = Ref.create();
XDebuggerUtil.getInstance().iterateLine(project, document, line, new Processor<PsiElement>() {
@Override
public boolean process(PsiElement element) {
// avoid comments
if ((element instanceof PsiWhiteSpace)
|| (PsiTreeUtil.getParentOfType(element, PsiComment.class, PsiImportStatementBase.class, PsiPackageStatement.class) != null)) {
return true;
}
PsiElement parent = element;
while(element != null) {
// skip modifiers
if (element instanceof PsiModifierList) {
element = element.getParent();
continue;
}
final int offset = element.getTextOffset();
if (offset >= 0) {
if (document.getLineNumber(offset) != line) {
break;
}
}
parent = element;
element = element.getParent();
}
if(parent instanceof PsiMethod) {
if (parent.getTextRange().getEndOffset() >= document.getLineEndOffset(line)) {
PsiCodeBlock body = ((PsiMethod)parent).getBody();
if (body != null) {
PsiStatement[] statements = body.getStatements();
if (statements.length > 0 && document.getLineNumber(statements[0].getTextOffset()) == line) {
result.set(JavaLineBreakpointType.class);
}
}
}
if (result.isNull()) {
result.set(JavaMethodBreakpointType.class);
}
}
else if (parent instanceof PsiField) {
if (result.isNull()) {
result.set(JavaFieldBreakpointType.class);
}
}
else {
result.set(JavaLineBreakpointType.class);
}
return true;
}
});
return result.get() == getClass();
}
示例4: isHtml
public static boolean isHtml(CustomTemplateCallback callback) {
FileType type = callback.getFileType();
return type == StdFileTypes.HTML || type == StdFileTypes.XHTML;
}
示例5: isTrueXml
private static boolean isTrueXml(FileType type) {
return type == StdFileTypes.XHTML || type == StdFileTypes.JSPX || type == StdFileTypes.XML;
}
示例6: isStrictTagMatchingForFileType
protected boolean isStrictTagMatchingForFileType(final FileType fileType) {
return fileType == StdFileTypes.XML ||
fileType == StdFileTypes.XHTML;
}