/*
 * The contents of this file are subject to the terms 
 * of the Common Development and Distribution License 
 * (the License).  You may not use this file except in
 * compliance with the License.
 * 
 * You can obtain a copy of the license at 
 * https://glassfish.dev.java.net/public/CDDLv1.0.html or
 * glassfish/bootstrap/legal/CDDLv1.0.txt.
 * See the License for the specific language governing 
 * permissions and limitations under the License.
 * 
 * When distributing Covered Code, include this CDDL 
 * Header Notice in each file and include the License file 
 * at glassfish/bootstrap/legal/CDDLv1.0.txt.  
 * If applicable, add the following below the CDDL Header, 
 * with the fields enclosed by brackets [] replaced by
 * you own identifying information: 
 * "Portions Copyrighted [year] [name of copyright owner]"
 * 
 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
 */

/*
 * ConnectorConnectionPoolHandlers.java
 *
 * Created on November 26, 2003, 2:35 PM
 */

package com.sun.enterprise.tools.admingui.handlers;

import java.util.EventObject;
import javax.servlet.http.HttpSession;

import com.iplanet.jato.RequestContext;
import com.iplanet.jato.RequestManager;
import com.iplanet.jato.model.DefaultModel;
import com.iplanet.jato.view.View;
import com.iplanet.jato.view.ViewBean;
import com.iplanet.jato.model.ModelControlException;
import com.iplanet.jato.view.ContainerViewBase;
import com.iplanet.jato.view.ViewBase;

import com.sun.enterprise.tools.guiframework.view.DescriptorContainerView;
import com.sun.enterprise.tools.guiframework.view.HandlerContext;
import com.sun.enterprise.tools.guiframework.exception.FrameworkException;
import com.sun.enterprise.tools.guiframework.view.descriptors.ViewDescriptor;


public class adminObjectHandlers {
    
    /* called from step2, to get values from step1 */
    public void getValuesFromStep1(RequestContext ctx, HandlerContext handlerCtx) throws ModelControlException {
        View view = handlerCtx.getView();
	DescriptorContainerView descView = (DescriptorContainerView)(((ViewBase)view));
	ViewDescriptor vd = descView.getViewDescriptor();
	HttpSession session = RequestManager.getSession();
        DefaultModel step1Model = (DefaultModel)(session.getValue("adminObjectStep1.model"));
        descView.setDisplayFieldValue("JndiName", step1Model.getValue("JndiName"));
        descView.setDisplayFieldValue("ResourceType", step1Model.getValue("ResourceType"));
        descView.setDisplayFieldValue("ResourceAdapter", step1Model.getValue("ResourceAdapter"));
    }
    
}
