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 12:24 Go to next message
No real name is currently offline No real name
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 14:30 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
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 15:30 Go to previous messageGo to next message
No real name is currently offline No real name
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] Tue, 15 February 2011 21:31 Go to previous messageGo to next message
Eclipse User
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 09:36 Go to previous messageGo to next message
No real name is currently offline No real name
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 11:00 Go to previous message
Paul Webster is currently offline Paul Webster
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:examples of cut/copy/paste of domain objects in TableViewer
Next Topic:Bind selected Observable to TreeViewer
Goto Forum:
  


Current Time: Sat Aug 30 04:44:38 EDT 2014

Powered by FUDForum. Page generated in 0.02026 seconds