Package org.dmd.mvw.tools.mvwgenerator.generated.dmo

Source Code of org.dmd.mvw.tools.mvwgenerator.generated.dmo.ActionBindingDMO

//  ---------------------------------------------------------------------------
//  dark-matter-data
//  Copyright (c) 2011 dark-matter-data committers
//  ---------------------------------------------------------------------------
//  This program is free software; you can redistribute it and/or modify it
//  under the terms of the GNU Lesser General Public License as published by the
//  Free Software Foundation; either version 3 of the License, or (at your
//  option) any later version.
//  This program is distributed in the hope that it will be useful, but WITHOUT
//  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
//  more details.
//  You should have received a copy of the GNU Lesser General Public License along
//  with this program; if not, see <http://www.gnu.org/licenses/lgpl.html>.
//  ---------------------------------------------------------------------------
package org.dmd.mvw.tools.mvwgenerator.generated.dmo;

// Generated from: org.dmd.dms.util.GenUtility.formatImports(GenUtility.java:391)
import java.io.Serializable;                                                         // Always required - (GenUtility.java:220)
import org.dmd.dmc.DmcAttribute;                                                     // Any attributes - (GenUtility.java:236)
import org.dmd.dmc.DmcNamedObjectIF;                                                 // Named object - (GenUtility.java:371)
import org.dmd.dmc.DmcOmni;                                                          // Lazy resolution - (GenUtility.java:316)
import org.dmd.dmc.DmcSliceInfo;                                                     // Required for object slicing - (GenUtility.java:225)
import org.dmd.dmc.DmcValueException;                                                // Any attributes - (GenUtility.java:237)
import org.dmd.dmc.types.CamelCaseName;                                              // Naming attribute type - (GenUtility.java:366)
import org.dmd.dms.generated.dmo.MetaDMSAG;                                          // Required for MODREC constructor - (GenUtility.java:224)
import org.dmd.dms.generated.types.DmcTypeCamelCaseNameSV;                           // Required type - (GenUtility.java:324)
import org.dmd.dms.generated.types.DmcTypeModifierMV;                                // Required for MODREC constructor - (GenUtility.java:223)
import org.dmd.mvw.tools.mvwgenerator.generated.dmo.ComponentDMO;                    // Type specific set/add - (GenUtility.java:303)
import org.dmd.mvw.tools.mvwgenerator.generated.dmo.MvwDefinitionDMO;                // Base class - (GenUtility.java:351)
import org.dmd.mvw.tools.mvwgenerator.generated.types.ComponentREF;                  // Helper class - (GenUtility.java:331)
import org.dmd.mvw.tools.mvwgenerator.generated.types.DmcTypeComponentREFSV;         // Reference type - (GenUtility.java:296)

/**
* The ActionBinding class allows for the definition of an intermediate
* component that binds\n behavioural triggers e.g. menu items, toolbar
* buttons etc. to action implementors e.g. Controllers,\n Presenters and
* Activities. The ActionBinding serves the same purpose as the
* com.google.gwt.user.client.Command\n interface, but provides some
* additional useful functionality. The implementation of the ActionBinding
* (see\n org.dmd.mvw.client.mvwmenus.base.ActionBinding) maintains a set of
* TriggerIF interfaces, which are the various\n implementations of the menu
* items, toolbar buttons etc. An implementing component can enable/disable
* its\n Actions which, in turn, can enable/disable its triggers.
* <P>
* Generated from the mvw schema at version 0.1
* <P>
* This code was auto-generated by the dmogenerator utility and shouldn't be alterred manually!
* Generated from: org.dmd.dms.util.DmoFormatter.dumpDMO(DmoFormatter.java:133)
*/
@SuppressWarnings("serial")
public class ActionBindingDMO  extends MvwDefinitionDMO  implements DmcNamedObjectIF, Serializable  {

    public final static String constructionClassName = "ActionBinding";


    static {
    }

    public ActionBindingDMO() {
        super("ActionBinding");
    }

    protected ActionBindingDMO(String oc) {
        super(oc);
    }

    @Override
    public ActionBindingDMO getNew(){
        ActionBindingDMO rc = new ActionBindingDMO();
        return(rc);
    }

    @Override
    public ActionBindingDMO getSlice(DmcSliceInfo info){
        ActionBindingDMO rc = new ActionBindingDMO();
        populateSlice(rc,info);
        return(rc);
    }

    public ActionBindingDMO(DmcTypeModifierMV mods) {
        super("ActionBinding");
        modrec(true);
        setModifier(mods);
    }

    public ActionBindingDMO getModificationRecorder(){
        ActionBindingDMO rc = new ActionBindingDMO();
        rc.setActionBindingName(getActionBindingName());
        rc.setModifier(new DmcTypeModifierMV(MetaDMSAG.__modify));
        rc.modrec(true);
        return(rc);
    }

    // org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:744)
    public CamelCaseName getObjectName(){
        DmcAttribute<?> name = get(MvwDMSAG.__actionBindingName);
        if (name != null)
            return((CamelCaseName)name.getSV());
   
        return(null);
    }

    // org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:761)
    public DmcAttribute<?> getObjectNameAttribute(){
        DmcAttribute<?> name = get(MvwDMSAG.__actionBindingName);
        return(name);
    }

    // org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:768)
    public boolean equals(Object obj){
        if (obj instanceof ActionBindingDMO){
            return( getObjectName().equals( ((ActionBindingDMO) obj).getObjectName()) );
        }
        return(false);
    }

    // org.dmd.dms.util.DmoFormatter.getAccessFunctions(DmoFormatter.java:776)
    public int hashCode(){
        CamelCaseName objn = getObjectName();
        if (objn == null)
            return(0);
       
        return(objn.hashCode());
    }

    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:645)
    public ComponentREF getImplementedBy(){
        DmcTypeComponentREFSV attr = (DmcTypeComponentREFSV) get(MvwDMSAG.__implementedBy);
        if (attr == null)
            return(null);

        if (DmcOmni.instance().lazyResolution()){
            if (attr.doLazyResolution(this)){
                rem(attr.getAttributeInfo());
                return(null);
            }
        }

        return(attr.getSV());
    }

    /**
     * Returns the reference to Component without attempting lazy resolution (if turned on).
     */
    public ComponentREF getImplementedByREF(){
        DmcTypeComponentREFSV attr = (DmcTypeComponentREFSV) get(MvwDMSAG.__implementedBy);
        if (attr == null)
            return(null);

        return(attr.getSV());
    }

    /**
     * Sets implementedBy to the specified value.
     * @param value ComponentDMO
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:699)
    public void setImplementedBy(ComponentDMO value) {
        DmcAttribute<?> attr = get(MvwDMSAG.__implementedBy);
        if (attr == null)
            attr = new DmcTypeComponentREFSV(MvwDMSAG.__implementedBy);
        else
            ((DmcTypeComponentREFSV)attr).removeBackReferences();
       
        try{
            attr.set(value);
            set(MvwDMSAG.__implementedBy,attr);
        }
        catch(DmcValueException ex){
            throw(new IllegalStateException("The type specific set() method shouldn't throw exceptions!",ex));
        }
    }

    /**
     * Sets implementedBy to the specified value.
     * @param value A value compatible with DmcTypeComponentREFSV
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:867)
    public void setImplementedBy(Object value) throws DmcValueException {
        DmcTypeComponentREFSV attr  = (DmcTypeComponentREFSV) get(MvwDMSAG.__implementedBy);
        if (attr == null)
            attr = new DmcTypeComponentREFSV(MvwDMSAG.__implementedBy);
        else
            attr.removeBackReferences();
       
        attr.set(value);
        set(MvwDMSAG.__implementedBy,attr);
    }

    /**
     * Removes the implementedBy attribute value.
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:887)
    public void remImplementedBy(){
         rem(MvwDMSAG.__implementedBy);
    }

    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:774)
    public CamelCaseName getActionBindingName(){
        DmcTypeCamelCaseNameSV attr = (DmcTypeCamelCaseNameSV) get(MvwDMSAG.__actionBindingName);
        if (attr == null)
            return(null);

        return(attr.getSV());
    }

    /**
     * Sets actionBindingName to the specified value.
     * @param value CamelCaseName
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:814)
    public void setActionBindingName(CamelCaseName value) {
        DmcAttribute<?> attr = get(MvwDMSAG.__actionBindingName);
        if (attr == null)
            attr = new DmcTypeCamelCaseNameSV(MvwDMSAG.__actionBindingName);
       
        try{
            attr.set(value);
            set(MvwDMSAG.__actionBindingName,attr);
        }
        catch(DmcValueException ex){
            throw(new IllegalStateException("The type specific set() method shouldn't throw exceptions!",ex));
        }
    }

    /**
     * Sets actionBindingName to the specified value.
     * @param value A value compatible with DmcTypeCamelCaseNameSV
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:867)
    public void setActionBindingName(Object value) throws DmcValueException {
        DmcTypeCamelCaseNameSV attr  = (DmcTypeCamelCaseNameSV) get(MvwDMSAG.__actionBindingName);
        if (attr == null)
            attr = new DmcTypeCamelCaseNameSV(MvwDMSAG.__actionBindingName);
       
        attr.set(value);
        set(MvwDMSAG.__actionBindingName,attr);
    }

    /**
     * Removes the actionBindingName attribute value.
     */
    // org.dmd.dms.util.GenUtility.formatSV(GenUtility.java:887)
    public void remActionBindingName(){
         rem(MvwDMSAG.__actionBindingName);
    }




}
TOP

Related Classes of org.dmd.mvw.tools.mvwgenerator.generated.dmo.ActionBindingDMO

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.