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
-
... ... @@ -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(...)" language="java"}} 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(...)"}} 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 -29822 901 +2982286 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/29822 90/The Plug-in Architecture of Eclipse1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/2982286/The Plug-in Architecture of Eclipse