Package net.caece.pri.hibernate.vo

Examples of net.caece.pri.hibernate.vo.FunForm


        sess = null;

        Combobox activeFlagCb = (Combobox) getFellow("ActiveFlag");
        Iterator activeFlagIt = activeFlagList.iterator();
        while (activeFlagIt.hasNext()) {
            FunForm activeFlag = (FunForm) activeFlagIt.next();
            Comboitem activeFlagItem = new Comboitem();
            activeFlagItem.setValue(activeFlag.getActiveFlag());
            activeFlagItem.setLabel(activeFlag.getActiveFlagString());
            activeFlagItem.setParent(activeFlagCb);
        }

        Combobox bootFlagCb = (Combobox) getFellow("BootFlag");
        Iterator bootFlagIt = bootFlagList.iterator();
        while (bootFlagIt.hasNext()) {
            FunForm bootFlag = (FunForm) bootFlagIt.next();
            Comboitem bootFlagItem = new Comboitem();
            bootFlagItem.setValue(bootFlag.getBootFlag());
            bootFlagItem.setLabel(bootFlag.getBootFlagString());
            bootFlagItem.setParent(bootFlagCb);
        }
    }
View Full Code Here


    private ArrayList getSubList(FunForm form, List data) {
        ArrayList subList = new ArrayList();
        Iterator it = data.iterator();

        while (it.hasNext()) {
            FunForm var = (FunForm) it.next();
            if ((var.getFunId() != form.getFunId())
                    && var.getParentFunId() != null
                    && form.getFunId().toString().equals(var.getParentFunId().toString())) {

                SimpleTreeNode stn = new SimpleTreeNode(var, getSubList(
                        var, data));
                subList.add(stn);
            }
View Full Code Here

                    }
                }
            }

            SimpleTreeNode node = (SimpleTreeNode) treeItem.getValue();
            FunForm funForm = (FunForm) node.getData();

            FunAuth funAuth = new FunAuth();
            funAuth.setFun(funForm);
            funAuth.setAuth(authForm);
            if ("Y".equals(funForm.getBootFlag())) {
                funAuth.setOperations(sb.toString());
            }
            funAuth.setOperateBy(operateBy);
            faDao.create(funAuth);
        }
View Full Code Here

        // create a new list with funForm not in funAuth
        List funObjList = new ArrayList();

        Iterator allFunItr = allFunObjList.iterator();
        while (allFunItr.hasNext()) {
            FunForm form = (FunForm) allFunItr.next();

            Iterator funAuthItr = funAuthObjList.iterator();
            boolean addIn = true;
            while (funAuthItr.hasNext()) {
                FunAuthForm var = (FunAuthForm) funAuthItr.next();
                if (form.getFunId().toString().equals(var.getFunId().toString()) //  && !"0".equals(form.getLayer())
                        ) {
                    addIn = false;
                    break;
                }
            }
View Full Code Here

        return subList;
    }

    private SimpleTreeNode prepareRootNode(List data) {
        FunForm root = new FunForm();
        root.setFunName("");

        ArrayList mother = new ArrayList();

        Iterator it = data.iterator();
        while (it.hasNext()) {
            FunForm form = (FunForm) it.next();
            if (form.getParentFunId().equals(form.getFunId())) {

                ArrayList subList = getSubList(form, data);
                SimpleTreeNode stn = new SimpleTreeNode(form, subList);
                mother.add(stn);
            }
View Full Code Here

        objTree.setTreeitemRenderer(objTreeRenderer);

    }

    private SimpleTreeNode prepareRootNode(List funData) {
        FunForm root = new FunForm();
        root.setFunName("");

        ArrayList mother = new ArrayList();
        Iterator it = funData.iterator();
        while (it.hasNext()) {
            FunForm form = (FunForm) it.next();
            if ("0".equals(form.getLayer().trim())) {

                ArrayList subList = getSubList(form, funData);
                SimpleTreeNode stn = new SimpleTreeNode(form, subList);
                mother.add(stn);
            }
View Full Code Here

    private ArrayList getSubList(FunForm form, List funData) {
        ArrayList subList = new ArrayList();
        Iterator it = funData.iterator();

        while (it.hasNext()) {
            FunForm funForm = (FunForm) it.next();

            if (!funForm.getFunId().equals(form.getFunId())
                    && funForm.getParentFunId().equals(form.getFunId())) {

                SimpleTreeNode stn = new SimpleTreeNode(funForm, getSubList(
                        funForm, funData));
                subList.add(stn);
            }
View Full Code Here

    //ck
    public void select() {
        Tree objTree = (Tree) getFellow("objTree");
        SimpleTreeNode node = (SimpleTreeNode) objTree.getSelectedItem().getValue();
        FunForm form = (FunForm) node.getData();

        objToView(form);
    }
View Full Code Here

        objToView(form);
    }

    //ck
    public void objToView(Object obj) {
        FunForm form = (FunForm) obj;

        Combobox serviceCB = (Combobox) getFellow("service");
        Textbox funNameTB = (Textbox) getFellow("FunName");
        Combobox bootFlagCB = (Combobox) getFellow("BootFlag");
        Combobox activeFlag = (Combobox) getFellow("ActiveFlag");

        Iterator ServiceCBIt = serviceCB.getItems().iterator();
        while (ServiceCBIt.hasNext()) {
            Comboitem item = (Comboitem) ServiceCBIt.next();
            if (((Service) item.getValue()).getServiceId().toString().equals(form.getServiceId().toString())) {
                serviceCB.setSelectedItem(item);
                form.setService((Service) item.getValue());
            }
        }

        funNameTB.setText(form.getFunName());
        Iterator bootFlagIt = bootFlagCB.getItems().iterator();
        while (bootFlagIt.hasNext()) {
            Comboitem item = (Comboitem) bootFlagIt.next();
            if (item.getValue().toString().equals(form.getBootFlag())) {
                bootFlagCB.setSelectedItem(item);
            }
        }
        Iterator activeFlagIt = activeFlag.getItems().iterator();
        while (activeFlagIt.hasNext()) {
            Comboitem item = (Comboitem) activeFlagIt.next();
            if (item.getValue().toString().equals(form.getActiveFlag())) {
                activeFlag.setSelectedItem(item);
            }
        }

        Textbox funPathTB = (Textbox) getFellow("FunPathTB");
        funPathTB.setText("");




        if ("Y".equals(form.getBootFlag())) {
            // if bootFlag is Yes, set the fun path
            funPathTB.setText(form.getFunPath());

            // if bootFlag is Yes, set the fun operations
            List operationsLists = ParaCache.getInstance().getByCatalogue("pri.Fun.operations");
            Iterator it = operationsLists.iterator();
            while (it.hasNext()) {
                Para para = (Para) it.next();
                Checkbox cb = (Checkbox) getFellow("checkbox_" + para.getParaName());
                cb.setChecked(false);

                StringTokenizer operList = new StringTokenizer(form.getOperations(), ":");
                boolean checked = false;
                while (operList.hasMoreTokens()) {
                    String token = operList.nextToken();
                    if (cb.getValue().equals(token)) {
                        checked = true;
View Full Code Here

    }

    //ck
    public void update() {
        FunForm var = null;
        Fun parentFun = null;

        objTree = (Tree) getFellow("objTree");
        if (objTree.getSelectedItem() != null) {
            SimpleTreeNode node = (SimpleTreeNode) objTree.getSelectedItem().getValue();
            var = (FunForm) node.getData();

            Treeitem parentItem = objTree.getSelectedItem().getParentItem();

            FunForm parentFunForm = null;
            if (parentItem != null) {
                SimpleTreeNode parentNode = (SimpleTreeNode) parentItem.getValue();
                parentFunForm = (FunForm) parentNode.getData();
            } else {
                parentFunForm = (FunForm) node.getData();
View Full Code Here

TOP

Related Classes of net.caece.pri.hibernate.vo.FunForm

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.