[BLOSSOM-47] Post create callbacks for template, area, component and DialogFactory classes Created: 15/Jul/11 Updated: 30/Jan/15 Resolved: 23/Jan/15 |
|
| Status: | Closed |
| Project: | Blossom |
| Component/s: | None |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | 3.0.5 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Tobias Mattsson | Assignee: | Tobias Mattsson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Description |
|
In methods annotated with @DialogFactory its possible to decide wether to add a tab based on custom logic. You can also do post processing of the dialog as a final step after everything has been added and modify it as you please. In classes annotated with @DialogFactory and classes for templates, areas and components this is not possible since they only have @TabFactory annotated methods that are called to add tabs. These methods are always called and there's no way to decide that the tab shouldn't be added. There's also no way to do post processing. A post create callback should be added that allows for adding tabs conditionally, removing tabs added by @TabFactory methods or do arbitrary changes to the dialog. The annotation used to denote callback methods should be @PostCreate. The callback should get access to:
The callback should be called in one of two phases, either after all tab factories in the same class have been called, or after all tab factories in the class hierarchy has been called. Requirements on invocation order:
Requirements on invocation order for callbacks in the after-tab-factories-in-same-class phase:
Requirements on invocation order for callbacks in the after-subclasses phase:
It is an error to use @PostCreate on static methods. Note that this changes the current invocation order of @TabFactory methods, they're currently invoked in class hierarchy bottom-up order. Tabs should still appear in the same order with tabs from superclasses on the right. Additionally, Blossom should prepare the dialog as much as possible before invoking @TabFactory and @PostCreate methods. I.e: setting i18nBasename and label earlier so it can be changed in the callbacks. |