2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.navigation
;
12 import org
.apache
.log4j
.Logger
;
13 import org
.eclipse
.jface
.action
.ContributionItem
;
14 import org
.eclipse
.jface
.action
.IContributionItem
;
15 import org
.eclipse
.jface
.action
.IContributionManager
;
16 import org
.eclipse
.swt
.widgets
.Menu
;
19 * This is a wrapper for Eclipse's recently opened editors functionality. IsDirty()
20 * and isDynamic() are both set to true to force redraw every time menu is opened.
26 public class RecentNamesContributionItem
extends ContributionItem
{
27 //FIXME E4 migrate recent menu items
28 private static final Logger logger
= Logger
29 .getLogger(RecentNamesContributionItem
.class);
31 private IContributionItem recentWindows
;
32 private IContributionManager parent
;
34 // @SuppressWarnings("restriction")
35 // RecentNamesContributionItem() {
36 //// WorkbenchPlugin.getDefault().getPreferenceStore().setValue(IPreferenceConstants.RECENT_FILES, 10);
37 // TaxeditorNavigationPlugin.getDefault().getPreferenceStore().setValue("RECENT_FILES", 10);
40 private IContributionItem
getRecentWindows() {
41 // if (recentWindows == null) {
43 //// int itemsToShow = TaxeditorNavigationPlugin.getDefault().getPreferenceStore()
44 //// .getInt("RECENT_FILES");
46 // recentWindows = ContributionItemFactory.REOPEN_EDITORS.create(NavigationUtil.getActiveWindow());
47 // recentWindows.setParent(parent);
53 * @see org.eclipse.jface.action.IContributionItem#dispose()
57 public void dispose() {
58 getRecentWindows().dispose();
63 * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.Menu, int)
67 public void fill(Menu parent
, int index
) {
68 // getRecentWindows().fill(parent, index);
72 * @see org.eclipse.jface.action.IContributionItem#isDirty()
76 public boolean isDirty() {
81 * @see org.eclipse.jface.action.IContributionItem#isDynamic()
85 public boolean isDynamic() {