Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Multiple ApplicationWindow-instances?
Multiple ApplicationWindow-instances? [message #654425] Tue, 15 February 2011 17:24 Go to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: March 2010
Junior Member
Hi
I'm developing a JFace application using the ApplicationWindow class as the main entrypoint. Now I want to support multiple instances of my application(window) within one JVM. Is this possible with the ApplicationWindow? My experiments ended with UI-thread/-events problems.
Re: Multiple ApplicationWindow-instances? [message #654441 is a reply to message #654425] Tue, 15 February 2011 19:30 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 02/15/2011 12:24 PM, gattacus@gmail.com wrote:
> Hi I'm developing a JFace application using the ApplicationWindow class
> as the main entrypoint. Now I want to support multiple instances of my
> application(window) within one JVM. Is this possible with the
> ApplicationWindow? My experiments ended with UI-thread/-events problems.

You can create multiple ApplicationWindows if you want.

The pattern would be:

void main(String[] args) {
create display
create and open app window 1
create and open app window 2
run display loop
}

How did you get off the UI thread? Or did you setBlockOnOpen(*) on your
windows?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Multiple ApplicationWindow-instances? [message #654451 is a reply to message #654425] Tue, 15 February 2011 20:30 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: March 2010
Junior Member
yes, I am using setBlockOnOpen(true). My idea was to have each instance in its own threadgroup. This would make it possible to get the instance from within other (associated) components by using static getInstance(). the singleton pattern is heavily used and a problem in the multiple-window case. so I am looking for a way to circumvent the issue. Any other idea?
Re: Multiple ApplicationWindow-instances? [message #654491 is a reply to message #654425] Wed, 16 February 2011 02:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: quincy.cs.gmail.com

I found it very easy to do it with rcp. Any reason not to use rcp?

Quincy Mitchell

wrote in message news:ijecgr$mtg$1@news.eclipse.org...

Hi
I'm developing a JFace application using the ApplicationWindow class as the
main entrypoint. Now I want to support multiple instances of my
application(window) within one JVM. Is this possible with the
ApplicationWindow? My experiments ended with UI-thread/-events problems.
Re: Multiple ApplicationWindow-instances? [message #654636 is a reply to message #654491] Wed, 16 February 2011 14:36 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: March 2010
Junior Member
Eclipse User wrote on Tue, 15 February 2011 21:31
Originally posted by: quincy.cs.gmail.com

I found it very easy to do it with rcp. Any reason not to use rcp?


several: big footprint, does not conform to my user experience vision and switching would cause a lot of work.
Re: Multiple ApplicationWindow-instances? [message #654677 is a reply to message #654451] Wed, 16 February 2011 16:00 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 02/15/2011 03:30 PM, gattacus@gmail.com wrote:
> yes, I am using setBlockOnOpen(true). My idea was to have each instance
> in its own threadgroup. This would make it possible to get the instance
> from within other (associated) components by using static getInstance().

You cannot do that. SWT, like AWT, runs in a single UI thread.

You need to create and open one or more windows, and then run the
display loop.

You can use WindowManager to keep track of your multiple windows, even
to group them and close them together.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:TableViewer use case
Next Topic:examples of cut/copy/paste of domain objects in TableViewer
Goto Forum:
  


Current Time: Fri Mar 29 11:13:17 GMT 2024

Powered by FUDForum. Page generated in 0.02854 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top