Code Monkey home page Code Monkey logo

Comments (5)

aheintz avatar aheintz commented on August 23, 2024

I've made two pull requests, one with a mavenization of the project and one with quite a lot of changes to validation, formatting and parsing. It's possible that I've gone too far. Please review my pull requests and let me know if I need to rollback/change anything.

from numberfield.

Ansku avatar Ansku commented on August 23, 2024

There are quite a few changes to lines that haven't actually changed in any relevant way, and it's making it a bit hard to spot the actual changes. I try to use Vaadin Coding Conventions (except for the parts that refer to Java 6) in all my projects, so if you have time to reformat the changes according to those it would hopefully speed things up from my end a bit. The Vaadin core's extra workspace preferences would be a bonus, I'm not sure if I've remembered to add those to that particular workspace yet.

It's been a bit of a hectic week for me, sorry for the delay :(

from numberfield.

aheintz avatar aheintz commented on August 23, 2024

Sorry I haven't responded yet, but it's been a few extremely focused weeks and since I got the numberfield working for our case... Don't worry about its taking time.

I tried to import the vaadin coding conventions eclipse file at https://github.com/vaadin/vaadin/blob/master/eclipse/VaadinJavaConventions.xml but either IntelliJ couldn't interpret it correctly or it's just wrong. For example is the indentatino 8 spaces(?). I've tried to fix my code formatter so it matches as closely as possible and it seems to match mostly except for javadoc indents. I also updated the javadoc along the way so it may look like more changes than there actually is. The code changes in the "mavenize" pull request was due to my screwing up and using plain mv instead of git mv.

from numberfield.

alkhimistta avatar alkhimistta commented on August 23, 2024

Another solution may be to modify the method

private boolean validateValue(String value) {
        if (value == null || "".equals(value)) {
            return !isRequiredIndicatorVisible();
        }

        final boolean isValid;
        if (isDecimalAllowed()) {
            isValid = NumberValidator.isValidDecimal(getValueAsFormattedDecimalNumber(),
                    getState(), false);
        } else {
            isValid = NumberValidator.isValidInteger(getValueAsFormattedDecimalNumber(),
                    getState(), false);
        }

        return isValid;
    }

by

private boolean validateValue(String value) {
        if (value == null || "".equals(value)) {
            return !isRequiredIndicatorVisible();
        }

        final boolean isValid;
        if (isDecimalAllowed()) {
            isValid = NumberValidator.isValidDecimal(getValueAsFormattedDecimalNumber(),
                    getState(), true);
        } else {
            isValid = NumberValidator.isValidInteger(getValueAsFormattedDecimalNumber(),
                    getState(), true);
        }

        return isValid;
    }

from numberfield.

igorbljahhin avatar igorbljahhin commented on August 23, 2024

Same issue here.

from numberfield.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.