global.namespace.truelicense.jsf.WelcomeBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truelicense-jsf Show documentation
Show all versions of truelicense-jsf Show documentation
The TrueLicense JSF module provides a web user interface for consuming
license keys.
/*
* Copyright (C) 2005-2017 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package global.namespace.truelicense.jsf;
import javax.faces.component.FacesComponent;
import static global.namespace.truelicense.ui.LicenseWizardMessage.*;
import global.namespace.truelicense.ui.LicenseWizardState;
/**
* The backing bean for welcoming the user and displaying available options.
*
* @since TrueLicense 2.3
* @author Christian Schlichtherle
*/
@FacesComponent
public final class WelcomeBean extends LicenseBean {
private LicenseWizardState nextState;
public String getTitle() { return message(welcome_title); }
public String getPrompt() { return message(welcome_prompt); }
public String getInstallLabel() { return message(welcome_install); }
public LicenseWizardState getInstallValue() { return LicenseWizardState.install; }
public String getDisplayLabel() { return message(welcome_display); }
public LicenseWizardState getDisplayValue() { return LicenseWizardState.display; }
public boolean isDisplayDisabled() { return isUninstallDisabled(); }
public String getUninstallLabel() { return message(welcome_uninstall); }
public LicenseWizardState getUninstallValue() { return LicenseWizardState.uninstall; }
public boolean isUninstallDisabled() { return !licenseInstalled(); }
@Override public LicenseWizardState nextState() {
return getNextState();
}
/**
* Returns the next state.
* The default value is determined as follows:
*
* - If a valid license key is installed, the next state is {@code display}.
*
- Otherwise, the next state is {@code install}.
*
*
* Note that this property is not persisted in the state helper.
*/
public LicenseWizardState getNextState() {
final LicenseWizardState nextState = this.nextState;
return null != nextState ? nextState : (this.nextState = super.nextState());
}
public void setNextState(final LicenseWizardState nextState) {
this.nextState = nextState;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy