KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > viewers > model > ElementCompareRequest


1 /*******************************************************************************
2  * Copyright (c) 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.debug.internal.ui.viewers.model;
12
13 import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
14 import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
15 import org.eclipse.jface.viewers.TreePath;
16 import org.eclipse.ui.IMemento;
17
18 /**
19  * @since 3.3
20  */

21 class ElementCompareRequest extends MementoUpdate implements IElementCompareRequest {
22
23     private boolean fEqual;
24     private ModelDelta fDelta;
25     /**
26      * @param context
27      * @param element
28      * @param memento
29      */

30     public ElementCompareRequest(ModelContentProvider provider, Object JavaDoc element, TreePath elementPath, IMemento memento, ModelDelta delta) {
31         super(provider, provider.getPresentationContext(), element, elementPath, memento);
32         fProvider = provider;
33         fDelta = delta;
34     }
35
36     /* (non-Javadoc)
37      * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest#setEqual(boolean)
38      */

39     public void setEqual(boolean equal) {
40         fEqual = equal;
41     }
42
43     /* (non-Javadoc)
44      * @see org.eclipse.core.runtime.IProgressMonitor#done()
45      */

46     public void done() {
47         if (isEqual()) {
48             fDelta.setElement(getElement());
49             fProvider.doRestore(fDelta);
50         }
51     }
52     
53     boolean isEqual() {
54         return fEqual;
55     }
56
57 }
58
Popular Tags