3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.navigation
;
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
;
17 import org
.eclipse
.ui
.actions
.ContributionItemFactory
;
20 * This is a wrapper for Eclipse's recently opened editors functionality. IsDirty()
21 * and isDynamic() are both set to true to force redraw every time menu is opened.
27 public class RecentNamesContributionItem
extends ContributionItem
{
29 private IContributionItem recentWindows
;
30 private IContributionManager parent
;
33 private IContributionItem
getRecentWindows() {
34 if (recentWindows
== null) {
35 recentWindows
= ContributionItemFactory
.REOPEN_EDITORS
.create(NavigationUtil
.getActiveWindow());
36 recentWindows
.setParent(parent
);
42 * @see org.eclipse.jface.action.IContributionItem#dispose()
45 public void dispose() {
46 getRecentWindows().dispose();
51 * @see org.eclipse.jface.action.IContributionItem#fill(org.eclipse.swt.widgets.Menu, int)
54 public void fill(Menu parent
, int index
) {
55 getRecentWindows().fill(parent
, index
);
59 * @see org.eclipse.jface.action.IContributionItem#isDirty()
62 public boolean isDirty() {
67 * @see org.eclipse.jface.action.IContributionItem#isDynamic()
70 public boolean isDynamic() {