@Override public String getMIMEType() { return delegate.getMIMEType(); }
@Override public String getMIMEType(String... withinMIMETypes) { return delegate.getMIMEType(withinMIMETypes); }
public String getMIMEType() { return leader.getMIMEType(); }
/** Get a header field (currently, content type only). * @param name the header name. Only <code>content-type</code> is guaranteed to be present. * @return the value (i.e., MIME type) */ public String getHeaderField(String name) { if (name.equalsIgnoreCase("content-type")) { // NOI18N try { connect(); if (fo.isFolder()) { return "text/html"; // NOI18N } else { return fo.getMIMEType(); } } catch (IOException e) { } } return super.getHeaderField(name); }
public static boolean isJsFile(FileObject fo) { // XXX: parsingapi; this should somehow be available in Parsing API //return LanguageRegistry.getInstance().isRelevantFor(fo, JsTokenId.JAVASCRIPT_MIME_TYPE); // these are the mimetypes for which JsEmbeddingProvider is registered return JsUtils.isJsFile(fo) || fo.getMIMEType().equals("application/x-httpd-eruby") //NOI18N || fo.getMIMEType().equals("text/html") //NOI18N || fo.getMIMEType().equals("text/x-jsp") //NOI18N || fo.getMIMEType().equals("text/x-tag") //NOI18N || fo.getMIMEType().equals("text/x-php5"); //NOI18N }
@Override protected boolean accept(FileObject orig) { String mimeType = orig.getMIMEType(); return MIMENames.QT_RESOURCE_MIME_TYPE.equals(mimeType) || MIMENames.QT_TRANSLATION_MIME_TYPE.equals(mimeType); }
@Override public String convert(String action, Lookup lookup) { if (ActionProvider.COMMAND_RUN_SINGLE.equals(action) || ActionProvider.COMMAND_DEBUG_SINGLE.equals(action)) { FileObject f = lookup.lookup(FileObject.class); if (f != null && "text/x-scala".equals(f.getMIMEType())) { //TODO this only applies to scala files with main() method. return action + ".main"; } } return null; }
@Override public Collection<ImplicitObject> getImplicitObjects(FileObject file) { return MIMETYPES.contains(file.getMIMEType()) ? getImplicitObjects() : Collections.<ImplicitObject>emptyList(); }
private static boolean isDisabled(Source source) { boolean disabled = false; for (FileObject file : source.getFileObjects()) { if (DISABLED_TYPES.contains(file.getMIMEType())) { disabled = true; break; } } return disabled; } }
/** Mime type of the document. * @return the mime type to use for the document */ public String getMimeType() { return getFileImpl ().getMIMEType (); }
private String getMime(DataObject dob) { FileObject primaryFile = dob == null ? null : dob.getPrimaryFile(); String mime = primaryFile == null ? "" : primaryFile.getMIMEType(); return mime; }
public StorageReader<String, TypedValue> createReader(FileObject f, String mimePath) { if (MIME_TYPE.equals(f.getMIMEType())) { return new Reader(f, mimePath); } else { // assume legacy file return new LegacyReader(f, mimePath); } }
private boolean isCOrCpp(FileObject fo) { String mime = fo.getMIMEType(); if (mime == null) { mime = FileUtil.getMIMEType(fo); if (TraceFlags.TRACE_EXTERNAL_CHANGES) { LOG.log(Level.INFO, "External updates: MIME resolved: {0}", mime); } } return MIMENames.isFortranOrHeaderOrCppOrC(mime); }
protected FileObject findPrimaryFile (FileObject fo) { String mimeType = fo.getMIMEType (); if (LanguagesManager.getDefault ().createDataObjectFor (mimeType)) return fo; return null; }
@Override protected Pane createPane() { // if there is a CndPaneProvider, us it CndPaneProvider paneProvider = Lookup.getDefault().lookup(CndPaneProvider.class); if (paneProvider != null) { Pane pane = paneProvider.createPane(this); if (pane != null) { return pane; } } return (CloneableEditorSupport.Pane) MultiViews.createCloneableMultiView(getDataObject().getPrimaryFile().getMIMEType(), getDataObject()); }
protected MultiDataObject createMultiObject (FileObject primaryFile) throws DataObjectExistsException, IOException { String mimeType = primaryFile.getMIMEType (); if (LanguagesManager.getDefault ().createDataObjectFor (mimeType)) return new LanguagesDataObject (primaryFile, this); return null; }
@Override public void propertyChange (PropertyChangeEvent evt) { FileObject fo = Context.getCurrentFile(); boolean isGroovyFile = fo != null && "text/x-groovy".equals(fo.getMIMEType()); // NOI18N [TODO] setEnabled(ActionsManager.ACTION_TOGGLE_BREAKPOINT, isGroovyFile); if ( debugger != null && debugger.getState () == JPDADebugger.STATE_DISCONNECTED ) destroy (); }
private boolean validBinary() { String validBinaryPath = getValidBinaryPath(); if (validBinaryPath != null) { FileObject fo = fileSystem.findResource(validBinaryPath); // can be null if (fo != null && fo.isValid()) { return MIMENames.isBinary(fo.getMIMEType()); } } return false; }
private DatabaseContext getRoot ( FileObject fo ) throws LanguageDefinitionNotFoundException, IOException, ParseException { Language l = LanguagesManager.get().getLanguage (fo.getMIMEType ()); ASTNode root = l.parse (fo.getInputStream ()); return DatabaseManager.parse (root, null, null); }
public LanguagesDataNode(LanguagesDataObject obj) { super(obj, Children.LEAF); String mimeType = obj.getPrimaryFile ().getMIMEType (); FileObject fo = Repository.getDefault ().getDefaultFileSystem (). findResource ("Editors/" + mimeType + "/language.nbs"); String icon = (String) fo.getAttribute ("icon"); if (icon == null) icon = "org/netbeans/modules/languages/resources/defaultIcon.png"; setIconBaseWithExtension (icon); }