1 /******************************************************************************* 2 * Copyright (c) 2004, 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.ui.memory; 12 13 import org.eclipse.debug.core.model.IMemoryBlock; 14 15 16 /** 17 * A rendering bindings provider provides rendering type bindings for a memory block. 18 * <p> 19 * By default, bindings for a memory block are provided by the memory rendering 20 * manager. However, a client can provide dynamic renderings for a memory block 21 * by contributing a dynamic rendering binding in the <code>renderingBindings</code> 22 * element of a <code>memoryRenderings</code> extension. 23 * </p> 24 * <p> 25 * Clients contributing dynamic rendering bindings are intended to implement this 26 * interface. 27 * </p> 28 * @since 3.1 29 */ 30 public interface IMemoryRenderingBindingsProvider { 31 32 /** 33 * Returns all rendering types bound to the given memory block. 34 * This includes default and primary rendering types. 35 * 36 * @param block memory block 37 * @return all rendering types bound to the given memory block 38 */ 39 public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block); 40 41 /** 42 * Returns default rendering types bound to the given memory block, 43 * possibly empty. 44 * 45 * @param block memory block 46 * @return default rendering types bound to the given memory block, 47 * possibly empty 48 */ 49 public IMemoryRenderingType[] getDefaultRenderingTypes(IMemoryBlock block); 50 51 /** 52 * Returns the primary rendering type bound to the given memory block, 53 * or <code>null</code> if none. 54 * 55 * @param block memory block 56 * @return the primary rendering type bound to the given memory block, 57 * or <code>null</code> if none 58 */ 59 public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block); 60 61 /** 62 * Adds a listener to this binding provider. The listener will be notified 63 * when rendering bindings change. 64 * <p> 65 * Has no affect if an identical listener is already registered. 66 * </p> 67 * @param listener listener to add 68 */ 69 public void addListener(IMemoryRenderingBindingsListener listener); 70 71 /** 72 * Removes a listener from this binding provider. 73 * <p> 74 * Has no affect if an identical listener is not already registered. 75 * </p> 76 * @param listener listener to remove 77 */ 78 public void removeListener(IMemoryRenderingBindingsListener listener); 79 } 80