Flavour Component Wizard
Creating a component in Flavour involves 3 interrelated changes:
In this feature, the plugin will provide a wizard that automates most
of these steps.
- Create Java class file for the component business logic
- Create HTML template file for the component
- Add an entry in the package's component resource file
- Right-click on a package in the Project view
- Pick 'Create Flavour Component'
- Enter the component name, like
Button. This creates ButtonComponent.java, button.html, and makes the registry entry.
It generates component files and updates the component registry:
What the wizard looks like:
Use Case #1: Create Component From Project View
- Right-click on a package
- Pick 'Create Flavour Component' in the menu
- Alternative: 'New File / Flavour Component'
- Complete Page 1
- Package name: Defaulted from right-click target
- Component class name: Required
- HTML template filename: Defaulted from component class name, but editable
- Click 'Finish'
- Files get created/updated
- The Component Java file and Template file get created
- The package's component resource file gets created or updated as required.
- The template and Java code will be opened in the editor. (Phase 2. Maybe there should be a checkbox in the wizard to control this)
Use Case #2: Create Component from another location
- Where else would users like to create new components from? Other HTML templates, when you need to embed a component in a template you are creating?
- Naming Standard
- Component class name ends in "Component": AddressComponent, ChartComponent, AnimatedButtonComponent
- Template Filename is the name of the component file, with 'Component.java' replaced with '.html' and the first letter lowercase
- AddressComponent.java becomes address.html
- AnimatedButtonComponent.java becomes animatedButton.html
- If the component or template already exists, the wizard will not overwrite. Error messaging will likely be limited in early releases, just a dialog on error.
- New components will be appended to the package resource file. Long-term, it is better to alphabetize them, but that won't be in the first releases.
Last modified on 15 Dec 2020 by AO
Copyright © 2020 Andrew Oliver