Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[e4-dev] UI Model Services API


Happy New Year folks !!

To start off this year I'm beginning the implementation of the EModelService (EMS).. This is intended to supply the API hooks to allow clients to perform common modelling operations as well as subsuming the current UIEventPublisher (i.e. 'subscribe' will be an EMS method).

This is an invitation to suggest any API that you think might be useful. Here are some starters:

QUERIES:

UIElement find(String id, MUIElementContainer<MUIElement> searchRoot)

This is the generic 'find', do we need specialized finds (i.e. only find certain types like MContribution)?

IEclipseContext getContainingContext(MUIElement element)

Returns the nearest parent element that inherits MContext. This is the current 'getParentContext used by the renderers.

OPERATIONS:

One of the possibilities here is to create a MParameterizedCommand out of the service's methods, allowing 'macro' constructions...should we ?

move(MUIElement element, MUIElementContainer<MUIElement> newParent);
move(MUIElement element, MUIElementContainer<MUIElement> newParent, boolean leavePlaceholder);
move(MUIElement element, MUIElementContainer<MUIElement> newParent, int index);
move(MUIElement element, MUIElementContainer<MUIElement> newParent, int index, boolean leavePlaceholder);

Moves the element to the new parent, possibly into an explicit index position. The 'leavePlaceholder' parameter will, if true, perform the move but leave a new MPlaceholder element behind. This is to be used initially to support the 'minimize' operation in which the stack would be 'moved' to the trim but an MPlaceholder would be left in the original position.

swap(MUIElement element, MPlaceholder placeholder);

Swaps the two elements while maintaining the MUIElement's information. This will be used to implement the 'shared parts' mechanism needed for perspectives but will be done in a model-neutral manner (i.e. it'll be able to share -any- MUIElement structure...think Editor Area...).

Let me know what *you* think should be there !!

Eric


Back to the top