Second Enhancement to FileList


Review and Plan for next steps

So far we've tailored our Squeak environment, used FileList to peruse files on a remote site, used SUnit, and extended FileList to make it easier to copy file names. We also learned how to capture our edits in Squeak into a change set that can be shared with other Squeak developers.

But we also saw how inefficient the copying of files between the remote and local systems remains. Let's see what can be done about making it easier to copy files from a remote system to our local one.

We will take a look back at the FileList getting used to access a remote file and explore what we would like to accomplish to get the file easily copied to the local workstation.

We should also use SUnit to write the test first, before we write any new code in FileList.

Since we know we will be spending some time browsing code in Squeak, now would be a good time to deal with fixing those colors used when browsing source code when "colorPrint" is enabled. Since you already know about change sets, we should now install some change sets adding new features we want. I've already written a solution to the colors problem and published the code to the WWW. We can use Squeak directly to fetch that code and install it.

Adding some features from the World Wide Web

You can skip over this section if you do not want to make added changes to your Squeak environment. Skip ahead to the next page of second FileList enhancement.

Squeak has a web browser built-in. It's lightweight. It does not support tables, Cascading Style Sheets, JavaScript, and many other "modern" web browser features. But it can be used for our immediate needs. The built in web browser in Squeak is called "Scamper". Let's go through the steps of using Scamper to add some new code.

From the World-->open... menu choose "web browser".


In the pane where is says "browser:about", select that text and replace it with the following URL:
http://w3.one.net/~swessels/pages/steve/squeak/source/3.2/editTxtColors-sbw.cs
Press Enter and wait for Scamper to finish loading that page. You have typed in a direct link to a change set stored on a web site. For Squeak 3.5 we more than likely use SqueakMap. But since we're using Squeak 3.2 let's proceed by installing change sets using this technique.

Things get a little messy for us now since Scamper doesn't have provision for downloading and installing change sets this way. We'll have to do some manual operations to do this correctly.

Squeak follows another model for sharing code which we have not discussed. That model consists of actually sharing Projects inside Squeak on the WWW. It's a cool concept. But our immediate interest is in getting this specific change set installed.

After Scamper has opened the page containing the change set we want to install, we will copy it's contents to a local file and then "File-in to New" from that file. The first thing we will want is the name of the change set (to keep things consistent). You can drag across the URL showing in Scamper and just select and copy the change set name: "editTxtColors-sbw.cs".

If that technique doesn't work, here's a direct link to the change set.
http://w3.one.net/~swessels/pages/steve/squeak/source/3.2/editTxtColors-sbw.cs

Open up a new FileList. From the files pane on the right, choose "add new file" from the menu. When Squeak asks for the name of the new file, paste in the name of the change set. The lower contents pane in the FileList will be empty. Go back to Scamper and select all the contents of the lower pane (the change set contents). Copy the change set contents and paste it into the File List contents pane. Perform an "accept" in the File List contents pane. Choose to overwrite the existing file when prompted.

Close Scamper. You have now copied the change set into your local system. With the new change set file still selected in the File List, press the "File-in to New" button. This will cause the change set to be installed into your system.

The new code we just installed adds a new editor to Squeak that allows us to modify the colors and text attributes of our source code when browsing. To open the new editor paste this:

DialectStreamAttributesEditor open
in a Workspace window and execute the code. I changed the values and colors this way:

Close the editor.

Some more environment and tool tweaks

Using Scamper and the same technique as above, load this change set to add some features to the Squeak browser.

http://w3.one.net/~swessels/pages/steve/squeak/source/3.2/BrowserPaneVars-sbw.cs

This change set adds a feature of making the project view morphs have shadows automatically. It's controlled by an option in the Preferences.
http://w3.one.net/~swessels/pages/steve/squeak/source/3.2/ProjectViewShadow-sbw.cs

Ned Konz wrote a really nice enhancement for the TestRunner which I like. You install this a little differently than the others. Using Scamper, load this URL:
http://minnow.cc.gatech.edu/squeak/uploads/1547/TestRunnerEnh-nk.cs
Scamper will complain that it doesn't like the file type and ask where you want to download the file. Use "TestRunnerEnh-nk.cs" for the file name, save it, and then file it in like the others.

As a footnote, File List provides an option you may use before installing change sets you have obtained from other developers. If you select the candidate change list in the file list, the file list menu gives you an option to "browse code". This will analyze the change set and open up a File Contents Browser allowing you to review the code in the change set, and see how it differs from your current image before any code is actually installed.

Close the extra File List and Scamper browser.

Continue on to the next page of second FileList enhancement.

Back to the beginning of this example.

/source