/** * This method could be called with the project's values, or with the global preference values. * Validators that are not configured on this project will be ignored. */ public void setValidators(ValidatorMetaData[] vmds) { super.setValidators(extractProjectValidators(vmds, getResource())); }
/** * This method could be called with the project's values, or with the global preference values. * Validators that are not configured on this project will be ignored. */ public void setEnabledValidators(ValidatorMetaData[] vmds) { super.setEnabledValidators(extractProjectValidators(vmds, getResource())); }
/** * If the preferences should be used then the preference settings are returned; otherwise return * the project settings. */ public ValidatorMetaData[] getEnabledValidators() throws InvocationTargetException { if (useGlobalPreference()) { return extractProjectValidators(ConfigurationManager.getManager().getGlobalConfiguration().getEnabledValidators(), getResource()); } return super.getEnabledValidators(); }
public ValidatorMetaData[] getManualEnabledValidators() throws InvocationTargetException { if (useGlobalPreference()) { return extractProjectValidators(ConfigurationManager.getManager().getGlobalConfiguration().getManualEnabledValidators(), getResource()); } return super.getManualEnabledValidators(); }
public ValidatorMetaData[] getEnabledFullBuildValidators(boolean fullBuild) throws InvocationTargetException { if (useGlobalPreference()) { return extractProjectValidators(ConfigurationManager.getManager().getGlobalConfiguration().getEnabledFullBuildValidators(fullBuild), getResource()); } return super.getEnabledFullBuildValidators(fullBuild); }
public ValidatorMetaData[] getBuildEnabledValidators() throws InvocationTargetException { if (useGlobalPreference()) { return extractProjectValidators(ConfigurationManager.getManager().getGlobalConfiguration().getBuildEnabledValidators(), getResource()); } return super.getBuildEnabledValidators(); }
/** * @see org.eclipse.wst.validation.internal.operations.internal.preference.ValidationConfiguration#getDisabledValidators() */ public ValidatorMetaData[] getDisabledValidators() throws InvocationTargetException { if (useGlobalPreference()) { return extractProjectValidators(ConfigurationManager.getManager().getGlobalConfiguration().getDisabledValidators(), getResource()); } return super.getDisabledValidators(); }
public ValidatorMetaData[] getEnabledFullBuildValidators(boolean fullBuild, boolean onlyReferenced) throws InvocationTargetException { if (useGlobalPreference()) { return extractProjectValidators(ConfigurationManager.getManager().getGlobalConfiguration().getEnabledFullBuildValidators(fullBuild), getResource(), onlyReferenced); } return super.getEnabledFullBuildValidators(fullBuild, onlyReferenced); }
/** * @see org.eclipse.wst.validation.internal.operations.internal.preference.ValidationConfiguration#getValidators() */ public ValidatorMetaData[] getValidators() throws InvocationTargetException { if (useGlobalPreference()) { return extractProjectValidators(ConfigurationManager.getManager().getGlobalConfiguration().getValidators(), getResource()); } return super.getValidators(); }
/** * @see org.eclipse.wst.validation.internal.operations.internal.attribute.ValidationConfiguration#getEnabledIncrementalValidators(boolean) */ public ValidatorMetaData[] getEnabledIncrementalValidators(boolean incremental) throws InvocationTargetException { if (useGlobalPreference()) { return extractProjectValidators(ConfigurationManager.getManager().getGlobalConfiguration().getEnabledIncrementalValidators(incremental), getResource()); } return super.getEnabledIncrementalValidators(incremental); }
public ValidatorMetaData[] getIncrementalValidators() throws InvocationTargetException { if (useGlobalPreference()) { return extractProjectValidators(ConfigurationManager.getManager().getGlobalConfiguration().getIncrementalValidators(), getResource()); } return super.getIncrementalValidators(); }
public ProjectConfiguration getProjectConfigurationWithoutMigrate(IProject project) throws InvocationTargetException { ProjectConfiguration prjp = null; try { prjp = (ProjectConfiguration) project.getSessionProperty(USER_PREFERENCE); if (prjp == null || !prjp.getResource().exists()) { prjp = new ProjectConfiguration(project); prjp.getVersion(); // initialize the configuration's version attribute prjp.load(); // initialize this instance from the stored values prjp.passivate(); // store this instance as a property on the IResource } return prjp; } catch (CoreException exc) { throw new InvocationTargetException(exc, ResourceHandler.getExternalizedMessage(ResourceConstants.VBF_EXC_RETRIEVE, new String[]{project.getName()})); } }
public ProjectConfiguration getProjectConfiguration(IProject project) throws InvocationTargetException { ProjectConfiguration prjp = null; try { prjp = (ProjectConfiguration) project.getSessionProperty(USER_PREFERENCE); if (prjp == null || !prjp.getResource().exists()) { prjp = new ProjectConfiguration(project); prjp.getVersion(); // initialize the configuration's version attribute prjp.load(); // initialize this instance from the stored values prjp.passivate(); // store this instance as a property on the IResource } return prjp; } catch (CoreException exc) { throw new InvocationTargetException(exc, ResourceHandler.getExternalizedMessage(ResourceConstants.VBF_EXC_RETRIEVE, new String[]{project.getName()})); } }
/** * This method exists only for migration purposes. The project marker must be deleted after * migration is complete. */ protected IMarker[] getMarker() { try { // First try to find the 4.03 project marker. IMarker[] allMarkers = getResource().findMarkers(ConfigurationConstants.PRJ_MARKER_403, false, IResource.DEPTH_ZERO); // If it doesn't exist, then this might be a 5.0 project marker. if ((allMarkers == null) || (allMarkers.length == 0)) { allMarkers = getResource().findMarkers(ConfigurationConstants.PRJ_MARKER, false, IResource.DEPTH_ZERO); } // There should be only one projectmarker. if (allMarkers.length == 1) { return allMarkers; } // Job is done. Nothing to migrate. return null; } catch (CoreException exc) { // Can't find the IMarker? Assume it's deleted. Logger logger = ValidationPlugin.getPlugin().getMsgLogger(); if (logger.isLoggingLevel(Level.SEVERE)) { LogEntry entry = ValidationPlugin.getLogEntry(); entry.setSourceIdentifier("ProjectConfiguration::getMarker"); //$NON-NLS-1$ entry.setTargetException(exc); logger.write(Level.SEVERE, entry); } return null; } }
protected void loadPreference() throws InvocationTargetException { IProject project = (IProject) getResource(); IScopeContext projectContext = new ProjectScope(project); final IEclipsePreferences prefs = projectContext.getNode(ValidationPlugin.PLUGIN_ID); if (prefs != null) { String storedConfig = prefs.get(USER_PREFERENCE,"default_value"); deserialize(storedConfig); String storedManualConfig = prefs.get(USER_MANUAL_PREFERENCE,"default_value"); deserializeManual(storedManualConfig); String storedBuildConfig = prefs.get(USER_BUILD_PREFERENCE,"default_value"); deserializeBuild(storedBuildConfig); String storedDelegatesConfiguration = prefs.get(DELEGATES_PREFERENCE,"default_value"); deserializeDelegates(storedDelegatesConfiguration); } } }
public void store() throws InvocationTargetException { IProject project = (IProject) getResource(); IScopeContext projectContext = new ProjectScope(project); final IEclipsePreferences pref = projectContext.getNode(ValidationPlugin.PLUGIN_ID); if (pref != null) { try { pref.put(USER_PREFERENCE, serialize()); pref.put(USER_MANUAL_PREFERENCE, serializeManualSetting()); pref.put(USER_BUILD_PREFERENCE, serializeBuildSetting()); pref.put(DELEGATES_PREFERENCE, serializeDelegatesSetting()); pref.flush(); } catch (BackingStoreException bse) { Logger.getLogger().log(bse); } } }
getResource().getWorkspace().deleteMarkers(marker); } catch (CoreException exc) { Logger logger = ValidationPlugin.getPlugin().getMsgLogger();