This question is answered.


Permlink Replies: 9 - Pages: 1 - Last Post: 28-Feb-2018 16:30 Last Post By: jGromit Threads: [ Previous | Next ]
ctwist

Posts: 1,517
Registered: 27-Sep-2003
Add a tool to the menu
Posted: 27-Feb-2018 14:32
 
  Click to reply to this thread Reply
I have written a tool which is in a jar file renamed to .jaext. This is in the config/ext folder.

This code adds the extension to the Tools menu. How can I add it to the "Tools / External Tools" menu instead?
public class SettingsConverterPlugin implements JAlbumPlugin
{
  private PluginContext context;
 
  public void init(PluginContext pPluginContext)
  { this.context = pPluginContext;
    JAlbumContext vJAlbumContext = context.getJAlbumContext();
    JMenuItem vMenuItem = new JMenuItem("<html>Settings Converter</html>");
    vMenuItem.addActionListener(new ActionListener()
    { public void actionPerformed(ActionEvent e)
      {	new PluginUI(vJAlbumContext.getEngine());
      }
    });
    context.addToolsMenuItem(vMenuItem);
  }


Edited by: ctwist on 27-Feb-2018 14:58
Moved from external tools. I just noticed that I am not supposed to ask questions there.
jGromit

Posts: 31,888
Registered: 31-Jan-2006
Re: Add a tool to the menu
Posted: 27-Feb-2018 21:01   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
Not sure about the underlying reason, but all of the entries on the External tools list are in the tools subdirectory (either program or user config), and they're all .bsh scripts. The Tools menu items, on the other hand, are all in ext, and they're all compiled Java. I suspect this is not just a coincidence. ;)
ctwist

Posts: 1,517
Registered: 27-Sep-2003
Re: Add a tool to the menu
Posted: 27-Feb-2018 22:34   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I noticed that as well. I couldn't make sense of it.
ctwist

Posts: 1,517
Registered: 27-Sep-2003
Re: Add a tool to the menu
Posted: 28-Feb-2018 01:33   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I suggest this as a distinction.

Tool:
  • A tool that is provided and/or endorsed by jAlbum.
  • It is either included in jAlbum or it is available for download from jAlbum.
  • Supported by jAlbum, either directly or through a trusted developer.
  • Available in the "Tools" menu.

External Tool:
  • A tool that is provided by any user, but is not officially endorsed as "part of jAlbum".
  • It may or may not be integrated with jAlbum.
  • It could be a third-party tool that is completely disconnected from jAlbum.
  • It may only be intended for a specific skin or operating system.
  • If it doesn't work, it may or may not get fixed.
  • Available in the "Tools/External Tools" menu.

Any tool can be written in BeanShell or compiled Java or JavaScript, or whatever languages are supported in the future. The programming language is not a factor in distinguishing a tool from an external tool.

Edited by: ctwist on 27-Feb-2018 21:56
Added: Available in the "Tools/External Tools" menu.
davidekholm

Posts: 21,759
Registered: 18-Oct-2002
Re: Add a tool to the menu
Posted: 28-Feb-2018 16:12   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
External tools can be written in JavaScript too and still goes inside the "tools" folder so it's not about the language. Scripted stuff (BeanShell or JavaScript goes inside the tools folder while ".jaext" and ".jar" files having code implementing the JAlbumPlugin interface goes into the "ext" folder ("extension"). -Yes I agree there is potential for confusion with all these synonyms (extension/plugin/tool). We've made various ways to extend jAlbum over the years hoping that one of these will go viral ;-)
ctwist

Posts: 1,517
Registered: 27-Sep-2003
Re: Add a tool to the menu
Posted: 28-Feb-2018 16:20   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
OK but back to my original question, shouldn't my jaext tool be in the "Tools / External Tools" menu?
davidekholm

Posts: 21,759
Registered: 18-Oct-2002
Re: Add a tool to the menu
Posted: 28-Feb-2018 16:24   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
OK but back to my original question, shouldn't my jaext tool be in the "Tools / External Tools" menu?

It actually usually appears straight under the Tools menu. I once added it to Tools->Extensions, but I believe it upset a number of jAlbum users (André?) to have them buried "so deep". These ".jaext" (jAlbum Extensions) can appear in various locations in jAlbum's user interface depending on what install method you call.
davidekholm

Posts: 21,759
Registered: 18-Oct-2002
Re: Add a tool to the menu
Posted: 28-Feb-2018 16:25   in response to: ctwist in response to: ctwist
Correct
  Click to reply to this thread Reply
ctwist wrote:
OK but back to my original question, shouldn't my jaext tool be in the "Tools / External Tools" menu?

That menu only lists the contents of jAlbum's "tools" sub folders and is reserved for scripts that don't install themselves as tightly into jAlbum's UI as the jAlbum Extensions you put in the "ext" folder.
ctwist

Posts: 1,517
Registered: 27-Sep-2003
Re: Add a tool to the menu
Posted: 28-Feb-2018 16:28   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
OK, I don't need to change anything.
jGromit

Posts: 31,888
Registered: 31-Jan-2006
Re: Add a tool to the menu
Posted: 28-Feb-2018 16:30   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
And the External tools menu is getting pretty long, even without any user-installed tools. In fact, I wonder if they're all accessible on a small display.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums