Package smilehouse.gui.html.fieldbased.editor

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


                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                    }
                };
                UneditingEditor editor3=new UneditingEditor();
               
                FieldInfo linkFieldInfo = new FieldInfo(id3, label3, modifier3, editor3);
                pipeListFieldInfo.addColumn(linkFieldInfo);
            }
            {
                // -----------------
                // Finish time
                // -----------------
                String id4 = "endtime";
                String label4 = "endtimelist";
                ModelModifier modifier4 = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                      Date end=((Pipe) model).getEndTime();
                        if(end==null||(pipeSet!=null&&pipeSet.contains((Pipe)model))){
                        return "";
                      }
                        return dateFormat.format(end);
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                    }
                };
                UneditingEditor editor4=new UneditingEditor();
               
                FieldInfo linkFieldInfo = new FieldInfo(id4, label4, modifier4, editor4);
                pipeListFieldInfo.addColumn(linkFieldInfo);
            }
            {
                // -----------------
                // Duration of pipe execution
                // -----------------
                String id4 = "duration";
                String label4 = "duration";
                ModelModifier modifier4 = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                      Long duration=((Pipe)model).getDuration();
                      if(duration==0)
                        return "";
                      else if(pipeSet!=null&&pipeSet.contains((Pipe)model))
                        return environment.getLabel(PIPE_RUNNING, language );
                      else
                        return DurationFormatUtils.formatDuration(duration,DURATION_FORMAT);
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                    }
                };
                UneditingEditor editor4=new UneditingEditor();
               
                FieldInfo linkFieldInfo = new FieldInfo(id4, label4, modifier4, editor4);
                pipeListFieldInfo.addColumn(linkFieldInfo);
            }
           
            {
                // -----------------
                // Last status
                // -----------------
                String id4 = "status";
                String label4 = "laststatus";
                ModelModifier modifier4 = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                      String status=((Pipe) model).getLastStatus();
                      if(status!=null && (pipeSet==null||!pipeSet.contains((Pipe)model)))
                        return status;
                      return "";
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                    }
                };
                UneditingEditor editor4=new UneditingEditor();
               
                FieldInfo linkFieldInfo = new FieldInfo(id4, label4, modifier4, editor4);
                pipeListFieldInfo.addColumn(linkFieldInfo);
            }
            {
                // -----------------
                // Last user
                // -----------------
                String id6 = "lastuser";
                String label6 = "lastuser";
                ModelModifier modifier6 = new DefaultModelModifier() {
                    public Object getModelValue(Object model) throws Exception {
                      String user=((Pipe) model).getUser();
                      if(user!=null && (pipeSet==null||!pipeSet.contains((Pipe)model)))
                        return user;
                      return "";
                    }

                    public void setModelValue(Object model, Object value) throws Exception {
                    }
                };
                UneditingEditor editor6=new UneditingEditor();
               
                FieldInfo linkFieldInfo = new FieldInfo(id6, label6, modifier6, editor6);
                pipeListFieldInfo.addColumn(linkFieldInfo);
            }
           
View Full Code Here


                    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 {
                        ((User) model).setName((String) value);
                    }
                };
                TextEditor editor = new TextEditor();
                editor.setSize(50);

                FieldInfo fieldInfo = new FieldInfo(NAME, NAME, modifier, editor);
                userListFieldInfo.addColumn(fieldInfo);
            }
        } catch(Exception e) {
View Full Code Here

                        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
View Full Code Here

TOP

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

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.