KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > variables > JavaVariableColumnPresentation


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 package org.eclipse.jdt.internal.debug.ui.variables;
12
13 import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation;
14 import org.eclipse.jdt.debug.ui.IJavaDebugUIConstants;
15
16 /**
17  * @since 3.2
18  *
19  */

20 public class JavaVariableColumnPresentation extends VariableColumnPresentation {
21     /**
22      * Constant identifier for the Java variable column presentation.
23      */

24     public final static String JavaDoc JAVA_VARIABLE_COLUMN_PRESENTATION = IJavaDebugUIConstants.PLUGIN_ID + ".VARIALBE_COLUMN_PRESENTATION"; //$NON-NLS-1$
25
/**
26      * Default column identifiers
27      */

28     public final static String JavaDoc COLUMN_INSTANCE_ID = JAVA_VARIABLE_COLUMN_PRESENTATION + ".COL_INSTANCE_ID"; //$NON-NLS-1$
29

30     /**
31      * Column ids
32      */

33     private static String JavaDoc[] fgAllColumns = null;
34     
35     /* (non-Javadoc)
36      * @see org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation#getAvailableColumns()
37      */

38     public String JavaDoc[] getAvailableColumns() {
39         if (fgAllColumns == null) {
40             String JavaDoc[] basic = super.getAvailableColumns();
41             fgAllColumns = new String JavaDoc[basic.length + 1];
42             System.arraycopy(basic, 0, fgAllColumns, 0, basic.length);
43             fgAllColumns[basic.length] = COLUMN_INSTANCE_ID;
44         }
45         return fgAllColumns;
46     }
47     
48     /* (non-Javadoc)
49      * @see org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation#getHeader(java.lang.String)
50      */

51     public String JavaDoc getHeader(String JavaDoc id) {
52         if (COLUMN_INSTANCE_ID.equals(id)) {
53             return VariableMessages.JavaVariableColumnPresentation_0;
54         }
55         return super.getHeader(id);
56     }
57     
58     /* (non-Javadoc)
59      * @see org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation#getId()
60      */

61     public String JavaDoc getId() {
62         return JAVA_VARIABLE_COLUMN_PRESENTATION;
63     }
64     
65     
66 }
67
Popular Tags