KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > elements > adapters > VariableColumnPresentation


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.debug.internal.ui.elements.adapters;
12
13 import org.eclipse.debug.internal.ui.viewers.provisional.AbstractColumnPresentation;
14 import org.eclipse.debug.ui.IDebugUIConstants;
15
16 /**
17  * Columns for Java variables.
18  *
19  * @since 3.2
20  */

21 public class VariableColumnPresentation extends AbstractColumnPresentation {
22     
23     /**
24      * Constant identifier for the default variable column presentation.
25      */

26     public final static String JavaDoc DEFAULT_VARIABLE_COLUMN_PRESENTATION = IDebugUIConstants.PLUGIN_ID + ".VARIALBE_COLUMN_PRESENTATION"; //$NON-NLS-1$
27

28     /**
29      * Default column identifiers
30      */

31     public final static String JavaDoc COLUMN_VARIABLE_NAME = DEFAULT_VARIABLE_COLUMN_PRESENTATION + ".COL_VAR_NAME"; //$NON-NLS-1$
32
public final static String JavaDoc COLUMN_VARIABLE_TYPE = DEFAULT_VARIABLE_COLUMN_PRESENTATION + ".COL_VAR_TYPE"; //$NON-NLS-1$
33
public final static String JavaDoc COLUMN_VARIABLE_VALUE = DEFAULT_VARIABLE_COLUMN_PRESENTATION + ".COL_VAR_VALUE"; //$NON-NLS-1$
34
public final static String JavaDoc COLUMN_VALUE_TYPE = DEFAULT_VARIABLE_COLUMN_PRESENTATION + ".COL_VALUE_TYPE"; //$NON-NLS-1$
35

36     private static final String JavaDoc[] ALL_COLUMNS = new String JavaDoc[]{COLUMN_VARIABLE_NAME, COLUMN_VARIABLE_TYPE, COLUMN_VARIABLE_VALUE, COLUMN_VALUE_TYPE};
37     private static final String JavaDoc[] INITIAL_COLUMNS = new String JavaDoc[]{COLUMN_VARIABLE_NAME, COLUMN_VARIABLE_VALUE};
38     
39     /* (non-Javadoc)
40      * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getColumns()
41      */

42     public String JavaDoc[] getAvailableColumns() {
43         return ALL_COLUMNS;
44     }
45
46     /* (non-Javadoc)
47      * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getHeader(java.lang.String)
48      */

49     public String JavaDoc getHeader(String JavaDoc id) {
50         if (COLUMN_VARIABLE_TYPE.equals(id)) {
51             return Messages.VariableColumnPresentation_0;
52         }
53         if (COLUMN_VARIABLE_NAME.equals(id)) {
54             return Messages.VariableColumnPresentation_1;
55         }
56         if (COLUMN_VARIABLE_VALUE.equals(id)) {
57             return Messages.VariableColumnPresentation_2;
58         }
59         if (COLUMN_VALUE_TYPE.equals(id)) {
60             return Messages.VariableColumnPresentation_3;
61         }
62         return null;
63     }
64
65     /* (non-Javadoc)
66      * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getId()
67      */

68     public String JavaDoc getId() {
69         return DEFAULT_VARIABLE_COLUMN_PRESENTATION;
70     }
71
72     /* (non-Javadoc)
73      * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getInitialColumns()
74      */

75     public String JavaDoc[] getInitialColumns() {
76         return INITIAL_COLUMNS;
77     }
78
79     /* (non-Javadoc)
80      * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#isOptional()
81      */

82     public boolean isOptional() {
83         return true;
84     }
85
86 }
87
Popular Tags