tags:

views:

73

answers:

2

I am working on a program that acts as a launcher for other programs. It is possible that there could be 20+ windows displayed when started. I would like someway of specifying which workspace the program opens on, while it is already possible to start the program on a certain workspace, I need a list of the available workspaces in my launcher for the user to choose from and then to pass as a command line argument to the processes when they are started. Is this possible? If it makes any difference, it is on the Java Desktop Environment.

If it is not possible in Java then is it possible in some other language? I could then run that from Java and use its output to produce the list.

A: 

Generic answer: look at the code that's responsible to start the program on a certain workspace. Look at the API docs of the classes used by that code - you have a good chance of finding what you're looking for there. It will probably be a JDE-specific class, since I don't think the Java standard API has the concept of workspaces at all.

Michael Borgwardt
I have just found that that code doesn't work anymore either. It was written ages ago when we still used the Common Desktop Environment, I loaded that up again it worked but doesn't in JDE. Looks like I'm back to square one.
Android
+1  A: 

That's not going to be easy. You'll probably need to find a C program that does what you want then translate all the calls to JNI. You might look around for a java library that already does the JNI for you--but then you are at the mercy of the library developers. I'd rather own this kind of thing in-house.

Also, in general, that's the kind of thing that should be doable through the configuration of your window manager--no coding involved at all. Perhaps if you could find the right config file, you could just open it, write a line out telling it where to place your app then close it again.

Bill K