Package eu.planets_project.pp.plato.model

Examples of eu.planets_project.pp.plato.model.AlternativesDefinition


        if (alt == null) {
            log
                    .error("No alternative selected. This method should not have been called.");
            return;
        }
        AlternativesDefinition alternativesDefinition = selectedPlan.getAlternativesDefinition();
        // its a new alternative and the alternative is not yet in list of
        // alternatives
        // note: the user can also edit an alternative that has already been added to the list
        if ((alt.getId() == 0) &&
            (!alternativesDefinition.getAlternatives().contains(alt))) {
            String altName = alt.getName();
            if ((altName.length() > 20)||
                (null != alternativesDefinition.alternativeByName(altName))){
                FacesMessages.instance()
                    .add(FacesMessage.SEVERITY_ERROR,
                        "Please provide a unique name which has no more than 20 characters.");
                return;
            }

            // add it to the preservation planning project
            alternativesDefinition.addAlternative(alt);
            // refresh the datamodel list
            alternativeList = alternativesDefinition.getAlternatives();
            // the alternativesdefinition has been changed
            alternativesDefinition.touch();
        }
        // this alternative has been changed
        alt.touch();

        // exit editing mode
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.model.AlternativesDefinition

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.