You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/FAQ/FAQ_How_do_I_configure_an_Eclipse_Java_project_to_use_SWT.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,26 +7,26 @@ The easiest way to configure a Java project in Eclipse to use SWT is as follows:
7
7
8
8
1. Download the SWT stable release for your Eclipse version and your operating system from [Eclipse SWT Project Page](https://www.eclipse.org/swt). For example, for Eclipse version 3.3 and Windows, select the Windows link under Releases / Stable, as shown in the screenshot below.
9
9
10
-

10
+

11
11
12
12
2. This will download a zip file that contains our org.eclipes.swt project. (For example, for Eclipse 3.3 and Windows, the file is called swt-3.3.1.1-win32-win32-x86.zip.) Do not unzip this file. Just download it and note the directory where you saved it.
13
13
3. Inside Eclipse, select Import / Existing Projects into Workspace, as shown below.
4. Press Next and select the option Select archive file. Browse to the zip file you just downloaded. A project called org.eclipse.swt will display in the Projects list. Make sure it is checked, as shown below, and press Finish.
5. Eclipse will create the project org.eclipse.swt in your workspace. This project already has the required SWT JAR file, including source code for the SWT classes.
22
22
6. Select the project that will be used to develop SWT programs (for example, "MyProject) and select Project / Properties / Java Build Path.
23
23
7. Select the Projects tab. Press Add. The org.eclipse.swt project will display in the Select projects to add: list. Select this project by checking the box. The screen should display as shown below.
Copy file name to clipboardExpand all lines: docs/FAQ/FAQ_How_do_I_create_an_application.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,25 @@ FAQ How do I create an application?
5
5
6
6
To create an application, you need a plug-in that adds an extension to the org.eclipse.core.runtime.applications extension point. An example application definition from a plugin.xml file is as follows:
The class attribute of the run element must specify a class that implements org.eclipse.core.boot.IPlatformRunnable. Here is the source of a trivial application:
16
16
17
-
public class HelloWorld implements IPlatformRunnable {
18
-
public Object run(Object args) throws Exception {
19
-
System.out.println("Hello from Eclipse application");
20
-
return EXIT_OK;
17
+
public class HelloWorld implements IPlatformRunnable {
18
+
public Object run(Object args) throws Exception {
19
+
System.out.println("Hello from Eclipse application");
20
+
return EXIT_OK;
21
+
}
21
22
}
22
-
}
23
23
24
24
To run the application, you need to specify the fully qualified ID of your application extension definition, using the application command-line argument when launching Eclipse:
The fully qualified extension ID is computed by prepending the plug-in ID to the simple extension ID from the plugin.xml file. In this example, the plug-in ID is org.eclipse.faq.helloworld, and the simple extension ID is helloworld.
Copy file name to clipboardExpand all lines: docs/FAQ/FAQ_How_do_I_create_an_external_tool_builder.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@ An external tool builder is an external tool that runs every time the projects i
11
11
12
12
As with ordinary external tools, you can define your own type of external tool builder by creating a new launch configuration type. In your launch configuration declaration, you must specify the category for external tool builder launch configurations:
Copy file name to clipboardExpand all lines: docs/FAQ/FAQ_How_do_I_create_an_image_registry_for_my_plug-in.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,18 @@ FAQ How do I create an image registry for my plug-in?
5
5
6
6
If you're writing a plug-in with UI components, it should be a subclass of AbstractUIPlugin. This superclass already provides you with an empty image registry accessible by calling getImageRegistry. When the registry is first accessed, the hook method initializeImageRegistry will be called. You should override this method to populate your image registry with the image descriptors you need. You don't have to use this registry if you don't need it, and because it is created lazily on first access, there is no performance overhead if you never use it. Here is an example of a plug-in that adds a sample.gif image to its image registry:
7
7
8
-
public class ExamplesPlugin extends AbstractUIPlugin {
9
-
public static final String PLUGIN_ID = "org.eclipse.faq.examples";
10
-
public static final String IMAGE_ID = "sample.image";
Copy file name to clipboardExpand all lines: docs/FAQ/FAQ_How_do_I_get_a_Display_instance.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,13 @@ Most users deploy Eclipse as one top-level window and manage their code in persp
7
7
8
8
If you call Display.getCurrent, it returns the display that was created in that thread, if any. Here is an example:
9
9
10
-
public static Display getDisplay() {
11
-
Display display = Display.getCurrent();
12
-
//may be null if outside the UI thread
13
-
if (display == null)
14
-
display = Display.getDefault();
15
-
return display;
16
-
}
10
+
public static Display getDisplay() {
11
+
Display display = Display.getCurrent();
12
+
//may be null if outside the UI thread
13
+
if (display == null)
14
+
display = Display.getDefault();
15
+
return display;
16
+
}
17
17
18
18
A calling thread that does not have an active display will return null. Therefore, this method is useful only when you are absolutely certain that you are in the thread that created the display. This brings us to the second way you can obtain a display instance: Display.getDefault(). It will return the first display that was created. If your application has only one display, this is an acceptable way of obtaining the display.
Copy file name to clipboardExpand all lines: docs/FAQ/FAQ_How_do_I_handle_setup_problems_for_a_given_builder.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ FAQ How do I handle setup problems for a given builder?
5
5
6
6
When running a build in a runtime workbench, you might get the following message:
7
7
8
-
!MESSAGE Skipping builder com.xyz.builder for project P.
9
-
Either the builder is missing from the install, or it
10
-
belongs to a project nature that is missing or disabled.
8
+
!MESSAGE Skipping builder com.xyz.builder for project P.
9
+
Either the builder is missing from the install, or it
10
+
belongs to a project nature that is missing or disabled.
11
11
12
12
This message means that something is wrong with the builder plug-in or with the attribution of the builder specification in the .project file. The builder plug-in might load fine but still be broken, perhaps because it is missing an ID in the extension point declaration.
You have to do this only once for each view that is created. The platform remembers your action handler and retargets the action each time the view becomes active. To unregister from a global action, simply invoke setGlobalActionHandler again and pass in a null value for the handler.
Copy file name to clipboardExpand all lines: docs/FAQ/FAQ_How_do_I_hook_my_editor_to_the_Back_and_Forward_buttons.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,15 @@ A navigation location can also choose to support persistence. When an editor clo
16
16
17
17
Now we know how to create and restore editor locations, but how are entries added to the navigation history in the first place? Anyone can mark an interesting location in an open editor by calling the markLocation method on INavigationHistory. Code that causes the cursor or selection to jump to another location in an editor should call this method both before and after performing the jump. As mentioned, implementations of restoreLocation should also mark the current location before restoring an old one. Regardless of whether the specific editor has any support for navigation history, markLocation will work. If the editor doesn't implement INavigationLocationProvider, a history entry will be added, allowing the user to jump back to that editor but without returning to any particular location. The following snippet shows an action that is added to the sample HTML editor. When the action is invoked, it will add the current cursor position to the navigation history:
0 commit comments