@Override public void processingInstruction(String target, String data) throws SAXException { if ("eclipse".equals(target)) { //$NON-NLS-1$ // Data should be of the form: version="<version>" Matcher matcher = VERSION_RE.matcher(data); if (matcher.matches()) { fSchemaVersion = TargetPlatformHelper.getSchemaVersionForTargetVersion(matcher.group(1)); } else { fSchemaVersion = TargetPlatformHelper.getSchemaVersion(); } } }
@Override public double getSchemaVersion() { if (fTargetVersion == 0) { IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(fPluginID); if (model != null) { IPluginBase base = model.getPluginBase(); if (base != null) { if (base.getSchemaVersion() != null) { fTargetVersion = Double.parseDouble(base.getSchemaVersion()); } } } if (fTargetVersion == 0) { // Use default for target platform fTargetVersion = Double.parseDouble(TargetPlatformHelper.getSchemaVersion()); } } return fTargetVersion; } }
@Override public void processingInstruction(String target, String data) throws SAXException { if ("eclipse".equals(target)) { //$NON-NLS-1$ // Data should be of the form: version="<version>" if (data.length() > 10 && data.substring(0, 9).equals("version=\"") && data.charAt(data.length() - 1) == '\"') { //$NON-NLS-1$ fSchemaVersion = TargetPlatformHelper.getSchemaVersionForTargetVersion(data.substring(9, data.length() - 1)); } else { fSchemaVersion = TargetPlatformHelper.getSchemaVersion(); } } }
private void createNewFile(IFile file) throws CoreException { WorkspacePluginModelBase model = (WorkspacePluginModelBase) getModel(file); IPluginBase base = model.getPluginBase(); base.setSchemaVersion(TargetPlatformHelper.getSchemaVersion()); base.add(createIntroExtension(model)); base.add(createIntroConfigExtension(model)); model.save(); }
@Override public void processingInstruction(String target, String data) throws SAXException { if ("eclipse".equals(target)) { //$NON-NLS-1$ // Data should be of the form: version="<version>" if (data.length() > 10 && data.substring(0, 9).equals("version=\"") && data.charAt(data.length() - 1) == '\"') { //$NON-NLS-1$ fSchemaVersion = Double.parseDouble(TargetPlatformHelper.getSchemaVersionForTargetVersion(data.substring(9, data.length() - 1))); } else { fSchemaVersion = Double.parseDouble(TargetPlatformHelper.getSchemaVersion()); } } }
private void createNewFile(IFile file, IProgressMonitor monitor) throws CoreException { WorkspacePluginModelBase model = (WorkspacePluginModelBase) getModel(file); IPluginBase base = model.getPluginBase(); base.setSchemaVersion(TargetPlatformHelper.getSchemaVersion()); base.add(createExtension(model)); // Update the splash handler. Update plug-in model and copy files updateSplashHandler(model, monitor); // Update splash progress. Update plug-in model and copy files updateSplashProgress(model, monitor); model.save(); }
public void ensurePluginContextPresence() { if (fInputContextManager.hasContext(PluginInputContext.CONTEXT_ID)) return; IProject project = fInputContextManager.getCommonProject(); WorkspacePluginModelBase model = null; IFile file = null; if (fInputContextManager.getAggregateModel() instanceof IFragmentModel) { file = PDEProject.getFragmentXml(project); model = new WorkspaceFragmentModel(file, false); } else { file = PDEProject.getPluginXml(project); model = new WorkspacePluginModel(file, false); } IPluginBase pluginBase = model.getPluginBase(true); try { pluginBase.setSchemaVersion(TargetPlatformHelper.getSchemaVersion()); } catch (CoreException e) { } model.save(); IEditorInput in = new FileEditorInput(file); fInputContextManager.putContext(in, new PluginInputContext(this, in, false, false)); updateBuildProperties(file.getName()); }