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
.core
.commands
.operations
.IUndoContext
;
14 import org
.eclipse
.core
.commands
.operations
.UndoContext
;
15 import org
.eclipse
.core
.runtime
.IAdapterFactory
;
19 * <p>WorkbenchUndoContextAdapterFactory class.</p>
25 public class WorkbenchUndoContextAdapterFactory
implements IAdapterFactory
{
26 private static final Logger logger
= Logger
27 .getLogger(WorkbenchUndoContextAdapterFactory
.class);
28 private UndoContext defaultUndoContext
;
30 private static final Class
[] ADAPTER_LIST
= new Class
[] { IUndoContext
.class };
33 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
36 public Object
getAdapter(Object adaptableObject
, Class adapterType
) {
37 if (IUndoContext
.class.equals(adapterType
)) {
38 return NavigationUtil
.getWorkbenchUndoContext();
46 private Object
getDefaultUndoContext() {
47 if (defaultUndoContext
== null) {
48 defaultUndoContext
= new UndoContext();
50 return defaultUndoContext
;
54 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
57 * <p>getAdapterList</p>
59 * @return an array of {@link java.lang.Class} objects.
61 public Class
[] getAdapterList() {