KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > viewers > AbstractAddRemoveRequestMonitor


1 /*******************************************************************************
2  * Copyright (c) 2005, 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;
12
13 import org.eclipse.jface.viewers.TreePath;
14
15
16
17 /**
18  * Common function for adds and removes.
19  *
20  * @since 3.2
21  */

22 abstract class AbstractAddRemoveRequestMonitor extends AsynchronousRequestMonitor {
23     
24     private TreePath fPath;
25
26     /**
27      * Constructs a request to add/reomve an element from the tree
28      *
29      * @param node
30      * @param path path to the element in the tree
31      * @param model
32      *
33      */

34     AbstractAddRemoveRequestMonitor(ModelNode node, TreePath path, AsynchronousModel model) {
35         super(node, model);
36         fPath = path;
37     }
38     
39     protected TreePath getPath() {
40         return fPath;
41     }
42
43     /* (non-Javadoc)
44      * @see org.eclipse.debug.internal.ui.viewers.AsynchronousModelRequestMonitor#contains(org.eclipse.debug.internal.ui.viewers.AsynchronousModelRequestMonitor)
45      */

46     protected boolean contains(AsynchronousRequestMonitor update) {
47         if (update instanceof AbstractAddRemoveRequestMonitor) {
48             ((AbstractAddRemoveRequestMonitor)update).getPath().equals(getPath());
49         }
50         return false;
51     }
52
53 }
54
Popular Tags