cldccustomcomminterview.java.svn-base

来自「cqME :java framework for TCK test.」· SVN-BASE 代码 · 共 147 行

SVN-BASE
147
字号
/* * $Id$ * * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 only, as published by the Free Software Foundation. * * 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 * General Public License version 2 for more details (a copy is * included at /legal/license.txt). * * You should have received a copy of the GNU General Public License * version 2 along with this work; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa * Clara, CA 95054 or visit www.sun.com if you need additional * information or have any questions. * */package com.sun.tck.j2me.interview;import java.util.Map;import com.sun.interview.FinalQuestion;import com.sun.interview.Interview;import com.sun.interview.Question;import com.sun.interview.StringQuestion;import com.sun.javatest.InterviewParameters;public class CldcCustomCommInterview extends com.sun.interview.Interview {    public CldcCustomCommInterview(Interview parent) throws InterviewParameters.Fault {        super(parent, "cldccustomcomm");        setHelpSet("help/vm");	        setResourceBundle("cldccustomcomm");        setFirstQuestion(qServerJar);    }    public String getServerClass() {        return serverClass;    }    public String getServerParams() {        return serverParams;    }    public String getClientClass() {        return clientClass;    }    public String getClientParams() {        return clientParams;    }    void setPreinstalledClient(boolean state) {        boolean changed = (state != preinstalledClient);        preinstalledClient = state;        // forces the interview to refresh the active path        // qClientJar is the question we're trying to affect        if (changed)            updatePath(qServerParams);    }    private StringQuestion qServerClass = new StringQuestion (this, "serverClass") {        protected Question getNext() {            if (value == null || value.length() == 0)                return null;            else                return qServerURL;        }        public void export (Map data) {            serverClass = getValue();        }    };    private JarQuestion qServerJar = new JarQuestion((CldcBaseCommInterview)getParent(), this, "serverJar", qServerClass);    private StringQuestion qServerURL = new StringQuestion (this, "serverURL") {        protected Question getNext() {            return qServerParams;        }        public void export (Map data) {            // must protect against null question answer            data.put("serverURL", (value == null ? "" : value));        }    };    private StringQuestion qServerParams = new StringQuestion (this, "serverParams") {        protected Question getNext() {            if (preinstalledClient)                return qClientClass;            else                return qClientJar;        }        protected void export(Map data) {            serverParams = (value == null ? "" : value);        }    };    private StringQuestion qClientClass = new StringQuestion (this, "clientClass") {        protected Question getNext() {            if (value == null || value.length() == 0)                return null;            else                return qClientParams;        }        protected void export(Map data) {            clientClass = value;        }    };    private JarQuestion qClientJar = new JarQuestion((CldcBaseCommInterview)getParent(), this, "clientJar", qClientClass);    private StringQuestion qClientParams = new StringQuestion (this, "clientParams") {        protected void export(Map data) {            clientParams = (value == null ? "" : value);        }        protected Question getNext() {            return qEnd;        }    };    private FinalQuestion qEnd = new FinalQuestion(this);    private String serverClass = null;    private String serverParams = null;    private String clientClass = null;    private String clientParams = null;    private boolean preinstalledClient = false;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?