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
.apache
.log4j
.Logger
;
14 import org
.eclipse
.core
.commands
.operations
.IUndoContext
;
15 import org
.eclipse
.core
.commands
.operations
.UndoContext
;
16 import org
.eclipse
.core
.runtime
.IAdapterFactory
;
24 public class WorkbenchUndoContextAdapterFactory
implements IAdapterFactory
{
25 private static final Logger logger
= Logger
26 .getLogger(WorkbenchUndoContextAdapterFactory
.class);
27 private UndoContext defaultUndoContext
;
29 private static final Class
[] ADAPTER_LIST
= new Class
[] { IUndoContext
.class };
32 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
34 public Object
getAdapter(Object adaptableObject
, Class adapterType
) {
35 if (IUndoContext
.class.equals(adapterType
)) {
36 return NavigationUtil
.getWorkbenchUndoContext();
44 private Object
getDefaultUndoContext() {
45 if (defaultUndoContext
== null) {
46 defaultUndoContext
= new UndoContext();
48 return defaultUndoContext
;
52 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
54 public Class
[] getAdapterList() {