KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > internal > core > refactoring > RefactoringUndoContext


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ltk.internal.core.refactoring;
12
13 import org.eclipse.core.resources.ResourcesPlugin;
14
15 import org.eclipse.core.commands.operations.IUndoContext;
16
17 public class RefactoringUndoContext implements IUndoContext {
18
19     public String JavaDoc getLabel() {
20         return RefactoringCoreMessages.RefactoringUndoContext_label;
21     }
22
23     public boolean matches(IUndoContext context) {
24         if (this == context)
25             return true;
26         IUndoContext workspaceContext= (IUndoContext)ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class);
27         if (workspaceContext == null)
28             return false;
29         return workspaceContext.matches(context);
30     }
31 }
32
Popular Tags