Package smilehouse.gui.html.fieldbased.editor

Examples of smilehouse.gui.html.fieldbased.editor.PasswordEditor


              if (valueStr != null && valueStr.length() > 0)
                ((JDBCSource) model).setPassword(valueStr);
            }
          };

          PasswordEditor editor = new PasswordEditor();
          editor.setSize(10);

          FieldInfo fieldInfo = new FieldInfo(PASSWORD_ATTR, PASSWORD_ATTR, modifier, editor);
          addField(PASSWORD_ATTR, fieldInfo);
        }
        {
          ModelModifier modifier = new DefaultModelModifier() {
            public Object getModelValue(Object model) throws FailTransferException, AbortTransferException {
              String value = ((JDBCSource) model).getCharset();
              return value != null ? value : DEFAULT_CHARSET;
            }

            public void setModelValue(Object model, Object value) throws FailTransferException, AbortTransferException {
              ((JDBCSource) model).setCharset((String) value);
            }
          };

          SelectEditor editor = new SelectEditor();
          for (int i = 0; i < CHARSETS.length; i++)
            editor.addOption(new DefaultSelectOption(CHARSETS[i], CHARSETS[i]));

          FieldInfo fieldInfo = new FieldInfo(CHARSET_ATTR, CHARSET_ATTR, modifier, editor);
          addField(CHARSET_ATTR, fieldInfo);
        }
        {
View Full Code Here


                        public void setModelValue(Object model, Object value) throws Exception {
                            ((WorkspaceHQLSource) model).setPassword((String) value);
                        }
                    };

                    PasswordEditor editor = new PasswordEditor();
                    editor.setSize(30);

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        PASSWORD_ATTR,
                        PASSWORD_ATTR,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(PASSWORD_ATTR, fieldInfo);
                }
               
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((WorkspaceHQLSource) model).getHQLQuery();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((WorkspaceHQLSource) model).setHQLQuery((String) value);
                        }
                    };

                    TextEditor editor = new TextEditor();
                    editor.setSize(100);

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        HQL_SELECT_QUERY_ATTR,
                      HQL_SELECT_QUERY_ATTR,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(HQL_SELECT_QUERY_ATTR, fieldInfo);
                }

                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((WorkspaceHQLSource) model).getSessionTimeout();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((WorkspaceHQLSource) model).setSessionTimeout((String) value);
                        }
                    };

                    TextEditor editor = new TextEditor();
                    editor.setSize(30);

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        SESSION_TIMEOUT_ATTR,
                        SESSION_TIMEOUT_ATTR,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    //context.addFieldInfo(fieldInfo);
                    addField(SESSION_TIMEOUT_ATTR, fieldInfo);
                }

                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((WorkspaceHQLSource) model).getResultsPerIteration();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((WorkspaceHQLSource) model).setResultsPerIteration((String) value);
                        }
                    };

                    TextEditor editor = new TextEditor();
                    editor.setSize(30);

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        RESULTS_PER_ITERATION_ATTR,
                        RESULTS_PER_ITERATION_ATTR,
View Full Code Here

                            if(valueStr != null && valueStr.length() > 0)
                                ((HTTPDestination) model).data.setAttribute(PASSWORD_ATTR, valueStr);
                        }
                    };

                    PasswordEditor editor = new PasswordEditor();
                    editor.setSize(10);

                    FieldInfo fieldInfo = new FieldInfo(
                        PASSWORD_ATTR,
                        PASSWORD_ATTR,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(PASSWORD_ATTR, fieldInfo);
                }
                {
                    String id = "param";
                      String label = "param";
                     ModelModifier modifier = new DefaultModelModifier() {

                           public Object getModelValue(Object model) throws Exception {
                               return ((HTTPDestination) model).getParameters();
                           }

                           public void setModelValue(Object model, Object value) throws Exception {
                               ((HTTPDestination) model).setParameters((String) value);
                           }

                       };

                       TextAreaEditor editor = new TextAreaEditor();
                       editor.setCols(70);
                       editor.setRows(20);
                       FieldInfo fieldInfo = new FieldInfo(id, label, modifier, editor);

                       //add the configuration to the context for usage in the http-requests.
                       addField(id, fieldInfo);

                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws FailTransferException, AbortTransferException {
                            return new Integer(((HTTPDestination) model).getRequestMethod());
                        }

                        public void setModelValue(Object model, Object value) throws FailTransferException, AbortTransferException {
                            ((HTTPDestination) model).setRequestMethod(((Integer) value).intValue());
                        }
                    };                   

                    SelectEditor editor = new SelectEditor();
                    for(int i = 0; i < REQUEST_METHOD_LABELS.length; i++)
                        editor.addOption(new DefaultSelectOption(
                            new Integer(i),
                            REQUEST_METHOD_LABELS[i]));                   

                    editor.setFormatter(new IntegerFormatter());
                   
                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        REQUEST_METHOD_ATTR,
                        REQUEST_METHOD_ATTR,
                        modifier,
                        editor);                   

                    //add the configuration to the context for usage in the http-requests.
                    addField(REQUEST_METHOD_ATTR, fieldInfo);                   
                }
               
                {
                  ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws FailTransferException, AbortTransferException {
                            return new Integer(((HTTPDestination) model).getRequestProtocol());
                        }

                        public void setModelValue(Object model, Object value) throws FailTransferException, AbortTransferException {
                            ((HTTPDestination) model).setRequestProtocol(((Integer) value).intValue());
                        }
                    };
                   
                    SelectEditor editor = new SelectEditor();
                    for(int i = 0; i < REQUEST_PROTOCOL_LABELS.length; i++)
                        editor.addOption(new DefaultSelectOption(
                            new Integer(i),
                            REQUEST_PROTOCOL_LABELS[i]));
                   
                    editor.setFormatter(new IntegerFormatter());
                   
                    FieldInfo fieldInfo = new FieldInfo(
                            REQUEST_PROTOCOL_ATTR,
                            REQUEST_PROTOCOL_ATTR,
                            modifier,
                            editor);
                   
                    addField(REQUEST_PROTOCOL_ATTR, fieldInfo);
                }
               
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((HTTPDestination) model).getAcceptSelfSignedCertificates();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((HTTPDestination) model).setAcceptSelfSignedCertificates((Boolean) value);
                        }
                    };

                    BooleanEditor editor = new BooleanEditor();

                    FieldInfo fieldInfo = new FieldInfo(ACCEPTSELFSIGNEDCERTIFICATES_ATTR,
                        ACCEPTSELFSIGNEDCERTIFICATES_ATTR, modifier, editor);

                    addField(ACCEPTSELFSIGNEDCERTIFICATES_ATTR, fieldInfo);
                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((HTTPDestination) model).getLogEnabled();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((HTTPDestination) model).setLogEnabled((Boolean)value);
                        }
                    };

                    BooleanEditor editor = new BooleanEditor();

                    FieldInfo fieldInfo = new FieldInfo(LOG_ATTR,
                        LOG_ATTR, modifier, editor);

                    addField(LOG_ATTR, fieldInfo);
                }
               
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((HTTPDestination) model).getResponseCodeCheckDisabled();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((HTTPDestination) model).setResponseCodeCheckDisabled((Boolean)value);
                        }
                    };

                    BooleanEditor editor = new BooleanEditor();

                    FieldInfo fieldInfo = new FieldInfo(DISABLE_RESPONSE_CODE_CHECK_ATTR,
                            DISABLE_RESPONSE_CODE_CHECK_ATTR, modifier, editor);

                    addField(DISABLE_RESPONSE_CODE_CHECK_ATTR, fieldInfo);
                }

               
               
                addSimpleTextFieldForComponent(PATH_ATTR, PATH_ATTR, 40);
                addSimpleTextFieldForComponent(NAME_ATTR, NAME_ATTR, 20);
                addSimpleTextFieldForComponent(SOAPACTION_ATTR,SOAPACTION_ATTR, 40);
                addSimpleTextFieldForComponent(CONTENT_TYPE_ATTR,CONTENT_TYPE_ATTR, 40);
               
               
                {
                    //set unique id and description labelkey
                    String id = CHARSET_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws FailTransferException,
                                AbortTransferException {
                            String value = ((HTTPDestination) model).getData().getAttribute(
                                CHARSET_ATTR);
                            return value != null ? value : DEFAULT_CHARSET;
                        }

                        public void setModelValue(Object model, Object value)
                                throws FailTransferException, AbortTransferException {
                            ((HTTPDestination) model).getData().setAttribute(
                                CHARSET_ATTR,
                                (String) value);
                        }
                    };

                    SelectEditor editor = new SelectEditor();
                    for(int i = 0; i < CHARSETS.length; i++)
                        editor.addOption(new DefaultSelectOption(CHARSETS[i], CHARSETS[i]));

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(id, id, modifier, editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(id, fieldInfo);
                }
               
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((HTTPDestination) model).getChosenResponseCharset();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((HTTPDestination) model).setChosenResponseCharset((Boolean)value);
                        }
                    };

                    BooleanEditor editor = new BooleanEditor();

                    FieldInfo fieldInfo = new FieldInfo(CHOOSE_RESPONSE_CHARSET_ATTR,
                        CHOOSE_RESPONSE_CHARSET_ATTR, modifier, editor);

                    addField(CHOOSE_RESPONSE_CHARSET_ATTR, fieldInfo);
                }
               
                {
                    //set unique id and description labelkey
                    String id = RESPONSE_CHARSET_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws FailTransferException,
                                AbortTransferException {
                            String value = ((HTTPDestination) model).getData().getAttribute(
                                RESPONSE_CHARSET_ATTR);
                            return value != null ? value : DEFAULT_CHARSET;
                        }

                        public void setModelValue(Object model, Object value)
                                throws FailTransferException, AbortTransferException {
                            ((HTTPDestination) model).getData().setAttribute(
                                RESPONSE_CHARSET_ATTR,
                                (String) value);
                        }
                    };

                    SelectEditor editor = new SelectEditor();
                    for(int i = 0; i < CHARSETS.length; i++)
                        editor.addOption(new DefaultSelectOption(CHARSETS[i], CHARSETS[i]));

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(id, id, modifier, editor);

                    //add the configuration to the context for usage in the http-requests.
View Full Code Here

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((RemoteOrderSource) model).setPassword((String) value);
                        }
                    };

                    PasswordEditor editor = new PasswordEditor();
                    editor.setSize(30);

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        PASSWORD_ATTR,
                        PASSWORD_ATTR,
View Full Code Here

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((RemoteCustomerSource) model).setPassword((String) value);
                        }
                    };

                    PasswordEditor editor = new PasswordEditor();
                    editor.setSize(30);

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        PASSWORD_ATTR,
                        PASSWORD_ATTR,
View Full Code Here

                            if(valueStr != null && valueStr.length() > 0)
                                ((DestinationIF) model).getData().setAttribute(PASSWORD_ATTR, valueStr);
                        }
                    };

                    PasswordEditor editor = new PasswordEditor();
                    editor.setSize(10);

                    FieldInfo fieldInfo = new FieldInfo(
                        PASSWORD_ATTR,
                        PASSWORD_ATTR,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(PASSWORD_ATTR, fieldInfo);
                }
                // Import type
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            Integer value = ((DestinationIF) model)
                                .getData().getIntegerAttribute(IMPORT_MODE_ATTR);
                            return value != null ? value : new Integer(0);
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            int intValue = value != null ? ((Integer) value).intValue() : 0;
                            ((DestinationIF) model).getData().setAttribute(IMPORT_MODE_ATTR, intValue);
                        }
                    };

                    SelectEditor editor = new SelectEditor();

                    for(Iterator i = IMPORT_MODES.keySet().iterator(); i.hasNext();) {
                        Integer optionNumber = (Integer) i.next();
                        String optionName = (String) IMPORT_MODES.get(optionNumber);
                        editor.addOption(new DefaultSelectOption(optionNumber, optionName));
                       
                    }
                   
                    editor.setFormatter(new IntegerFormatter());

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        IMPORT_MODE_ATTR,
                        IMPORT_MODE_ATTR,
View Full Code Here

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((Pipe) model).setStartPassword((String) value);
                    }
                };
                PasswordEditor editor = new PasswordEditor();
                editor.setSize(20);
                editor.setFormatter(new NullHidingFormatter());
                generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
            }
/*
            {
                // ----------------------
                // Enable RPC start field
                // ----------------------
                String id = ENABLE_RPC_START;
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return new Boolean(((Pipe) model).isRpcStartEnabled());
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((Pipe) model).setRpcStartEnabled(((Boolean) value).booleanValue());
                    }
                };
                BooleanEditor editor = new BooleanEditor();
                generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
            }
*/
            {
                // ----------------------
                // Enable HTTP start field
                // ----------------------
                String id = ENABLE_HTTP_START;
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return new Boolean(((Pipe) model).isHttpStartEnabled());
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((Pipe) model).setHttpStartEnabled(((Boolean) value).booleanValue());
                    }
                };
                BooleanEditor editor = new BooleanEditor();
                generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
            }
            {
                // -------------------------
                // Verbosity level drop down
                // -------------------------
                String id = VERBOSITY_LEVEL;
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return new Integer(((Pipe) model).getLoggingVerbosityLevel());
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((Pipe) model).setLoggingVerbosityLevel(((Integer) value).intValue());
                    }
                };
                SelectEditor editor = new SelectEditor();
                editor.addOption(new DefaultSelectOption(
                    new Integer(MessageLogger.LOG_ERROR),
                    "log_errors"));
                editor.addOption(new DefaultSelectOption(
                    new Integer(MessageLogger.LOG_WARNING),
                    "log_warnings"));
                editor.addOption(new DefaultSelectOption(
                    new Integer(MessageLogger.LOG_DEBUG),
                    "log_debug"));
                editor.addOption(new DefaultSelectOption(
                        new Integer(MessageLogger.LOG_DYNAMIC),
                        "log_dynamic"));
                editor.setFormatter(new IntegerFormatter());

                generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
            }
            {
                // -------------------------
                // Transfer log notification level drop down
                // -------------------------
                String id = NOTIFICATION_LEVEL;
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return new Integer(((Pipe) model).getTransferLogNotificationLevel());
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((Pipe) model).setTransferLogNotificationLevel(((Integer) value).intValue());
                    }
                };
                SelectEditor editor = new SelectEditor();
                editor.addOption(new DefaultSelectOption(
                    new Integer(MessageLogger.MAIL_ERROR),
                    "log_errors"));
                editor.addOption(new DefaultSelectOption(
                    new Integer(MessageLogger.MAIL_WARNING),
                    "log_warnings"));
                editor.addOption(new DefaultSelectOption(
                    new Integer(MessageLogger.MAIL_DEBUG),
                    "log_debug"));
                editor.addOption(new DefaultSelectOption(
                    new Integer(MessageLogger.MAIL_NONE),
                  "mail_none"));
                editor.setFormatter(new IntegerFormatter());

                generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
            }{
                // ----------
                // Mail server field
                // ----------
                String id = MAIL_HOST;
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return ((Pipe) model).getMailHost();
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((Pipe) model).setMailHost((String) value);
                    }
                };
                TextEditor editor = new TextEditor();
                editor.setSize(25);
                editor.setFormatter(new NullHidingFormatter());
                generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
            }{
                // ----------
                // Recipient name field
                // ----------
                String id = RECIPIENT;
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return ((Pipe) model).getRecipientAddress();
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((Pipe) model).setRecipientAddress((String) value);
                    }
                };
                TextEditor editor = new TextEditor();
                editor.setSize(25);
                editor.setFormatter(new NullHidingFormatter());
                generalFieldsContext.addFieldInfo(new FieldInfo(id, id, modifier, editor));
            }{
                // ----------
                // Send-mail-when-pipe-aborts checkbox
                // ----------
View Full Code Here

                            if(valueStr != null && valueStr.length() > 0)
                                ((FTPSource) model).data.setAttribute(PASSWORD_ATTR, valueStr);
                        }
                    };

                    PasswordEditor editor = new PasswordEditor();
                    editor.setSize(10);

                    FieldInfo fieldInfo = new FieldInfo(
                        PASSWORD_ATTR,
                        PASSWORD_ATTR,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(PASSWORD_ATTR, fieldInfo);
                }
                addSimpleTextFieldForComponent(FILENAME_START_ATTR, FILENAME_START_ATTR, 20);
                addSimpleTextFieldForComponent(DATE_FORMAT_ATTR, DATE_FORMAT_ATTR, 20);
                addSimpleTextFieldForComponent(FILE_EXTENSION_ATTR, FILE_EXTENSION_ATTR, 5);
                addSimpleTextFieldForComponent(DATE_DAYSINCREMENT, DATE_DAYSINCREMENT, 5);

                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return new Integer(((FTPSource) model).getFileType());
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((FTPSource) model).setFileType(((Integer) value).intValue());
                        }
                    };

                    SelectEditor editor = new SelectEditor();
                    for(int i = 0; i < FILE_TYPE_LABELS.length; i++)
                        editor.addOption(new DefaultSelectOption(
                            new Integer(i),
                            FILE_TYPE_LABELS[i]));

                    editor.setFormatter(new IntegerFormatter());
                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        FILE_TYPE_ATTR,
                        FILE_TYPE_ATTR,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(FILE_TYPE_ATTR, fieldInfo);
                }
                {
                    //set unique id and description labelkey
                    String id = CHARSET_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws FailTransferException,
                                AbortTransferException {
                            String value = ((FTPSource) model).getData().getAttribute(
                                CHARSET_ATTR);
                            return value != null ? value : DEFAULT_CHARSET;
                        }

                        public void setModelValue(Object model, Object value)
                                throws FailTransferException, AbortTransferException {
                            ((FTPSource) model).getData().setAttribute(
                                CHARSET_ATTR,
                                (String) value);
                        }
                    };

                    SelectEditor editor = new SelectEditor();
                    for(int i = 0; i < CHARSETS.length; i++)
                        editor.addOption(new DefaultSelectOption(CHARSETS[i], CHARSETS[i]));

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(id, id, modifier, editor);

                    //add the configuration to the context for usage in the http-requests.
View Full Code Here

                            if(valueStr != null && valueStr.length() > 0)
                                ((HTTPSource) model).data.setAttribute(PASSWORD_ATTR, valueStr);
                        }
                    };

                    PasswordEditor editor = new PasswordEditor();
                    editor.setSize(10);

                    FieldInfo fieldInfo = new FieldInfo(
                        PASSWORD_ATTR,
                        PASSWORD_ATTR,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(PASSWORD_ATTR, fieldInfo);
                }
                {
                    String id = "param";
                      String label = "param";
                     ModelModifier modifier = new DefaultModelModifier() {

                           public Object getModelValue(Object model) throws Exception {
                               return ((HTTPSource) model).getParameters();
                           }

                           public void setModelValue(Object model, Object value) throws Exception {
                               ((HTTPSource) model).setParameters((String) value);
                           }

                       };

                       TextAreaEditor editor = new TextAreaEditor();
                       editor.setCols(70);
                       editor.setRows(20);
                       FieldInfo fieldInfo = new FieldInfo(id, label, modifier, editor);

                       //add the configuration to the context for usage in the http-requests.
                       addField(id, fieldInfo);

                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws FailTransferException, AbortTransferException {
                            return new Integer(((HTTPSource) model).getRequestMethod());
                        }

                        public void setModelValue(Object model, Object value) throws FailTransferException, AbortTransferException {
                            ((HTTPSource) model).setRequestMethod(((Integer) value).intValue());
                        }
                    };

                    SelectEditor editor = new SelectEditor();
                    for(int i = 0; i < REQUEST_METHOD_LABELS.length; i++)
                        editor.addOption(new DefaultSelectOption(
                            new Integer(i),
                            REQUEST_METHOD_LABELS[i]));

                    editor.setFormatter(new IntegerFormatter());
                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        REQUEST_METHOD_ATTR,
                        REQUEST_METHOD_ATTR,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(REQUEST_METHOD_ATTR, fieldInfo);
                }
                {
                  ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws FailTransferException, AbortTransferException {
                            return new Integer(((HTTPSource) model).getRequestProtocol());
                        }

                        public void setModelValue(Object model, Object value) throws FailTransferException, AbortTransferException {
                            ((HTTPSource) model).setRequestProtocol(((Integer) value).intValue());
                        }
                    };
                   
                    SelectEditor editor = new SelectEditor();
                    for(int i = 0; i < REQUEST_PROTOCOL_LABELS.length; i++)
                        editor.addOption(new DefaultSelectOption(
                            new Integer(i),
                            REQUEST_PROTOCOL_LABELS[i]));
                   
                    editor.setFormatter(new IntegerFormatter());
                   
                    FieldInfo fieldInfo = new FieldInfo(
                            REQUEST_PROTOCOL_ATTR,
                            REQUEST_PROTOCOL_ATTR,
                            modifier,
                            editor);
                   
                    addField(REQUEST_PROTOCOL_ATTR, fieldInfo);
                }
               
                addSimpleTextFieldForComponent(DIRECTORY_NAME, DIRECTORY_NAME, 40);
                addSimpleTextFieldForComponent(FILENAME_ATTR, FILENAME_ATTR, 20);
              
               
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((HTTPSource) model).getChosenResponseCharset();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((HTTPSource) model).setChosenResponseCharset((Boolean)value);
                        }
                    };

                    BooleanEditor editor = new BooleanEditor();

                    FieldInfo fieldInfo = new FieldInfo(CHOOSE_RESPONSE_CHARSET_ATTR,
                            CHOOSE_RESPONSE_CHARSET_ATTR, modifier, editor);

                    addField(CHOOSE_RESPONSE_CHARSET_ATTR, fieldInfo);
                }
               
                {
                    //set unique id and description labelkey
                    String id = RESPONSE_CHARSET_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws FailTransferException,
                                AbortTransferException {
                            String value = ((HTTPSource) model).getData().getAttribute(
                                RESPONSE_CHARSET_ATTR);
                            return value != null ? value : DEFAULT_CHARSET;
                        }

                        public void setModelValue(Object model, Object value)
                                throws FailTransferException, AbortTransferException {
                            ((HTTPSource) model).getData().setAttribute(
                                RESPONSE_CHARSET_ATTR,
                                (String) value);
                        }
                    };

                    SelectEditor editor = new SelectEditor();
                    for(int i = 0; i < CHARSETS.length; i++)
                        editor.addOption(new DefaultSelectOption(CHARSETS[i], CHARSETS[i]));

                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(id, id, modifier, editor);

                    //add the configuration to the context for usage in the http-requests.
View Full Code Here

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((WorkspaceHQLResultConverter) model).setPassword((String) value);
                        }
                    };

                    PasswordEditor editor = new PasswordEditor();
                    editor.setSize(30);

                    FieldInfo fieldInfo = new FieldInfo(
                        PASSWORD_ATTR,
                        PASSWORD_ATTR,
                        modifier,
View Full Code Here

TOP

Related Classes of smilehouse.gui.html.fieldbased.editor.PasswordEditor

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.