Package net.sf.eclipsecs.core.config

Examples of net.sf.eclipsecs.core.config.ICheckConfigurationWorkingSet


     */
    private ICheckConfiguration createOrGetCheckstyleConfig(
            final ProjectConfigurationWorkingCopy pcWorkingCopy,
            final URL ruleset, String executionId) throws CheckstylePluginException {

        final ICheckConfigurationWorkingSet workingSet =
                pcWorkingCopy.getLocalCheckConfigWorkingSet();

        CheckConfigurationWorkingCopy workingCopy = null;

        // Try to retrieve an existing checkstyle configuration to be updated
        CheckConfigurationWorkingCopy[] workingCopies =
                workingSet.getWorkingCopies();
        final String configName = ECLIPSE_CS_PREFS_CONFIG_NAME + " " + executionId;
    if (workingCopies != null) {
            for (CheckConfigurationWorkingCopy copy : workingCopies) {
                if (configName.equals(copy.getName())) {
                    if (this.remoteConfigurationType.equals(copy.getType())) {
                        workingCopy = copy;
                        break;
                    }
                    throw new CheckstylePluginException(String.format(
                            "A local Checkstyle configuration allready exists with name "
                                    + " [%s] with incompatible type [%s]",
                            configName, copy.getType()));
                }
            }
        }
        // Nothing exist create a brand new one.
        if (workingCopy == null) {
            // Create a fresh check config
            workingCopy =
                    workingSet.newWorkingCopy(this.remoteConfigurationType);
            workingCopy.setName(configName);
            workingSet.addCheckConfiguration(workingCopy);
        }

        workingCopy.setDescription("maven-checkstyle-plugin configuration " + executionId);
        workingCopy.setLocation(ruleset.toExternalForm());
        return workingCopy;
View Full Code Here

TOP

Related Classes of net.sf.eclipsecs.core.config.ICheckConfigurationWorkingSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.