Revision as of 18:52, 25 March 2011 by Phejl (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

ExternalTools (draft)

Issuezilla: 35582

External tools feature should allow simple usage of external tools in the IDE. Tools are configurable by user and they can be invoked directly without leaving the IDE. If it is possible tools should be available in context menu too (suggest to place it under Tools, separated by JSeparator).


Configuration dialog

For the configuration there will be common configuration dialog where extrenal tools can be managed.


There are several possibilities where to store the configuration:

  • Preferences
  • does not establish API
  • hard or impossible to configure shortcuts
  • Whole JMenu has to be managed by the plugin
  • SFS
  • establishes API - known folder in SFS and common Action class handling the execution of the tool
  • shortcuts can be configured same way as it is done now
    <folder name="Menu">
        <folder name="Tools">

            <folder name="ExternalTools">
                <attr name="position" intvalue="1250"/>

                <file name="ExternalAction1.instance">
                    <attr name="instanceCreate" methodvalue="org.netbeans.api.exttools.createAction"/>
                    <attr name="position" intvalue="100"/>
                    <attr name="displayName" stringvalue="List Project Dir"/>
                    <attr name="executable" stringvalue="ls"/>
                    <attr name="arguments" stringvalue="${project_folder}"/>

    <folder name="Keymaps">
        <folder name="NetBeans">
            <file name="S-A-Left.shadow">
                <attr name="originalFile" stringvalue="Menu/Tools/ExternalTools/ExternalAction1.instance"/>


Edit dialog

Edit dialog allows configuration of the tool including:

  • Display name
  • Executable
  • Arguments

It could be extended to support:

  • Environment variables
  • Shortcut

Minor drawback of adding shortcut configuration directly into the dialog is the fact that shortcut would be configurable from two places (and there is no ui API for now afaik).


Even the first version needs to provide some predefined variables in order to be anything useful. These variables should cover at least:

  • Project directory
  • Edited/Selected file(s)

For full featured support there should be defined IDE wide variables as a concept (not just for libraries).


From DavidKonecny:

  • Eclipse has quite an exhausting list of variables you can use as arguments for external tool (see Arguments panel in Run Configurations). Might be inspirational to have a look at the list. Some of the variables if used will trigger an UI during external tool execution asking for a password/file/folder/text/etc. Very useful IMO.
  • NB has a concept of IDE Variables - a user defined variable pointing to a file/folder. These variables are stored in userdir in build.properties file. If there is ever a need to share definition of external tools between users than I would suggest to use IDE variables. At the moment IDE variables are used only on project classpath. There is also a custom JFileChooser which lets use specify how to reference to a file - via absolute path, relative path or variable based path. It should not be difficult to refactor it out of Ant module and use it by ExternalTools if needed.
  • just brainstorming: add possibility to define an External Tool in a project?
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo