1 /******************************************************************************* 2 * Copyright (c) 2006, 2011 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 *******************************************************************************/ 14 package org.eclipse.debug.internal.ui.viewers.model.provisional; 15 16 import org.eclipse.jface.resource.ImageDescriptor; 17 18 /** 19 * Defines the possible set of columns presented in a view for a model. 20 * A column presentation is customizable per presentation context (view) and 21 * view input, and is created by an <code>IColumnPresentationFactory</code>. 22 * 23 * @since 3.2 24 */ 25 public interface IColumnPresentation { 26 27 /** 28 * Initializes this column presentation to be used in the 29 * given context. 30 * 31 * @param context Presentation context. 32 */ init(IPresentationContext context)33 void init(IPresentationContext context); 34 35 /** 36 * Disposes this column presentation 37 */ dispose()38 void dispose(); 39 40 /** 41 * Returns an array of all columns supported by this adapter as 42 * column identifiers. 43 * 44 * @return column identifiers 45 */ getAvailableColumns()46 String[] getAvailableColumns(); 47 48 /** 49 * Returns an ordered array of columns that should be displayed initially for 50 * this presentation as column IDs. 51 * 52 * @return initial columns to display 53 */ getInitialColumns()54 String[] getInitialColumns(); 55 56 /** 57 * Returns the column header for the column with the given identifier. 58 * 59 * @param id a column identifier included in <code>getColumns()</code> 60 * @return column header 61 */ getHeader(String id)62 String getHeader(String id); 63 64 /** 65 * Returns the image for the column with the given identifier, or <code>null</code> 66 * 67 * @param id column id 68 * @return image descriptor or <code>null</code> 69 */ getImageDescriptor(String id)70 ImageDescriptor getImageDescriptor(String id); 71 72 /** 73 * Returns an identifier for this columns presentation. 74 * The identifier should be unique per kind of column presentation 75 * (for example, the column presentation for Java stack frames 76 * in the variables view). Allows visible column information to be 77 * persisted by the platform. 78 * 79 * @return identifier 80 */ getId()81 String getId(); 82 83 /** 84 * Returns whether this column presentation is optional. When a column presentation 85 * is optional, the user may toggle columns on/off. 86 * 87 * @return whether this column presentation is optional 88 */ isOptional()89 boolean isOptional(); 90 91 } 92