|
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
|
|
From: Benoit X. (JIRA) <no...@at...> - 2006-05-03 09:33:47
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-263?page=all ] Benoit Xhenseval updated RCP-263: --------------------------------- Attachment: RCP-263.patch here is the suggested patch. the use is trivial simply specify singleton="false" <bean id="myView" class="org.springframework.richclient.application.support.DefaultViewDescriptor" singleton="false"> <property name="viewClass"> <value>net.objectlab.....MyView</value> </property> <property name="viewProperties"> <map> ... </property> </bean> If singleton="false" then the findPageComponent will return null and a new internal frame created! > 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 > Assignee: Oliver Hutchison > Attachments: RCP-263.patch > > 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 |
|
From: Lieven D. (JIRA) <no...@sp...> - 2008-10-09 20:21:25
|
[ http://jira.springframework.org/browse/RCP-263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo updated RCP-263:
-----------------------------
Fix Version/s: 1.x
> Adding ability to have multiple instance of internal frames
> -----------------------------------------------------------
>
> Key: RCP-263
> URL: http://jira.springframework.org/browse/RCP-263
> Project: Spring Framework Rich Client Project
> Issue Type: New Feature
> Components: Application Framework
> Reporter: Benoit Xhenseval
> Assignee: Oliver Hutchison
> Fix For: 1.x
>
> Attachments: RCP-263.patch
>
>
> 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://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|