-
Notifications
You must be signed in to change notification settings - Fork 1
/
getting-started.html
284 lines (274 loc) · 11.8 KB
/
getting-started.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Eclipse TEA</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="The website of Eclipse TEA, an open-source framework for development of IDE extensions that can be run from everywhere">
<meta name="author" content="Markus Duft">
<link rel="shortcut icon" href="images/favicon.png">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
<link href="css/shield-responsive.css" rel="stylesheet" type="text/css">
<link href="css/fonts.css" rel="stylesheet" type="text/css">
<link href="css/prettyPhoto.css" rel="stylesheet" media="screen" type="text/css">
<link href="css/prettify.css" type="text/css" rel="stylesheet"/>
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/coverflow.css" rel="stylesheet" type="text/css">
</head>
<body>
<header class="site-header">
<!-- Navbar -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse"
data-target=".nav-collapse"> <span class="icon-bar"></span> <span
class="icon-bar"></span> <span class="icon-bar"></span>
</a> <a class="brand" href="index.html"></a>
<div class="nav-collapse collapse" style="height: 0px;">
<ul class="nav">
<li ><a href="download.html">Download</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Documentation<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="overview.html">Overview</a></li>
<li><a href="getting-started.html">Getting Started</a></li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/forums/index.php/f/370/" target="_blank">Forums</a></li>
<li ><a href="https://bugs.eclipse.org/bugs/buglist.cgi?product=Tea" target="_blank">Bug Tracker</a></li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
</div>
<!-- Navbar End -->
</header>
<img style="position: fixed; top: 0; right: 0; margin-top: 65px; z-index:1000; border: 0; " src="images/incubation.png"/>
<div id="01-Main" class="modal fade" style="display: none;" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title">Headless TEA product settings</h3>
</div>
<div class="modal-body">
<img class="img-responsive" src="images/01-Main.png"/>
</div>
</div>
</div>
</div> <div id="01-Arguments" class="modal fade" style="display: none;" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title">Headless TEA argument settings</h3>
</div>
<div class="modal-body">
<img class="img-responsive" src="images/01-Arguments.png"/>
</div>
</div>
</div>
</div>
<div id="page">
<div class="container">
<div class="row">
<div class="span12">
<h2>Getting Started</h2>
<p>
This page gives a simple getting started example that provides a quick tour through the basics of writing TEA <em>Task</em>s and <em>TaskChain</em>s.
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>Preparation</h3>
</div>
</div>
<div class="row">
<div class="span12">
<p>
To implement TEA components, you will need a workspace with a project that will host these components. Most importantly:
<ul>
<li>The Target Platform needs to be set to an Eclipse installation with TEA available. The most simple case is the running Eclipse with TEA installed (see <a href="download.html">here</a>).</li>
<li>A plug-in project that will host the code.</li>
<li>A launch configuration that will launch Eclipse with your plug-in added.</li>
</ul>
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>Creating the first <em>Task</em></h3>
</div>
</div>
<div class="row">
<div class="span12">
<p>
A <em>Task</em> in TEA is nothing more than a simple POJO with an <em>@Execute</em> annotated method.
<pre class="prettyprint linenums">
@Named("My Task")
public class MyTask {
@Execute
public void demo(TaskingLog log) {
log.info("Hello World!");
}
}
</pre>
Note how <em>@Named</em> can be used to set a user visible name for the task. If the annotation is not present,
the <em>toString</em> of the <em>Task</em> is used, and if this is the default <em>Object.toString</em> the simple
class name of the <em>Task</em> is used as a last resort.
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>Creating the first <em>TaskChain</em></h3>
</div>
</div>
<div class="row">
<div class="span12">
<p>
Now that there is a <em>Task</em>, we want to execute it somehow. TEA uses <em>TaskChain</em>s to accomplish this.
</p>
<p>
Each <em>TaskChain</em> must at least:
<ul>
<li>Implement the <code class="prettyprint">TaskChain</code> interface.</li>
<li>Be registered as OSGi service. The easiest way to do so is to use the <code class="prettyprint">@Component</code> annotation.
Processing of this annotation needs to be enabled in Eclipse (on the projects properties: <em>Plug-in Development > DS Annotations > Generate descriptors from annotated sources</em>)</li>
<li>Have a method annotated with <code class="prettyprint">@TaskChainContextInit</code> which accepts a <code class="prettyprint">TaskExecutionContext</code> (and optionally more parameters available for injection - more on this later).</li>
</ul>
Each <em>TaskChain</em> can optionally have:
<ul>
<li>A method annotated with <code class="prettyprint">@TaskChainUiInit</code> which may present UI to the user (and is called in the UI thread) in case the <em>TaskChain</em> is executed in the IDE.
This method may accept a <code class="prettyprint">Shell</code> parameter which represents the <code class="prettyprint">Shell</code> to be used as parent for dialogs.</li>
<li>A top-level <code class="prettyprint">@TaskChainId</code> annotation, which can be used to add a human readable description as well as aliases which can be used to access the <em>TaskChain</em> more easily from the command line application.</li>
<li>A top-level <code class="prettyprint">@TaskChainMenuEntry</code> annotation, which can be used to make this <em>TaskChain</em> available from the <em>TEA</em> menu inside the IDE.</li>
</ul>
</p>
<p>
A simple example <em>TaskChain</em> which contains the above <em>Task</em> could look like this:
<pre class="prettyprint linenums">
@TaskChainId(description = "My TaskChain", alias = "MyChainAlias")
@TaskChainMenuEntry(path = "Demos")
@Component
public class MyChain implements TaskChain {
@TaskChainContextInit
public void init(TaskExecutionContext c) {
c.addTask(MyTask.class);
}
}
</pre>
Note that the <em>Task</em> is added using <code class="prettyprint">MyTask.class</code>. Alternatively,
if the <em>Task</em> would require additional constructor parameters, an instance of <code class="prettyprint">MyTask</code> could be passed as well.
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>Testing in the IDE</h3>
</div>
</div>
<div class="row">
<div class="span12">
<p>
Once you have these two classes in place, you can test your first <em>TaskChain</em> already.
Simply run your prepared Eclipse launch configuration to run another IDE from your IDE. It now should
contain a top-level menu entry <em>TEA > Demos > My TaskChain</em>. Clicking this menu item will
run the <em>TaskChain</em> <code class="prettyprint">MyChain</code> from your plug-in.
</p>
</div>
</div>
<div class="row">
<div class="span12">
<h3>Testing Headless</h3>
</div>
</div>
<div class="row">
<div class="span9">
<p>
This one is a little tricky at first. What you will need:
<ul>
<li>An (empty) property file called with an arbitrary name, lets call it <em>headless.properties</em>.</li>
<li>The name of the <em>TaskChain</em> you want to run. In this case it's either
<code class="prettyprint">MyChainAlias</code> or the fully qualified class name
<code class="prettyprint">your.pkg.name.MyChain</code></li>
</ul>
Now you will need to create a new Eclipse launch configuration. You can copy this one from the Eclipse
configuration you used before.
Change the configuration and use <code>org.eclipse.tea.core.ui.HeadlessTaskingEngine</code> as product to run.
Also change the Program arguments on the according tab. Add:
<ul>
<li>-properties /path/to/headless.properties</li>
<li>-taskchain MyChainAlias</li>
</ul>
Once you run this launch configuration, you should see TEA starting up and executing your <em>TaskChain</em>
before exiting again.
</p>
</div>
<div class="span3">
<span class="pull-right">
<a class="thumbnail" style="max-width: 250px;" href="#" data-toggle='modal' data-target='#01-Main'><img src="images/01-Main.png" alt="Headless TEA product settings"/></a> <a class="thumbnail" style="max-width: 250px;" href="#" data-toggle='modal' data-target='#01-Arguments'><img src="images/01-Arguments.png" alt="Headless TEA argument settings"/></a> </span>
</div>
</div>
</div>
</div>
<footer class="site-footer">
<div id="extra">
<div class="inner">
<div class="container">
<div class="row">
<div class="span12">
<h3 class="footer-links-header">Quick Links</h3>
<ul class="footer-links clearfix">
<li><a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a></li>
<li><a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
<li><a href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a></li>
<li><a href="http://www.eclipse.org/legal/">Legal</a></li>
</ul>
<ul class="footer-links clearfix">
<li><a href="http://www.eclipse.org">Eclipse Home</a></li>
<li><a href="http://marketplace.eclipse.org/">Market Place</a></li>
<li><a href="http://live.eclipse.org/">Eclipse Live</a></li>
<li><a href="http://www.planeteclipse.org/">Eclipse Planet</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="js/jquery.prettyPhoto.js" type="text/javascript"></script>
<script src="js/prettify.js" type="text/javascript"></script>
<script src="js/lang-common.js" type="text/javascript"></script>
<script src="js/custom.js" type="text/javascript"></script>
<script src="js/coverflow.min.js" type="text/javascript"></script>
<script>
$(function() {
$('#coverflow').coverflow({
active : 1,
visibleAside: 2,
overlap : 0.5,
scale : 0.9,
angle : 20,
trigger : {
"itemfocus" : true,
"swipe" : true,
"mousewheel" : false
}
});
$('#coverflow :hidden').toggle();
$(window).resize(function() {
$('#coverflow').coverflow();
});
});
</script>
</footer>
</body>
</html>