Skip to content

Commit 9348087

Browse files
jnerlichvogella
authored andcommitted
Rework many FAQ migrated pages to markdown
This includes: * Fixing links and formating issues * Correct image links
1 parent 15efa2a commit 9348087

File tree

98 files changed

+788
-882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+788
-882
lines changed

docs/FAQ/FAQ_Are_there_any_special_Eclipse_UI_guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ In fact, the 100-page article is a great source of inspiration for any plug-in d
1313
See Also:
1414
---------
1515

16-
Online article on UI Guidelines ([http://eclipse.org/articles](http://eclipse.org/articles)).
16+
Online article on UI Guidelines ([https://eclipse.org/articles](https://eclipse.org/articles)).
1717

1818
There is a partly obsolete article with eclipse [2.1 UI Guidelines](https://www.eclipse.org/articles/Article-UI-Guidelines/Index.html)
1919

docs/FAQ/FAQ_Can_I_add_icons_declared_by_my_plugin.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
FAQ Can I add icons declared by my plugin.xml in the runtime JAR?
42
=================================================================
53

@@ -15,16 +13,11 @@ The structure of a plug-in roughly looks like this:
1513

1614
Plug-in activation is a process that requires considerable memory and central processing unit (CPU) cycles. To speed up load time of the platform, opening the runtime JAR is avoided for as long as possible.
1715

18-
1916

2017
Of course, images included in a runtime JAR can be used by plug-in code using standard Java resource-loading techniques, such as getResource on a given Java class or by using a class loader.
2118

22-
23-
24-
25-
26-
See Also:
27-
---------
19+
See Also
20+
--------
2821

2922
[FAQ\_How\_do\_I\_add\_images\_and\_other\_resources\_to\_a\_runtime\_JAR_file?](./FAQ_How_do_I_add_images_and_other_resources_to_a_runtime_JAR_file.md "FAQ How do I add images and other resources to a runtime JAR file?")
3023

docs/FAQ/FAQ_Can_I_create_an_application_that_doesn't_have_a_data_location.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33
FAQ Can I create an application that doesn't have a data location?
44
==================================================================
55

6-
7-
8-
9-
106
Yes you can, if you are very careful. In Eclipse 3.0, the base Eclipse runtime was designed to be able to run without any data location at all. If you have a carefully crafted RCP application, you might be able to get away with not having a data location. To launch an Eclipse application with no data location at all, use the special -data @none command-line argument:
117

12-
eclipse -data @none -application your.app.id
8+
eclipse -data @none -application your.app.id
139

1410
If you do this, an error will occur if any plug-in attempts to access the platform instance location, including the plug-in metadata location. In other words, this configuration makes sense only for a tightly controlled application in which you are absolutely certain that the instance location will never be used.
1511

1612
One advantage of this approach is that multiple instances of your application can run simultaneously without forcing the user to pick a different data location for each one. For most RCP applications, this type of configuration is too constrictive. A better approach for applications that don't need to store any interesting state is to pick a random location in a scratch directory, such as the directory provided by System.getProperty("java.io.tmpdir"). This will ensure that your application does not fail if a plug-in is installed that does want to access the instance location.
1713

1814

1915

20-
See Also:
16+
See Also
2117
---------
2218

2319
[FAQ\_How\_do\_I\_specify\_where\_application\_data\_is_stored?](./FAQ_How_do_I_specify_where_application_data_is_stored.md "FAQ How do I specify where application data is stored?")

docs/FAQ/FAQ_Can_I_create_an_application_that_doesn't_have_views_or_editors.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,36 @@ When you create an RCP application using a workbench advisor, you are still cons
88

99
Configuration of a JFace application works through subclassing rather than plugging in an advisor. Your application needs to subclass the JFace class called ApplicationWindow and override the various methods that are used to customize the appearance and behavior of the window. The following is a simple JFace application window from the FAQ examples plug-in. As with other applications, you begin by creating a class that implements IPlatformRunnable:
1010

11-
public class JFaceApp implements IPlatformRunnable {
12-
public Object run(Object args) throws Exception {
13-
Display display = new Display();
14-
JFaceAppWindow window = new JFaceAppWindow();
15-
window.open();
16-
Shell shell = window.getShell();
17-
while (!shell.isDisposed()) {
18-
if (!display.readAndDispatch())
19-
display.sleep();
11+
public class JFaceApp implements IPlatformRunnable {
12+
public Object run(Object args) throws Exception {
13+
Display display = new Display();
14+
JFaceAppWindow window = new JFaceAppWindow();
15+
window.open();
16+
Shell shell = window.getShell();
17+
while (!shell.isDisposed()) {
18+
if (!display.readAndDispatch())
19+
display.sleep();
20+
}
21+
return EXIT_OK;
2022
}
21-
return EXIT_OK;
2223
}
23-
}
2424

2525
JFaceAppWindow is a subclass of the framework class ApplicationWindow. The subclass creates a simple window with a menu bar, a status line, and a single button inside the main window that is used to exit the application (Figure 16.2).
2626

2727
Complete source for the class can be found in the FAQ Examples plug-in, but here is the basic structure:
2828

29-
public class JFaceAppWindow extends ApplicationWindow {
30-
public JFaceAppWindow() {
31-
super(null);
32-
addMenuBar();
33-
addStatusLine();
34-
}
35-
protected void configureShell(Shell shell) {
36-
super.configureShell(shell);
37-
shell.setText("Simple JFace Application");
29+
public class JFaceAppWindow extends ApplicationWindow {
30+
public JFaceAppWindow() {
31+
super(null);
32+
addMenuBar();
33+
addStatusLine();
34+
}
35+
protected void configureShell(Shell shell) {
36+
super.configureShell(shell);
37+
shell.setText("Simple JFace Application");
38+
}
39+
...
3840
}
39-
...
40-
}
4141

4242
The subclass also needs to override the createContents method to create the SWT widgets that will appear in the window's main content area. Override createMenuManager to populate the window's menus, createToolBarManager to populate the toolbar, and so on. If you browse through the ApplicationWindow class, you will see that many other hook methods allow your application to customize the appearance of the top-level window.
4343

docs/FAQ/FAQ_Can_I_install_plug-ins_outside_the_main_install_directory.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ Users who like to live on the edge will be frequently installing new builds of E
77

88
A product extension must be laid out on disk in a certain way so the Eclipse configuration tools can recognize it. Following is the disk layout for a product extension that contains a single plug-in called org.eclipse.faq.examples.
99

10-
eclipse/
11-
.eclipseextension
12-
plugins/
13-
org.eclipse.faq.examples/
14-
plugin.xml
15-
examples.jar
16-
... optionally more plug-in directories ...
17-
features/
18-
... features would go here ...
10+
eclipse/
11+
.eclipseextension
12+
plugins/
13+
org.eclipse.faq.examples/
14+
plugin.xml
15+
examples.jar
16+
... optionally more plug-in directories ...
17+
features/
18+
... features would go here ...
1919

2020
The file .eclipseextension is empty, acting as a special marker that tells install tools that this is an Eclipse extension. Other than that special file, the layout is the same as that for an Eclipse product. Plug-ins go in a directory called plugins, and if the extension contains features, they go in a sibling directory called features.
2121

docs/FAQ/FAQ_Can_I_use_SWT_outside_Eclipse_for_my_own_project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This can be interpreted as either a legal question or a technical question. You
77

88
Each platform you want your project to run on will need its own native libraries. Luckily, this is easier than it used to be because the download section of eclipse.org now includes SWT drops. Download the appropriate SWT drop for the platform you are interested in running on, and set up the VM's classpath and library path accordingly. Here is a command line that was used to launch the BrowserSnippet stand-alone program:
99

10-
java -cp swt.jar;. -Djava.library.path=. BrowserSnippet
10+
java -cp swt.jar;. -Djava.library.path=. BrowserSnippet
1111

1212
This command line assumes that java is on your execution path and that both swt.jar and the SWT dynamic link library are located in the current working directory.
1313

docs/FAQ/FAQ_Can_fragments_be_used_to_patch_a_plug-in.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ A common misconception is that a fragment can be used to patch or replace functi
77

88
Nonetheless, it is possible to design a plug-in so that it allows a portion of its functionality to be implemented or replaced by a fragment. Let's look at a notable example of how this is applied in the org.eclipse.swt plug-in. The SWT plug-in manifest declares a runtime library by using a special path-substitution variable:
99

10-
<library name="$ws$/swt.jar">
10+
<library name="$ws$/swt.jar">
1111

1212
When the plug-in manifest is loaded, the platform will substitute the $ws$ variable with a string describing the windowing system of the currently running operating system. Each windowing system has a separate SWT plug-in fragment that will provide this library. For example, when running on windows, $ws$ will resolve to ws/win32. You can make use of this path-substitution facility in your own plug-in code by using the Plugin.find methods. The fragment org.eclipse.swt.win32 supplies the swt.jar library at the path org.eclipse.swt.win32/ws/win32/swt.jar. Thus, in this case the fragment will supply a library that was specified by its host plug-in.
1313

1414
The same principle can be used to allow a fragment to provide a patch to a host plug-in. The host plug-in can specify both its own library and a patch library in its plug-in manifest:
1515

16-
<runtime>
17-
<library name="patch.jar">
18-
<export name="*"/>
19-
</library>
20-
<library name="main.jar">
21-
<export name="*"/>
22-
</library>
23-
</runtime>
16+
<runtime>
17+
<library name="patch.jar">
18+
<export name="*"/>
19+
</library>
20+
<library name="main.jar">
21+
<export name="*"/>
22+
</library>
23+
</runtime>
2424

2525

2626
The host plug-in puts all its code in main.jar and does not specify a patch.jar at all. When no patch is needed, the patch.jar library is simply missing from the classpath. This allows a fragment to be added later that contributes the patch.jar library. Because the host plug-in has defined patch.jar at the front of its runtime classpath, classes in the patch library will be found before classes in the original library.
@@ -32,5 +32,4 @@ See Also:
3232

3333
[FAQ\_What\_is\_the\_classpath\_of\_a_plug-in?](./FAQ_What_is_the_classpath_of_a_plug-in.md "FAQ What is the classpath of a plug-in?")
3434

35-
For a step by step walk through to use fragments to patch hosts bundles in Eclipse 3.2 and up using OSGi see: [Steps\_to\_use\_Fragments\_to\_patch\_a_plug-in](/Steps_to_use_Fragments_to_patch_a_plug-in "Steps to use Fragments to patch a plug-in")
3635

docs/FAQ/FAQ_Does_Eclipse_run_on_any_Linux_distribution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ For historical interest, earlier versions of Eclipse have also been compiled wit
1818
See Also:
1919
---------
2020

21-
* The Eclipse download site ([http://eclipse.org/downloads](http://eclipse.org/downloads))
21+
* The Eclipse download site ([https://eclipse.org/downloads](https://eclipse.org/downloads))
2222
* IKVM ([http://www.ikvm.net](http://www.ikvm.net))
2323

docs/FAQ/FAQ_Does_the_platform_have_support_for_concurrency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ See Also:
3434
* [FAQ How do I switch from using a Progress dialog to the Progress view?](./FAQ_How_do_I_switch_from_using_a_Progress_dialog_to_the_Progress_view.md "FAQ How do I switch from using a Progress dialog to the Progress view?")
3535
* [FAQ Actions, commands, operations, jobs: What does it all mean?](./FAQ_Actions,_commands,_operations,_jobs:_What_does_it_all_mean.md "FAQ Actions, commands, operations, jobs: What does it all mean?")
3636
* [On the Job: The Eclipse Jobs API](https://www.eclipse.org/articles/Article-Concurrency/jobs-api.html)
37-
* [Eclipse Jobs and Background processing Tutorial](http://www.vogella.de/articles/EclipseJobs/article.html)
37+
* [Eclipse Jobs and Background processing Tutorial](https://www.vogella.com/tutorials/EclipseJobs/article.html)
3838

docs/FAQ/FAQ_How_are_resources_created.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ FAQ How are resources created?
55

66
The workspace is manipulated using _resource handles_. Resource handles are lightweight pointers to a particular project, folder, or file in the workspace. You can create a resource handle without creating a resource, and resources can exist regardless of whether any handles exist that point to them. To create a resource, you first have to create a resource handle and then tell it to create the resource. The following snippet uses resource handles to create a project, a folder, and a file.
77

8-
IWorkspace workspace = ResourcesPlugin.getWorkspace();
9-
IWorkspaceRoot root = workspace.getRoot();
10-
IProject project = root.getProject("MyProject");
11-
IFolder folder = project.getFolder("Folder1");
12-
IFile file = folder.getFile("hello.txt");
13-
//at this point, no resources have been created
14-
if (!project.exists()) project.create(null);
15-
if (!project.isOpen()) project.open(null);
16-
if (!folder.exists())
17-
folder.create(IResource.NONE, true, null);
18-
if (!file.exists()) {
19-
byte[] bytes = "File contents".getBytes();
20-
InputStream source = new ByteArrayInputStream(bytes);
21-
file.create(source, IResource.NONE, null);
22-
}
8+
IWorkspace workspace = ResourcesPlugin.getWorkspace();
9+
IWorkspaceRoot root = workspace.getRoot();
10+
IProject project = root.getProject("MyProject");
11+
IFolder folder = project.getFolder("Folder1");
12+
IFile file = folder.getFile("hello.txt");
13+
//at this point, no resources have been created
14+
if (!project.exists()) project.create(null);
15+
if (!project.isOpen()) project.open(null);
16+
if (!folder.exists())
17+
folder.create(IResource.NONE, true, null);
18+
if (!file.exists()) {
19+
byte[] bytes = "File contents".getBytes();
20+
InputStream source = new ByteArrayInputStream(bytes);
21+
file.create(source, IResource.NONE, null);
22+
}
2323

2424
This example defensively checks that the resource doesn't already exist before trying to create it. This kind of defensive programming is a good idea because an exception is thrown if you try to create a resource that already exists. This way, the example can be run more than once in the same workspace without causing an error. The null parameters to the creation methods should be replaced by a progress monitor in a real application.
2525

0 commit comments

Comments
 (0)