Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324085

Summary: In-memory reusable UI resource
Product: [Technology] XWT Reporter: Yves YANG <yves.yang>
Component: CoreAssignee: Project Inbox <e4.xwt-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Yves YANG CLA 2010-08-31 09:08:08 EDT
In a real application, the same UI resource could be used several time. It is more smart to provide a mechanism to load it once and reuse it as needed to avoid the file loading and XML parsing each time. 

The solution is to create a new type to keep the parsing result. And the we can use this element to create the UI when we need it.
Comment 1 Yves YANG CLA 2010-08-31 09:11:28 EDT
Next step,  it is possible to serialize this object (let's say binary resource) in a file, which can be loaded directly by light weight runtime without XML bundle dependency.
Comment 2 Yves YANG CLA 2010-08-31 10:35:05 EDT
A new type IUIPattern is added to hold the in memory data after the XML parsing. Some methods are introudcued in XWT to create such object via UI resource:
   XWT.loadAsPattern(URL, ...);

Once IUIPattern is created, we can use it to create UI same as URL. 

The implementation is committed -> 20100831.
Comment 3 Yves YANG CLA 2010-08-31 18:20:40 EDT
"Pattern" may not be a appropriate name. It is not template either. I propose Mold. I know it is not a common software term. It is the term of Art and Sculpture.