protected Preferences getModelPreferences() { return XMLCorePlugin.getDefault().getPluginPreferences(); }
public void logWarning(String warning, Throwable exception) { XMLCorePlugin.getDefault().getLog().log(new Status(IStatus.WARNING, XMLCorePlugin.getDefault().getBundle().getSymbolicName(), IStatus.WARNING, warning, exception)); } }
private String getPluginStateLocation(String fileName) { String location = getStateLocation().append(fileName).toString(); String file_protocol = "file:"; //$NON-NLS-1$ if (location != null && !location.startsWith(file_protocol)) { location = file_protocol + location; } return location; }
protected void doSavePreferenceStore() { XMLCorePlugin.getDefault().savePluginPreferences(); // model }
private void retrieveCatalog() { if (systemCatalog != null) return; ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs(); for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { systemCatalog = referencedCatalog; } } } }
/** * read from plugin registry and parse it. */ protected void readRegistry() { IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry(); IExtensionPoint point = pluginRegistry.getExtensionPoint(XMLCorePlugin.getDefault().getBundle().getSymbolicName(), EXTENSION_POINT_ID); if (point != null) { IConfigurationElement[] elements = point.getConfigurationElements(); for (int i = 0; i < elements.length; i++) { readElement(elements[i]); } } }
public ICatalog getDefaultXMLCatalog() { if (catalogSet == null) { catalogSet = new CatalogSet(); defaultCatalogFileStateLocation = getPluginStateLocation(Catalog.DEFAULT_CATALOG_FILE); catalogSet.putCatalogPersistenceLocation(DEFAULT_CATALOG_ID, defaultCatalogFileStateLocation); catalogSet.putCatalogPersistenceLocation(SYSTEM_CATALOG_ID, getPluginStateLocation(Catalog.SYSTEM_CATALOG_FILE)); catalogSet.putCatalogPersistenceLocation(USER_CATALOG_ID, getPluginStateLocation(Catalog.USER_CATALOG_FILE)); } return catalogSet.lookupOrCreateCatalog(DEFAULT_CATALOG_ID, defaultCatalogFileStateLocation); }
public XMLCatalogPreferencePage() { defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs(); for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { systemCatalog = referencedCatalog; } else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) { userCatalog = referencedCatalog; } } } }
protected void doSavePreferenceStore() { XMLUIPlugin.getDefault().savePluginPreferences(); // editor XMLCorePlugin.getDefault().savePluginPreferences(); // model }
public void initializeDefaultPreferences() { IEclipsePreferences node = new DefaultScope().getNode(XMLCorePlugin.getDefault().getBundle().getSymbolicName());
protected Preferences getModelPreferences() { return XMLCorePlugin.getDefault().getPluginPreferences(); }
private void retrieveCatalog() { if (systemCatalog != null) return; ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs(); for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { systemCatalog = referencedCatalog; } } } }
public void logError(String error, Throwable exception) { XMLCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, XMLCorePlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, error, exception)); }
protected void storeOptions() { getModelPreferences().setValue(XMLCorePreferenceNames.COMPRESS_EMPTY_ELEMENT_TAGS, fCheckBoxCompressEmptyElementTags.getSelection()); getModelPreferences().setValue(XMLCorePreferenceNames.INSERT_REQUIRED_ATTRS, fCheckBoxInsertRequiredAttrs.getSelection()); getModelPreferences().setValue(XMLCorePreferenceNames.INSERT_MISSING_TAGS, fCheckBoxInsertMissingTags.getSelection()); getModelPreferences().setValue(XMLCorePreferenceNames.QUOTE_ATTR_VALUES, fCheckBoxQuoteAttrValues.getSelection()); getModelPreferences().setValue(XMLCorePreferenceNames.FORMAT_SOURCE, fCheckBoxFormatSource.getSelection()); getModelPreferences().setValue(XMLCorePreferenceNames.CONVERT_EOL_CODES, fCheckBoxConvertEOLCodes.getSelection()); if (fRadioButtonConvertEOLUnix.getSelection()) { getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.LF); } else if (fRadioButtonConvertEOLMac.getSelection()) { getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CR); } else { getModelPreferences().setValue(XMLCorePreferenceNames.CLEANUP_EOL_CODE, CommonEncodingPreferenceNames.CRLF); } // explicitly save plugin preferences so values are stored XMLCorePlugin.getDefault().savePluginPreferences(); }
protected Preferences getModelPreferences() { return XMLCorePlugin.getDefault().getPluginPreferences(); }
public SelectFromCatalogDialog(Shell parentShell) { super(parentShell); defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs(); for (int i = 0; i < nextCatalogs.length; i++) { INextCatalog catalog = nextCatalogs[i]; ICatalog referencedCatalog = catalog.getReferencedCatalog(); if (referencedCatalog != null) { if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { systemCatalog = referencedCatalog; } else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) { userCatalog = referencedCatalog; } } } }
/** * Load the customizer class. */ protected void loadCustomizer() { try { Class customizerClass = bundle.loadClass(classname); customizer = (IErrorMessageCustomizer)customizerClass.newInstance(); } catch(Exception e) { XMLCorePlugin.getDefault().getLog().log( new Status(IStatus.WARNING, XMLCorePlugin.getDefault().getBundle().getSymbolicName(), IStatus.OK, "The XML validator error customizer was unable to load class " + classname, e)); //$NON-NLS-1$ } }
protected Preferences getModelPreferences() { return XMLCorePlugin.getDefault().getPluginPreferences(); }
private Collection getCatalogRecords() { if (fCatalogRecords == null) { List records = new ArrayList(); ICatalog defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog(); if (defaultCatalog != null) {
protected Preferences getModelPreferences() { return XMLCorePlugin.getDefault().getPluginPreferences(); }