-
Apr 7th, 2006, 04:16 PM
#1
defaultApplicationPagePrototype can not be created
I am trying to declar my own page prototype, for that i created bean
defaultApplicationPagePrototype in sample applications - richclient-startup-context.xml - but found that it can not be created due to code in createPage function which creates the Bean of type DefaultApplicationPage...
-->> From DefaultApplicationWindow.java
protected ApplicationPage createPage(PageDescriptor descriptor) {
try {
DefaultApplicationPage page = (DefaultApplicationPage)getServices().getBean(
DEFAULT_APPLICATION_PAGE_BEAN_ID, DefaultApplicationPage.class);
page.setApplicationWindow(this);
page.setDescriptor(descriptor);
return page;
}
catch (NoSuchBeanDefinitionException e) {
return new DefaultApplicationPage(this, descriptor);
}
}
-->> From AbstractApplicationPage.java
public AbstractApplicationPage(ApplicationWindow window, PageDescriptor pageDescriptor) {
setApplicationWindow(window);
setDescriptor(pageDescriptor);
}
...
public final void setApplicationWindow(ApplicationWindow window) {
Assert.notNull(window, "The containing window is required");
Assert.state(this.window == null, "Page window already set: it should only be set once, during initialization");
this.window = window;
sharedCommandTargeter = new SharedCommandTargeter(window);
addPageComponentListener(sharedCommandTargeter);
}
Now DefaultApplicationPage constructor expects two argument and sets applicationWindow and throws Illigal ArgumentException if setApplicationWindow is called again. So theoritically you can not use "DefaultApplicationWindow" without over riding this method.
I am wondering how others change their page layout for adding addtional docable windows - alwyas extend "DefaultApplicationWindow" and over-ride above protected ApplicationPage createPage(PageDescriptor descriptor) method?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules