1) Separated out transaction stuff to CdmTransactionController, 2) Put data source...
[taxeditor.git] / eclipseprojects / eu.etaxonomy.taxeditor / src / eu / etaxonomy / taxeditor / navigation / RecentNamesView.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the recentNamesComposite of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.taxeditor.navigation;
11
12 import org.apache.log4j.Logger;
13 import org.eclipse.jface.action.IMenuManager;
14 import org.eclipse.jface.action.IToolBarManager;
15 import org.eclipse.swt.SWT;
16 import org.eclipse.swt.layout.FillLayout;
17 import org.eclipse.swt.layout.GridLayout;
18 import org.eclipse.swt.widgets.Composite;
19 import org.eclipse.swt.widgets.Display;
20 import org.eclipse.ui.part.ViewPart;
21
22 /**
23 * The left navigation pane.
24 *
25 * @author p.ciardelli
26 * @created 27.05.2008
27 * @version 1.0
28 */
29 public class RecentNamesView extends ViewPart {
30 private static final Logger logger = Logger.getLogger(RecentNamesView.class);
31
32 private Composite recentNamesComposite = null;
33 public static final String ID = "eu.etaxonomy.taxeditor.navigation.recentnamesview"; //$NON-NLS-1$
34
35 /**
36 * Create contents of the view part
37 * @param parent
38 */
39 @Override
40 public void createPartControl(Composite parent) {
41
42 parent.setLayout(new FillLayout());
43 GridLayout gridLayout = new GridLayout();
44 gridLayout.horizontalSpacing = 0;
45 gridLayout.marginWidth = 0;
46 gridLayout.marginHeight = 0;
47 gridLayout.verticalSpacing = 0;
48
49 recentNamesComposite = new Composite(parent, SWT.NONE);
50 recentNamesComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
51 recentNamesComposite.setLayout(new FillLayout());
52
53 new RecentNamesTableViewer(recentNamesComposite);
54
55 createActions();
56 initializeToolBar();
57 initializeMenu();
58 }
59
60 private void createActions() {
61 // Create the actions
62 }
63
64 /**
65 * Initialize the toolbar
66 */
67 private void initializeToolBar() {
68 IToolBarManager toolbarManager = getViewSite().getActionBars()
69 .getToolBarManager();
70 }
71
72 /**
73 * Initialize the menu
74 */
75 private void initializeMenu() {
76 IMenuManager menuManager = getViewSite().getActionBars()
77 .getMenuManager();
78 }
79
80 @Override
81 public void setFocus() {
82 // Set the focus
83 }
84 }