When starting to copy the file and it's contents between the systems in this manual fashion, it seems like the first thing we'll need is the proper file name for the destination file. When we select the source file in the File List and examine the list menu we find a menu item named "copy name to clipboard". Let's try that.
If you open up a new Workspace (Use the World-->open..-->workspace menus) the contents of the clipboard can easily be examined by direct pasting. This is what I get:
steve@192.168.2.2/develop/squeak/3.5 tutorial/importer-support.released.cs
It's the whole path name. Too much information. We can imagine why having the full path would be useful, but it's not what we need. Let's see if we can figure out how to add a new menu item for just the file name portion getting copied.
At this point I recommend that we create a new project just to hold any code changes we develop to support enhancements to FileList.
Close the open FileLists. We can get them back later. From the World menu, select "open..." and then "morphic project". A new morphic project view will be created. It's name will be "unnamed1" again because we renamed the previous one with that name. Using the halo menu for that morph, move it to another location on the desktop. Give it a new name. I used "FileList-mods". Add a drop shadow for cosmetics. You should have this on your desktop:
Our strategy will be to modify the menu and write the supporting method, while the remote FileList browser is open. Use the World-->open.. menu and open up a "browser". The first list pane in the browser contains system categories. We can use that to help up find our class. Use the menu in that pane and perform a "find class...". When the prompter opens, type
FileList
and accept. Since there are several classes that have "FileList" in them, just select the one that is the exact class name match. You can also tell the "find" command you used to take the literal match of what you type by adding a period on the end. Like this:
FileList.
Only the exact match will be used by the Browser.
|
|
If you try the new menu item it will do the same thing as the other menu item did, of course. We haven't written the new method behavior yet. So let's go do it.
Here's the existing #copyName method. It should give us pretty good clues concerning what we want to do for a new #copyJustFileName method.
We can operate on a Morphic object directly and learn more about the value this instance variable holds. Just for experimentation, open up a new FileList. Select any local file, just to load this instance variable. I picked a relatively small text file.
Let's go write our new method, using the #copyName method as a guide.
We need to go back and ensure our new #copyJustFileName method is called by our service.
Continue to the next page of first FileList enhancement.
Back to the beginning of this example.