Package clips.delegate.doctor.certificate.tag.interfaces

Source Code of clips.delegate.doctor.certificate.tag.interfaces.TypeSelectableEdit

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package clips.delegate.doctor.certificate.tag.interfaces;

import cli_fmw.delegate.report.ReportParam;
import cli_fmw.main.ClipsException;
import clips.delegate.doctor.DiseaseLocal;
import clips.delegate.doctor.certificate.CertificateLocal;
import framework.utils.PairIntStr;
import java.util.ArrayList;
import java.util.Set;

/**
*
* @author vip
*/
abstract public class TypeSelectableEdit extends TypeSelectable {
    /**
     * Обязательно инициализировать в потомках в методе fillitems,
     * этот метод вызывается в конструкторе предка
     */
    protected Set<Integer> editableItems;

    public TypeSelectableEdit() throws ClipsException {
    }

    public TypeSelectableEdit(CertificateLocal certificateLocal, ReportParam reportParam, DiseaseLocal diseaseLocal) throws ClipsException {
        super(certificateLocal, reportParam, diseaseLocal);
    }

    @Override
    final public boolean isEditable() {
        Integer id = certTagResult.items.get(0);
        return editableItems.contains(id);
    }

/*    @Override
    final public void setText(String text, boolean forced) throws ClipsException {
        additionalText = text;
    }*/

    @Override
    final public PairIntStr getValue() throws ClipsException {
        return new PairIntStr(certTagResult.items.get(0), getText());
    }

    @Override
    public void setItem(int id) throws ClipsException {
        certTagResult.items = new ArrayList<Integer>();
        certTagResult.items.add(id);
        setTagResult(certTagResult);
    }

}
TOP

Related Classes of clips.delegate.doctor.certificate.tag.interfaces.TypeSelectableEdit

TOP
Copyright © 2018 www.massapi.com. 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.