Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for all official Property types + much much more. #12

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

Tuupertunut
Copy link

@Tuupertunut Tuupertunut commented Jul 25, 2017

Major changes:

  • Support for ObjectProperty, ListProperty, SetProperty and MapProperty
    • Their generics are working too.
  • Support for read-only properties.
    • Like writable properties, but without setter.
  • Support for read-only wrappers.
    • Like read-only properties, but property getter returns the wrapped read-only property with getReadOnlyProperty().
  • Old methods don't get removed anymore. Instead, new methods just won't get created if there already is a method with that name.
    • This prevents code accidentally being deleted.

Minor changes:

  • Removed final from the xxxProperty() property getter methods.
  • Moved getters first, before setters and property getters.
    • They appear to be so in most of JavaFX documentation.
  • The generation action now appears only if the class has property fields.
  • Plugin moved to the same JavaFX 2 category as the official JavaFX plugins.
  • Now requires at least NetBeans 8.1.

Development-only changes:

  • Removed nb-configuration.xml from project.
    • Its jdkPlatform property is causing compilation issues to many developers, including me.
    • It isnt needed anyway, as java version is already specified in the POM.
  • A LOT of refactoring.

Bugfixes:

  • Fixed NullPointerException when pressing Alt + Insert outside of a class.
  • Method generation now works in enums as well.
  • Methods are no longer generated for any class implementing Property
    • There is no way to know what types their values are and what methods they support. This caused invalid methods and errors.
    • Only the official Property classes are supported. List in readme.
  • First character capitalization for getter and setter names is no longer locale sensitive
    • For example, property idle used to create method getİdle in Turkish locale.

The jdkPlatform property is causing compiling issues for many developers and isn't needed anyway.
Apparently committer @kunstmusik used tabs for indentation while the rest of the code used 4 spaces. Everything uses 4 spaces now.
Support added for:
ObjectProperty
ListProperty
SetProperty
MapProperty

+ refactoring related to the changes.
Previously all classes implementing "Property" were supported, which led to errors.
For example, previously in the Turkish locale, property "idle" would generate a method "getİdle" instead of "getIdle".
Instead, new methods check if there is already a method with the same name. If there is, the new method just won't get created. This ensures that no code will be accidentally removed. This is also how the NetBeans default "Getter and Setter..." generator works.
Uses a new method TreeUtilities.getPathElementOfKind, which was added in NetBeans 8.1. For this reason, all NetBeans dependencies are updated to 8.1.
@Tuupertunut
Copy link
Author

I have released these changes as a separate plugin in the plugin portal.

https://github.com/Tuupertunut/JavaFXGetterGenerator
http://plugins.netbeans.org/plugin/73209/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant