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

A dialog to control the granularity of code generation would be nice #5

Open
brucebeisel opened this issue Dec 7, 2015 · 7 comments

Comments

@brucebeisel
Copy link

Much in the same way the vanilla Java getter/setter generator allows you to generate getters and setters separately through different menu items. A dialog allowing you to choose which fields will have code generated is also a nice feature to add.

@rterp
Copy link
Owner

rterp commented Dec 8, 2015

Agreed, that this would be a nice feature to add.

@Naoghuman
Copy link
Collaborator

Hi brucebeisel and rterp,
I have done a little analyse for #4 (Double functionality for getter and setter) where I thought also for me that this would be a nice feature.

Unfortunately the chooser dialog for the getter(setter) selection can't be easily extended because its not part from the open api in the module java.editor. Momentary I am work on to extract all functionalities for the vanilla Getter/Setter generation in one plugin so that I can focus what should be done to extend the standard functionalities with the JavaFX functionalities.

With the extention and not create a new dialog for the JavaFX generation its then also possible to correct the false generation from JavaFX properties in the vanilla Getter/Setter generation (see for more information #4).

I will upload the extraction in the next days.

@Naoghuman
Copy link
Collaborator

getterandsetterpanel
Here is a suggestion from me how the dialog will be look. On the left side is the original, on the right side is the extented dialog. For all 3 functionalities (getter, setter, getter and setter) is the same dialog used -> netbeans.modules.java.editor.codegen.ui.GetterSetterPanel.

@rterp
Copy link
Owner

rterp commented Dec 11, 2015

Looks good. How difficult would it be to provide a hook into the plugin to display the dialog when the user selects the generate prop getter/setter action?

@Naoghuman
Copy link
Collaborator

Hi Rob,
I extract the vanilla getter-and-setter functionalities in an own module as a reference for the refactoring and extension. Can you plz create a branch 'vanilla-getter-and-setter'? So I can request the extraction as reference.

I tried to copy & paste the stuff in your module, but unfortunaly something goes wrong. A bundle file wont be found, so that the module wan't be build. So I choose the solution with the zip file. General I simple copy & paste the needed classes. So there are many functionalities which aren't needed.

Functionalities, restrictions from the vanille module:

  • Defined own Getter, Setter and Getter and Setter actions in the popup.
  • In the selection dialog all Java, JavaFX properties are merged. Generate methods follow the vanilla Java Rules.
  • Its possible to generate generic methods.
  • The implementation for all 3 actions in the class GetterSetterGenerator.

Steps for the extended dialog:

  • Replace the vanilla action for the generations with own actions. The orignal action from JavaFxBeanHelper will the the new 3 actions.
  • Move the functionality to extract the properties (separated lists for getter and setter properties) from GetterSetterGenerator to JavaFxBeanHelper. Remove from the lists the JavaFX properties and added then to own lists.
  • Extend the GetterSetterPanel like the suggestion above.
  • Extend the generation in coordination from the user selection.

It will be a little work, but I planed to investigate some time from my holiday because I think its a really good opportunity to extend my knowledge.

@rterp
Copy link
Owner

rterp commented Dec 12, 2015

Hi Peter,

I've added you as a collaborator to the project, so you should now be able to create branches and push changes back into the repo.

@Naoghuman
Copy link
Collaborator

Hi,
sorry for the delay. My plan was to do in holiday the points above - but how the life plays. I start with a new program Competency-Matrix which I plan to use for my work and hobbies.

But now I have time and will to do what we have spoken last year. Here a picture about the new dialog. Next step is to implement that the JavaFX tree will be filled with JavaFX properties.
dialog-with-java-fx

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

No branches or pull requests

3 participants