Changes for page The Plug-in Architecture of Eclipse
Last modified by cds on 2025/01/30 12:03
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -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. TellEclipsethat theproject is inside a Git repository.Right-click on the project,click //Team//,and click //Share Project//. SelectGit as the repository type and click //Next//.Therepository information should appear and you should be able to simply click //Finish//.90 +1. (% style="color: rgb(153,51,0);" %)**TODO: GIT PROJECT** 91 91 92 92 == Create the Main Editor Class == 93 93 ... ... @@ -122,44 +122,10 @@ 122 122 123 123 = Creating a Simple View = 124 124 125 - The next task consists of creating a view that is able to display the state of a Turing Machine.We will do this using a table with one column, where each row represents an entry on the tape of theTuringMachine.Thetape shall be infinite to one side, and the position of the read/write head shall be movable by two buttons.The content of the tape shall be determined by the currently active instance of our simple text editor.125 +WRITE THIS SECTION 126 126 127 -{{info title="Hint"}} 128 -In this tutorial, we will be making use of the Standard Widget Toolkit (SWT) to build a user interface. It might be a good idea now to search for an introduction to SWT concepts on the Internet now before you proceed. 129 -{{/info}} 130 - 131 -== Creating the View Class == 132 - 133 -We will start by creating a class that will define the view. 134 - 135 -1. Create a class {{code language="none"}}TapeViewPart{{/code}} in a new package {{code language="none"}}de.cau.cs.rtprakt.login.simple.views{{/code}} that extends the [[ViewPart>>url:http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/part/ViewPart.html||shape="rect"]] class. 136 -1. Add a private field {{code language="none"}}tableViewer{{/code}} of type [[TableViewer>>url:http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/TableViewer.html||shape="rect"]]. 137 -1. ((( 138 -Your TableViewPart contains a still empty method createPartControl. This method will be responsible for creating the user interface components of your view. Add the following code to create the table we want to display: 139 - 140 -{{code title="createPartControl(...)" linenumbers="true" language="java" collapse="true"}} 141 -Table table = new Table(parent, SWT.BORDER); 142 -TableColumn column = new TableColumn(table, SWT.NONE); 143 -column.setWidth(80); 144 -tableViewer = new TableViewer(table); 145 -{{/code}} 146 -))) 147 -1. ((( 148 -The setFocus method controls what happens when your part gets the focus. Make sure the focus will then automatically be set to the table by adding the following code: 149 - 150 -{{code title="setFocus(...)" linenumbers="true" collapse="true"}} 151 -tableViewer.getControl().setFocus(); 152 -{{/code}} 153 -))) 154 - 155 155 156 156 157 - 158 - 159 - 160 - 161 - 162 - 163 163 = Creating an Extension Point = 164 164 165 165 WRITE THIS SECTION
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -298228 71 +2982284 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/298228 7/The Plug-in Architecture of Eclipse1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/2982284/The Plug-in Architecture of Eclipse