cdt/cdt_6_0_x/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableColumnPresentation.java
author ryall
Tue, 12 Jan 2010 07:49:28 -0600
changeset 129 723898599d35
parent 37 c2bce6dd59e7
permissions -rw-r--r--
Bug 299167, turn the Variable View's Address column into a Location column.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     1
/*******************************************************************************
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     2
 * Copyright (c) 2006, 2008 Wind River Systems and others.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     3
 * All rights reserved. This program and the accompanying materials
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     4
 * are made available under the terms of the Eclipse Public License v1.0
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     5
 * which accompanies this distribution, and is available at
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     6
 * http://www.eclipse.org/legal/epl-v10.html
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     7
 * 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     8
 * Contributors:
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     9
 *     Wind River Systems - initial API and implementation
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    10
 *******************************************************************************/
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    11
package org.eclipse.cdt.dsf.debug.ui.viewmodel.variable;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    12
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    13
import org.eclipse.cdt.dsf.debug.ui.viewmodel.IDebugVMConstants;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    14
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    15
import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    16
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    17
import org.eclipse.jface.resource.ImageDescriptor;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    18
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    19
/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    20
 * 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    21
 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    22
public class VariableColumnPresentation implements IColumnPresentation {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    23
    public static final String ID = DsfUIPlugin.PLUGIN_ID + ".VARIABLES_COLUMN_PRESENTATION_ID"; //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    24
    
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    25
    // @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#init(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    26
    public void init(IPresentationContext context) {}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    27
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    28
    // @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#dispose()
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    29
    public void dispose() {}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    30
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    31
    // @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getAvailableColumns()
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    32
    public String[] getAvailableColumns() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    33
        return new String[] { IDebugVMConstants.COLUMN_ID__NAME, IDebugVMConstants.COLUMN_ID__TYPE, IDebugVMConstants.COLUMN_ID__VALUE, IDebugVMConstants.COLUMN_ID__ADDRESS };
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    34
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    35
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    36
    // @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getHeader(java.lang.String)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    37
    public String getHeader(String id) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    38
        if (IDebugVMConstants.COLUMN_ID__NAME.equals(id)) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    39
            return MessagesForVariablesVM.VariableColumnPresentation_name; 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    40
        } else if (IDebugVMConstants.COLUMN_ID__TYPE.equals(id)) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    41
            return MessagesForVariablesVM.VariableColumnPresentation_type;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    42
        } else if (IDebugVMConstants.COLUMN_ID__VALUE.equals(id)) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    43
            return MessagesForVariablesVM.VariableColumnPresentation_value;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    44
        } else if (IDebugVMConstants.COLUMN_ID__ADDRESS.equals(id)) {
129
723898599d35 Bug 299167, turn the Variable View's Address column into a Location column.
ryall
parents: 37
diff changeset
    45
        	return MessagesForVariablesVM.VariableColumnPresentation_location;
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    46
        } 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    47
        return null;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    48
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    49
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    50
    // @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getId()
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    51
    public String getId() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    52
        return ID;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    53
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    54
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    55
    // @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getImageDescriptor(java.lang.String)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    56
    public ImageDescriptor getImageDescriptor(String id) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    57
        return null;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    58
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    59
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    60
    // @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getInitialColumns()
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    61
    public String[] getInitialColumns() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    62
        return new String[] { IDebugVMConstants.COLUMN_ID__NAME, IDebugVMConstants.COLUMN_ID__TYPE, IDebugVMConstants.COLUMN_ID__VALUE };
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    63
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    64
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    65
    // @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#isOptional()
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    66
    public boolean isOptional() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    67
        return true;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    68
    }
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    69
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    70
}