Package realcix20.classes.basic

Examples of realcix20.classes.basic.Column


                                    //add components to groupPanel
                                    int currentComponentNumber = 1;
                                    Iterator columnIter = getObject().getColumns().iterator();                                   
                                    while (columnIter.hasNext()) {
                                       
                                        Column column = (Column)columnIter.next();
                                        if ( (column.isHeadField()) && (column.getGroupName() == groupName) ) {
                                           
                                          tableLayout.insertRow(currentComponentNumber,TableLayout.PREFERRED);
                                         
                                            //add label
                                            JLabel label = new JLabel(column.toString());                                           
//                                            groupPanel.add(label, cc.xy(3, currentComponentNumber * 2 + 1));
                                            groupPanel.add(label,"1,"+currentComponentNumber+",f,t");
                                                                                       
                                            //add component
                                            ComponentExt componentExt = (ComponentExt)headComponentExtIter.next();
                                            JComponent component = componentExt.getComponent();                                                                                       
                                           
                                            //specify, for edit action, the primarykey Component is not allowed to modify
                                            if (action.equals("Edit")) {
                                                if ( (column.isPrimaryKey()) && (column.getTableName().equals(object.getMainTableName())) ) {
                                                    component.setEnabled(false);
                                                }
                                            }
                                           
//                                            groupPanel.add(component, cc.xy(5, currentComponentNumber * 2 + 1));
                                            groupPanel.add(component,"2,"+currentComponentNumber+",f,f");
                                           
                                            //add alert label
                                            JLabel alertLabel = new JLabel();
                                            componentExt.setAlertLabel(alertLabel);
                                            alertLabel.setForeground(Color.RED);
                                            if (column.isPrimaryKey()) {
                                                alertLabel.setIcon(ImageManager.getImage(ImageManager.HELP_IMAGE));
                                            } else {
                                                alertLabel.setVisible(false);
                                            }                                          
//                                            groupPanel.add(alertLabel, cc.xy(7, currentComponentNumber * 2 + 1));
View Full Code Here


                this.cComponentExt = cComponentExt;
            }
           
            public String toString() {
               
                Column pColumn = pComponentExt.getColumn();
                Column cColumn = cComponentExt.getColumn();
               
                return (pColumn.getTableName() + "." + pColumn.getColumnName() + " -----> " + cColumn.getTableName() + "." + cColumn.getColumnName());
               
            }
View Full Code Here

                e.printStackTrace();
            }
           
            Iterator pkColumnIter = container.getObject().getPkColumns().iterator();
            while (pkColumnIter.hasNext()) {
                Column pkColumn = (Column)pkColumnIter.next();
                if (pkColumn.getTableName().equals(mainTableName)) {
                    Cell childPkOldCell = ObjectUtil.findOldCell(newRow, childTableName, pkColumn.getColumnName());

                    //found
                    if (childPkOldCell != null) {
                        Cell childPkNewCell = ObjectUtil.findNewCell(newRow, childTableName, pkColumn.getColumnName());
                        Cell mainPkNewCell = ObjectUtil.findNewCell(newRow, mainTableName, pkColumn.getColumnName());
                        childPkOldCell.setColumnValue(mainPkNewCell.getColumnValue());
                        childPkNewCell.setColumnValue(mainPkNewCell.getColumnValue());
                    }
                }
            }           
View Full Code Here

               
                Iterator pkColumnIter = container.getObject().getPkColumns().iterator();
                String mainTableName = container.getObject().getMainTableName();
                String childTableName = container.getObject().getChildTableName();
                while (pkColumnIter.hasNext()) {
                    Column pkColumn = (Column)pkColumnIter.next();
                    if (pkColumn.getTableName().equals(mainTableName)) {
                        Cell childPkOldCell = ObjectUtil.findOldCell(selectedRow, childTableName, pkColumn.getColumnName());

                        //found
                        if (childPkOldCell != null) {
                            Cell childPkNewCell = ObjectUtil.findNewCell(selectedRow, childTableName, pkColumn.getColumnName());
                            Cell mainPkNewCell = ObjectUtil.findNewCell(container.getCurrentRow(), mainTableName, pkColumn.getColumnName());
                            childPkOldCell.setColumnValue(mainPkNewCell.getColumnValue());
                            childPkNewCell.setColumnValue(mainPkNewCell.getColumnValue());
                        }
                    }
                }
View Full Code Here

                Row childRow = (Row)childRowIter.next();
                if (childRow != mainRow) {
                    Iterator childRowCellIter = childRow.getNewCells().iterator();                   
                    while (childRowCellIter.hasNext()) {
                        Cell childRowCell = (Cell)childRowCellIter.next();                     
                        Column tColumn = ObjectUtil.findColumn(container.getObject(), childRowCell.getTableName(), childRowCell.getColumnName());
                        if ( (tColumn.isPrimaryKey()) && (tColumn.getTableName().equals(container.getObject().getChildTableName())) ) {
                            Cell mainRowCell = ObjectUtil.findNewCell(mainRow, container.getObject().getMainTableName(), childRowCell.getColumnName());
                            if (mainRowCell != null)
                                childRowCell.setColumnValue(mainRowCell.getColumnValue());
                        }
                        /*if ( (tColumn.getTableName().equals("PA")) && (tColumn.getColumnName().equals("PUBKEY")) )
View Full Code Here

            Row childRow = (Row)rowDatas.get(rowDatas.size() - 1);
            Iterator pkColumnIter = container.getObject().getPkColumns().iterator();
            String mainTableName = container.getObject().getMainTableName();
            String childTableName = container.getObject().getChildTableName();
            while (pkColumnIter.hasNext()) {
                Column pkColumn = (Column)pkColumnIter.next();
                if (pkColumn.getTableName().equals(mainTableName)) {
                    Cell childPkOldCell = ObjectUtil.findOldCell(childRow, childTableName, pkColumn.getColumnName());
                    //found
                    if (childPkOldCell != null) {
                        Cell childPkNewCell = ObjectUtil.findNewCell(childRow, childTableName, pkColumn.getColumnName());
                        Cell mainPkNewCell = ObjectUtil.findNewCell(container.getCurrentRow(), mainTableName, pkColumn.getColumnName());
                        childPkOldCell.setColumnValue(mainPkNewCell.getColumnValue());
                        childPkNewCell.setColumnValue(mainPkNewCell.getColumnValue());
                    }
                }
            }
            childRow.setModify(true);
            childRow.print();
        }
        //set childs' components
        rowDatasIter = dataVector.iterator();
        while (rowDatasIter.hasNext()) {
            Vector rowDatas = (Vector)rowDatasIter.next();
            Row childRow = (Row)rowDatas.get(rowDatas.size() - 1);
            Vector itemComponentExts = container.getItemComponentExts();
            Iterator itemComponentExtIter = itemComponentExts.iterator();
            while (itemComponentExtIter.hasNext()) {
                ComponentExt componentExt = (ComponentExt)itemComponentExtIter.next();
                Column column = componentExt.getColumn();
                JComponent component = ComponentManager.getComponent(componentExt.getColumn());
                componentExt.setComponent(component);
            }
            container.setItemComponentExts(itemComponentExts);
            container.createRelation();
            itemComponentExtIter = itemComponentExts.iterator();
            while (itemComponentExtIter.hasNext()) {
                ComponentExt componentExt = (ComponentExt)itemComponentExtIter.next();
                Column column = componentExt.getColumn();
                container.getRelationManager().init81Or82Or83ComponentAction(componentExt);
                ComponentManager.setValue(getValue(componentExt.getColumn(), childRow), componentExt.getComponent());
            }
            itemComponentExtIter = itemComponentExts.iterator();
            while (itemComponentExtIter.hasNext()) {
                ComponentExt componentExt = (ComponentExt)itemComponentExtIter.next();
                if (componentExt.getComponent() instanceof DetailList) {
//                    System.err.println("dldldl");
                    DetailList dl = (DetailList)componentExt.getComponent();
                    dl.getNotVisibleTableButton().doClick();
                }
            }           
            Iterator componentExtIter = itemComponentExts.iterator();
            while (componentExtIter.hasNext()) {
                ComponentExt componentExt = (ComponentExt)componentExtIter.next();
                JComponent component = componentExt.getComponent();
                Column column = componentExt.getColumn();
                if (column.isMandatory()) {
                    if ( (ComponentManager.getValue(component) == null) || (ComponentManager.getValue(component).toString().trim().equals("")) ) {
                        result = false;
                    }
                }               
            }
View Full Code Here

            boolean result = true;           
            Iterator componentExtIter = itemComponentExts.iterator();
            while (componentExtIter.hasNext()) {               
                ComponentExt componentExt = (ComponentExt)componentExtIter.next();         
                JComponent component = componentExt.getComponent();
                Column column = componentExt.getColumn();
                if (column.getInputType() == 81) {
                    boolean cellResult = false;
                    DetailList detailList = (DetailList)component;
                    Object value = detailList.getValue();                   
                    detailList.getNotVisibleTableButton().doClick();
                    Vector columns = detailList.getColumns();
                    DefaultTableModel model = (DefaultTableModel)detailList.getTable().getModel();
                    Vector dataVector = model.getDataVector();            
                    Vector tDataVector = detailList.tDataVector;
                    Iterator dataVectorsIter = dataVector.iterator();
                    Iterator tDataVectorsIter = tDataVector.iterator();
                    while (dataVectorsIter.hasNext()) {
                        Vector rowDatas = (Vector)dataVectorsIter.next();
                        Vector tRowDatas = (Vector)tDataVectorsIter.next();
                        Object rowValue = rowDatas.get(rowDatas.size() - 1);
                        if (value == null)
                            value = "";
                        if (rowValue == null)
                            rowValue = "";
                        if (value.equals(rowValue)) {                           
                            if (column.getCControls() == null) {
                                cellResult = true;
                                break;
                            } else {       
                                StringTokenizer st = new StringTokenizer(column.getCControls(), "!!");
                                boolean childResult = true;
                                while (st.hasMoreElements()) {
                                    StringTokenizer stt = new StringTokenizer((String)st.nextElement(), ".");
                                    String tableName = (String)stt.nextElement();
                                    String columnName = (String)stt.nextElement();
                                    Object newValue = ObjectUtil.findNewCell(childRow, tableName, columnName).getColumnValue();                          
                                    Column tempColumn = ObjectUtil.findColumn(container.getObject(), tableName, columnName);
                                    if ( (tempColumn.getInputType() != 81) && (tempColumn.getInputType() != 101) ) {
                                        childResult = true;
                                    } else {
                                        if (newValue == null)
                                        newValue = "";
                                        boolean find = false;
View Full Code Here

                   
           
            Iterator componentExtIter = container.getItemComponentExts().iterator();
            while (componentExtIter.hasNext()) {
                ComponentExt componentExt = (ComponentExt)componentExtIter.next();
                Column column = componentExt.getColumn();
                JComponent component = componentExt.getComponent();
                Iterator cellIter = row.getNewCells().iterator();
                while (cellIter.hasNext()) {
                    Cell cell = (Cell)cellIter.next();
                    if ( (cell.getColumnName().equals(column.getColumnName())) && (cell.getTableName().equals(column.getTableName())) ) {
                       
                        if (column.getInputType() == 24) {//lastchanged by
                            Row currentRow = Session.getInstance().getCurrentUser();
                            Iterator tempCellIter = currentRow.getOldCells().iterator();
                            while (tempCellIter.hasNext()) {
                                Cell tempCell = (Cell)tempCellIter.next();
                                if (tempCell.getColumnName().equals("RUSER"))
                                    cell.setColumnValue(tempCell.getColumnValue());
                            }
                        } else if (column.getInputType() == 23) {//lastchanged
                            java.util.Date date = new java.util.Date();
                            Calendar cal = Calendar.getInstance();
                            cal.setTime(date);
                            int year = cal.get(Calendar.YEAR);
                            int month = cal.get(Calendar.MONTH) + 1;
View Full Code Here

       
            Iterator componentExtIter = componentExts.iterator();
            while (componentExtIter.hasNext()) {
               
                    ComponentExt componentExt = (ComponentExt)componentExtIter.next();
                    final Column column = componentExt.getColumn();
                    JComponent component = componentExt.getComponent();
                    if (column.getInputType() == 83) {
                        final XrCalculator xrCalculator = (XrCalculator)component;
                        xrCalculator.setRelationManager(this);
                        final Vector parameters = getParameters(componentExt);
                        final String sql = getSQL(componentExt, parameters);
                        xrCalculator.addActionListener(
                            new ActionAdapter() {
                                public void actionPerformed(ActionEvent e) {                                                           
                                    DAO dao = DAO.getInstance();
                                    dao.query(sql);
                                    for (int i = 0; i < parameters.size(); i++) {
                                   
                                        String parameter = (String)parameters.get(i);
                                        StringTokenizer st = new StringTokenizer(parameter, ".");
                                        String tableName = (String)st.nextElement();
                                        String columnName = (String)st.nextElement();
                                        ComponentExt componentExt = findComponentExt(tableName, columnName);
                                        JComponent component = componentExt.getComponent();
                                        dao.setObject(i+1, ComponentManager.getValue(component));
                                   
                                    }
                                   
                                    ResultSet rs = dao.executeQuery();
                                    try {
                                        ResultSetMetaData rsmd = rs.getMetaData();
                                        Vector columns = new Vector();
                                        for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                                            ComponentExt tempComponentExt = findComponentExt(column.getTableName(), rsmd.getColumnName(i));
                                            boolean isThisObjectColumn = (tempComponentExt != null);
                                            if (isThisObjectColumn)
                                                columns.add(column.getTableName() + "-" + rsmd.getColumnName(i));
                                            else
                                                columns.add(rsmd.getTableName(i) + "-" + rsmd.getColumnName(i));
                                           
                                        }                                                                               
                                        xrCalculator.setColumns(columns);
                                    } catch (Exception ee) {
                                        ee.printStackTrace();
                                    }                                     
                                   
                                }     
                        });
                    } else if ( (column.getInputType() == 81) || (column.getInputType() == 82) ) {                       
                        final DetailList detailList = (DetailList)component;
                        detailList.setRelationManager(this);
                        final Vector parameters = getParameters(componentExt);
                        final String sql = getSQL(componentExt, parameters);
                        detailList.addActionListener(
                            new ActionAdapter() {
                                public void actionPerformed(ActionEvent e) {                                                           
                                    DAO dao = DAO.getInstance();
                                    dao.query(sql);
                                    for (int i = 0; i < parameters.size(); i++) {
                                   
                                        String parameter = (String)parameters.get(i);
                                        StringTokenizer st = new StringTokenizer(parameter, ".");
                                        String tableName = (String)st.nextElement();
                                        String columnName = (String)st.nextElement();
                                        ComponentExt componentExt = findComponentExt(tableName, columnName);
                                        JComponent component = componentExt.getComponent();
                                        dao.setObject(i+1, ComponentManager.getValue(component));
                                   
                                    }
                                   
                                    ResultSet rs = dao.executeQuery();
                                    try {
                                        ResultSetMetaData rsmd = rs.getMetaData();
                                        Vector columns = new Vector();
                                        Vector columnNames = new Vector();
                                        Vector datas = new Vector();
                                        detailList.tDataVector = new Vector();
                                        for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                                            ComponentExt tempComponentExt = findComponentExt(column.getTableName(), rsmd.getColumnName(i));
                                            boolean isThisObjectColumn = (tempComponentExt != null);
                                            if (isThisObjectColumn)
                                                columns.add(column.getTableName() + "-" + rsmd.getColumnName(i));
                                            else
                                                columns.add(rsmd.getTableName(i) + "-" + rsmd.getColumnName(i));

                                            Column tempColumn = null;
                                            if (isThisObjectColumn)
                                                tempColumn = ColumnManager.getColumn(column.getTableName(), rsmd.getColumnName(i));
                                            else
                                                tempColumn = ColumnManager.getColumn(rsmd.getTableName(i), rsmd.getColumnName(i));
                                            if (tempColumn != null) {
                                                String columnName = ObjectUtil.findColumnTxt(tempColumn.getClsId(), tempColumn.getTableName(), tempColumn.getColumnName());
                                                if (columnName != null)
                                                    columnNames.add(columnName);
                                                else {
                                                    columnNames.add("Txt");
                                                }
                                            } else {
                                                columnNames.add("Txt");
                                            }
                                        }                                       
                                        columnNames.add("value");//restore value
                                        detailList.setColumns(columns);
                                        while (rs.next()) {
                                            detailList.tRowDatas = new Vector();
                                            Vector rowDatas = new Vector();
                                            for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                                                Object columnValue = rs.getObject(rsmd.getColumnName(i));
                                                ComponentExt tempComponentExt = findComponentExt(column.getTableName(), rsmd.getColumnName(i));
                                                boolean isThisObjectColumn = (tempComponentExt != null);
                                                Column tempColumn = null;
                                                if (isThisObjectColumn) {
                                                    tempColumn = ColumnManager.getColumn(column.getTableName(), rsmd.getColumnName(i));
                                                } else {
                                                    tempColumn = ColumnManager.getColumn(rsmd.getTableName(i), rsmd.getColumnName(i));
                                                }
                                                if (tempColumn != null) {
                                                    if (tempColumn.isI18N()) {
                                                        String i18nString = I18NManager.getI18NString(tempColumn.getI18nPrefix(), columnValue);
                                                        if (GlobalValueManager.getValue("APPLICATION.ZIC").equals("1")) {
                                                            rowDatas.add(i18nString);
                                                        } else if (GlobalValueManager.getValue("APPLICATION.ZIC").equals("2")) {
                                                            rowDatas.add(columnValue);
                                                        } else if (GlobalValueManager.getValue("APPLICATION.ZIC").equals("3")) {
View Full Code Here

       
        Iterator componentExtIter = componentExts.iterator();
        while (componentExtIter.hasNext()) {
           
            ComponentExt componentExt = (ComponentExt)componentExtIter.next();
            Column column = componentExt.getColumn();
            if ( (column.getCControls() != null) && (!column.getCControls().trim().equals("")) ) {
               
                StringTokenizer st = new StringTokenizer(column.getCControls(), "!!");
                while (st.hasMoreElements()) {
                    StringTokenizer stt = new StringTokenizer((String)st.nextElement(), ".");
                    String tableName = (String)stt.nextElement();
                    String columnName = (String) stt.nextElement();
                    ComponentExt cComponentExt = findComponentExt(tableName, columnName);
View Full Code Here

TOP

Related Classes of realcix20.classes.basic.Column

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.