1 package eu
.etaxonomy
.taxeditor
;
3 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
4 import org
.eclipse
.jface
.resource
.JFaceResources
;
5 import org
.eclipse
.swt
.SWT
;
6 import org
.eclipse
.swt
.events
.SelectionAdapter
;
7 import org
.eclipse
.swt
.events
.SelectionEvent
;
8 import org
.eclipse
.swt
.graphics
.Font
;
9 import org
.eclipse
.swt
.layout
.GridData
;
10 import org
.eclipse
.swt
.layout
.GridLayout
;
11 import org
.eclipse
.swt
.widgets
.Composite
;
12 import org
.eclipse
.swt
.widgets
.Label
;
13 import org
.eclipse
.swt
.widgets
.Link
;
14 import org
.eclipse
.swt
.widgets
.Text
;
15 import org
.eclipse
.ui
.part
.ViewPart
;
17 public class View
extends ViewPart
{
19 public static final String ID
= "eu.etaxonomy.taxeditor.view";
21 public void createPartControl(Composite parent
) {
22 Composite top
= new Composite(parent
, SWT
.NONE
);
23 GridLayout layout
= new GridLayout();
24 layout
.marginHeight
= 10;
25 layout
.marginWidth
= 10;
26 top
.setLayout(layout
);
28 Composite banner
= new Composite(top
, SWT
.NONE
);
29 banner
.setLayoutData(new GridData(GridData
.HORIZONTAL_ALIGN_FILL
, GridData
.VERTICAL_ALIGN_BEGINNING
, true, false));
30 layout
= new GridLayout();
31 layout
.marginHeight
= 5;
32 layout
.marginWidth
= 10;
33 layout
.numColumns
= 2;
34 banner
.setLayout(layout
);
37 Font boldFont
= JFaceResources
.getFontRegistry().getBold(JFaceResources
.DEFAULT_FONT
);
39 Label l
= new Label(banner
, SWT
.WRAP
);
40 l
.setText("Subject:");
42 l
= new Label(banner
, SWT
.WRAP
);
43 l
.setText("This is a message about the cool Eclipse RCP!");
45 l
= new Label(banner
, SWT
.WRAP
);
49 final Link link
= new Link(banner
, SWT
.NONE
);
50 link
.setText("<a>nicole@mail.org</a>");
51 link
.addSelectionListener(new SelectionAdapter() {
52 public void widgetSelected(SelectionEvent e
) {
53 MessageDialog
.openInformation(getSite().getShell(), "Not Implemented", "Imagine the address book or a new message being created now.");
57 l
= new Label(banner
, SWT
.WRAP
);
60 l
= new Label(banner
, SWT
.WRAP
);
61 l
.setText("10:34 am");
63 Text text
= new Text(top
, SWT
.MULTI
| SWT
.WRAP
);
64 text
.setText("This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n"+
65 "- add a top-level menu and toolbar with actions\n"+
66 "- add keybindings to actions\n" +
67 "- create views that can't be closed and\n"+
68 " multiple instances of the same view\n"+
69 "- perspectives with placeholders for new views\n"+
70 "- use the default about dialog\n"+
71 "- create a product definition\n");
72 text
.setLayoutData(new GridData(GridData
.FILL_BOTH
));
75 public void setFocus() {