|
From: Benoit X. (JIRA) <no...@at...> - 2006-01-14 02:37:40
|
Adding ability to have multiple instance of internal frames
-----------------------------------------------------------
Key: RCP-263
URL: http://opensource.atlassian.com/projects/spring/browse/RCP-263
Project: Spring Framework Rich Client Project
Type: New Feature
Components: Application Framework
Reporter: Benoit Xhenseval
Assigned to: Oliver Hutchison
Hello
based on Peter's RCP56 for Internal Frame, I note that the code has now moved to an mdi package.
Would it be possible to add the following code to DesktopApplicationPage so that it is possible to have more than 1 internal frame based on the same view.
// + New Stuff for managing Singleton views...
private Map<String,Boolean> singletonViews = new HashMap<String,Boolean>();
/**
* This method is called each time a new internal frame is being launched.
* @return null means that this view is not launched yet and therefore a new one will be created.
*/
@Override
protected PageComponent findPageComponent(String viewDescriptorId) {
Boolean isSingleton = singletonViews.get(viewDescriptorId);
if (isSingleton==null) {
// fetch the bean and check if it is a singleton.
BeanFactory factory = Application.instance().getServices().getBeanFactory();
isSingleton = factory.isSingleton(viewDescriptorId);
singletonViews.put(viewDescriptorId,isSingleton);
}
if (isSingleton) {
return super.findPageComponent(viewDescriptorId);
} else {
return null;
}
}
More details on
http://forum.springframework.org/showthread.php?t=20141&highlight=multiple+view
The code shown in JDk5.0 but it would be trivial to refactor for any older jdk.
Many thanks
Benoit
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/spring/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|