All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.fhframework.docs.uc.DropdownUC Maven / Gradle / Ivy

package pl.fhframework.docs.uc;

import pl.fhframework.core.designer.IDocumentationUseCase;
import pl.fhframework.core.logging.FhLogger;
import pl.fhframework.core.uc.UseCase;
import pl.fhframework.core.uc.url.UseCaseWithUrl;
import pl.fhframework.docs.forms.component.DropdownForm;
import pl.fhframework.docs.forms.component.model.DropdownElement;
import pl.fhframework.annotations.Action;
import pl.fhframework.events.BreakLevelEnum;


/**
 * Use case supporting Dropdown documentation
 */
@UseCase
public class DropdownUC implements IDocumentationUseCase {
    private DropdownElement model;

    @Override
    public void start(DropdownElement model) {
        this.model = model;
        showForm(DropdownForm.class, model);
    }


    @Action(breakOnErrors = BreakLevelEnum.NEVER)
    public void onDropdownItemClick() {
        boolean initialValue = model.isInitialValue();
        model.setInitialValue(!initialValue);
        if (initialValue) {
            model.setDropdownLabel(model.getInitialLabel());
        } else {
            model.setDropdownLabel(model.getChangedLabel());
        }
        FhLogger.debug(this.getClass(), logger -> logger.log("DropdownItem clicked"));
    }


}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy