KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > launch > LaunchViewUpdatePolicy


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.views.launch;
12
13 import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer;
14 import org.eclipse.debug.internal.ui.viewers.TreeUpdatePolicy;
15 import org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta;
16
17 /**
18  * @since 3.2
19  *
20  */

21 public class LaunchViewUpdatePolicy extends TreeUpdatePolicy {
22     
23     private LaunchView fView = null;
24     
25     public LaunchViewUpdatePolicy(LaunchView view) {
26         fView = view;
27     }
28
29     /* (non-Javadoc)
30      * @see org.eclipse.debug.internal.ui.viewers.update.AbstractUpdatePolicy#dispose()
31      */

32     public synchronized void dispose() {
33         super.dispose();
34         fView = null;
35     }
36
37     /* (non-Javadoc)
38      * @see org.eclipse.debug.internal.ui.viewers.update.DefaultUpdatePolicy#handleState(org.eclipse.debug.internal.ui.viewers.AsynchronousTreeModelViewer, org.eclipse.debug.internal.ui.viewers.IModelDelta)
39      */

40     protected void handleState(AsynchronousTreeViewer viewer, IModelDelta delta) {
41          super.handleState(viewer, delta);
42          // only context change if not already selected
43
if ((delta.getFlags() & IModelDelta.SELECT) == 0) {
44              fView.possibleContextChange(delta.getElement());
45          }
46     }
47
48 }
49
Popular Tags