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

io.imunity.console.views.signup_and_enquiry.requests.GenericReviewPanel Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
/*
 * Copyright (c) 2016 ICM Uniwersytet Warszawski All rights reserved.
 * See LICENCE.txt file for licensing information.
 */
package io.imunity.console.views.signup_and_enquiry.requests;

import org.springframework.beans.factory.annotation.Autowired;

import com.vaadin.flow.component.orderedlayout.VerticalLayout;

import pl.edu.icm.unity.base.registration.EnquiryForm;
import pl.edu.icm.unity.base.registration.EnquiryResponse;
import pl.edu.icm.unity.base.registration.EnquiryResponseState;
import pl.edu.icm.unity.base.registration.RegistrationForm;
import pl.edu.icm.unity.base.registration.RegistrationRequest;
import pl.edu.icm.unity.base.registration.RegistrationRequestState;
import pl.edu.icm.unity.engine.api.utils.PrototypeComponent;

/**
 * Component showing either {@link RegistrationReviewPanel} or {@link EnquiryReviewPanel} depending on an input to
 * show.
 * @author K. Benedyczak
 */
@PrototypeComponent
class GenericReviewPanel extends VerticalLayout
{
	private final EnquiryReviewPanel enquiryPanel;
	private final RegistrationReviewPanel registrationPanel;

	@Autowired
	GenericReviewPanel(EnquiryReviewPanel enquiryPanel,
			RegistrationReviewPanel registrationPanel)
	{
		this.enquiryPanel = enquiryPanel;
		this.registrationPanel = registrationPanel;
		
		setPadding(false);
		setMargin(false);
		setSpacing(false);
		
		setSizeFull();
	}

	void setEnquiry(EnquiryResponseState requestState, EnquiryForm form)
	{
		enquiryPanel.setInput(requestState, form);
		removeAll();
		add(enquiryPanel);
	}
	
	void setRegistration(RegistrationRequestState requestState, RegistrationForm form)
	{
		registrationPanel.setInput(requestState, form);
		removeAll();
		add(registrationPanel);
	}
	
	RegistrationRequest getUpdatedRequest()
	{
		return registrationPanel.getUpdatedRequest();
	}
	
	EnquiryResponse getUpdatedResponse()
	{
		return enquiryPanel.getUpdatedRequest();
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy