Package java.beans

Examples of java.beans.PropertyEditorSupport


                            language = (String)getPrimaryFile().getAttribute(LANGUAGE);
                        return language;
                    }
                   
                    public PropertyEditor getPropertyEditor() {
                        return new PropertyEditorSupport() {
                            public String[] getTags() {
                                return languages;
                            }
                               
                            public void setAsText(String text) {
View Full Code Here


                    public Object getValue() {
                        return filter;
                    }
                   
                    public PropertyEditor getPropertyEditor() {
                        return new PropertyEditorSupport() {
                            public String[] getTags() {
                                String[] tags = new String[availableFilters.length];
                               
                                for (int i = 0; i < availableFilters.length; i++)
                                    tags[i] = availableFilters[i].toString();
View Full Code Here

                            language = (String)getPrimaryFile().getAttribute(LANGUAGE);
                        return language;
                    }
                   
                    public PropertyEditor getPropertyEditor() {
                        return new PropertyEditorSupport() {
                            public String[] getTags() {
                                return languages;
                            }
                               
                            public void setAsText(String text) {
View Full Code Here

                    public Object getValue() {
                        return filter;
                    }
                   
                    public PropertyEditor getPropertyEditor() {
                        return new PropertyEditorSupport() {
                            public String[] getTags() {
                                String[] tags = new String[availableFilters.length];
                               
                                for (int i = 0; i < availableFilters.length; i++)
                                    tags[i] = availableFilters[i].toString();
View Full Code Here

   * Implements initBinder from BaseCrudController to bind UserGroup class
   */
  @Override
  protected void initBinder(HttpServletRequest arg0,
      ServletRequestDataBinder binder) throws Exception {
    PropertyEditorSupport pes = new UserGroupEditor(userGroupService);
    binder.registerCustomEditor(UserGroup.class, pes);
    binder.registerCustomEditor(SystemCodes.class, new SystemCodeEditor(getSystemCodesService()));
  }
View Full Code Here

    binder.registerCustomEditor(Boolean.class, new CustomBooleanEditor(CustomBooleanEditor.VALUE_TRUE, CustomBooleanEditor.VALUE_FALSE, true));

    binder.registerCustomEditor(Date.class, new CustomDateEditor(
            new SimpleDateFormat("dd/MM/yyyy"), true));

    binder.registerCustomEditor(InetAddress.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveInetAddress(element));
      }
    });


    binder.registerCustomEditor(Activity.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveActivity(element));
      }
    });

/*
    binder.registerCustomEditor(Request.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveRequest(element));
      }
    });
    */
    binder.registerCustomEditor(Protocol.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveProtocol(element));
      }
    });

    binder.registerCustomEditor(Group.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveGroup(element));
      }
    });

    binder.registerCustomEditor(Set.class, "users", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveUser(element);
      }
    });

    binder.registerCustomEditor(Set.class, "groups", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveGroup(element);
      }
    });
   
//TGAC Classes
    binder.registerCustomEditor(com.eaglegenomics.simlims.core.User.class, new PropertyEditorSupport() {
     @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveUser(element));
      }
    });

    binder.registerCustomEditor(Project.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveProject(element));
      }
    });

    /*
    binder.registerCustomEditor(ProjectOverview.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        log.info("Overviews set found... resolving...");
        setValue(resolveProjectOverview(element));
      }
    });

    binder.registerCustomEditor(Set.class, "overviews", new CustomCollectionEditor(Set.class) {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveProjectOverview(element));
      }
    });
    */

    binder.registerCustomEditor(Set.class, "studies", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveStudy(element);
      }
    });

    binder.registerCustomEditor(Study.class, "study", new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveStudy(element));
      }
    });

    binder.registerCustomEditor(Set.class, "experiments", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveExperiment(element);
      }
    });

    binder.registerCustomEditor(Experiment.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveExperiment(element));
      }
    });

    binder.registerCustomEditor(Pool.class, "sequencerPartitionContainers.partitions.pool", new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolvePool(element));
      }
    });

    /*
    binder.registerCustomEditor(Pool.class, "flowcells.lanes.pool", new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolvePool(element));
      }
    });
    */

    binder.registerCustomEditor(Set.class, "samples", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveSample(element);
      }
    });

    binder.registerCustomEditor(Sample.class, "sample", new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveSample(element));
      }
    });

    binder.registerCustomEditor(Set.class, "runs", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveRun(element);
      }
    });

    binder.registerCustomEditor(Run.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveRun(element));
      }
    });

    binder.registerCustomEditor(Pool.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolvePool(element));
      }
    });

    binder.registerCustomEditor(PlatformType.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolvePlatformType(element));
      }
    });

    binder.registerCustomEditor(Set.class, "platformTypes", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolvePlatformType(element);
      }
    });

    binder.registerCustomEditor(List.class, "partitions", new CustomCollectionEditor(List.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolvePartition(element);
      }
    });

    binder.registerCustomEditor(SequencerPartitionContainer.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveSequencerPartitionContainer(element));
      }
    });

    binder.registerCustomEditor(List.class, "sequencerPartitionContainers", new CustomCollectionEditor(List.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveSequencerPartitionContainer(element);
      }
    });

    binder.registerCustomEditor(Library.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveLibrary(element));
      }
    });

    binder.registerCustomEditor(Set.class, "libraries", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveLibrary(element);
      }
    });

    binder.registerCustomEditor(Dilution.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        log.info("Binding dilution " + element);
        setValue(resolveDilution(element));
      }
    });

    binder.registerCustomEditor(Set.class, "dilutions", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        log.info("Binding dilution set " + element.toString());
        return resolveDilution(element);
      }
    });

    binder.registerCustomEditor(LibraryDilution.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        log.info("Binding library dilution " + element);
        setValue(resolveLibraryDilution(element));
      }
    });

    binder.registerCustomEditor(Set.class, "libraryDilutions", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        log.info("Binding library dilution set " + element.toString());
        return resolveLibraryDilution(element);
      }
    });

    binder.registerCustomEditor(LibraryType.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveLibraryType(element));
      }
    });

    binder.registerCustomEditor(Set.class, "libraryTypes", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveLibraryType(element);
      }
    });

    binder.registerCustomEditor(LibrarySelectionType.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveLibrarySelectionType(element));
      }
    });

    binder.registerCustomEditor(Set.class, "librarySelectionTypes", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveLibrarySelectionType(element);
      }
    });

    binder.registerCustomEditor(LibraryStrategyType.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveLibraryStrategyType(element));
      }
    });

    binder.registerCustomEditor(Set.class, "libraryStrategyTypes", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveLibraryStrategyType(element);
      }
    });

    binder.registerCustomEditor(TagBarcode.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveTagBarcode(element));
      }
    });

    binder.registerCustomEditor(HashMap.class, "tagBarcodes", new CustomMapEditor(HashMap.class) {


      @Override
      protected Object convertValue(Object element) {
        return resolveTagBarcode(element);
      }
    });

    binder.registerCustomEditor(emPCRDilution.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveEmPcrDilution(element));
      }
    });

    binder.registerCustomEditor(Set.class, "pcrDilutions", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveEmPcrDilution(element);
      }
    });

    binder.registerCustomEditor(Platform.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolvePlatform(element));
      }
    });

    binder.registerCustomEditor(SequencerReference.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveSequencerReference(element));
      }
    });

    binder.registerCustomEditor(Status.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveStatus(element));
      }
    });

    binder.registerCustomEditor(SecurityProfile.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveSecurityProfile(element));
      }
    });

    binder.registerCustomEditor(Submittable.class, "submissionElement", new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveSubmittable(element));
      }
    });

    binder.registerCustomEditor(Set.class, "submissionElements", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveSubmittable(element);
      }
    });

    binder.registerCustomEditor(Kit.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveKit(element));
      }
    });

    binder.registerCustomEditor(Set.class, "kits", new CustomCollectionEditor(Set.class) {
      @Override
      protected Object convertElement(Object element) {
        return resolveKit(element);
      }
    });

    binder.registerCustomEditor(KitDescriptor.class, new PropertyEditorSupport() {
      @Override
      public void setAsText(String element) throws IllegalArgumentException {
        setValue(resolveKitDescriptor(element));
      }
    });
View Full Code Here

     * @param binder
     * @throws Exception
     */
    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {

        binder.registerCustomEditor(State.class, "address.state", new PropertyEditorSupport() {
            @Override
            public void setAsText(String text) {
                State state = stateService.findStateByAbbreviation(text);
                setValue(state);
            }
        });

        binder.registerCustomEditor(Country.class, "address.country", new PropertyEditorSupport() {
            @Override
            public void setAsText(String text) {
                Country country = countryService.findCountryByAbbreviation(text);
                setValue(country);
            }
        });

        binder.registerCustomEditor(Phone.class, "address.phonePrimary", new PropertyEditorSupport() {
            @Override
            public void setAsText(String text) {
                if (!StringUtils.isBlank(text)) {
                    Phone phone = new PhoneImpl();
                    phone.setPhoneNumber(text);
View Full Code Here

     * @param request
     * @param binder
     * @throws Exception
     */
    protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
        binder.registerCustomEditor(State.class, "address.state", new PropertyEditorSupport() {
            @Override
            public void setAsText(String text) {
                if (StringUtils.isNotEmpty(text)) {
                    State state = stateService.findStateByAbbreviation(text);
                    setValue(state);
                } else {
                    setValue(null);
                }
            }
        });

        binder.registerCustomEditor(Country.class, "address.country", new PropertyEditorSupport() {
            @Override
            public void setAsText(String text) {
                Country country = countryService.findCountryByAbbreviation(text);
                setValue(country);
            }
        });
        binder.registerCustomEditor(Phone.class, "address.phonePrimary", new PropertyEditorSupport() {

            @Override
            public void setAsText(String text) {
                if (!StringUtils.isBlank(text)) {
                    Phone phone = new PhoneImpl();
View Full Code Here

                            language = (String)getPrimaryFile().getAttribute(LANGUAGE);
                        return language;
                    }
                   
                    public PropertyEditor getPropertyEditor() {
                        return new PropertyEditorSupport() {
                            public String[] getTags() {
                                return languages;
                            }
                               
                            public void setAsText(String text) {
View Full Code Here

                    public Object getValue() {
                        return filter;
                    }
                   
                    public PropertyEditor getPropertyEditor() {
                        return new PropertyEditorSupport() {
                            public String[] getTags() {
                                String[] tags = new String[availableFilters.length];
                               
                                for (int i = 0; i < availableFilters.length; i++)
                                    tags[i] = availableFilters[i].toString();
View Full Code Here

TOP

Related Classes of java.beans.PropertyEditorSupport

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.