Komodo Tour

 

Table of Contents

Part 1: The Toolbox

In the first part of the tour you will:

Opening a File in the Editor Pane

Begin your tour of Komodo by opening the Perl file you will use in a later example. If K2.5_Tour.kpf has been opened on the Projects tab, you are ready to open the StockQuote_snippet.pl file.

  • On the Projects tab, double-click the StockQuote_snippet.pl file to open it in the Editor Pane. Alternatively, you can right-click the file on the Projects tab and select Open File from the context menu.

View Example

Top

Adding a Snippet to the Toolbox

If there are sections of code that you frequently add to your programs, they can be saved as code snippets in the Toolbox. To add a snippet to the Toolbox:

  1. Position the cursor anywhere in the Editor Pane.
  2. Select Edit|Select All.
  3. Right-click the selected code, and select Add as snippet in the Toolbox from the Editor Pane context menu. The snippet will be displayed on the Toolbox tab.

View Example

Top

Renaming a Snippet

Notice that, by default, the snippet that you just added to the Toolbox has automatically derived a name from portions of the code itself. It is a good idea, however, to give your code snippets more meaningful names, so that they will be easier to find the next time you want to use them. To rename a snippet:

  1. Right-click the snippet on the Toolbox tab, and select Rename from the Toolbox context menu. The Rename Item dialog box will be displayed.
  2. In the Item Name field, type "Stock Quote Code", and click OK.

View Example

Top

Assigning a Key Binding to a Snippet

Once you have saved a snippet or another type of item in the Toolbox, you have the option of assigning keyboard shortcuts that invoke these items. These can be particularly useful if, for example, you have a code snippet that you plan to insert often. To assign a key binding to a snippet:

  1. On the Toolbox tab, right-click the "Stock Quote Code" snippet, and select Properties.
  2. Click the Key Binding tab.
  3. Position the cursor in the New Key Sequence field, and, while holding down the ALT key, press the "S" key. "Alt+S" will now be displayed.
  4. Click Add. The key binding will be added to the Current Key Sequence field.
  5. Click OK to save the new key binding.

View Example

Top

Adding a URL to the Toolbox

A URL is another type of item that you can store in the Toolbox. After a URL has been added to the Toolbox, you can simply double-click it to navigate to the associated Web page. You will now add the XMethods Web services listing site to the Toolbox in preparation for the next topic in the tour, "Adding a Web Service to the Toolbox".

  1. Select Toolbox|Add|New URL.
  2. Replace the text "New URL" with "XMethods".
  3. In the Value field, enter "www.xmethods.com", and Click OK. A link to the XMethods home page will now be displayed on the Toolbox tab.

View Example

Top

Adding a Web Service to the Toolbox

When you add a Web service bookmark, a link to a Web service on the Internet is created. The advantage of storing Web service bookmarks in the Toolbox is that you can quickly and easily add a Web service reference to a program. Although you can also add Web services using the Project Manager, in this example you will add a Web service to the Toolbox using the URL link created in the previous example.

Note: to use Web services with Perl, ActivePerl must be installed on your system.

To add the Web service to the Toolbox:

  1. On the Toolbox tab, double-click the XMethods link. The XMethods home page will be displayed in your default browser.
  2. Scroll down to the "XMethods Demo Services" section of the page, and click the "Delayed Stock Quote" Web service. A link to the Delayed Stock Quote WSDL file will be displayed, highlighted in yellow.
  3. Click the WSDL link to display a page containing the XML for the "Delayed Stock Quote" Web service.
  4. In your browser's address field, select the URL and copy it.
  5. Return to Komodo, select Toolbox|Add|New Web Service. The Web Services dialog box will be displayed.
  6. In the URL field, paste the URL that you copied from your browser, and click Suggest. The other fields in the dialog box will be automatically updated.
  7. In the Name field, change the text to "Delayed Stock Quote Web Service", and, in the Object Name field, change the text to "StockQuoteService" (the second entry must be exactly as it appears here because code used later in the tour will depend on it). Click OK. The new Web service bookmark will be displayed on the Toolbox tab.

View Example

Top

Getting Help For a Web Service

You can quickly get help for a Web service using the Toolbox's Service Help feature.

  • On the Toolbox tab, right-click the Web service bookmark, and select Service Help. A reference page for the Web service will open in the Editor Pane.

View Example

Top
Top Previous Next