Using Eclipse with orca
In this howto i will explain the installation, configuration and some basics of using eclipse with orca. Some more articles will follow soon explaining some special cases of using eclipse for example for plugin development and things like that. In this article i will just concentrate on using it for java development.
In general i have to say, that i could get eclipse only work properly with orca on a Ubuntu 8.04 (Hardy) machine. If you get it work on another system please leave some notes about how to do this right here.
1. Orca and AT
I suggest one has pulled the latest revisions of ATK, gail, at-spi and orca from svn and installed them properly as described on the "Orca donwload / install" page. At the time i wrote this article my orca version was 2.23.5. pre.
2. Java and Eclipse
In order to run eclipse one has to install the java development kit as of version 1.6. May be 1.5 is working as well, but i don't have tested this. And i think the jdk 1.6 will give you full support for eclipse.
Also install the latest java access bridge in ordr to get access to java applications. How to setup the jdk and the latest access bridge is shown on the "Orca /jabg" page.
To get eclipse installed simply run
sudo aptitude -y install eclipse-sdk
WARNING: it's not recommanded to use a package directly from eclipse.org because there might be some specail issues in the newer versions like gannimede to be done before running them in ubuntu.
3. Setting up your environment
In order to make eclipse work properly with orca set the JAVA_HOME variable. One can do this permanently by adding it to the /etc/bash.bashrc file. If you don't set this variable eclipse will use another jvm (java virtual machine) on which no access bridge is installed. So open the bash.bashrc file with your favorit editor, in this example i used nano:
sudo nano /etc/bash.bashrc
Move to the end of the file and add the following line:
Save and exit the file pressing Ctrl + X and confirming the yes no question if yu want to save and also leave the shown file name to save the file to - just hit enter. You will have to re-open the gnome-terminal for the change to take effect. Eclipse is looking for this variable at startup time and if it is set use the specified jvm.
Also one has to create a file called .eclipseextensions in /usr/local/lib/eclipse/ One can do this with the following commands:
sudo touch /usr/local/lib/eclipse/.eclipseextensions
sudo chmod 2775 /usr/local/lib/eclipse/.eclipseextensions
sudo chown root:staff /usr/local/lib/eclipse/.eclipseextensions
First start of eclipse
1. Workspace selection
I prefer to run eclipse from the command line to get more control of vm arguments and also eclipse start parameters. But before you run it the first time i suggest you to create a workspace in which meta data from eclipse is stored e.g.
Now you can run eclipse without any parameters just type:
At the first startup eclipse will show a dialog "Workspace selection". In this dialog, as you might have guessed, one can select his workspace. Focus will be in a text field displaying the path to the workspace. Eclipse is suggesting the path /home/<username>/workspace/
as default. You can tab to the "browse" button beside the text field to look for another workspace location. So enter or choose your workspace and press enter.
To prevent eclipse from asking at each startup for a workspace you have two possibillities:
- in the "select workspace" dialog there is a checkbox saying something like "use this as the default and do not ask again". If you check this your prefered workspace location will be stored and this dialog wount be displayed anymore.
- One can provide the workspace location as a parameter to eclipse by typing:
eclipse -data /path/to/your/workspace/
2. Simple Java Example to verify your installation
Let's create the old and famous "Hello World" example for test purpose:
- Select File menu (alt + F), new, Java project.
A wizard will show up asking for the settings for this project. First of all enter a name for this project. I named it HelloWorldExample. All the other values should be fine for this purpose. So just enter the name and press Enter to create the project.
- Step to the project in the package explorer by holding Ctrl and pressing F7 as often as needed to get to the package explorer.
Note: holding Ctrl + pressing F7 always displays the open views as a list and steps through it.
- Create a class by again selecting File, new, and now Class. Another wizard will shoow up to set the values of this class.
Enter a name for it like HelloWorldExample. Tab to the public static void main checkbox and check it to create a class containing a main method.
Tab on to the finish button and hit it.
- The newly created class will be displayed in the Editor. And it should allready have the focus. If not just put the focus to another view using Ctrl + F7 and than back to the Editor to refresh.
- Go into the main method and enter
- Save the file by pressing Ctrl + S.
- Now you can run it by selectin Run menu, run as, Java application. This can be done by selecting it from the menu or directly by pressing Alt + Shift + X and selecting Java application from the resulting list.
- The output will be send to the build in console. If it is currently not open just select the Window menu (Alt + W), show view, and Console from the resulting list. If it's open the console should get focus whenever an application is writing to standard out or standard err. (could be turned of via prefrences, run / debug, console)
1. General stuff
1.1. Disable heap status feature
One thing one should turn off when using with eclipse is, the "show heap status" feature. For this will (in big applications) change so often that orca wount read anything else than the heap status. But thats not good if one wants to see for example the console output. To prevent eclipse from doing this select the Window menu, Preferences, and tab to the tree of cattegories. Select "general" if not allready selected and tab on to the checkbox "show heap status" and deselect it. Afterward tab to the apply button and hit it and then hit the ok button.
1.2. Change browser view part
Eclipse is using an internal browser to display html content. For example the javadoc and other things like that. This browser view part is currently not accessible by orca. A possible work around is to set the default browser to firefox:
- Go to the Window menu (Alt + W) and there to the preferences entry.
- tab to the tree of categories and select general.
- open it by pressing + on the alphanumeric keyboard
- go down to the web browser entry and then tab to the radio button group
- here use internal browser will be selected by default
- cursor down to enable use external web browser
- tab on to the table of available web browsers and there the default system browser should be activated allready
- hit apply and than ok to save your settings.
NOTE: this work around gives me some javadoc in readable output but not everything. I am currently looking for a way to implement a plugin, which will present the content which is send to the browser in a format that is fully readable by orca.
1.3. Some general shortcuts
The most important keyboard shortcut in my opinion is Ctrl + Shift + L. This will display all bound shortcuts of eclipse. Here are some more Shortcuts which might be useful:
- Ctrl + F7 = display the currently open views.
- Ctrl + E = display the currently open editors
(you can jump directly to a editor in this view by typing the starting letters)
- Ctrl + F6 = select an open file / class from a list like with views and Ctrl + F7
- Ctrl + blank = code completion
- Note: this will open a list with propusals which you can access by pressing F2.
- Ctrl + o = open an outline with a text field at the top to enter a string to directly jump to according methods / fields etc.
- Ctrl + t (on a class or interface) = show members implementing this class / interface
- Ctrl + H = perform a search for a string in the current package (Camel Cases are allowed and wildcards too)
- Ctrl + Shift + t = Open Type
this will open a text field to enter Camel caes or fully qualified type name. a list beside will show the found results and can be accessed via tab.
- Ctrl + Shift + r = Open resource
will open a dialog like the open type dialog but for all possible resources e. g. xml files etc.
2. Plugins to enhance accessibillity
There is a lot of work to do to make eclipse fully accessible for orca. I am currently working on some Plugins for eclipse to enhance accessibillity. So if you have any suggestions which features would be nice to have in eclipse just let me know, and i will see if i can implement it. Just drop me a line on my Gnome Page
Just add it to the Eclipse todo list.