|
From: Ryan S. (JIRA) <no...@at...> - 2006-07-01 14:48:51
|
null application window
-----------------------
Key: RCP-376
URL: http://opensource.atlassian.com/projects/spring/browse/RCP-376
Project: Spring Framework Rich Client Project
Type: Bug
Versions: 0.1.0
Reporter: Ryan Sonnek
My action command executor extends the ApplicationWindowAwareCommand, yet when I run the command, I get a null pointer exception.
how does the application window get initialized on my object?
public class ApplicationWindowProgressMonitorActionCommandExecutor extends ApplicationWindowAwareCommand implements ActionCommandExecutor {
private final ParameterizableActionCommandExecutor delegate;
public ApplicationWindowProgressMonitorActionCommandExecutor(ParameterizableActionCommandExecutor delegate) {
this.delegate = delegate;
}
protected void doExecuteCommand() {
BusyIndicator.showAt(getApplicationWindow().getControl());
getProgressMonitor().taskStarted(getText(), StatusBar.UNKNOWN);
delegate.execute(getParameters());
BusyIndicator.clearAt(getApplicationWindow().getControl());
getProgressMonitor().done();
}
private ProgressMonitor getProgressMonitor() {
return getApplicationWindow().getStatusBar().getProgressMonitor();
}
}
--
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: Ryan S. (JIRA) <no...@at...> - 2006-07-01 15:03:47
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-376?page=comments#action_18351 ] Ryan Sonnek commented on RCP-376: --------------------------------- looks like the LifecycleAdvisor is supposed to initialize this field. is it true that *only* commands declared in the windowCommandBarDefinitions get the application window set on them? > null application window > ----------------------- > > Key: RCP-376 > URL: http://opensource.atlassian.com/projects/spring/browse/RCP-376 > Project: Spring Framework Rich Client Project > Type: Bug > Versions: 0.1.0 > Reporter: Ryan Sonnek > > My action command executor extends the ApplicationWindowAwareCommand, yet when I run the command, I get a null pointer exception. > how does the application window get initialized on my object? > public class ApplicationWindowProgressMonitorActionCommandExecutor extends ApplicationWindowAwareCommand implements ActionCommandExecutor { > private final ParameterizableActionCommandExecutor delegate; > public ApplicationWindowProgressMonitorActionCommandExecutor(ParameterizableActionCommandExecutor delegate) { > this.delegate = delegate; > } > protected void doExecuteCommand() { > BusyIndicator.showAt(getApplicationWindow().getControl()); > getProgressMonitor().taskStarted(getText(), StatusBar.UNKNOWN); > delegate.execute(getParameters()); > BusyIndicator.clearAt(getApplicationWindow().getControl()); > getProgressMonitor().done(); > } > private ProgressMonitor getProgressMonitor() { > return getApplicationWindow().getStatusBar().getProgressMonitor(); > } > } -- 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: Rogan D. <ro...@da...> - 2006-07-01 15:24:46
|
Ryan Sonnek (JIRA) wrote: > [ http://opensource.atlassian.com/projects/spring/browse/RCP-376?page=comments#action_18351 ] > > Ryan Sonnek commented on RCP-376: > --------------------------------- > > looks like the LifecycleAdvisor is supposed to initialize this field. > > is it true that *only* commands declared in the windowCommandBarDefinitions get the application window set on them? > Yes, I think so. ISTR that there is a special type of BeanFactory/Context that registers a BeanPostProcessor that is responsible for setting the current ApplicationWindow. Trace the code, and see how it is done. You should find it without too much difficulty, as an inner class somewhere. This is one of the reasons that I'm not too happy about the way that commands are constructed. I was trying to construct a globally consistent ToggleCommand (i.e. I could define it in one place, and have it keep all its menuitems, togglebuttons, etc up to date, regardless of how many windows were opened) What it is doing makes sense in a way (creating new commands for each window, and letting each command know which window it relates to), but there seems to be no way to define a single globally-consistent ToggleCommand using this scheme. Theoretically, one should create such globally-applicable in the application context; however, doing this doesn't let the command get auto-configured with message labels, etc. If I could solve this problem, I think I'd be happy enough with the way that things are done currently. Regards, Rogan >> null application window >> ----------------------- >> >> Key: RCP-376 >> URL: http://opensource.atlassian.com/projects/spring/browse/RCP-376 >> Project: Spring Framework Rich Client Project >> Type: Bug > >> Versions: 0.1.0 >> Reporter: Ryan Sonnek > >> My action command executor extends the ApplicationWindowAwareCommand, yet when I run the command, I get a null pointer exception. >> how does the application window get initialized on my object? >> public class ApplicationWindowProgressMonitorActionCommandExecutor extends ApplicationWindowAwareCommand implements ActionCommandExecutor { >> private final ParameterizableActionCommandExecutor delegate; >> public ApplicationWindowProgressMonitorActionCommandExecutor(ParameterizableActionCommandExecutor delegate) { >> this.delegate = delegate; >> } >> protected void doExecuteCommand() { >> BusyIndicator.showAt(getApplicationWindow().getControl()); >> getProgressMonitor().taskStarted(getText(), StatusBar.UNKNOWN); >> delegate.execute(getParameters()); >> BusyIndicator.clearAt(getApplicationWindow().getControl()); >> getProgressMonitor().done(); >> } >> private ProgressMonitor getProgressMonitor() { >> return getApplicationWindow().getStatusBar().getProgressMonitor(); >> } >> } > |
|
From: Thomas R. C. <co...@sa...> - 2006-07-03 00:27:41
|
On Saturday, 01 July 2006 10:24 am, Rogan Dawes escreveu: > Ryan Sonnek (JIRA) wrote: > > [ > > http://opensource.atlassian.com/projects/spring/browse/RCP-376?page=comme > >nts#action_18351 ] > > > > Ryan Sonnek commented on RCP-376: > > --------------------------------- > > > > looks like the LifecycleAdvisor is supposed to initialize this field. > > > > is it true that *only* commands declared in the > > windowCommandBarDefinitions get the application window set on them? > > Yes, I think so. ISTR that there is a special type of > BeanFactory/Context that registers a BeanPostProcessor that is > responsible for setting the current ApplicationWindow. Trace the code, > and see how it is done. You should find it without too much difficulty, > as an inner class somewhere. > > This is one of the reasons that I'm not too happy about the way that > commands are constructed. I was trying to construct a globally > consistent ToggleCommand (i.e. I could define it in one place, and have > it keep all its menuitems, togglebuttons, etc up to date, regardless of > how many windows were opened) > > What it is doing makes sense in a way (creating new commands for each > window, and letting each command know which window it relates to), but > there seems to be no way to define a single globally-consistent > ToggleCommand using this scheme. > > Theoretically, one should create such globally-applicable in the > application context; however, doing this doesn't let the command get > auto-configured with message labels, etc. If I could solve this problem, > I think I'd be happy enough with the way that things are done currently. > I don't know if this deals with what you are talking about, but I declare a list of "otherCommands" in my xml files and then in my lifecycle advisor do this: public void initializeOtherCommandGroups() { // // Only want to do this once, I think. // if ( _loggedIn ) { return; } Iterator iter = _commandGroups.iterator(); String commandGroup; while ( iter.hasNext() ) { commandGroup = (String) iter.next(); getCommandGroup( commandGroup ); } } That gets them all initialized properly. Actually, I have a list of other command groups, other tool bars, or just a list of miscellaneous commands that I want to use. |
|
From: Ryan S. (JIRA) <no...@at...> - 2006-07-01 15:10:57
|
[ http://opensource.atlassian.com/projects/spring/browse/RCP-376?page=comments#action_18352 ] Ryan Sonnek commented on RCP-376: --------------------------------- yep, it only works when my life cycle advisor has the commands in the windowCommandBarDefinitions file. This is a definate issue for me, since i'm declaring "reusable" commands in one xml file and "specific application" commands in another. besides that, it's very confusing why implementing the interface *only* works when it's in the file. can we apply this functionality to the complete bean context instead? > null application window > ----------------------- > > Key: RCP-376 > URL: http://opensource.atlassian.com/projects/spring/browse/RCP-376 > Project: Spring Framework Rich Client Project > Type: Bug > Versions: 0.1.0 > Reporter: Ryan Sonnek > > My action command executor extends the ApplicationWindowAwareCommand, yet when I run the command, I get a null pointer exception. > how does the application window get initialized on my object? > public class ApplicationWindowProgressMonitorActionCommandExecutor extends ApplicationWindowAwareCommand implements ActionCommandExecutor { > private final ParameterizableActionCommandExecutor delegate; > public ApplicationWindowProgressMonitorActionCommandExecutor(ParameterizableActionCommandExecutor delegate) { > this.delegate = delegate; > } > protected void doExecuteCommand() { > BusyIndicator.showAt(getApplicationWindow().getControl()); > getProgressMonitor().taskStarted(getText(), StatusBar.UNKNOWN); > delegate.execute(getParameters()); > BusyIndicator.clearAt(getApplicationWindow().getControl()); > getProgressMonitor().done(); > } > private ProgressMonitor getProgressMonitor() { > return getApplicationWindow().getStatusBar().getProgressMonitor(); > } > } -- 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: Jan H. (JIRA) <no...@sp...> - 2008-03-04 07:32:06
|
[ http://jira.springframework.org/browse/RCP-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_32772 ]
Jan Hoskens commented on RCP-376:
---------------------------------
This is a direct consequence of the fact that multiple applicationwindows can exist. This was fixed by having the commands.xml parsed anew on each creation of a new window. Commands needing the applicationwindow would then get the correct applicationwindow injected because of their separated commands context. Note that using the applicationWindowAware interface on any object outside of the commands.context won't work.
Currently these are the possible solutions I can think of:
1) remove the applicationWindowAware interface. Always use the Application.getInstance().getActiveWindow(). Any object needing the window can get the active one at that time. No multiple instances needed.
2) add something like an ApplicationWindowScope that instantiates the object again with the correct window. Note that we'll have multiple instances and that each instance should be kept in a kind of 'session' of the ApplicationWindow so that it can be created/retrieved correctly by the scope. When an object implementing the ApplicationWindowAware interface is needed, the scope looks in the ApplicationWindow 'session' to see if an object with that id already exists, if not one is created and returned, otherwise the object found is returned.
Currently I tend to lean towards 1) as this seems the easiest way: no need for multiple instances, no need for a 'session' storage at applicationWindow level. Note that even with the ApplicationWindowScope a call to getActiveWindow() is probably needed. I'll let this thought ripe for another day before I actually make the changes.
> null application window
> -----------------------
>
> Key: RCP-376
> URL: http://jira.springframework.org/browse/RCP-376
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Affects Versions: 0.1.0
> Reporter: Ryan Sonnek
>
> My action command executor extends the ApplicationWindowAwareCommand, yet when I run the command, I get a null pointer exception.
> how does the application window get initialized on my object?
> public class ApplicationWindowProgressMonitorActionCommandExecutor extends ApplicationWindowAwareCommand implements ActionCommandExecutor {
> private final ParameterizableActionCommandExecutor delegate;
> public ApplicationWindowProgressMonitorActionCommandExecutor(ParameterizableActionCommandExecutor delegate) {
> this.delegate = delegate;
> }
> protected void doExecuteCommand() {
> BusyIndicator.showAt(getApplicationWindow().getControl());
> getProgressMonitor().taskStarted(getText(), StatusBar.UNKNOWN);
> delegate.execute(getParameters());
> BusyIndicator.clearAt(getApplicationWindow().getControl());
> getProgressMonitor().done();
> }
> private ProgressMonitor getProgressMonitor() {
> return getApplicationWindow().getStatusBar().getProgressMonitor();
> }
> }
--
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
|
|
From: Jan H. (JIRA) <no...@sp...> - 2008-03-17 13:59:06
|
[ http://jira.springframework.org/browse/RCP-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_33409 ]
Jan Hoskens commented on RCP-376:
---------------------------------
The current codebase needs a refactoring before any solid solution can be implemented:
http://www.nabble.com/ApplicationWindowAware---commands-context-to16055490.html
We'll probably fix this in Spring Desktop where we have the opportunity to do the refactoring. As mentioned, in some cases you can use a workaround by getting the current window through the Application instance for now.
> null application window
> -----------------------
>
> Key: RCP-376
> URL: http://jira.springframework.org/browse/RCP-376
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Affects Versions: 0.1.0
> Reporter: Ryan Sonnek
>
> My action command executor extends the ApplicationWindowAwareCommand, yet when I run the command, I get a null pointer exception.
> how does the application window get initialized on my object?
> public class ApplicationWindowProgressMonitorActionCommandExecutor extends ApplicationWindowAwareCommand implements ActionCommandExecutor {
> private final ParameterizableActionCommandExecutor delegate;
> public ApplicationWindowProgressMonitorActionCommandExecutor(ParameterizableActionCommandExecutor delegate) {
> this.delegate = delegate;
> }
> protected void doExecuteCommand() {
> BusyIndicator.showAt(getApplicationWindow().getControl());
> getProgressMonitor().taskStarted(getText(), StatusBar.UNKNOWN);
> delegate.execute(getParameters());
> BusyIndicator.clearAt(getApplicationWindow().getControl());
> getProgressMonitor().done();
> }
> private ProgressMonitor getProgressMonitor() {
> return getApplicationWindow().getStatusBar().getProgressMonitor();
> }
> }
--
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
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2008-10-09 20:09:22
|
[ http://jira.springframework.org/browse/RCP-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo resolved RCP-376.
------------------------------
Resolution: Won't Fix
> null application window
> -----------------------
>
> Key: RCP-376
> URL: http://jira.springframework.org/browse/RCP-376
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Affects Versions: 0.1.0
> Reporter: Ryan Sonnek
>
> My action command executor extends the ApplicationWindowAwareCommand, yet when I run the command, I get a null pointer exception.
> how does the application window get initialized on my object?
> public class ApplicationWindowProgressMonitorActionCommandExecutor extends ApplicationWindowAwareCommand implements ActionCommandExecutor {
> private final ParameterizableActionCommandExecutor delegate;
> public ApplicationWindowProgressMonitorActionCommandExecutor(ParameterizableActionCommandExecutor delegate) {
> this.delegate = delegate;
> }
> protected void doExecuteCommand() {
> BusyIndicator.showAt(getApplicationWindow().getControl());
> getProgressMonitor().taskStarted(getText(), StatusBar.UNKNOWN);
> delegate.execute(getParameters());
> BusyIndicator.clearAt(getApplicationWindow().getControl());
> getProgressMonitor().done();
> }
> private ProgressMonitor getProgressMonitor() {
> return getApplicationWindow().getStatusBar().getProgressMonitor();
> }
> }
--
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
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2008-10-09 20:09:23
|
[ http://jira.springframework.org/browse/RCP-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo updated RCP-376:
-----------------------------
Fix Version/s: 1.0.2
> null application window
> -----------------------
>
> Key: RCP-376
> URL: http://jira.springframework.org/browse/RCP-376
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Affects Versions: 0.1.0
> Reporter: Ryan Sonnek
> Fix For: 1.0.2
>
>
> My action command executor extends the ApplicationWindowAwareCommand, yet when I run the command, I get a null pointer exception.
> how does the application window get initialized on my object?
> public class ApplicationWindowProgressMonitorActionCommandExecutor extends ApplicationWindowAwareCommand implements ActionCommandExecutor {
> private final ParameterizableActionCommandExecutor delegate;
> public ApplicationWindowProgressMonitorActionCommandExecutor(ParameterizableActionCommandExecutor delegate) {
> this.delegate = delegate;
> }
> protected void doExecuteCommand() {
> BusyIndicator.showAt(getApplicationWindow().getControl());
> getProgressMonitor().taskStarted(getText(), StatusBar.UNKNOWN);
> delegate.execute(getParameters());
> BusyIndicator.clearAt(getApplicationWindow().getControl());
> getProgressMonitor().done();
> }
> private ProgressMonitor getProgressMonitor() {
> return getApplicationWindow().getStatusBar().getProgressMonitor();
> }
> }
--
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
|