-
Notifications
You must be signed in to change notification settings - Fork 3
Description
This perhaps should be a module in inez or even a new project.
There is a perspective and there are views in it.
Views are TabPanes.
The perspective is a SplitPane, with either a TabPane or a SplitPane embedded in it.
^this is what so far implemented in the wireframe
Now this should be enhanced to be similar what Eclipse does with UI layout management.
A view should have a String getContentDescriptor() method, and the resulting string passed to static void create(String contentDescriptor) should create the same view. The contentDescriptor string should be embeddable in an xml, and should not contain the actual content, but a reference to it and possibly information about how it was rendered at the time. For example the wireframe's tree layout (let's call it InezModelTree) could just return ROOT as the ID of the top element contained as the simplistic approach, and if the need arises, it could be further evolved to be an xml snippet containing the root id and which element paths are expanded (and in this case it should silently ignore those paths which no longer exist). (Or even the empty string if we say that it always starts from the root element and we don't bother recording what was expanded).
The top level SplitPane is vorizontal, the second level is vertical, etc.
If the user drags and drops a view into a SplitPane, then based on whether there are already perpectives in it and the placement of the drop target, one of the following things happen:
- if there are no perspectives yet, the perspective is inserted into the TabPane waiting there.
- if there are perspectives:
- it the drop is in the line of the tab handlers, the perspective is put in as the nth child according to the exact drop position, and made the active tab.
- if the drop is in the perspective area, then
- if it is in a non-side area of the split or in the general middle of a side area, then the area is split, the opposite side containing the already existing views, and the near side containing the dropped view
- if it is in the outer side of a side area, a new area is created there and the perspective dropped there
If a TabPane looses all its tabs (closed or moved out), then the corresponding area is removed.
A perspective should have a String queryLayout() method, which returns a string embeddable in xml, and contains the information about the current layout of the perspective, including the result of getContentDescriptor() calls to views. The void recreateLayout(String layoutDescriptor) call should recreate the layout when called on an empty perspective.
We probably need some API to insert a view into a specific ara of the perspective, and definitely need void insertView(View view) which inserts a view into some default area from where the user can move it.