Currently one needs to clone a top component and then drag it beside the original one in order to have different views showing without needing to use the multiview toggle buttons at the beginning of the toolbar. There should be ability to split a Multiview top component inside the same top component window.
Created attachment 133424 [details]
I will start a review for the two methods that need to be added in TopComponent.SubComponent class but thought to put all the implementation in the patch for better overview.
Created attachment 133426 [details]
new View menu entry
Created attachment 133427 [details]
new Window menu entry
Created attachment 133428 [details]
new popup menu entry
Created attachment 133429 [details]
Horizontal split in action
Created attachment 133430 [details]
new View menu entry
Please review the addition of two methods in TopComponent.SubComponent class. Any comments on the split implementation are more than welcomed. Thank you
Y01 Typo 'cunjunction'
Y02 I don't see what an API user has to do the make the splitting work. A <usecase> in arch.xml would be nice. Or is the splitting automatic.
Y03 What can an API user do to disable the splitting?
Y04 Why are actions registered via layer and not via @ActionRegistration and @ActionReference annotations?
Y05 Are the new methods in SubComponent needed only because of PaletteController? How does one find out that the values of these methods changed?
Y06 No tests.
(In reply to comment #8)
> Y01 Typo 'cunjunction'
> Y02 I don't see what an API user has to do the make the splitting work. A
> <usecase> in arch.xml would be nice. Or is the splitting automatic.
the splitting is automatic for Multiview elements
> Y03 What can an API user do to disable the splitting?
I can add a branding token so that someone wanting multiviews but not splitting can disable it and all the relevant menu-items would become invisible
> Y04 Why are actions registered via layer and not via @ActionRegistration and
> @ActionReference annotations?
I need different names for the menu-items, Split vs Split Document. Can this be done with the annotation?
> Y05 Are the new methods in SubComponent needed only because of
> PaletteController? How does one find out that the values of these methods
the list of subcomponent you get from the SubComponent class is "a snapshot valid at the time of the call and shouldn't be held for too long" as stated in the javadoc so the user does not need to be notified if something changes.
> Y06 No tests.
will add some
Created attachment 133503 [details]
addressing Y01, Y03 and Y06. Also added support so that when tc is split and the user invokes Clone action the split is also cloned. If there will be no more comments I intend to integrate on Wednesday. Thank you
Since there are no more comments I will integrate later today. Thank you for the review.
Integrated into 'main-golden', will be available in build *201304182301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Theofanis Oikonomou <email@example.com>
Log: #228448 - No ability to split current top component
Really awesome feature. Thanks.