/** * Returns the API component associated with this API description * * @return API component * @exception CoreException if the API component cannot be located */ private ProjectComponent getApiComponent() throws CoreException { IApiBaseline baseline = ApiBaselineManager.getManager().getWorkspaceBaseline(); ProjectComponent component = (ProjectComponent) baseline.getApiComponent(getJavaProject().getProject()); if (component == null) { throw new CoreException(new Status(IStatus.ERROR, ApiPlugin.PLUGIN_ID, "Unable to resolve project API component for API description")); //$NON-NLS-1$ } return component; }
/** * Returns the singleton instance of the manager * * @return the singleton instance of the manager */ public static synchronized ApiBaselineManager getManager() { if (fInstance == null) { fInstance = new ApiBaselineManager(ApiPlugin.isRunningInFramework()); } return fInstance; }
/** * Writes out the current state of the {@link IApiBaseline} as XML to the * given output stream * * @param stream * @throws CoreException */ private void writeBaselineDescription(IApiBaseline baseline, OutputStream stream) throws CoreException { String xml = getProfileXML(baseline); try { stream.write(xml.getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { abort("Error writing pofile descrition", e); //$NON-NLS-1$ } }
@Override public void saving(ISaveContext context) throws CoreException { if (!fNeedsSaving) { return; } try { persistStateCache(); cleanStateCache(); fNeedsSaving = false; } catch (IOException e) { ApiPlugin.log(e); } }
/** * Loads the information from the *.profile file the first time the baseline * is accessed */ private void loadBaselineInfos() { if (fComponentsById != null) { return; } try { ApiBaselineManager.getManager().loadBaselineInfos(this); } catch (CoreException ce) { ApiPlugin.log(ce); } }
/** * Performs the finishing actions from this page */ boolean finish() { saveWidgetState(); final IApiBaseline baseline = ApiBaselineManager.getManager().getApiBaseline(this.baselineName); if (baseline == null) { return false; } CompareOperation op = new CompareOperation(baseline, this.selection); op.setSystem(false); op.setPriority(Job.LONG); op.schedule(); return true; }
reporter.reportCounts(); ApiBaselineManager apiManager = ApiBaselineManager.getManager(); IApiBaseline[] baselines = apiManager.getApiBaselines(); boolean dispose = true; for (IApiBaseline baseline2 : baselines) {
@Override public void stop(BundleContext context) throws Exception { try { ApiDescriptionManager.shutdown(); ApiBaselineManager.getManager().stop(); ResourcesPlugin.getWorkspace().removeSaveParticipant(PLUGIN_ID); FileManager.getManager().deleteFiles(); fBundleContext = null; if (deltaProcessor != null) { JavaCore.removeElementChangedListener(deltaProcessor); ResourcesPlugin.getWorkspace().removeResourceChangeListener(deltaProcessor); } } finally { super.stop(context); } }
/** * Returns the {@link IApiBaselineManager}, allowing clients to add/remove * and search for * {@link org.eclipse.pde.api.tools.internal.provisional.model.IApiBaseline} * s stored in the manager. * * @return the singleton instance of the {@link IApiProfileManager} */ public IApiBaselineManager getApiBaselineManager() { return ApiBaselineManager.getManager(); }
System.out.println("--> processing OPEN project: [" + proj.getElementName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ bmanager.disposeWorkspaceBaseline(); } else if ((flags & IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) != 0 || (flags & IJavaElementDelta.F_CLASSPATH_CHANGED) != 0) { if (ApiPlugin.DEBUG_WORKSPACE_DELTA_PROCESSOR) { System.out.println("--> processing CLASSPATH CHANGE project: [" + proj.getElementName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ bmanager.disposeWorkspaceBaseline(); dmanager.projectClasspathChanged(proj); try { System.out.println("--> processing manifest delta"); //$NON-NLS-1$ bmanager.disposeWorkspaceBaseline(); break; System.out.println("--> processing PROJECT RENAME from: [" + delta.getMovedFromElement().getJavaProject().getElementName() + "] to: [" + proj.getElementName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ bmanager.disposeWorkspaceBaseline(); System.out.println("processed REMOVED delta for package fragment: [" + fragment.getElementName() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ ((ApiBaseline) bmanager.getWorkspaceBaseline()).clearPackage(fragment.getElementName());
@Override public synchronized IApiComponent getWorkspaceComponent(String symbolicName) { IApiBaseline baseline = getWorkspaceBaseline(); if (baseline != null) { return baseline.getApiComponent(symbolicName); } return null; } }
/** * @param name * @return */ private boolean isNameValid(String name) { if(name.length() < 1) { setErrorMessage(WizardMessages.ApiProfileWizardPage_20); return false; } if(!name.equals(originalname) && (((ApiBaselineManager)ApiPlugin.getDefault().getApiBaselineManager()).isExistingProfileName(name) && !ApiBaselinePreferencePage.isRemovedBaseline(name))) { setErrorMessage(WizardMessages.ApiProfileWizardPage_profile_with_that_name_exists); return false; } IStatus status = ResourcesPlugin.getWorkspace().validateName(name, IResource.FILE); if(!status.isOK()) { setErrorMessage(status.getMessage()); return false; } return true; }
@Override public synchronized IApiBaseline getWorkspaceBaseline() { if (ApiPlugin.isRunningInFramework()) { if (this.workspacebaseline == null) { try { this.workspacebaseline = createWorkspaceBaseline(); } catch (CoreException e) { ApiPlugin.log(e); } } return this.workspacebaseline; } return null; }
parser.setErrorHandler(new DefaultHandler()); } catch (ParserConfigurationException e) { abort("Error restoring API baseline", e); //$NON-NLS-1$ } catch (FactoryConfigurationError e) { abort("Error restoring API baseline", e); //$NON-NLS-1$ abort("Error restoring API baseline", e); //$NON-NLS-1$ } catch (SAXException e) { abort("Error restoring API baseline", e); //$NON-NLS-1$ } finally { try { abort("Invalid baseline description", null); //$NON-NLS-1$
/** * Performs the finishing actions from this page */ boolean finish() { saveWidgetState(); final IApiBaseline baseline = ApiBaselineManager.getManager().getApiBaseline(this.baselineName); if (baseline == null) { return false; } CompareOperation op = new CompareOperation(baseline, this.selection); op.setSystem(false); op.setPriority(Job.LONG); op.schedule(); return true; }
reporter.reportCounts(); ApiBaselineManager apiManager = ApiBaselineManager.getManager(); IApiBaseline[] baselines = apiManager.getApiBaselines(); boolean dispose = true; for (int i = 0; i < baselines.length; i++) {
IApiBaselineManager manager = ApiBaselineManager.getManager(); IApiBaseline baseline = manager.getWorkspaceBaseline(); if (baseline == null) {
/** * @param name * @return */ protected boolean isNameValid(String name) { if (name.length() < 1) { setErrorMessage(WizardMessages.ApiProfileWizardPage_20); return false; } if (!name.equals(originalname) && (((ApiBaselineManager) ApiPlugin.getDefault().getApiBaselineManager()).isExistingProfileName(name) && !ApiBaselinePreferencePage.isRemovedBaseline(name))) { setErrorMessage(WizardMessages.ApiProfileWizardPage_profile_with_that_name_exists); return false; } IStatus status = ResourcesPlugin.getWorkspace().validateName(name, IResource.FILE); if (!status.isOK()) { setErrorMessage(status.getMessage()); return false; } return true; }
public static IApiComponent getStubApiComponent(int eeValue) { if (AllSystemLibraryApiComponents == null) { AllSystemLibraryApiComponents = new LinkedHashMap<>(); } String name = ProfileModifiers.getName(eeValue); IApiComponent component = AllSystemLibraryApiComponents.get(name); if (component == null) { // search if the corresponding stub file exists File stubFile = getFileFor(eeValue, name); if (stubFile == null) { return null; } component = new StubApiComponent(ApiBaselineManager.getManager().getWorkspaceBaseline(), stubFile.getAbsolutePath(), name); AllSystemLibraryApiComponents.put(name, component); } return component; }
ApiBaselineManager bmanager = ApiBaselineManager.getManager(); switch (kind) { case ApiUseLaunchDelegate.KIND_API_BASELINE: abort(Messages.ApiUseScanJob_baseline_name_missing); IApiBaseline baseline = bmanager.getApiBaseline(name); if (baseline == null) { abort(MessageFormat.format(Messages.ApiUseScanJob_baseline_does_not_exist, new String[]{name}));