org.codeartisans.java.sos.wizard.presenters.WizardPresenter Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2009, Paul Merlin. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.codeartisans.java.sos.wizard.presenters;
import org.codeartisans.java.sos.presenters.Presenter;
import org.codeartisans.java.sos.wizard.model.WizardModel;
import org.codeartisans.java.sos.wizard.views.WizardBlockingView;
import org.codeartisans.java.sos.wizard.views.WizardPageView;
/**
* A presenter for Wizards.
*
* @param M the model type extending {@link WizardModel}, this is the M in MVP
*
* @author Paul Merlin
*/
public interface WizardPresenter
extends Presenter
{
M wizardModel();
void addTransition( WizardPagePresenter previous, WizardPagePresenter next, Boolean enabled );
void applyTransitionChanges( Iterable changes );
void clickButton( WizardButton button );
void setButtonVisible( WizardButton button, boolean visible );
void setButtonEnabled( WizardButton button, boolean enabled );
/**
* Disabling automatic buttons means that the Wizard will not attempt to automatically calculate
* button states based on the current page's position after the next page change. This is used for
* {@link WizardPagePresenter#beforeShow()} and other {@link WizardPagePresenter} callbacks that need to manually
* modify the button state. The {@link WizardPagePresenter} must completely handle the buttons
* states after setting this to true
. This value is reset to false
after each page change.
*/
void disableAutomaticButtonsDuringNextTransition();
WizardBlockingRegistration blockWizard( WizardBlockingView blockingView );
void previous();
void next();
}