p2izing the editor
[taxeditor.git] / eclipseprojects / eu.etaxonomy.taxeditor / src / eu / etaxonomy / taxeditor / editor / UndoView.java
1 package eu.etaxonomy.taxeditor.editor;
2
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;
31
32 import eu.etaxonomy.taxeditor.TaxEditorPlugin;
33
34 public class UndoView extends ViewPart {
35
36 public static final String ID = "eu.etaxonomy.taxeditor.editor.undoview"; //$NON-NLS-1$
37 private Table table;
38
39 /**
40 * Create contents of the view part
41 * @param parent
42 */
43 @Override
44 public void createPartControl(Composite parent) {
45 Composite container = new Composite(parent, SWT.NONE);
46 container.setLayout(new FillLayout(SWT.VERTICAL));
47
48 table = new Table(container, SWT.NONE);
49 table.getHorizontalBar().setVisible(false);
50 table.setLinesVisible(true);
51
52 final TableColumn newColumnTableColumn = new TableColumn(table, SWT.NONE);
53 newColumnTableColumn.setWidth(19);
54
55 final TableColumn newColumnTableColumn_1 = new TableColumn(table, SWT.NONE);
56 newColumnTableColumn_1.setWidth(1000);
57 newColumnTableColumn_1.setText("New column");
58
59 final TableItem newItemTableItem = new TableItem(table, SWT.BORDER);
60 newItemTableItem.setText(1, "Created taxon \"Pilosella fuscoatra (Nägeli & Peter) Soják\"");
61
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\"");
64
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\"");
67
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.\"");
70
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\"");
73
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\"");
76
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\"");
79
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\"");
84 //
85 createActions();
86 initializeToolBar();
87 initializeMenu();
88 }
89
90 /**
91 * Create the actions
92 */
93 private void createActions() {
94 // Create the actions
95 }
96
97 /**
98 * Initialize the toolbar
99 */
100 private void initializeToolBar() {
101 IToolBarManager toolbarManager = getViewSite().getActionBars()
102 .getToolBarManager();
103 }
104
105 /**
106 * Initialize the menu
107 */
108 private void initializeMenu() {
109 IMenuManager menuManager = getViewSite().getActionBars()
110 .getMenuManager();
111 }
112
113 @Override
114 public void setFocus() {
115 // Set the focus
116 }
117
118 }