Package smilehouse.gui.html.fieldbased.model

Examples of smilehouse.gui.html.fieldbased.model.ModelModifier


                addSimpleTextFieldForComponent(DATABASE_TYPE_ATTR, DATABASE_TYPE_ATTR, 20);
                addSimpleTextFieldForComponent(CLASS_NAME, CLASS_NAME, 40);
                addSimpleTextFieldForComponent(HOST_ATTR, HOST_ATTR, 40);
                addSimpleTextFieldForComponent(PORT_ATTR, PORT_ATTR, 5);
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return "";

                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            String valueStr = (String) value;
                            if(valueStr != null && valueStr.length() > 0)
                                ((JDBCConverter) model).data.setAttribute(PASSWORD_ATTR, valueStr);
                        }
                    };

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

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

                    addField(PASSWORD_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 = ((JDBCConverter) model).getData().getAttribute(
                                CHARSET_ATTR);
                            return value != null ? value : DEFAULT_CHARSET;
View Full Code Here


        addSimpleTextFieldForComponent(USER_NAME_ATTR, USER_NAME_ATTR, 20);
        addSimpleTextFieldForComponent(JDBC_DRIVER_NAME_ATTR, JDBC_DRIVER_NAME_ATTR, 20);
        addSimpleTextFieldForComponent(RESULTS_PER_ITERATION_ATTR, RESULTS_PER_ITERATION_ATTR, 20);
        addSimpleTextAreaFieldForComponent(SQL_QUERY_ATTR, SQL_QUERY_ATTR, 80, 10);
        {
          ModelModifier modifier = new DefaultModelModifier() {
            public Object getModelValue(Object model) throws Exception {
              return "";

            }

            public void setModelValue(Object model, Object value) throws Exception {
              String valueStr = (String) value;
              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);
        }
        {
          ModelModifier modifier = new DefaultModelModifier() {
            public Object getModelValue(Object model) throws Exception {
              return ((JDBCSource) model).getXMLdeclarationForEachBlock();
            }

            public void setModelValue(Object model, Object value) throws Exception {
View Full Code Here

                }
                {
                    //set unique id and description labelkey
                    String id = CHARSET_ATTR;

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

        public WorkspaceHQLSourceGUI() {

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

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

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

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

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

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

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

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

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

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

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

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

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

                        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,
                        modifier,
                        editor);

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

                        public void setModelValue(Object model, Object value) throws Exception {
View Full Code Here

            try {
                addSimpleTextFieldForComponent(HOST_ATTR, HOST_ATTR, 40);
                addSimpleTextFieldForComponent(PORT_ATTR, PORT_ATTR, 10);
                addSimpleTextFieldForComponent(USER_ATTR, USER_ATTR, 10);
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws FailTransferException, AbortTransferException {
                            return "";
                            //return ((HTTPDestination) model).getAttribute(PASSWORD_ATTR);
                        }

                        public void setModelValue(Object model, Object value) throws FailTransferException, AbortTransferException {
                            String valueStr = (String) value;
                            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;
View Full Code Here

                }
                {
                    //set unique id and description labelkey
                    String id = CHARSET_ATTR;

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

        public RemoteOrderSourceGUIContextContainer() {
            super();
            try {
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((RemoteOrderSource) model).getOpenInterfaceHost();
                        }

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

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

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

                    //add the configuration to the context for usage in the http-requests.
                    context.addFieldInfo(fieldInfo);
                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((RemoteOrderSource) model).getDatabase();
                        }

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

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

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

                    //add the configuration to the context for usage in the http-requests.
                    context.addFieldInfo(fieldInfo);
                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((RemoteOrderSource) model).getUsername();
                        }

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

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

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

                    //add the configuration to the context for usage in the http-requests.
                    context.addFieldInfo(fieldInfo);
                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((RemoteOrderSource) model).getPassword();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
View Full Code Here

        public RemoteCustomerSourceGUIContextContainer() {
            super();
            try {
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((RemoteCustomerSource) model).getOpenInterfaceHost();
                        }

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

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

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

                    //add the configuration to the context for usage in the http-requests.
                    context.addFieldInfo(fieldInfo);
                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((RemoteCustomerSource) model).getDatabase();
                        }

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

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

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

                    //add the configuration to the context for usage in the http-requests.
                    context.addFieldInfo(fieldInfo);
                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((RemoteCustomerSource) model).getUsername();
                        }

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

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

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

                    //add the configuration to the context for usage in the http-requests.
                    context.addFieldInfo(fieldInfo);
                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((RemoteCustomerSource) model).getPassword();
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
View Full Code Here

                addSimpleTextFieldForComponent(DATABASE_ATTR, DATABASE_ATTR, 20);
                // User
                addSimpleTextFieldForComponent(USER_ATTR, USER_ATTR, 20);
                // Password
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return "";
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            String valueStr = (String) value;
                            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,
                        modifier,
                        editor);

                    //add the configuration to the context for usage in the http-requests.
                    addField(IMPORT_MODE_ATTR, fieldInfo);
                }
                // Additive answer update checkbox
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            Boolean value = ((DestinationIF) model)
                                .getData().getBooleanAttribute(ADDITIVE_ANSWER_UPDATE_ATTR);
                            if(value == null)
                                value = Boolean.TRUE;
                            return value;
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            boolean booleanValue = value != null ? ((Boolean) value).booleanValue()
                                    : true;
                            ((DestinationIF) model).getData().setAttribute(ADDITIVE_ANSWER_UPDATE_ATTR, booleanValue);
                        }
                    };

                    BooleanEditor editor = new BooleanEditor();

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

                    //add the configuration to the context for usage in the http-requests.
                    addField(ADDITIVE_ANSWER_UPDATE_ATTR, fieldInfo);
                }
                // Additive basket update checkbox
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            Boolean value = ((DestinationIF) model)
                                .getData().getBooleanAttribute(ADDITIVE_BASKET_UPDATE_ATTR);
                            if(value == null)
                                value = Boolean.FALSE;
                            return value;
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            boolean booleanValue = value != null ? ((Boolean) value).booleanValue()
                                    : false;
                            ((DestinationIF) model).getData().setAttribute(
                                ADDITIVE_BASKET_UPDATE_ATTR,
                                booleanValue);
                        }
                    };

                    BooleanEditor editor = new BooleanEditor();

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

                    //add the configuration to the context for usage in the http-requests.
                    addField(ADDITIVE_BASKET_UPDATE_ATTR, fieldInfo);
                }
               
                // Invoke received events checkbox
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            Boolean value = ((DestinationIF) model)
                                .getData().getBooleanAttribute(INVOKE_RECEIVED_EVENTS_ATTR);
                            if(value == null)
                                value = Boolean.FALSE;
View Full Code Here

                //set unique id and description labelkey
                String id = "script";
                String label = "script";

                ModelModifier modifier = new DefaultModelModifier() {

                    public Object getModelValue(Object model) throws Exception {
                        return ((ASCIItoXMLConverter) model).getScript();
                    }
View Full Code Here

TOP

Related Classes of smilehouse.gui.html.fieldbased.model.ModelModifier

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.