source: contrib/MailArchiver/sources/src/serpro/mailarchiver/view/BaseComponent.java @ 6785

Revision 6785, 13.9 KB checked in by rafaelraymundo, 12 years ago (diff)

Ticket #2946 - Liberado codigo do MailArchiver?. Documentação na subpasta DOCS.

Line 
1/**
2 * MailArchiver is an application that provides services for storing and managing e-mail messages through a Web Services SOAP interface.
3 * Copyright (C) 2012  Marcio Andre Scholl Levien and Fernando Alberto Reuter Wendt and Jose Ronaldo Nogueira Fonseca Junior
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/******************************************************************************\
20*
21*  This product was developed by
22*
23*        SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO),
24*
25*  a government company established under Brazilian law (5.615/70),
26*  at Department of Development of Porto Alegre.
27*
28\******************************************************************************/
29
30package serpro.mailarchiver.view;
31
32import java.util.UUID;
33
34import javax.annotation.PostConstruct;
35
36import org.springframework.beans.factory.annotation.Configurable;
37
38import com.eventrouter.SubscriptionRegistry;
39import com.eventrouter.annotation.AnnotationProcessor;
40
41import com.vaadin.data.Container;
42import com.vaadin.ui.Component;
43import com.vaadin.ui.ComponentContainer;
44import com.vaadin.ui.FormFieldFactory;
45import com.vaadin.ui.Layout;
46
47public final class BaseComponent {
48
49    private BaseComponent() {}
50
51    //<editor-fold defaultstate="collapsed" desc=" VerticalLayout ">
52    @Configurable
53    public static abstract class VerticalLayout extends com.vaadin.ui.VerticalLayout implements Initializable {
54
55        private String displayId;
56
57        @PostConstruct
58        private void postConstruct() {
59            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
60            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
61            processor.process(this);
62            init();
63        }
64
65        //--------------------------------------------------------------------------
66        public VerticalLayout() {}
67
68        //--------------------------------------------------------------------------
69        @Override
70        public String getDisplayId() {
71            if(displayId == null) {
72                displayId = UUID.randomUUID().toString();
73            }
74            return displayId;
75        }
76
77        @Override
78        public final String getDebugId() {
79            return getDisplayId();
80        }
81    }
82    //</editor-fold>
83
84
85    //<editor-fold defaultstate="collapsed" desc=" HorizontalLayout ">
86    @Configurable
87    public static abstract class HorizontalLayout extends com.vaadin.ui.HorizontalLayout implements Initializable {
88
89        private String displayId;
90
91        @PostConstruct
92        private void postConstruct() {
93            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
94            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
95            processor.process(this);
96            init();
97        }
98
99        //--------------------------------------------------------------------------
100        public HorizontalLayout() {}
101
102        //--------------------------------------------------------------------------
103        @Override
104        public String getDisplayId() {
105            if(displayId == null) {
106                displayId = UUID.randomUUID().toString();
107            }
108            return displayId;
109        }
110
111        @Override
112        public final String getDebugId() {
113            return getDisplayId();
114        }
115    }
116    //</editor-fold>
117
118
119    //<editor-fold defaultstate="collapsed" desc=" GridLayout ">
120    @Configurable
121    public static abstract class GridLayout extends com.vaadin.ui.GridLayout implements Initializable {
122
123        private String displayId;
124
125        @PostConstruct
126        private void postConstruct() {
127            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
128            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
129            processor.process(this);
130            init();
131        }
132
133        //--------------------------------------------------------------------------
134        public GridLayout() {}
135
136        public GridLayout(int columns, int rows) {
137            super(columns, rows);
138        }
139
140        //--------------------------------------------------------------------------
141        @Override
142        public String getDisplayId() {
143            if(displayId == null) {
144                displayId = UUID.randomUUID().toString();
145            }
146            return displayId;
147        }
148
149        @Override
150        public final String getDebugId() {
151            return getDisplayId();
152        }
153    }
154    //</editor-fold>
155
156
157    //<editor-fold defaultstate="collapsed" desc=" Panel ">
158    @Configurable
159    public static abstract class Panel extends com.vaadin.ui.Panel implements Initializable {
160
161        private String displayId;
162
163        @PostConstruct
164        private void postConstruct() {
165            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
166            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
167            processor.process(this);
168            init();
169        }
170
171        //--------------------------------------------------------------------------
172        public Panel() {}
173
174        public Panel(String caption) {
175            super(caption);
176        }
177
178        public Panel(ComponentContainer content) {
179            super(content);
180        }
181
182        public Panel(String caption, ComponentContainer content) {
183            super(caption, content);
184        }
185
186        //--------------------------------------------------------------------------
187        @Override
188        public String getDisplayId() {
189            if(displayId == null) {
190                displayId = UUID.randomUUID().toString();
191            }
192            return displayId;
193        }
194
195        @Override
196        public final String getDebugId() {
197            return getDisplayId();
198        }
199    }
200    //</editor-fold>
201
202
203    //<editor-fold defaultstate="collapsed" desc=" Window ">
204    @Configurable
205    public static abstract class Window extends com.vaadin.ui.Window implements Initializable {
206
207        private String displayId;
208
209        @PostConstruct
210        private void postConstruct() {
211            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
212            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
213            processor.process(this);
214            init();
215        }
216
217        //--------------------------------------------------------------------------
218        public Window() {}
219
220        public Window(String caption) {
221            super(caption);
222        }
223
224        public Window(String caption, ComponentContainer content) {
225            super(caption, content);
226        }
227
228        //--------------------------------------------------------------------------
229        @Override
230        public String getDisplayId() {
231            if(displayId == null) {
232                displayId = UUID.randomUUID().toString();
233            }
234            return displayId;
235        }
236
237        @Override
238        public final String getDebugId() {
239            return getDisplayId();
240        }
241    }
242    //</editor-fold>
243
244
245    //<editor-fold defaultstate="collapsed" desc=" Table ">
246    @Configurable
247    public static abstract class Table extends com.vaadin.ui.Table implements Initializable {
248
249        private String displayId;
250
251        @PostConstruct
252        private void postConstruct() {
253            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
254            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
255            processor.process(this);
256            init();
257        }
258
259        //--------------------------------------------------------------------------
260        public Table() {}
261
262        public Table(String caption) {
263            super(caption);
264        }
265
266        public Table(String caption, Container dataSource) {
267            super(caption, dataSource);
268        }
269
270        //--------------------------------------------------------------------------
271        @Override
272        public String getDisplayId() {
273            if(displayId == null) {
274                displayId = UUID.randomUUID().toString();
275            }
276            return displayId;
277        }
278
279        @Override
280        public final String getDebugId() {
281            return getDisplayId();
282        }
283    }
284    //</editor-fold>
285
286
287    //<editor-fold defaultstate="collapsed" desc=" Tree ">
288    @Configurable
289    public static abstract class Tree extends com.vaadin.ui.Tree implements Initializable {
290
291        private String displayId;
292
293        @PostConstruct
294        private void postConstruct() {
295            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
296            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
297            processor.process(this);
298            init();
299        }
300
301        //--------------------------------------------------------------------------
302        public Tree() {}
303
304        public Tree(String caption) {
305            super(caption);
306        }
307
308        public Tree(String caption, Container dataSource) {
309            super(caption, dataSource);
310        }
311
312        //--------------------------------------------------------------------------
313        @Override
314        public String getDisplayId() {
315            if(displayId == null) {
316                displayId = UUID.randomUUID().toString();
317            }
318            return displayId;
319        }
320
321        @Override
322        public final String getDebugId() {
323            return getDisplayId();
324        }
325    }
326    //</editor-fold>
327
328
329    //<editor-fold defaultstate="collapsed" desc=" Form ">
330    @Configurable
331    public static abstract class Form extends com.vaadin.ui.Form implements Initializable {
332
333        private String displayId;
334
335        @PostConstruct
336        private void postConstruct() {
337            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
338            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
339            processor.process(this);
340            init();
341        }
342
343        //--------------------------------------------------------------------------
344        public Form() {}
345
346        public Form(Layout formLayout) {
347            super(formLayout);
348        }
349
350        public Form(Layout formLayout, FormFieldFactory fieldFactory) {
351            super(formLayout, fieldFactory);
352        }
353
354        //--------------------------------------------------------------------------
355        @Override
356        public String getDisplayId() {
357            if(displayId == null) {
358                displayId = UUID.randomUUID().toString();
359            }
360            return displayId;
361        }
362
363        @Override
364        public final String getDebugId() {
365            return getDisplayId();
366        }
367    }
368    //</editor-fold>
369
370
371    //<editor-fold defaultstate="collapsed" desc=" MenuBar ">
372    @Configurable
373    public static abstract class MenuBar extends com.vaadin.ui.MenuBar implements Initializable {
374
375        private String displayId;
376
377        @PostConstruct
378        private void postConstruct() {
379            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
380            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
381            processor.process(this);
382            init();
383        }
384
385        //--------------------------------------------------------------------------
386        public MenuBar() {}
387
388        //--------------------------------------------------------------------------
389        @Override
390        public String getDisplayId() {
391            if(displayId == null) {
392                displayId = UUID.randomUUID().toString();
393            }
394            return displayId;
395        }
396
397        @Override
398        public final String getDebugId() {
399            return getDisplayId();
400        }
401    }
402    //</editor-fold>
403
404
405    //<editor-fold defaultstate="collapsed" desc=" CustomComponent ">
406    @Configurable
407    public static abstract class CustomComponent extends com.vaadin.ui.CustomComponent implements Initializable {
408
409        private String displayId;
410
411        @PostConstruct
412        private void postConstruct() {
413            SubscriptionRegistry subscriptionRegistry = BaseApplication.getInstance().getDispatchContext().getSubscriptionRegistry();
414            AnnotationProcessor processor = new AnnotationProcessor(subscriptionRegistry);
415            processor.process(this);
416            init();
417        }
418
419        //--------------------------------------------------------------------------
420        public CustomComponent() {}
421
422        public CustomComponent(Component compositionRoot) {
423            super(compositionRoot);
424        }
425
426        //--------------------------------------------------------------------------
427        @Override
428        public String getDisplayId() {
429            if(displayId == null) {
430                displayId = UUID.randomUUID().toString();
431            }
432            return displayId;
433        }
434
435        @Override
436        public final String getDebugId() {
437            return getDisplayId();
438        }
439    }
440    //</editor-fold>
441
442
443}
Note: See TracBrowser for help on using the repository browser.