Last modified by cds on 2025/01/30 12:03

From version 14.1
edited by cds
on 2012/10/24 11:55
Change comment: There is no comment for this version
To version 7.1
edited by cds
on 2012/10/19 15:51
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -The Plug-in Architecture of Eclipse
1 +The Plugin Architecture of Eclipse
Content
... ... @@ -1,7 +5,3 @@
1 -{{warning title="Warning"}}
2 -This tutorial isn't complete yet!
3 -{{/warning}}
4 -
5 5  This tutorial will teach you the basics of writing plugins that run inside the Eclipse framework. You will learn about editors, views, and extension points by creating one of each yourself.
6 6  
7 7  
... ... @@ -51,29 +51,10 @@
51 51  
52 52  == Preparing the Repository ==
53 53  
54 -We have created a Git repository for everyone to do his tutorials in. You can access the repository online through our Stash tool [[over here>>url:http://git.rtsys.informatik.uni-kiel.de:7990/projects/PRAK/repos/12ws-eclipse-tutorials/browse||shape="rect"]]. You will first have to configure your Stash account:
50 +{{warning title="ToDo"}}
51 +Write this section.
52 +{{/warning}}
55 55  
56 -1. Login with your Rtsys account information.
57 -1. Through the button in the top right corner, access your profile.
58 -1. Switch to the //SSH keys// tab.
59 -1. Click //Add Key// and upload a public SSH key that you want to use to access the repository.
60 -
61 -You should now be able to access the repository. Clone it:
62 -
63 -1. Open a console window and navigate to an empty directory that the repository should be placed in.
64 -1. Enter the command ssh:~/~/git@git.rtsys.informatik.uni-kiel.de:7999/PRAK/12ws-eclipse-tutorials.git{{code language="none"}} .{{/code}} (including the final dot, which tells git to clone the repository into the current directory instead of a subdirectory).
65 -1. You should now have a clone of the repository in the current directory.
66 -
67 -You will use this repository for all your tutorial work, along with everyone else. To make sure that you don't interfere with each other, everyone will work on a different branch. This is not exactly how people usually use Git, but goes to demonstrate Git's flexibility... Add a branch for you to work in:
68 -
69 -1. Enter {{code language="none"}}git checkout -b login_name{{/code}}
70 -
71 -You have just added and checked out a new branch. Everything you commit will go to this branch. To push your local commits to the server (which you will need to do so we can access your results), do the following:
72 -
73 -1. Enter {{code language="none"}}git push origin login_name{{/code}}
74 -
75 -You would usually have to enter {{code language="none"}}git pull{{/code}} first, but since nobody will mess with your branch this won't be necessary. By the way, you only need to mention {{code language="none"}}origin login_name{{/code}} with the first {{code language="none"}}git push{{/code}}, since Git doesn't know where to push the branch yet. After the first time, Git remembers the information and it will be enough to just enter {{code language="none"}}git push{{/code}}.
76 -
77 77  = Creating a Simple Text Editor =
78 78  
79 79  OK, with all the preliminaries out of the way let's get working. Fire up Eclipse, choose an empty workspace, close the Welcome panel it will present you with and follow the following steps.
... ... @@ -87,7 +87,7 @@
87 87  1. As the project name, enter {{code language="none"}}de.cau.cs.rtprakt.login.simple{{/code}}. Uncheck //Use default location// (which would put the project into your workspace), and put it into your local clone of the Git repository instead (the //Location// should read something like {{code language="none"}}/path/to/git/repository/de.cau.cs.rtprakt.login.simple{{/code}}). Click //Next//.
88 88  1. As the name, enter {{code language="none"}}Simple (login){{/code}}. Also, make sure that //Generate an activator// and //This plug-in will make contributions to the UI// are both checked. Click //Finish//. (Eclipse might ask you whether you want to switch to the //Plug-in Development Perspective//, which configures Eclipse to provide the views that are important for plug-in development. Choose //Yes//. Or //No//. It won't have a big influence on your future...)
89 89  1. Eclipse has now created your new plug-in and was nice enough to open the //Plug-in Manifest Editor//, which allows you to graphically edit two important files of your plugin: {{code language="none"}}plugin.xml{{/code}} and {{code language="none"}}META-INF/MANIFEST.MF{{/code}}. (By the way, this would be a great time to research the editor and the two files online.) Basically, those two files provide information that tell Eclipse what other plug-ins your plug-in needs and how it works together with other plug-ins by providing extensions and extension points. Our new plug-in will depend on two other plug-ins, so switch to the //Dependencies// tab of the editor and add dependencies to {{code language="none"}}org.eclipse.ui.editors{{/code}} and {{code language="none"}}org.eclipse.jface.text{{/code}}. Save the editor and close it. (You can always reopen it by opening one of the two mentioned files from the //Package Explorer//.)
90 -1. Tell Eclipse that the project is inside a Git repository. Right-click on the project, click //Team//, and click //Share Project//. Select Git as the repository type and click //Next//. The repository information should appear and you should be able to simply click //Finish//.
67 +1. (% style="color: rgb(153,51,0);" %)**TODO: GIT PROJECT**
91 91  
92 92  == Create the Main Editor Class ==
93 93  
... ... @@ -108,28 +108,10 @@
108 108  
109 109  == Test the Editor ==
110 110  
111 -It's time to test your new simple editor in a new Eclipse instance.
88 +
112 112  
113 -1. Switch back to the //Overview// tab of the //Plug-in Manifest Editor//.
114 -1. Click //Launch an Eclipse Application.//\\
115 -1*. For future tests, you can now select //Eclipse Application// in the run menu.
116 -1*. To enable debug mode for your test instances: open the //Run Configurations// dialog, select the //Arguments// tab of the //Eclipse Application// configuration, and add -debug -consoleLog as program arguments. This dumps all errors and exceptions to the console view, so you can directly see what went wrong.
117 -1*. To improve performance, select only the plugins that are necessary: in the //Plug-ins// tab select //Launch with plug-ins selected below only//, deselect //Target Platform//, select //Workspace//, and then //Add Required Plug-ins//.\\
118 -1**. Make sure that org.eclipse.ui.ide.application is also selected, else you won't be able to launch Eclipse.
119 -1**. The requirements list needs to be updated when the dependencies of your plugins have changed; click //Add Required Plug-ins// again for updating.
120 -1. In the new Eclipse instance, click //New -> Project...// -> //General// -> //Project//. Enter {{code language="none"}}test{{/code}} as the project name.
121 -1. Right-click the new project and click //New// -> //File...// As the file name, enter {{code language="none"}}test.simple{{/code}}. This will create a new file with that name and open the file in your newly added text editor. (You can see that it is your editor by looking at the editor icon, which should look like the icon you downloaded and put into the icons folder.)
122 -
123 -= Creating a Simple View =
124 -
125 -WRITE THIS SECTION
126 -
127 127  
128 128  
129 -= Creating an Extension Point =
130 -
131 -WRITE THIS SECTION
132 -
133 133  
134 134  
135 135  
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -2982286
1 +2982251
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/2982286/The Plug-in Architecture of Eclipse
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/2982251/The Plugin Architecture of Eclipse