From c8622457856fe41e518dc2027b166bf7a04c808c Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Thu, 21 Dec 2023 15:30:44 +0100 Subject: [PATCH] JFace wiki --- docs/JFace.md | 101 +++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 51 deletions(-) diff --git a/docs/JFace.md b/docs/JFace.md index 6ccb635d3d2..7f576a35d7d 100644 --- a/docs/JFace.md +++ b/docs/JFace.md @@ -112,56 +112,56 @@ In this step, we will create one project that will point to all of the JAR files ![Classpath variables.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Classpath_variables.png) 10. Press New to display the New Variable Entry dialog. Enter ECLIPSE_HOME in the Name field. For the Path field, press Folder and browse to the top-level directory where Eclipse is installed. This is the directory that contains the Eclipse executable file (e.g., "eclipse.exe" on Windows) and has subdirectories including "configuration", "features", and "plugins". In the example below, Eclipse is installed in “c:\\eclipse”. - - ![New variable entry.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/New_variable_entry.png) - -11. Press OK. Now the ECLIPSE_HOME variable will display in the Classpath Variables list. Press OK again to return to the New Variable Classpath Entry. Press Cancel to return to the Libraries tab of the Java Build Path dialog. -12. Now, we're ready to add our JFace JAR files. We'll use the ECLIPSE\_HOME classpath variable we just created. That way, if the location of our Eclipse installation changes, we can just change the ECLIPSE\_HOME variable to point to the new location. -13. Press the Add Variable button to again display the New Variable Classpath Entry dialog. Make sure ECLIPSE_HOME is selected and press the Extend... button to display the Variable Extension dialog, shown below. + +![New variable entry.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/New_variable_entry.png) + +1. Press OK. Now the ECLIPSE_HOME variable will display in the Classpath Variables list. Press OK again to return to the New Variable Classpath Entry. Press Cancel to return to the Libraries tab of the Java Build Path dialog. +2. Now, we're ready to add our JFace JAR files. We'll use the ECLIPSE\_HOME classpath variable we just created. That way, if the location of our Eclipse installation changes, we can just change the ECLIPSE\_HOME variable to point to the new location. +3. Press the Add Variable button to again display the New Variable Classpath Entry dialog. Make sure ECLIPSE_HOME is selected and press the Extend... button to display the Variable Extension dialog, shown below. ![Variable extension.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Variable_extension.png) -14. This will display the subdirectories of the ECLIPSE_HOME directory. The JAR files we need are in the plugins directory. -15. Expand the plugins directory and browse down to the org.eclipse.core.commands and select it as shown below. (Note that the JAR file version numbers may be different.) - - ![Core commands.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Core_commands.png) - -16. You can select multiple JAR files from this list by holding down the Ctrl key while clicking. Scroll down the list and select the remaining JAR files. The complete list for Eclipse 3.3 is shown below. +4. This will display the subdirectories of the ECLIPSE_HOME directory. The JAR files we need are in the plugins directory. +5. Expand the plugins directory and browse down to the org.eclipse.core.commands and select it as shown below. (Note that the JAR file version numbers may be different.) + +![Core commands.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Core_commands.png) + +1. You can select multiple JAR files from this list by holding down the Ctrl key while clicking. Scroll down the list and select the remaining JAR files. The complete list for Eclipse 3.3 is shown below. 1. org.eclipse.core.commands_.jar 2. org.eclipse.equinox.common_.jar 3. org.eclipse.jface_.jar 4. org.eclipse.osgi_.jar 5. org.eclipse.ui.workbench_.jar -17. If there are any other JAR files that displayed for your Eclipse version when you looked at the JFace dependencies above, select them here as well. As mentioned earlier, org.eclipse.ui.workbench is not actually part of JFace but is included here because it supplies some useful dialog classes. When you have selected all of the required files, press OK. The Libraries tab should now show all of the JAR files, similar to the screenshot below. - - ![JFace jars added.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/JFace_jars_added.png) - -18. The source code for the SWT classes was added automatically when the org.eclipse.swt project was imported. If you like, you can add the source code to the JFace JAR file. Note that the JFace source code comes as part of the Eclipse Platform Plug-in Developer Resources feature, which is included in the Eclipse for RCP/Plug-in Developers download. If you don't have this Eclipse package, you can download the Eclipse Platform Plug-in Developer Resources feature from the Eclipse Project Updates update site, as shown below. - - ![Updates developer resources.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Updates_developer_resources.png) - -19. To attach the JFace source code, expand the JFace JAR file and select the Source Attachment, as shown below. - - ![Jface source attachment1.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Jface_source_attachment1.png) - -20. Press Edit to display the Source Attachment Configuration dialog. Press the Variable button, select the ECLIPSE_HOME variable, and press OK to display the screen below. - - ![Jface source attachment1a.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Jface_source_attachment1a.png) - -21. Now press the Extension... button. This will open the Variable Extension Selection dialog. Again, expand the plugins directory. Find the directory called org.eclipse.rcp.source_. Note that this is a directory, not a JAR file. -22. Expand this directory, expand the src subdirectory, scroll down to the directory called org.eclipse.jface_. Expand this, and select the file called src.zip, as shown below. - - ![Jface source attachment2.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Jface_source_attachment2.png) - -23. Press OK twice to return to the Libraries tab. At this point, you have attached the JFace source code and the screen should look like the one below. - - ![Jface source attachment3.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Jface_source_attachment3.png) - -24. Finally, select the Order and Export tab and check the check boxes next to each of the ECLIPSE_HOME JAR files so that the screen appears as shown below. - - ![Order and export.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Order_and_export.png) - -25. Press OK. At this point, the org.eclipse.swt project is set up and will supply all of the required libraries for a SWT and JFace project. +2. If there are any other JAR files that displayed for your Eclipse version when you looked at the JFace dependencies above, select them here as well. As mentioned earlier, org.eclipse.ui.workbench is not actually part of JFace but is included here because it supplies some useful dialog classes. When you have selected all of the required files, press OK. The Libraries tab should now show all of the JAR files, similar to the screenshot below. + +![JFace jars added.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/JFace_jars_added.png) + +1. The source code for the SWT classes was added automatically when the org.eclipse.swt project was imported. If you like, you can add the source code to the JFace JAR file. Note that the JFace source code comes as part of the Eclipse Platform Plug-in Developer Resources feature, which is included in the Eclipse for RCP/Plug-in Developers download. If you don't have this Eclipse package, you can download the Eclipse Platform Plug-in Developer Resources feature from the Eclipse Project Updates update site, as shown below. + +![Updates developer resources.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Updates_developer_resources.png) + +1. To attach the JFace source code, expand the JFace JAR file and select the Source Attachment, as shown below. + +![Jface source attachment1.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Jface_source_attachment1.png) + +1. Press Edit to display the Source Attachment Configuration dialog. Press the Variable button, select the ECLIPSE_HOME variable, and press OK to display the screen below. + +![Jface source attachment1a.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Jface_source_attachment1a.png) + +1. Now press the Extension... button. This will open the Variable Extension Selection dialog. Again, expand the plugins directory. Find the directory called org.eclipse.rcp.source_. Note that this is a directory, not a JAR file. +2. Expand this directory, expand the src subdirectory, scroll down to the directory called org.eclipse.jface_. Expand this, and select the file called src.zip, as shown below. + +![Jface source attachment2.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Jface_source_attachment2.png) + +1. Press OK twice to return to the Libraries tab. At this point, you have attached the JFace source code and the screen should look like the one below. + +![Jface source attachment3.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Jface_source_attachment3.png) + +1. Finally, select the Order and Export tab and check the check boxes next to each of the ECLIPSE_HOME JAR files so that the screen appears as shown below. + +![Order and export.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Order_and_export.png) + +1. Press OK. At this point, the org.eclipse.swt project is set up and will supply all of the required libraries for a SWT and JFace project. ### Add the org.eclipse.swt Project to Your Java Project @@ -173,9 +173,8 @@ Once the steps above are complete, it is very easy to add the SWT and JFace libr ![Required project selection.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Required_project_selection.png) 3. Press OK to return to the Projects tab of the Java Build Path dialog. The screen should show the org.eclipse.swt project as shown below. - - ![Myproject build path.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Myproject_build_path.png) - + +![Myproject build path.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Myproject_build_path.png) ### Test Your org.eclipse.swt Project @@ -183,15 +182,15 @@ At this point, your Java project should have everything needed to create a stand 1. In your Java project, create a new package called jface.test. 2. Create a new class called JFaceTest, as shown below. - - ![New java class.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/New_java_class.png) - -3. In the New Java Class dialog, for the Superclass press Browse and enter ApplicationWindow. The class ApplicationWindow, in the org.eclipse.jface.window package, should display as an option, as shown below. + +![New java class.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/New_java_class.png) + +1. In the New Java Class dialog, for the Superclass press Browse and enter ApplicationWindow. The class ApplicationWindow, in the org.eclipse.jface.window package, should display as an option, as shown below. ![Superclass selection.png](https://raw.githubusercontent.com/vogellacompany/eclipse.platform.ui/master/docs/images/Superclass_selection.png) -4. Select ApplicationWindow and press Finish to create the class. -5. In the Java editor, click on the word ApplicationWindow and press F3. This should open the Java source code for the ApplicationWindow.class. +2. Select ApplicationWindow and press Finish to create the class. +3. In the Java editor, click on the word ApplicationWindow and press F3. This should open the Java source code for the ApplicationWindow.class. At this point you are ready to start developing stand-alone SWT and JFace applications.