1 package eu
.etaxonomy
.taxeditor
.editor
;
3 import org
.eclipse
.jface
.action
.IMenuManager
;
4 import org
.eclipse
.jface
.action
.IToolBarManager
;
5 import org
.eclipse
.swt
.SWT
;
6 import org
.eclipse
.swt
.events
.PaintEvent
;
7 import org
.eclipse
.swt
.events
.PaintListener
;
8 import org
.eclipse
.swt
.events
.SelectionAdapter
;
9 import org
.eclipse
.swt
.events
.SelectionEvent
;
10 import org
.eclipse
.swt
.graphics
.Image
;
11 import org
.eclipse
.swt
.graphics
.Rectangle
;
12 import org
.eclipse
.swt
.layout
.FillLayout
;
13 import org
.eclipse
.swt
.layout
.GridData
;
14 import org
.eclipse
.swt
.layout
.GridLayout
;
15 import org
.eclipse
.swt
.widgets
.Button
;
16 import org
.eclipse
.swt
.widgets
.Canvas
;
17 import org
.eclipse
.swt
.widgets
.Combo
;
18 import org
.eclipse
.swt
.widgets
.Composite
;
19 import org
.eclipse
.swt
.widgets
.Display
;
20 import org
.eclipse
.swt
.widgets
.FileDialog
;
21 import org
.eclipse
.swt
.widgets
.Group
;
22 import org
.eclipse
.swt
.widgets
.Label
;
23 import org
.eclipse
.swt
.widgets
.List
;
24 import org
.eclipse
.swt
.widgets
.Table
;
25 import org
.eclipse
.swt
.widgets
.TableColumn
;
26 import org
.eclipse
.swt
.widgets
.TableItem
;
27 import org
.eclipse
.swt
.widgets
.Text
;
28 import org
.eclipse
.ui
.part
.ViewPart
;
29 import com
.swtdesigner
.ResourceManager
;
30 import com
.swtdesigner
.SWTResourceManager
;
32 import eu
.etaxonomy
.taxeditor
.TaxEditorPlugin
;
34 public class UndoView
extends ViewPart
{
36 public static final String ID
= "eu.etaxonomy.taxeditor.editor.undoview"; //$NON-NLS-1$
40 * Create contents of the view part
44 public void createPartControl(Composite parent
) {
45 Composite container
= new Composite(parent
, SWT
.NONE
);
46 container
.setLayout(new FillLayout(SWT
.VERTICAL
));
48 table
= new Table(container
, SWT
.NONE
);
49 table
.getHorizontalBar().setVisible(false);
50 table
.setLinesVisible(true);
52 final TableColumn newColumnTableColumn
= new TableColumn(table
, SWT
.NONE
);
53 newColumnTableColumn
.setWidth(19);
55 final TableColumn newColumnTableColumn_1
= new TableColumn(table
, SWT
.NONE
);
56 newColumnTableColumn_1
.setWidth(1000);
57 newColumnTableColumn_1
.setText("New column");
59 final TableItem newItemTableItem
= new TableItem(table
, SWT
.BORDER
);
60 newItemTableItem
.setText(1, "Created taxon \"Pilosella fuscoatra (Nägeli & Peter) Soják\"");
62 final TableItem newItemTableItem_1
= new TableItem(table
, SWT
.BORDER
);
63 newItemTableItem_1
.setText(1, "Added fact (Distribution) \"California deciduous forest ...\" to \"Pilosella fuscoatra (Nägeli & Peter) Soják\"");
65 final TableItem newItemTableItem_2
= new TableItem(table
, SWT
.BORDER
);
66 newItemTableItem_2
.setText(1, "Added fact (Distribution) \"Brazilian (Northerly region)\" to \"Pilosella fuscoatra (Nägeli & Peter) Soják\"");
68 final TableItem newItemTableItem_3
= new TableItem(table
, SWT
.BORDER
);
69 newItemTableItem_3
.setText(1, "Moved taxon \"Pilosella fuscoatra (Nägeli & Peter) Soják\" to \"Pilosella fuscoatra coll.\"");
71 final TableItem newItemTableItem_4
= new TableItem(table
, SWT
.BORDER
);
72 newItemTableItem_4
.setText(1, "Added unknown syn. \"Hieracium fuscoatrum Nägeli & Peter\" to \"Pilosella fuscoatra (Nägeli & Peter) Soják\"");
74 final TableItem newItemTableItem_5
= new TableItem(table
, SWT
.BORDER
);
75 newItemTableItem_5
.setText(1, "Changed rel. type to homo. syn. for \"Hieracium fuscoatrum Nägeli & Peter\" to \"Pilosella fuscoatra (Nägeli & Peter) Soják\"");
77 final TableItem newItemTableItem_6
= new TableItem(table
, SWT
.BORDER
);
78 newItemTableItem_6
.setText(1, "Edited name \"Hieracium fuscoatrum Nägeli & Peter\" to \"Pilosella fuscoatra (Nägeli & Peter) Soják\"");
80 final TableItem newItemTableItem_7
= new TableItem(table
, SWT
.BORDER
);
81 newItemTableItem_7
.setText(new String
[] {"Undo the last action"});
82 newItemTableItem_7
.setImage(0, ResourceManager
.getPluginImage(TaxEditorPlugin
.getDefault(), "icons/undo.gif"));
83 newItemTableItem_7
.setText(1, "Deleted fact (Distribution) \"Brazilian (Northerly region)\" to \"Pilosella fuscoatra (Nägeli & Peter) Soják\"");
93 private void createActions() {
98 * Initialize the toolbar
100 private void initializeToolBar() {
101 IToolBarManager toolbarManager
= getViewSite().getActionBars()
102 .getToolBarManager();
106 * Initialize the menu
108 private void initializeMenu() {
109 IMenuManager menuManager
= getViewSite().getActionBars()
114 public void setFocus() {