Part 1: The Toolbox
In the first part of the tour you will:
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
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:
- Position the cursor anywhere in the Editor Pane.
- Select Edit|Select All.
- 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
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:
- Right-click the snippet on the Toolbox tab, and select
Rename from the Toolbox context menu. The Rename Item dialog
box will be displayed.
- In the Item Name field, type "Stock Quote Code", and click
OK.
View
Example
Top
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:
- On the Toolbox tab, right-click the "Stock Quote Code" snippet,
and select Properties.
- Click the Key Binding tab.
- 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.
- Click Add. The key binding will be added to the
Current Key Sequence field.
- Click OK to save the new key binding.
View
Example
Top
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".
- Select Toolbox|Add|New URL.
- Replace the text "New URL" with "XMethods".
- 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
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:
- On the Toolbox tab, double-click the XMethods link. The XMethods home page
will be displayed in your default browser.
- 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.
- Click the WSDL link to display a page containing the XML for the "Delayed Stock Quote" Web
service.
- In your browser's address field, select the URL and copy it.
- Return to Komodo, select Toolbox|Add|New Web Service. The Web Services
dialog box will be displayed.
- 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.
- 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
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
|