Making a Windows Taskbar Jump-List in Java
Asked Answered
C

2

5

I know the following things, and was wondering if they can be combined to make Java use jump-lists in Windows:

  1. Windows displays Jump-Lists for supporting programs when a taskbar icon is right-clicked
  2. C++, C#, F#, and VB support this natively (as shown here)
  3. Java can import native capabilities using the JNA (as shown here)

Anybody have experience they can lend to help me create a jump-list for a Java app?

The J7Goodies library won't work, as it no longer exists.

Cunningham answered 23/9, 2010 at 20:26 Comment(4)
I don't I can help you any further than pointing you in the direction of bug no 293226 - bugs.eclipse.org/bugs/show_bug.cgi?id=293226 in Eclipse. The dependency tree for this parent bug would be a good place to start.Excusatory
that doesn't help me at all....Cunningham
See child bug 293229. I'm not sure if the code patch present in one of the posts will help, but it might be a good place to start.Excusatory
No, that seems to just be a bugfix for Eclipse, not actually dealing with jump-lists in Java.Cunningham
S
5

The word "natively" is overstating the case a bit. WPF provides jump list support. That's not the same as C# providing it. (For Windows Forms people there's the Code Pack which is a set of managed wrappers.) And MFC provides jump list support which is also not the same as C++ providing it. Anyway, there are two things going on here. One is adding files you opened recently to that jumplist, which under some circumstances you can get for free. The other is adding arbitrary files (typically starting point templates etc) to the jumplist.

To add a file to the recent/frequent list, you call SHAddToRecentDocs, though you may not have to if, for example, you use the Common File Dialog control to open files, and/or the user double-clicks files to launch your app and open them (you have the file type registered.) Lots of folks suggest calling it anyway to be on the safe side. To add any old thing to the jumplist see http://msdn.microsoft.com/en-us/library/dd378402(v=VS.85).aspx.

How to call those from Java, I forget, but I hope they get you started.

Shakiashaking answered 24/9, 2010 at 11:57 Comment(2)
Thanks for the help. It seems that the SWT does not have the exact method <code>SHAddToRecentDocs</code>. Is there any other way to do that?Cunningham
It's a Windows API function in Shell32.dll - so you want to use JNA or whatever the current "I need to call a native function of the underlying platform" mechanism is to call that function.Shakiashaking
F
2

There is a Java library providing the new Windows 7 features for Java. It's called J7Goodies by Strix Code. You can create your own jump lists with it.

Fronnia answered 2/12, 2010 at 14:46 Comment(5)
You have tried to use it without a valid license this is why it didn't work. You cannot use the library by taking it out of the demo app.Fronnia
well I am not paying over $200 to use my computer in a way in which I already can. Do you have any free alternatives?Cunningham
Sorry, I don't know about any alternative commercial or free.Fronnia
Resurrecting, is there any free alternative, now?Cunningham
I had to unaccept this answer, as it seems J7Goodies no longer exists :/Cunningham

© 2022 - 2024 — McMap. All rights reserved.