Package smilehouse.gui.html.fieldbased.model

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


            {
                // ----------------
                // Sum greater than
                // ----------------
                String id = OrderSource.SUM_GREATER_THAN_ATTR;
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return ((OrderSource) model).getSumGreaterThan();
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((OrderSource) model).setSumGreaterThan((Double) value);
                    }
                };
                DoubleFormatter formatter = new DoubleFormatter();
                formatter.setAcceptEmptyValues(true);
                TextEditor editor = new TextEditor();
                editor.setSize(10);
                editor.setFormatter(formatter);

                FieldInfo fieldInfo = new FieldInfo(id, id, modifier, editor);
                context.addFieldInfo(fieldInfo);
            }
            {
                // -------------
                // Sum less than
                // -------------
                String id = OrderSource.SUM_LESS_THAN_ATTR;
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return ((OrderSource) model).getSumLessThan();
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((OrderSource) model).setSumLessThan((Double) value);
                    }
                };
                DoubleFormatter formatter = new DoubleFormatter();
                formatter.setAcceptEmptyValues(true);
                TextEditor editor = new TextEditor();
                editor.setSize(10);
                editor.setFormatter(formatter);

                FieldInfo fieldInfo = new FieldInfo(id, id, modifier, editor);
                context.addFieldInfo(fieldInfo);
            }
            {
                // ----------
                // Date after
                // ----------
                String id = "dateAfter";

                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        Date date = ((OrderSource) model).getDateAfter();
                        if(date != null)
                            return OrderSource.dateFormat.format(date);
                        else
                            return "";
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        String valueStr = (String) value;
                        Date date = null;
                        if(valueStr != null && valueStr.length() != 0) {
                            try {
                                date = OrderSource.dateFormat.parse(valueStr);
                            } catch(ParseException pe) { /* Ignore invalid dates */ }
                        }
                        ((OrderSource) model).setDateAfter(date);
                    }
                };

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

                //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.
                context.addFieldInfo(fieldInfo);
            }
            {
                // -----------
                // Date before
                // -----------
                String id = "dateBefore";

                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        Date date = ((OrderSource) model).getDateBefore();
                        if(date != null)
                            return OrderSource.dateFormat.format(date);
                        else
View Full Code Here


                // ----------
                // Date created after
                // ----------
               String id = "dateCreatedAfter";

                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        Date date = ((CustomerSource) model).getDateCreatedAfter();
                        if(date != null)
                            return CustomerSource.dateFormat.format(date);
                        else
                            return "";
                    }

           
                    public void setModelValue(Object model, Object value) throws Exception {
                        String valueStr = (String) value;
                        Date date = null;
                        if(valueStr != null && valueStr.length() != 0) {
                            try {
                                date = CustomerSource.dateFormat.parse(valueStr);
                            } catch(ParseException pe) {
                            /* Ignore invalid dates */
                    }
                        }
                        ((CustomerSource) model).setDateCreatedAfter(date);
                    }
                };

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

                //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.
                context.addFieldInfo(fieldInfo);
            }

            {
                // -----------
                // Date created before
                // -----------
                String id = "dateCreatedBefore";

                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        Date date = ((CustomerSource) model).getDateCreatedBefore();
                        if(date != null)
                            return CustomerSource.dateFormat.format(date);
                        else
                            return "";
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        String valueStr = (String) value;
                        Date date = null;
                        if(valueStr != null && valueStr.length() != 0) {
                            try {
                                date = CustomerSource.dateFormat.parse(valueStr);
                            } catch(ParseException pe) {
                             /* Ignore invalid dates */
            }
                        }
                        ((CustomerSource) model).setDateCreatedBefore(date);
                    }
                };

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

                //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.
                context.addFieldInfo(fieldInfo);
            }
           
            {
                // ----------
                // Date last visit after
                // ----------
               String id = "dateLastVisitAfter";

                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        Date date = ((CustomerSource) model).getDateLastVisitAfter();
                        if(date != null)
                            return CustomerSource.dateFormat.format(date);
                        else
                            return "";
                    }

           
                    public void setModelValue(Object model, Object value) throws Exception {
                        String valueStr = (String) value;
                        Date date = null;
                        if(valueStr != null && valueStr.length() != 0) {
                            try {
                                date = CustomerSource.dateFormat.parse(valueStr);
                            } catch(ParseException pe) {
                            /* Ignore invalid dates */
                    }
                        }
                        ((CustomerSource) model).setDateLastVisitAfter(date);
                    }
                };

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

                //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.
                context.addFieldInfo(fieldInfo);
            }

            {
                // -----------
                // Date last visit before
                // -----------
                String id = "dateLastVisitBefore";

                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        Date date = ((CustomerSource) model).getDateLastVisitBefore();
                        if(date != null)
                            return CustomerSource.dateFormat.format(date);
                        else
                            return "";
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        String valueStr = (String) value;
                        Date date = null;
                        if(valueStr != null && valueStr.length() != 0) {
                            try {
                                date = CustomerSource.dateFormat.parse(valueStr);
                            } catch(ParseException pe) {
                             /* Ignore invalid dates */
                            }
                        }
                        ((CustomerSource) model).setDateLastVisitBefore(date);
                    }
                };

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

                //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.
                context.addFieldInfo(fieldInfo);
            }
           
           
            {
              // -----------
                // Datebox, customer modified before
                // -----------
               String id = "customerModifiedBefore";
              
               ModelModifier modifier = new DefaultModelModifier() {
                     public Object getModelValue(Object model) throws Exception {
                         Date date = ((CustomerSource) model).getDateCustModifiedBefore();
                         if(date != null)
                             return CustomerSource.dateFormat.format(date);
                         else
                             return "";
                     }

                     public void setModelValue(Object model, Object value) throws Exception {
                         String valueStr = (String) value;
                         Date date = null;
                         if(valueStr != null && valueStr.length() != 0) {
                             try {
                                 date = CustomerSource.dateFormat.parse(valueStr);
                             } catch(ParseException pe) {
                              /* Ignore invalid dates */
                             }
                         }
                         ((CustomerSource) model).setDateCustModifiedBefore(date);
                     }
                 };
              
                 TextEditor editor = new TextEditor();
                 editor.setSize(40);
             
              FieldInfo fieldInfo = new FieldInfo(id,id,modifier,editor);
             
              context.addFieldInfo(fieldInfo);
             
            }
            {
              // -----------
                // Datebox customer modified after
                // -----------
               String id = "customerModifiedAfter";
              
               ModelModifier modifier = new DefaultModelModifier() {
                     public Object getModelValue(Object model) throws Exception {
                         Date date = ((CustomerSource) model).getDateCustModifiedAfter();
                         if(date != null)
                             return CustomerSource.dateFormat.format(date);
                         else
                             return "";
                     }

                     public void setModelValue(Object model, Object value) throws Exception {
                         String valueStr = (String) value;
                         Date date = null;
                         if(valueStr != null && valueStr.length() != 0) {
                             try {
                                 date = CustomerSource.dateFormat.parse(valueStr);
                             } catch(ParseException pe) {
                              /* Ignore invalid dates */
                             }
                         }
                         ((CustomerSource) model).setDateCustModifiedAfter(date);
                     }
                 };
              
              TextEditor editor = new TextEditor();
              editor.setSize(40);
             
              FieldInfo fieldInfo = new FieldInfo(id,id,modifier,editor);
             
              context.addFieldInfo(fieldInfo);
             
            }
            {
//              // -----------
                // Datebox admin modified before
                // -----------
               String id = "adminModifiedBefore";
              
               ModelModifier modifier = new DefaultModelModifier() {
                     public Object getModelValue(Object model) throws Exception {
                         Date date = ((CustomerSource) model).getDateAdminModifiedBefore();
                         if(date != null)
                             return CustomerSource.dateFormat.format(date);
                         else
                             return "";
                     }

                     public void setModelValue(Object model, Object value) throws Exception {
                         String valueStr = (String) value;
                         Date date = null;
                         if(valueStr != null && valueStr.length() != 0) {
                             try {
                                 date = CustomerSource.dateFormat.parse(valueStr);
                             } catch(ParseException pe) {
                              /* Ignore invalid dates */
                             }
                         }
                         ((CustomerSource) model).setDateAdminModifiedBefore(date);
                     }
                 };
              
                 TextEditor editor = new TextEditor();
                 editor.setSize(40);
             
              FieldInfo fieldInfo = new FieldInfo(id,id,modifier,editor);
             
              context.addFieldInfo(fieldInfo);
             
            }
            {
//              // -----------
                // Datebox admin modified after
                // -----------
               String id = "adminModifiedAfter";
              
               ModelModifier modifier = new DefaultModelModifier() {
                     public Object getModelValue(Object model) throws Exception {
                         Date date = ((CustomerSource) model).getDateAdminModifiedAfter();
                         if(date != null)
                             return CustomerSource.dateFormat.format(date);
                         else
                             return "";
                     }

                     public void setModelValue(Object model, Object value) throws Exception {
                         String valueStr = (String) value;
                         Date date = null;
                         if(valueStr != null && valueStr.length() != 0) {
                             try {
                                 date = CustomerSource.dateFormat.parse(valueStr);
                             } catch(ParseException pe) {
                              /* Ignore invalid dates */
                             }
                         }
                         ((CustomerSource) model).setDateAdminModifiedAfter(date);
                     }
                 };
              
                 TextEditor editor = new TextEditor();
                 editor.setSize(40);
             
              FieldInfo fieldInfo = new FieldInfo(id,id,modifier,editor);
             
              context.addFieldInfo(fieldInfo);
             
            }
           
            {
              // -----------
                // what rule to apply (customer / admin / both)
                // -----------
              //set unique id and description labelkey
                String id = "modifyOperation";

                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws FailTransferException,
                            AbortTransferException {
                      String value = ((CustomerSource)model).getModifyOperation();
                     
                      if(value != null){
View Full Code Here

                addSimpleTextFieldForComponent(ESCAPE_CHAR_ATTR, ESCAPE_CHAR_ATTR, 2);
                {
                    // --------------
                    // Iteration size
                    // --------------
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return new Integer( ((IteratingFileSource) model).getBlockSize() );
                        }

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

                    TextEditor editor = new TextEditor();
                    IntegerFormatter formatter = new IntegerFormatter();
                    formatter.acceptOnlyStrictlyPositive("invalid_block_size");
                    editor.setFormatter(formatter);
                    editor.setSize(5);
                   
                    FieldInfo fieldInfo = new FieldInfo(
                        BLOCK_SIZE_ATTR,
                        BLOCK_SIZE_ATTR,
                        modifier,
                        editor);

                    addField(BLOCK_SIZE_ATTR, fieldInfo);
                }
                {
                    // --------------
                    // Charset select
                    // --------------
                    String id = CHARSET_ATTR;
                   
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((IteratingFileSource) model).getCharset();
                        }
                       
                        public void setModelValue(Object model, Object value) throws Exception {
View Full Code Here

     * GUIContext ant the testobject instance variables.
     */
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        try {
            ModelModifier userListModifier = new DefaultModelModifier() {
                public Object getModelValue(Object model) throws Exception {
                    return ((ListModel) model).getList();
                }

                public void setModelValue(Object model, Object value) throws Exception {
                    ((ListModel) model).setList((RecallingList) value);
                }
            };
            ContainerEditor userListEditor = new ContainerEditor();
            userListEditor.enableDelete("delete");
            //containerEditor.enableAdd(Pipe.class, "add");
            userListFieldInfo = new ContainerFieldInfo(
                "list",
                "users",
                userListModifier,
                userListEditor);
            {
                // -----
                // Login
                // -----
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return ((User) model).getLogin();
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                    // We won't set it here...
                    }
                };
                UneditingEditor editor = new UneditingEditor();

                FieldInfo fieldInfo = new FieldInfo(LOGIN, LOGIN, modifier, editor);
                userListFieldInfo.addColumn(fieldInfo);

            }
            {
                // --------
                // Password
                // --------
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return ""; // We won't show it
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                        String strValue = (String) value;
                        if(strValue != null && strValue.length() > 0)
                            ((User) model).setPassword(strValue);
                    }
                };
                PasswordEditor editor = new PasswordEditor();
                editor.setSize(20);

                FieldInfo fieldInfo = new FieldInfo(PASSWORD, PASSWORD, modifier, editor);
                userListFieldInfo.addColumn(fieldInfo);
            }
            {
                // ----
                // Name
                // ----
                ModelModifier modifier = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                        return ((User) model).getName();
                    }

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

                // instead of PipeComponentIFs so that Hibernate doesn't get confused...
                // (Hibernate don't know anything about the PipeComponentIF interface)
                // --------------------------------------------------------------------
                String id = "converters";

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

                    public void setModelValue(Object model, Object value) throws Exception {
                        ((Pipe) model).setConverterList((List) value);
                    }
                };
                ContainerEditor containerEditor = new ContainerEditor();
                containerEditor.enableDelete("delete", "confirm_delete_component2");
                containerEditor.enableMove("move", "pics/arrow_up_button.gif",
                    "move", "pics/arrow_down_button.gif", "move");

                converterFieldInfo = new ContainerFieldInfo(id, id, modifier, containerEditor);
                {
                    // ---------------------------------------------------
                    // Field for displaying the converter component's type
                    // ---------------------------------------------------
                    String id1 = "type";
                    String label1 = "converter_type";
                    ModelModifier modifier1 = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            //PipeComponentData componentData = (PipeComponentData) model;
                            ConverterListItem componentImpl = (ConverterListItem) model;
                            //if(!componentData.getImplementation().implementationExists()) {

                            // Assume component implementation exists
                            /*if(!componentImpl.implementationExists()) {
                             // If implementation is not there, show error...
                             return "!!! Class not found: "
                             + componentImpl.getClassName() + " !!!";
                             } else {
                             */
                            //PipeComponentIF impl = componentImpl.getInstance();
                            //return impl.getName();
                            return componentImpl.getConverter().getName();
                            //}
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                        // We don't want to change it, we just want to see it
                        }
                    };
                    // Just want to show it...
                    UneditingEditor editor1 = new UneditingEditor();
                    FieldInfo typeFieldInfo = new FieldInfo(id1, label1, modifier1, editor1);
                    converterFieldInfo.addColumn(typeFieldInfo);
                }

                // TODO: Converter component's Edit button should be disabled if the Converter does not
                //       implement GUIConfigurationIF
                {
                    // ---------------
                    // Edit link field
                    // ---------------
                    String id2 = "edit";
                    String label2 = "edit";
                    ModelModifier modifier2 = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            ConverterListItem componentData = (ConverterListItem) model;

                            HashMap m = new HashMap();
                            m.put(COMPONENT_ID, componentData.getConverter().getID());
View Full Code Here

                addSimpleTextFieldForComponent(EXTENSION_ATTR, EXTENSION_ATTR, 10);
                {
                    // ----------
                    // Block size
                    // ----------
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return new Integer( ((IteratingXMLFileSource) model).getBlockSize() );
                        }

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

                    TextEditor editor = new TextEditor();
                    IntegerFormatter formatter = new IntegerFormatter();
                    formatter.acceptOnlyStrictlyPositive("invalid_block_size");
                    editor.setFormatter(formatter);
                    editor.setSize(5);
                   
                    FieldInfo fieldInfo = new FieldInfo(
                        BLOCK_SIZE_ATTR,
                        BLOCK_SIZE_ATTR,
                        modifier,
                        editor);

                    addField(BLOCK_SIZE_ATTR, fieldInfo);
                }
                {
                    // ----------
                    // Chop depth
                    // ----------
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return new Integer( ((IteratingXMLFileSource) model).getChopDepth() );
                        }

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

                    TextEditor editor = new TextEditor();
                    IntegerFormatter formatter = new IntegerFormatter();
                    formatter.acceptOnlyPositive("invalid_chop_depth");
                    editor.setFormatter(formatter);
                    editor.setSize(5);
                   
                    FieldInfo fieldInfo = new FieldInfo(
                        CHOP_DEPTH_ATTR,
                        CHOP_DEPTH_ATTR,
                        modifier,
                        editor);

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

            super();
           
            // Add WorkspaceHQLOrderSource specific fields to GUI
            try {
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((WorkspaceHQLOrderSource) model).getNewOrderHandlingStatus();
                        }
   
                        public void setModelValue(Object model, Object value) throws Exception {
                            ((WorkspaceHQLOrderSource) model).setNewOrderHandlingStatus((String) value);
                        }
                    };
   
                    TextEditor editor = new TextEditor();
                    editor.setSize(40);
   
                    //and finally create the configurationObject
                    FieldInfo fieldInfo = new FieldInfo(
                        NEW_ORDER_HANDLING_STATUS,
                        NEW_ORDER_HANDLING_STATUS,
                        modifier,
                        editor);
   
                    //add the configuration to the context for usage in the http-requests.
                    addField(NEW_ORDER_HANDLING_STATUS, fieldInfo);
                }
                {
                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            return ((WorkspaceHQLOrderSource) model).getNewOrderPaymentStatus();
                        }
   
                        public void setModelValue(Object model, Object value) throws Exception {
View Full Code Here

                addField(CHARSET_ATTR, LocalFileDestination.gui.getField(CHARSET_ATTR));
                {
                    //set unique id and description labelkey
                    String id = PREFIX_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            String value = ((TimestampFileDestination) model)
                                .data.getAttribute(PREFIX_ATTR);
                            return value != null ? value : "";
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((TimestampFileDestination) model).data.setAttribute(
                                PREFIX_ATTR,
                                (String) value);
                        }
                    };

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

                    //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);
                }
                {
                    //set unique id and description labelkey
                    String id = DATEFORMAT_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            String value = ((TimestampFileDestination) model)
                                .data.getAttribute(DATEFORMAT_ATTR);
                            return value != null ? value : DEFAULT_DATEFORMAT;
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((TimestampFileDestination) model).data.setAttribute(
                                DATEFORMAT_ATTR,
                                (String) value);
                        }
                    };

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

                    //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);
                }
                {
                    //set unique id and description labelkey
                    String id = EXTENSION_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            String value = ((TimestampFileDestination) model)
                                .data.getAttribute(EXTENSION_ATTR);
                            return value != null ? value : "";
                        }
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);
                        }
View Full Code Here

                addField(CHARSET_ATTR, LocalFileDestination.gui.getField(CHARSET_ATTR));
                {
                    //set unique id and description labelkey
                    String id = PREFIX_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            String value = ((MultiFileDestination) model)
                                .data.getAttribute(PREFIX_ATTR);
                            return value != null ? value : "";
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((MultiFileDestination) model).data.setAttribute(
                                PREFIX_ATTR,
                                (String) value);
                        }
                    };

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

                    //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);
                }
                {
                    //set unique id and description labelkey
                    String id = COUNTERSTARTVALUE_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            String value = ((MultiFileDestination) model)
                                .data.getAttribute(COUNTERSTARTVALUE_ATTR);
                            return value != null ? value : "";
                        }

                        public void setModelValue(Object model, Object value) throws Exception {
                            ((MultiFileDestination) model).data.setAttribute(
                                COUNTERSTARTVALUE_ATTR,
                                (String) value);
                        }
                    };

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

                    //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);
                }
                {
                    //set unique id and description labelkey
                    String id = EXTENSION_ATTR;

                    ModelModifier modifier = new DefaultModelModifier() {
                        public Object getModelValue(Object model) throws Exception {
                            String value = ((MultiFileDestination) model)
                                .data.getAttribute(EXTENSION_ATTR);
                            return value != null ? value : "";
                        }
View Full Code Here

TOP

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

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.