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.
9 package eu
.etaxonomy
.taxeditor
.navigation
;
11 import org
.apache
.logging
.log4j
.LogManager
;import org
.apache
.logging
.log4j
.Logger
;
12 import org
.eclipse
.jface
.action
.ContributionItem
;
13 import org
.eclipse
.jface
.action
.IContributionItem
;
14 import org
.eclipse
.jface
.action
.IContributionManager
;
15 import org
.eclipse
.swt
.widgets
.Menu
;
18 * This is a wrapper for Eclipse's recently opened editors functionality. IsDirty()
19 * and isDynamic() are both set to true to force redraw every time menu is opened.
24 public class RecentNamesContributionItem
extends ContributionItem
{
26 //FIXME E4 migrate recent menu items
27 private static final Logger logger
= Logger
.getLogger(RecentNamesContributionItem
.class);
29 private IContributionItem recentWindows
;
30 private IContributionManager parent
;
32 // @SuppressWarnings("restriction")
33 // RecentNamesContributionItem() {
34 //// WorkbenchPlugin.getDefault().getPreferenceStore().setValue(IPreferenceConstants.RECENT_FILES, 10);
35 // TaxeditorNavigationPlugin.getDefault().getPreferenceStore().setValue("RECENT_FILES", 10);
38 private IContributionItem
getRecentWindows() {
39 // if (recentWindows == null) {
41 //// int itemsToShow = TaxeditorNavigationPlugin.getDefault().getPreferenceStore()
42 //// .getInt("RECENT_FILES");
44 // recentWindows = ContributionItemFactory.REOPEN_EDITORS.create(NavigationUtil.getActiveWindow());
45 // recentWindows.setParent(parent);
51 * @see org.eclipse.jface.action.IContributionItem#dispose()
55 public void dispose() {
56 getRecentWindows().dispose();
61 * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.Menu, int)
65 public void fill(Menu parent
, int index
) {
66 // getRecentWindows().fill(parent, index);
70 * @see org.eclipse.jface.action.IContributionItem#isDirty()
74 public boolean isDirty() {
79 * @see org.eclipse.jface.action.IContributionItem#isDynamic()
83 public boolean isDynamic() {