本文整理了Java中org.netbeans.modules.parsing.api.Source.getMimeType()
方法的一些代码示例,展示了Source.getMimeType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Source.getMimeType()
方法的具体详情如下:
包路径:org.netbeans.modules.parsing.api.Source
类名称:Source
方法名:getMimeType
暂无
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base
@Override
public ExtraLock reformatLock() {
return JavacParser.MIME_TYPE.equals(source.getMimeType()) ? null : new ExtraLock() {
public void lock() {
Utilities.acquireParserLock();
}
public void unlock() {
Utilities.releaseParserLock();
}
};
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-css-prep
@Override
public Collection<String> getPseudoClasses(EditorFeatureContext context) {
Collection<String> result = null;
if (CPUtils.LESS_FILE_MIMETYPE.equals(context.getSource().getMimeType())) {
result = PSEUDO_CLASSES;
}
return result;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-rhtml
@Override
public Collection<? extends SchedulerTask> create(Snapshot snapshot) {
if (snapshot.getSource().getMimeType().equals(RhtmlTokenId.MIME_TYPE)) {
return Collections.singleton(new RubyEmbeddingProvider());
} else {
return Collections.<SchedulerTask>emptyList();
}
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javascript-hints
public boolean appliesTo(RuleContext context) {
return JsTokenId.JAVASCRIPT_MIME_TYPE.equals(context.parserResult.getSnapshot().getSource().getMimeType());
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-groovy-editor
Source source = Source.create(fo);
if (GroovyLanguage.GROOVY_MIME_TYPE.equals(source.getMimeType())) {
try {
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-source-base
JavacParser (final Collection<Snapshot> snapshots, boolean privateParser) {
this.privateParser = privateParser;
this.sourceCount = snapshots.size();
final boolean singleJavaFile = this.sourceCount == 1 && MIME_TYPE.equals(snapshots.iterator().next().getSource().getMimeType());
this.supportsReparse = singleJavaFile && !DISABLE_PARTIAL_REPARSE;
JavaFileFilterImplementation filter = null;
if (singleJavaFile) {
final Source source = snapshots.iterator().next().getSource();
FileObject fo = source.getFileObject();
if (fo != null) {
//fileless Source -- ie. debugger watch CC etc
filter = JavaFileFilterQuery.getFilter(fo);
}
}
this.filterListener = filter != null ? new FilterListener (filter) : null;
this.cpInfoListener = new ClasspathInfoListener (
listeners,
new Runnable() {
@Override
public void run() {
if (sourceCount == 0) {
invalidate(true);
}
}
});
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-inspect
@Override
public void run(ParserResult result, SchedulerEvent event) {
final CSSUpdater updater = CSSUpdater.getDefault();
if (!updater.isStarted()) {
return;
}
String sourceMimeType = result.getSnapshot().getSource().getMimeType();
if (!hasFatalErrors(result) && "text/css".equals(sourceMimeType)) { // NOI18N
updater.update(result.getSnapshot().getSource().getFileObject(), result.getSnapshot().getText().toString());
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf
LOGGER.log(Level.WARNING, "Error parsing Source with mimeType=" + source.getMimeType(), ex);
return null;
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javascript-hints
if (/*node.getType() == Token.EMPTY && */!JsTokenId.JAVASCRIPT_MIME_TYPE.equals(info.getSnapshot().getSource().getMimeType())) {
setContextRemove(context);
return;
内容来源于网络,如有侵权,请联系作者删除!