WOLips-Eclipse beginner mistakes and questions

Version 130.1 by Pascal Robert on 2007/06/20 04:21

This document tries to catch the errors that every beginner seems to have to go through before reaching Eclipse/WOLips nirvana. The path is narrow and slippery, but thou shalt be rewarded....

The first most common error:

Eclipse/WOLips does not run properly in java 1.4.2.

Run it using JavaVM1.5.

Only Way: 1.5.

One more time: 1.5

How to get eclipse running with Java1.5?

go to /Applications/Utilities/Java/J2SE 5.0/Java Preferences. Select J2SE5.0

JavaRunTimeApplicationSettings.png

The second most common error

I can not get help to start in my browser, things work flakey

Eclipse 3.2.2 is a big, big project. It uses lots of frameworks. Sometimes these frameworks are already in some way available in your environment, but they are old versions, that do not do the expected thing in Eclipse. I had the experience that the help did not start in the browser. If that happens to you, remove all the jars of which you are not sure why they are there in /Library/Java/Extensions. You do not have to remove things like frontbase.jar, postgresql.jar etc.

This is actually fixed in Eclipse 3.3 (Eclipse reads first it's own paths, and then the system paths), but WOLips does not support Eclipse3.3 yet.

The third most common error

WOLips does not behave like you describe. (Use nightly)

WOLips updates often. And although there is a stable version, the nightly version is where it's at. It is used in production by the wonderful people from MDimension who develop WOLips and other WebObjects developers. If something breaks in nightly, it gets fixed immediately. They depend on it themselves.

http://webobjects.mdimension.com/wolips/nightly/ should be in your Eclipse update site, under Help->Software Update->Find and install->Search for new features to install

The fourth most common error

I can not install the projects I built, the WOLips install does not work, strange things happen. (be admin)

Allthough we all know that we should not run as admin, for installing Eclipse you'd better be. If you have installed Eclipse on one of the common places, or it has been installed for you, than the permission from the Eclipse folder will prevent you to install WOLips and other plugins. Make sure that, if you are installing plugins, You are allowed to do so.

More admin problems

If installing your frameworks does not work, than it might be that you are running as a plain user, not admin user. The WOLips ant install by default tries to install in /Library/Frameworks, and Apps in /Library/WebObjects/JavaApplications. As a plain user you should not have permission to write there.

User questions

Why don't I see all my files?

Not all the files are presented, some are filtered away. In Package Explorer (In WOLips pespective, the upper left window), go to the right corner of that window, there is a caret. Under this caret, there is a Filter option.Click on it to see what get's filtered away.

filters.png

As you can see, quite a lot of files are excluded from the view.

FilterProperties.png

Where did all my code go?

Suppose you suddenly ended up with something like this:

StrangePerspective1.png

Or this:

StrangePerspective2.png

Most of the times this is caused by inadvertently clicking on the menu-bar of the subwindow. That window will then fill the whole workspace.Clicking the menubar one more time will restore the view.

Or it is happened because your perspective has changed inadertently, because you clicked on a file that caused another perspective to be fired up (like Entitymodeler) You can go to the top right, where there is a place where the currently loaded perspectives are located. Choose WOLips again. You're done.

chooseperspective.png

I have the right perspective, but it is all screwed up.

That happens. A lot, if you are inexperienced. And even if you are experienced. Eclipse does some things inadvertently, and as it does not conform to the Apple Interface guidelines, you might press something that has an other effect in Eclipse.

Do not worry: there is a menu button, Windown->Reset Perspective that will give you the original settings back.

Which file from which project am I editing?

If you open a lot of projects at the same time, you'll sometime find yourself editing a few Session.java or localizable.strings files at the same time. How can you see which file from what project you are editing? There is a simple trick for that: in the Package Explorer window, click on the icon with the two arrows on it. From now on, if you select another file in the editor window, you'll be directed to that file in the project in Package Explorer.

SeeFileinProject.png

Another app is running than I expected:

Running an app works a bit different from running an app in XCode.

Normally you select the project in the Package Explorer, goto to the contextual menu (via right click), then click Run WOApplication. you can also go to the Run menu. Or to the Run icon.

Don't suppose you are running the app you are running because you selected the project and pressed the run button in the toolbar. It will run the last application you have run, no matter what you have selected in the package explorer. You have to do a "run as", select your program and then you might get your app.

I want to run my app with some other arguments.

The way eclipse works, it saves a set of arguments in which your app has run. This set of arguments have some default settings, depending on which type of application you are running. You can save these arguments in your project, for later use.

Changing the Launch arguments:

Select Project in Package Explorer, from menu choose Run->Run... , from contextual menu choose Run As->Run

LaunchArgs1.png

You'll get into the create,manage and run configurations window. If there are any launch configurations available in your projects, you will already see them here. If there aren't any, a new one will be created.

Normally the proper settings for a WOApplication are all in place, if you have created the application from the contextual menu. See the tutorials.

By default these settings are stored in the workspace, not in the project. If you want to store them in the project, you have to change the settings under the "Common" tab, from "local" file to "shared file", and you can save it then in your project for future use.

Launchsaving.png

I want to open EntityModeler in a new window, so it does not get in the way of WOLips

There is a setting in the WOLips preferences, which will get your EOModel started in a separate EntityModelere window:

OpenEntityModelerInNewWindowAnnot.png

I see all that magic typing with code completion going on. How do you do that?

The shortcut is CMD-space on the Mac, by default. It is also known as contextual assist.

Actually, it is real magic. The trick is that it works in a contextual way. So the program knows what kind code can be expected where. For instance, if you are inside the bindings of a WOComponent, it will know which bindings are there. Just press CMD-Space, and you will get the possible endings.

ContextualContentAssist.png

Which shortcuts are available?

I don't know. It depends on the plugins you are running. Fortunately, there is a shortcut to end all shortcuts:

cmd-shift-l= show the shortcuts in a popup-window. Pressing cmd-shift-l one more time will show you all the shortcuts via the preferences.

Some general Eclipse shortcuts:

cmd-1 = Quickfix: suggest you a fix for your errror
cmd-e = quick switch to other open documents
cmd-space = completion, also known as content assist. This one screws up with the standard settings for Spotlight, which are also cmd-space. Some have tried to move cmd-space to something else in Eclipse, but that does not seems to be picked up everywhere. Better replace Spotlight to something else.

Some shortcuts that are available from WOLips (gracefully donated by Mike Schrag):

Ten ShortCut Commandments for Mike:
cmd-shift-t = open type
cmd-shift-r = open resource
cmd-shift-o = auto-import
cmd-opt-r = refactor rename (global)
cmd-2 r = refactor local rename
cmd-opt-1 / 2 / 3 = switch between java/wod/html
cmd-o = in-place outline view
cmd-o o = include superclass
cmd-shift-g = show references
F3 = go to declaration

Another nice overview of shortcuts that Edgar Klein sent me can be found here: http://eclipse-tools.sourceforge.net/Keyboard_shortcuts_(3.0).pdf. It can be even printed out on one double page, so you can put it above your bed.

I have the choice of doing a WOApplication or a WOnderApplication, which one should I use ?

Even if it's got "Wonder" in it's name, "WOnderApplication" and "WOnderFramework" don't include any Wonder related stuff in the project, it's just a different project layout than the other two.  The Wonder layouts will become the only layout in the future, so use those.