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 12 package org.eclipse.debug.internal.ui.views.memory; 13 14 import org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider; 15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; 16 import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; 17 import org.eclipse.swt.widgets.Composite; 18 19 /** 20 * Customized tree viewer for the Memory View 21 * This Tree Viewer has a specialized update policy for the memory view. 22 * When the model fires a ADDED delta, the update policy handles the event as follows: 23 * If the ADDED delta is accompanied by SELECT, and the added element is an memory blok, then 24 * the udpate policy asks the Memory View if the it is currently pinned to a memory block. If the view 25 * is currently pinned, then the SELECT delta is ignored. 26 * 27 * If the ADDED delta and SELECT delta are recieved in separate nodes, then the delta will be handled as-is and would 28 * not take the pinning state of the memory view into account. 29 * 30 */ 31 public class MemoryViewTreeViewer extends TreeModelViewer { 32 33 public MemoryViewTreeViewer(Composite parent, int style, 34 IPresentationContext context) { 35 super(parent, style, context); 36 } 37 38 /* 39 * Need to have a customized content provider to define a special update policy for the Memory View 40 * (non-Javadoc) 41 * @see org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer#createContentProvider() 42 */ 43 protected TreeModelContentProvider createContentProvider() { 44 return new MemoryViewTreeModelContentProvider(); 45 } 46 47 } 48