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

jpaoletti.jpm.core.PMCoreObject Maven / Gradle / Ivy

The newest version!
package jpaoletti.jpm.core;

/**
 * This is the superclass of all the core objects of Presentation Manager and it
 * provides some helpers.
 *
 * @author jpaoletti
 *
 */
public abstract class PMCoreObject implements PMCoreConstants {

    private Boolean debug;

    /**
     * Display a debug information on PM log if debug flag is active
     *
     * @param s String information
     */
    public void debug(String s) {
        if (getDebug()) {
            PresentationManager.getPm().debug(this, s);
        }
    }

    /**
     * @param debug the debug to set
     */
    public void setDebug(Boolean debug) {
        this.debug = debug;
    }

    /**
     * @return the debug
     */
    public Boolean getDebug() {
        if (debug == null) {
            return false;
        }
        return debug;
    }

    /**
     * Return the presentation manager singleton
     *
     * @return The Presentation Manager
     */
    protected PresentationManager getPm() {
        return PresentationManager.getPm();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy