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

at.spardat.xma.mdl.simple.ISimpleWMClient Maven / Gradle / Ivy

/*******************************************************************************
 * Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     s IT Solutions AT Spardat GmbH - initial API and implementation
 *******************************************************************************/

// @(#) $Id: ISimpleWMClient.java 2324 2008-02-05 16:34:39Z s3460 $
package at.spardat.xma.mdl.simple;

import at.spardat.enterprise.fmt.IFmt;
import at.spardat.xma.mdl.IWModelClient;

/**
 * This class defines the behaviour of a SimpleWM at the client side of XMA.
 * The primary enrichment compared to ISimpleWM is the ability to set
 * and query a formatter, see {@link at.spardat.enterprise.fmt.IFmt IFmt} and
 * to check if the value of this is valid with respect to the formatter.
 *
 * @author YSD, 23.06.2003 13:57:32
 */
public interface ISimpleWMClient extends ISimpleWM, IWModelClient {

    /**
     * Determines if the value contained in this Model is a valid one in terms of the associated
     * formatter. Note the formatter usually restricts the allowed value range of the type.
     * Since formatters are only executing at the client side, it may be the case that
     * the server provides values which are obeying the type, but are conflicting with
     * the formatter.
     *
     * @return true if the contained value conflicts with the formatter.
     */
    public abstract boolean isValueValid ();

    /**
     * Returns a clone of the associated Formatter or null if none is associated.
     *
     * @return the attached formatter
     */
    public abstract IFmt getFmt ();

    /**
     * Sets a new Formatter.
     *
     * @param formatter to be set. It must be compatible to the type set in the superclass.
     *         For type T_STRING, any formatter may be set. For the other types, the type of the
     *         formatter must be compatible with the type specified in the superclass. For
     *         instance, if the type is T_BCD, only instances of ABcdFmt are allowed.
     * @exception IllegalArgumentException if the provided formatter is not type compatible
     */
    public abstract void setFmt (IFmt formatter);

    /**
     * Provides a string that results from applying the formatter to the internally stored
     * value.
     */
    public abstract String getFormattedString();

    /**
     * Returns the MANDATORY-property of the associated formatter. Returns false, if there
     * is no formatter associated.
     */
    public boolean isMandatory ();

    /**
     * If there is a formatter attached, this method clones the old formatter, changes
     * the MANDATORY-property of the formatter to the provided value, and sets the formatter.
     * If there is no formatter attached, this method does nothing.
     */
    public void setMandatory (boolean what);

    /**
     * If this is set to true then the widget is validated in the editable=false state, too.
     * Normally widgets in the editable=false state are not validated.
     * So this property defaults to false, if not set otherwise.
     * @param what
     * @since version_number
     * @author s3460
     */
    public void setValidateIfUneditable(boolean what);

    /**
     * Returns if this widget is validated in the editable=false state, too.
     * Normally widgets in the editable=false state are not validated.
     * So this property defaults to false, if not set otherwise.
     * @return the validateUneditable property
     * @since version_number
     * @author s3460
     */
    public boolean isValidateIfUneditable();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy