Package org.swingml.model

Examples of org.swingml.model.ExternalActionModel


    /**
     * @see org.swingml.xml.Mapper#getModelToMap(Node, Object)
     */
    public Object getModelToMap(Node aNode, Object aParent, Container aContainer) {
        ExternalActionModel theModel = new ExternalActionModel();
        ListenerModel theListener = (ListenerModel) aParent;
        theListener.addAction(theModel);
        return theModel;
    }
View Full Code Here


    /**
     * @see org.swingml.xml.Mapper#mapModel(Node, Object)
     */
    public void mapModel(Node aNode, Object aParent, Container aContainer) {
        ExternalActionModel theModel = (ExternalActionModel) this.getModelToMap(aNode, aParent, aContainer);
        this.mapModelAttributes(aNode, theModel, aParent);
        super.iterate(aNode, theModel, aContainer);
    }
View Full Code Here

    /**
     * @see org.swingml.xml.Mapper#mapModelAttributes(Node, Object, Object)
     */
    public void mapModelAttributes(Node aNode, Object aModel, Object aParent) {
        ExternalActionModel theActionModel = (ExternalActionModel) aModel;
        Node theResultNode = null;
        theResultNode = super.getAttribute(aNode, Constants.COMPONENT);
        if (theResultNode != null) {
            theActionModel.setComponent(theResultNode.getNodeValue());
        }
        theResultNode = super.getAttribute(aNode, Constants.EXTERNAL_CLASS);
        if (theResultNode != null) {
            Class externalClass = null;
            String className = theResultNode.getNodeValue();
            try {
                externalClass = Class.forName(className);
            } catch (Exception e) {
                SwingMLLogger.getInstance().log("Syntax Error: Failed to load the class: [" + className + "]");
                SwingMLLogger.getInstance().log(e);
                externalClass = null;
            } finally {
                theActionModel.setExternalClass(externalClass);
            }
        }
        theResultNode = super.getAttribute(aNode, Constants.EXTERNAL_FACTORY_CLASS);
        if (theResultNode != null) {
            Class externalFactoryClass = null;
            String className = theResultNode.getNodeValue();
            try {
                externalFactoryClass = Class.forName(className);
                if (externalFactoryClass.isAssignableFrom(InvokableEventHandlerFactory.class)) {
                    throw new IllegalArgumentException("The class " + className + " does not implement " + InvokableEventHandlerFactory.class.getName());
                }
            } catch (Exception e) {
                SwingMLLogger.getInstance().log("Syntax Error: Failed to load the class: [" + className + "]");
                SwingMLLogger.getInstance().log(e);
                externalFactoryClass = null;
            } finally {
                theActionModel.setExternalFactoryClass(externalFactoryClass);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.swingml.model.ExternalActionModel

Copyright © 2018 www.massapicom. 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.