Package realcix20.guis.utils

Examples of realcix20.guis.utils.ComponentExt


       
    }
   
    public ComponentExt findComponentExt(String tableName, String columnName) {
       
            ComponentExt componentExt = null;
       
            Iterator componentExtIter = componentExts.iterator();
            while (componentExtIter.hasNext()) {
                ComponentExt tempComponentExt = (ComponentExt)componentExtIter.next();
                Column tempColumn = tempComponentExt.getColumn();
                if ( (tempColumn.getTableName().equals(tableName)) && (tempColumn.getColumnName().equals(columnName)) ) {
                    componentExt = tempComponentExt;
                    break;
                }
            }
View Full Code Here


       
    }
   
    private ComponentExt findComponentExt(JComponent component) {
       
            ComponentExt componentExt = null;
           
            Iterator componentExtIter = componentExts.iterator();
            while (componentExtIter.hasNext()) {
                ComponentExt tempComponentExt = (ComponentExt)componentExtIter.next();
                JComponent tempComponent = tempComponentExt.getComponent();
                if (component == tempComponent) {
                    componentExt = tempComponentExt;
                    break;
                }
            }
View Full Code Here

        private void setCChildComponentsFormat() {
           
                Vector childComponentExts = relationManager.getChildComponentExts(column);
                Iterator childComponentExtIter = childComponentExts.iterator();
                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();
                        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() + "###");
                        int fraction = Integer.parseInt(GlobalValueManager.getValue("APPLIATION.DEFFRACTION"));
                        if (pValue != null)
                            fraction = up.getFraction(pValue.toString());
                        if (fraction > 0) {
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();
                    if ( (childColumn.getInputType() != 81) && (childColumn.getInputType() != 82) ) {
                        JComponent component = childComponentExt.getComponent();
                        boolean findComponent = false;
                        for (int i = 0; i < columns.size(); i++) {
                            String columnId = (String)columns.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())) ) {
                                ComponentManager.setValue(value, component);
                                findComponent = true;
                                break;
                            }
                        }
                        if (!findComponent) {
                            Vector parameters = relationManager.getParameters(childComponentExt);
                            if (parameters != null) {
                                String sql = relationManager.getSQL(childComponentExt, parameters);
//                                System.err.println("SQLSQL = " + sql);
                                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 {              
//                                    System.err.println("rsrs = " + rs.getStatement());
                                    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) {
                                                    JLabel alertLabel = tempComponentExt.getAlertLabel();
                                                    alertLabel.setIcon(ImageManager.getImage(ImageManager.INFORMATION_IMAGE));
                                                    alertLabel.setText(TxtManager.getTxt("VALIDATE.ASSIGNVALUEFAIL"));
                                                    alertLabel.setVisible(true);
                                                } else {
                                                    JLabel alertLabel = tempComponentExt.getAlertLabel();
                                                    alertLabel.setVisible(false);
                                                    ComponentManager.setValue(rs.getObject(i), tempComponentExt.getComponent());
                                                }
                                            }
                                        }                                       
                                    } else {
                                        JLabel alertLabel = childComponentExt.getAlertLabel();
View Full Code Here

                        try {

                            ResultSetMetaData rsmd = rs.getMetaData();
                            if (rsmd.getColumnCount() == 1) {
                                while (rs.next()) {
                                    Item item = new Item(rs.getObject(1), rs.getObject(1));
                                    ((JComboBox)component).addItem(item);
                                }
                            } else {
                                while (rs.next()) {
                                   
                                    StringBuffer sb = new StringBuffer();
                                    for (int i = 2; i < rsmd.getColumnCount(); i++)
                                        sb.append(rs.getObject(i) + " | ");
                                    sb.append(rs.getObject(rsmd.getColumnCount()));
                                   
                                    Item item = new Item(rs.getObject(1), sb.toString());
                                    ((JComboBox)component).addItem(item);
                                }
                            }
                            rs.close();
View Full Code Here

        try {

            ResultSetMetaData rsmd = rs.getMetaData();
            if (rsmd.getColumnCount() == 1) {
                while (rs.next()) {
                    Item item = new Item(rs.getObject(1), rs.getObject(1));
                    ((JComboBox)childComponent).addItem(item);
                }
            } else {
                while (rs.next()) {

                    StringBuffer sb = new StringBuffer();
                    for (int i = 2; i < rsmd.getColumnCount(); i++)
                        sb.append(rs.getObject(i) + " | ");
                    sb.append(rs.getObject(rsmd.getColumnCount()));

                    Item item = new Item(rs.getObject(1), sb.toString());
                    ((JComboBox)childComponent).addItem(item);
                }
            }
            rs.close();

        }
        catch (SQLException sqle) {

        }
       
        Iterator componentIter = components.iterator();
        while (componentIter.hasNext()) {
            JComponent component = (JComponent)componentIter.next();
            ((JComboBox)component).addActionListener(
                new ActionAdapter() {
           
                    public void actionPerformed(ActionEvent e) {
                       
                        ((JComboBox)childComponent).removeAllItems();
                       
                        DAO dao = DAO.getInstance();
                        dao.query(sql);
                        for (int i = 1; i <= components.size(); i++) {
                            JComponent tempComponent = (JComponent)components.get(i - 1);
                            dao.setObject(i, ComponentManager.getValue(tempComponent));
                        }
                        ResultSet rs = dao.executeQuery();
                        try {

                            ResultSetMetaData rsmd = rs.getMetaData();
                            if (rsmd.getColumnCount() == 1) {
                                while (rs.next()) {
                                    Item item = new Item(rs.getObject(1), rs.getObject(1));
                                    ((JComboBox)childComponent).addItem(item);
                                }
                            } else {
                                while (rs.next()) {
                                   
                                    StringBuffer sb = new StringBuffer();
                                    for (int i = 2; i < rsmd.getColumnCount(); i++)
                                        sb.append(rs.getObject(i) + " | ");
                                    sb.append(rs.getObject(rsmd.getColumnCount()));
                                   
                                    Item item = new Item(rs.getObject(1), sb.toString());
                                    ((JComboBox)childComponent).addItem(item);
                                }
                            }
                            rs.close();
View Full Code Here

                StringBuffer factValueBuffer = new StringBuffer();
                for (int i = 1; i< rsmd.getColumnCount(); i++) {
                    factValueBuffer.append(rs.getObject(i) + "-");
                }
                factValueBuffer.append(rs.getObject(rsmd.getColumnCount()));
                Item item = new Item(factValueBuffer.toString(), displayValue);
                ((JComboBox)component).addItem(item);
            }
           
            rs.close();
View Full Code Here

        }
        //Users GUI Theme       
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {                       
                if (GlobalValueManager.getValue("firsttime").equals("TRUE")) {                   
                    new LicenseView();
                } else {
                    Resources.LANGUAGE = GlobalValueManager.getApplicationLang();
                    new LoginFrame();
                }
            }
View Full Code Here

            public void run() {                       
                if (GlobalValueManager.getValue("firsttime").equals("TRUE")) {                   
                    new LicenseView();
                } else {
                    Resources.LANGUAGE = GlobalValueManager.getApplicationLang();
                    new LoginFrame();
                }
            }
        });      
    }   
View Full Code Here

       
        try {
            KeyPairGenerator keyGen = KeyPairGenerator.getInstance(KEY_GENERATE_ALGORITHM);
            keyGen.initialize(1024);
            KeyPair key = keyGen.generateKeyPair();
            DAO dao = DAO.getInstance();
            dao.update(Resources.GENERATE_KEY_SQL);
            dao.setObject(1, (Object)key.getPublic());
            dao.setObject(2, (Object)key.getPrivate());
            dao.executeUpdate();
        } catch (Exception e) {
            e.printStackTrace();
        }              
       
    }
View Full Code Here

TOP

Related Classes of realcix20.guis.utils.ComponentExt

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.