Package realcix20.classes.basic

Examples of realcix20.classes.basic.Column


                  
    }
       
    private Column findColumn(BaseClass object, String tableName, String columnName) {
       
            Column rColumn = null;
       
            Iterator columnIter = object.getColumns().iterator();
            while (columnIter.hasNext()) {
                Column column = (Column)columnIter.next();
                if ( (column.getTableName().equals(tableName)) && (column.getColumnName().equals(columnName)) ) {
                    rColumn = column;
                    break;
                }
            }
           
View Full Code Here


        Iterator childComponentExtIter = childComponentExts.iterator();
        if (columns != null) {
//            System.err.println("format here");
            while (childComponentExtIter.hasNext()) {
                ComponentExt childComponentExt = (ComponentExt)childComponentExtIter.next();
                Column childColumn = childComponentExt.getColumn();
                if (childColumn.getInputType() == 11) {
                    Column column = childComponentExt.getColumn();
                    StringTokenizer st = new StringTokenizer(column.getPControls(), ".");
                    String tableName = (String)st.nextElement();
                    String columnName = (String) st.nextElement();
                    ComponentExt pComponentExt = relationManager.findComponentExt(tableName, columnName);
                    Object pValue = ComponentManager.getValue(pComponentExt.getComponent());
                    JComponent component = childComponentExt.getComponent();
                    CurrencyPlugin cp = CurrencyPlugin.getInstance();
                    StringBuffer sb = new StringBuffer("###" + cp.getSepor() + "###");
                    int fraction = Integer.parseInt(GlobalValueManager.getValue("APPLIATION.DEFFRACTION"));
                    if (pValue != null)
                        fraction = cp.getFraction(pValue.toString());
                    if (fraction > 0) {
                        sb.append(cp.getFpoint());
                    }
                    for (int i = 1; i <= fraction; i++) {
                        sb.append("0");
                    }
                    DecimalFormat df = new DecimalFormat(sb.toString());
                    NumberFormatter nf = new NumberFormatter(df);
                    DefaultFormatterFactory factory = new DefaultFormatterFactory(nf);
                    ((JFormattedTextField)component).setFormatterFactory(factory);
                } else if (childColumn.getInputType() == 12) {
                    JComponent component = childComponentExt.getComponent();
                    CurrencyPlugin cp = CurrencyPlugin.getInstance();
                    UomPlugin up = UomPlugin.getInstance();
                    if (column.getPControls() != null) {
                        StringTokenizer st = new StringTokenizer(column.getPControls(), ".");
                        String tableName = (String)st.nextElement();
                        String columnName = (String)st.nextElement();
                        ComponentExt pComponentExt = relationManager.findComponentExt(tableName, columnName);
                        Object pValue = ComponentManager.getValue(pComponentExt.getComponent());
                        StringBuffer sb = new StringBuffer("###" + cp.getSepor() + "###");
View Full Code Here

    private void setCChildComponentsValue() {           
        Vector childComponentExts = relationManager.getChildComponentExts(column);
        Iterator childComponentExtIter = childComponentExts.iterator();
        while (childComponentExtIter.hasNext()) {
            ComponentExt childComponentExt = (ComponentExt)childComponentExtIter.next();
            Column childColumn = childComponentExt.getColumn();                   
            JComponent component = childComponentExt.getComponent();
            boolean findComponent = false;
            if (columns != null) {
                for (int i = 0; i < getColumns().size(); i++) {
                    String columnId = (String)getColumns().get(i);
                    StringTokenizer st = new StringTokenizer(columnId, "-");
                    String tableName = (String)st.nextElement();
                    String columnName = (String)st.nextElement();
                    if ( (tableName.equals(childColumn.getTableName())) && (columnName.equals(childColumn.getColumnName())) ) {
                        int selectedRowNumber = getTable().convertRowIndexToModel(getTable().getSelectedRow());
                        ListTableModel model = (ListTableModel)getTable().getModel();
                        Vector dataVector = model.getDataVector();
                        Vector rowDatas = (Vector)dataVector.get(selectedRowNumber);
                        Object childValue = rowDatas.get(i);
                        if (childColumn.isI18N()) {
                            childValue = ((Vector)this.tDataVector.get(selectedRowNumber)).get(i);
                            //System.err.println("childValue = " + childValue);
                            ComponentManager.setValue(childValue, component);
                        } else {
                            ComponentManager.setValue(childValue, component);
View Full Code Here

//            ResultSet rs = stmt.executeQuery(select_sql);
//           createScrollEnabledResultSet()
            ResultSetMetaData rsmd = rs.getMetaData();      
            if (stat.equals("object")) {
                for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                    Column column = ObjectUtil.findColumn(object, rsmd.getTableName(i), rsmd.getColumnName(i));
                    if ( (column.isIndexField()) ||
                            ( (column.isPrimaryKey()) && (column.getTableName().equals(object.getMainTableName())) ) ) {
                        getTables().add(rsmd.getTableName(i));
                        getColumns().add(rsmd.getColumnName(i));
                    }
                }
            } else if (stat.equals("report")) {
View Full Code Here

    public String getColumnName(int columnIndex) {
        if (columnIndex == 0 )
            return "";
        else {
            if (stat.equals("object")) {
                Column column = ObjectUtil.findColumn(object, (String)getTables().get(columnIndex-1), (String)getColumns().get(columnIndex-1));
                return column.toString();
            } else if (stat.equals("report")) {
                if ( (tables.get(columnIndex - 1) != null) && (((String)tables.get(columnIndex - 1)).trim().length() > 0) ) {
                    Column column = ObjectUtil.findColumn(object, (String)getTables().get(columnIndex-1), (String)getColumns().get(columnIndex-1));
                    return column.toString();
                } else {
                    String name = getTables().get(columnIndex - 1) + "." + getColumns().get(columnIndex - 1);
                    return name;
                }
            } else {
View Full Code Here

                      obj = rowIndex+1;
                      return obj;
                  }
                  else {
                      obj = getRs().getObject((String)getColumns().get(columnIndex-1));
                      Column column = getColumn(columnIndex);
                      if (column != null) {
                          if (column.isI18N()) {
                              String i18nString = I18NManager.getI18NString(column.getI18nPrefix(), obj);
                              if (GlobalValueManager.getI18nStringDisplayStat().equals("key")) {
                                  Item item = new Item(obj, realcix20.guis.utils.Formatter.formatObject(obj, column));
                                  return item;
                              } else if (GlobalValueManager.getI18nStringDisplayStat().equals("text")) {
                                  Item item = new Item(obj, i18nString);
View Full Code Here

                itemGroups = new Vector();
                this.itemComponentExts = container.getItemComponentExts();
                Iterator itemComponentExtIter = getItemComponentExts().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 = getItemComponentExts().iterator();
                while (itemComponentExtIter.hasNext()) {
                    ComponentExt componentExt = (ComponentExt)itemComponentExtIter.next();
                    Column column = componentExt.getColumn();
                    container.getRelationManager().init81Or82Or83ComponentAction(componentExt);
                    if (action.equals("Edit")) {
                      //if correspendence, init the default value
if(object.getClsId()==520){
    RelationManager relationManager = container.getRelationManager();
    Vector parameters = relationManager.getParameters_Defvalue(componentExt);
    if (parameters != null) {
        String sql = relationManager.getSQL_Defvalue(componentExt, parameters);
        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 tempComponentExt = relationManager.findComponentExt(tableName, columnName);
            JComponent tempComponent = tempComponentExt.getComponent();                                   
            dao.setObject(i+1, ComponentManager.getValue(tempComponent));
        }
        ResultSet rs = dao.executeQuery();
        try {
            if (rs.next()) {
                ResultSetMetaData rsmd = rs.getMetaData();
                for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                    ComponentExt tempComponentExt = relationManager.findComponentExt(column.getTableName(), rsmd.getColumnName(i));
                    boolean isThisObjectColumn = (tempComponentExt != null);
                    if (isThisObjectColumn) {
                        if (rs.getObject(i) != null) {
                            ComponentManager.setValue(rs.getObject(i), tempComponentExt.getComponent());
                        }
                    }
                }
            }
            rs.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    } 
}
                        ComponentManager.setValue(getValue(componentExt.getColumn(), selectedRow), componentExt.getComponent());                       
                    } else if (action.equals("Add")) {                       
                        RelationManager relationManager = container.getRelationManager();
                        Vector parameters = relationManager.getParameters_Defvalue(componentExt);
                        if (parameters != null) {
                            String sql = relationManager.getSQL_Defvalue(componentExt, parameters);
                            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 tempComponentExt = relationManager.findComponentExt(tableName, columnName);
                                JComponent tempComponent = tempComponentExt.getComponent();                                   
                                dao.setObject(i+1, ComponentManager.getValue(tempComponent));
                            }
                            ResultSet rs = dao.executeQuery();
                            try {
                                if (rs.next()) {
                                    ResultSetMetaData rsmd = rs.getMetaData();
                                    for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                                        ComponentExt tempComponentExt = relationManager.findComponentExt(column.getTableName(), rsmd.getColumnName(i));
                                        boolean isThisObjectColumn = (tempComponentExt != null);
                                        if (isThisObjectColumn) {
                                            if (rs.getObject(i) != null) {
                                                ComponentManager.setValue(rs.getObject(i), tempComponentExt.getComponent());
                                            }
View Full Code Here

                                    //add components to groupPanel
                                    int currentComponentNumber = 1;
                                    Iterator columnIter = getObject().getColumns().iterator();
                                    while (columnIter.hasNext()) {
                                       
                                        Column column = (Column)columnIter.next();
                                        if ( (column.isItemField()) && (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)itemComponentExtIter.next();
                                            JComponent component = componentExt.getComponent();
//                                            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);
                                            if (column.isPrimaryKey()) {
                                                alertLabel.setIcon(ImageManager.getImage(ImageManager.HELP_IMAGE));                                              
                                            } else {
                                                alertLabel.setVisible(false);
                                            }
                                           
View Full Code Here

                        this.object = ClassManager.createClass(260);                       
                        names = new Vector();
                        dataValues = new Vector();
                        Iterator columnIter = object.getColumns().iterator();
                        while (columnIter.hasNext()) {
                            Column column = (Column)columnIter.next();
                            if (column.isIndexField())
                                names.add(column);
                        }
                        names.add("row");
                        Iterator rowIter = object.getRows().iterator();
                        while (rowIter.hasNext()) {
                            Row row = (Row)rowIter.next();
                            String ns = ObjectUtil.findOldCell(row, "PB", "NS").getColumnValue().toString();
                            if (ns.equals("ME")) {
                                Vector rowDatas = new Vector();
                                columnIter = object.getColumns().iterator();
                                while (columnIter.hasNext()) {
                                    Column column = (Column)columnIter.next();
                                    if (column.isIndexField()) {                       
                                        Cell newCell = ObjectUtil.findNewCell(row, column.getTableName(), column.getColumnName());
                                        if (column.isI18N()) {
                                            String i18nString = null;
                                            if (newCell.getColumnValue() != null)
                                                i18nString = I18NManager.getI18NString(column.getI18nPrefix(), newCell.getColumnValue());
                                            if (i18nString != null)
                                                rowDatas.add(newCell.getColumnValue() + "(" + i18nString + ")");
                                            else
                                                rowDatas.add(newCell.getColumnValue());
                                        } else {
View Full Code Here

                        this.object = ClassManager.createClass(280);                       
                        names = new Vector();
                        dataValues = new Vector();
                        Iterator columnIter = object.getColumns().iterator();
                        while (columnIter.hasNext()) {
                            Column column = (Column)columnIter.next();
                            if (column.isIndexField())
                                names.add(column);
                        }
                        names.add("row");
                        Iterator rowIter = object.getRows().iterator();
                        while (rowIter.hasNext()) {
                            Row row = (Row)rowIter.next();
                            String ns = ObjectUtil.findOldCell(row, "ADDR", "NS").getColumnValue().toString();
                            if (ns.equals("ME")) {
                                Vector rowDatas = new Vector();
                                columnIter = object.getColumns().iterator();
                                while (columnIter.hasNext()) {
                                    Column column = (Column)columnIter.next();
                                    if (column.isIndexField()) {                       
                                        Cell newCell = ObjectUtil.findNewCell(row, column.getTableName(), column.getColumnName());
                                        if (column.isI18N()) {
                                            String i18nString = null;
                                            if (newCell.getColumnValue() != null)
                                                i18nString = I18NManager.getI18NString(column.getI18nPrefix(), newCell.getColumnValue());
                                            if (i18nString != null)
                                                rowDatas.add(newCell.getColumnValue() + "(" + i18nString + ")");
                                            else
                                                rowDatas.add(newCell.getColumnValue());
                                        } else {
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.