Eclipse - SPLessons

Eclipse Creating An External Tool

Home > Lesson > Chapter 6
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Eclipse Creating An External Tool

Eclipse Creating An External Tool

 

shape Introduction

This chapter Eclipse Creating An External Tool demonstrate the use of creating an external tool in Eclipse. The External tools permit client to configure and run programs, Ant build files, batch files and others utilizing the Workbench and client can also save these external tool configurations and run them at a later time. Following are the concepts covered.
  • External Tools
  • Creating an External Tool

External Tools

shape Description

The External tools are known as some applications or scripts which are basically used for development environment extensions. The end users are allowed to do a standard level of integration for a non-eclipse-aware tool without writing code for a plug-in by using the external tools. The External Tools might be utilized to deploy the application, script the package and to run an external compiler on source files. External tools are created and configured using the following method as mentioned. Run -> External tools -> External Tools configuration or can also be run using the drop-down menu on the Run button provided in Toolbar by default. The External tools are mainly used in a project building process and are run in the specified order whenever the project is built. The table below demonstrate various available variables for configuring an external tool.
Variables Description
${workspace_loc} Used to build the path between Eclipse workspace directory and system hard drive.
${Workspace_loc:} The variable define the path between stated resource and the system hard drive.
${project_loc} The variable define the path between currently choose resource project and the system hard drive.
${project_loc:} The variable define the path between stated resource project and the system hard drive.
${container_loc} The variable defines the path between currently choose resource parent folder or a project.
${container_loc:} The variable defines the path between the stated resource parent folder or a project and the system hard drive.
${resource_loc} The variable defines the path between choose resource and the system hard drive.
${resource_loc:} The variable defines the path between stated resource and the system hard drive.
${project_path} The variable defined as the path with respect to the workspace root of the presently choose resource project that being built when the external tool is keep running as a major part of build.
${container_path} The variable defined as the path with respect to the workspace root of the presently chosen resource parent folder or project.
${resource_path} The variable defined as the path with respect to the workspace root of the presently chosen resource.
${project_name} The variable define the name for the presently chosen project that being built when the external tool is keep running as a major part of build.
${container_name} The variable define the name for the chosen resource parent folder or a project.
${resource_name} The variable define the name for the presently chosen resource.
${build_type} The variable define as when the external tool run inside the build produces the incremental, auto or full values if run outside produces none.

Creating an External Tool

shape Description

There is no convenient way to jump to the file location on desk of the selected file in eclipse, the only way is to right click and select properties of that file to view the location. But user can quickly create an External Tool to overcome such situation using External tools menu. Follow the steps below in order to create an External tool that can easily make user to identify the file location on desk.

shape Step 1

Click drop-down arrow on External tool button and select the External Tools Configurations as shown in the image below.

shape Step 2

Now, the External Tool configurations window appears providing some options, select Program and click New Lunch configuration icon as shown in the image below. The window redirects and provide some setting options, give the name for the tool and Click Variables button under location section as shown in the image below.

shape Step 3

A window appears know as Select Variable provided with some list of variables, select environment variable (env_var) from the list and type SystemRoot in Argument space, this is the variable that defines on windows which takes user to the Windows directory, after doing all the required changes proceed by clicking ok button as shown in the image below.

shape Step 4

By clicking Ok button it puts in the correct curly braces and the colon, Add a slash and mention the file name to be wanted in the directory and in case of windows it would be like explorer.exe. Skip Working directory section, go to Arguments section and type /select, and click Variables under Arguments section as shown in the image below. Now, a window appears providing some list of variables select resource_loc variable and proceed by clicking OK button as shown in the image below. Click Apply button after performing all the required operations as shown in the image below. Now the command is done for tool.

shape Step 5

User do not have convenient access to use the created tool. So, in order to get access click Common menu in the same External Tools Configurations Windows and tick the check box External Tools and proceed by clicking Apply button and close the window as shown in the image below.

shape Step 6

In order to check the created tool, select any file from Package Explorer, open the file and click any were on the file in Editor’s window and follow the procedure as mentioned. Click External Tool drop-down arrow -> select show file in explorer as shown in the image below. Now, a popup window appears displaying the location of the file in local drive as shown in the image below.

Summary

shape Points

  • The External tools are mainly used for extending the development environment.
  • There are several variables in order to configure an External tool.
  • The Tools once created can be saved and edited later as per the need of user.