public void shutdown() { IContentTypeManager contentTypeManager = Platform.getContentTypeManager(); //if the service is already gone there is nothing to do if (contentTypeManager != null) contentTypeManager.removeContentTypeChangeListener(this); }
/** * Returns JSP fragment content type * * @return jspf content type */ private IContentType getJSPFContentType() { if (fJSPFContentType == null) { fJSPFContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT); } return fJSPFContentType; }
private IContentType getTextContentType() { if (textContentType == null) textContentType = Platform.getContentTypeManager().getContentType(IContentTypeManager.CT_TEXT); return textContentType; }
/** * Get content type associated with this new file wizard * * @return IContentType */ protected IContentType getContentType() { return Platform.getContentTypeManager().getContentType(ContentTypeIdForXML.ContentTypeID_XML); }
/** * Gets list of content types this visitor is interested in * * @return All JSP-related content types */ private IContentType[] getValidContentTypes() { if (fContentTypes == null) { // currently "hard-coded" to be jsp & jspf fContentTypes = new IContentType[]{Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP), Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT)}; } return fContentTypes; }
/** * Returns JSP fragment content type * * @return jspf content type */ private IContentType getJSPFContentType() { if (fJSPFContentType == null) { fJSPFContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT); } return fJSPFContentType; }
public void shutdown() { IContentTypeManager contentTypeManager = Platform.getContentTypeManager(); //if the service is already gone there is nothing to do if (contentTypeManager != null) contentTypeManager.removeContentTypeChangeListener(this); }
public void shutdown() { IContentTypeManager contentTypeManager = Platform.getContentTypeManager(); //if the service is already gone there is nothing to do if (contentTypeManager != null) contentTypeManager.removeContentTypeChangeListener(this); }
@Override public Object compute(IEclipseContext context, String contextKey) { if (editorRegistry == null) { editorRegistry = new EditorRegistry(Platform.getContentTypeManager()); } return editorRegistry; } });
IContentType getJspContentType() { if (this.fContentTypeJSP == null) this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP); return this.fContentTypeJSP; }
IContentType getJspContentType() { if(this.fContentTypeJSP == null) this.fContentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP); return this.fContentTypeJSP; }
/** * Get list of valid extensions for XML Content type * * @return List */ List getValidExtensions() { if (fValidExtensions == null) { IContentType type = Platform.getContentTypeManager().getContentType(ContentTypeIdForXML.ContentTypeID_XML); fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC))); } return fValidExtensions; }
public void createXMLDocument(String xmlFileName) throws Exception { IContentType contentType = Platform.getContentTypeManager().findContentTypeFor(xmlFileName); String charset = null; if (contentType != null) { charset = contentType.getDefaultCharset(); } ByteArrayOutputStream outputStream = createXMLDocument(xmlFileName, charset); File file = new File(xmlFileName); FileOutputStream fos = new FileOutputStream(file); outputStream.writeTo(fos); fos.close(); }
private static abstract class SafeNotifier implements ISafeRunnable { @Override public void handleException(Throwable ex) { // NOTE: Logging is done by SafeRunner } }
private static abstract class SafeNotifier implements ISafeRunnable { public void handleException(Throwable ex) { IStatus status= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, "TextFileBufferManager failed to notify an ITextFileBufferListener", ex); //$NON-NLS-1$ FileBuffersPlugin.getDefault().getLog().log(status); } }
/** * Creates a content type matcher for the given project. Takes natures and user settings into account. */ private IContentTypeMatcher createMatcher(Project project) { ProjectContentTypeSelectionPolicy projectContentTypeSelectionPolicy = new ProjectContentTypeSelectionPolicy(project); return Platform.getContentTypeManager().getMatcher(projectContentTypeSelectionPolicy, projectContentTypeSelectionPolicy); }
/** * Return the storage merger associated with the <code>IContentTypeManager.CT_TEXT</code> * content type. * @return the storage merger associated with the <code>IContentTypeManager.CT_TEXT</code> * content type */ public static IStorageMerger createTextMerger() { return Team.createMerger(Platform.getContentTypeManager().getContentType(IContentTypeManager.CT_TEXT)); }
private IContentDescription getContentType(String contentTypeDescriber) { if (contentTypeDescriber != null) return Platform.getContentTypeManager().getContentType(contentTypeDescriber).getDefaultDescription(); else return null; }
/** * Creates a content type matcher for the given project. Takes natures and user settings into account. */ private IContentTypeMatcher createMatcher(Project project) { ProjectContentTypeSelectionPolicy projectContentTypeSelectionPolicy = new ProjectContentTypeSelectionPolicy(project); return Platform.getContentTypeManager().getMatcher(projectContentTypeSelectionPolicy, projectContentTypeSelectionPolicy); }
protected static String getContentTypeName(URI uri) { if (WorkbenchResourceHelperBase.isPlatformResourceURI(uri) || !isValidFullyQualifiedModuleURI(uri)) return null; String contentTypeIdentifier = (uri.segmentCount() > 3 ? uri.segment(ModuleURI.CONTENT_TYPE_INDX) : null); if (contentTypeIdentifier != null && Platform.getContentTypeManager().getContentType(uri.segment(ModuleURI.CONTENT_TYPE_INDX)) != null) return contentTypeIdentifier; else return null; } public static boolean isValidFullyQualifiedModuleURI(URI aModuleURI) {