ExternalTools

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).

image:menu_ExternalTools.png

Configuration dialog

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

image:configuration_ExternalTools.png

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
<filesystem>
   
    <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}"/>
                </file>
            </folder>
        </folder>
    </folder>

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

</filesystem>

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).

image:edit_ExternalTools.png

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).


Comments/ideas

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