1 11 package org.eclipse.debug.internal.ui.views.memory; 12 13 import java.math.BigInteger ; 14 15 import org.eclipse.debug.internal.ui.DebugUIPlugin; 16 import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; 17 import org.eclipse.debug.ui.IDebugModelPresentation; 18 import org.eclipse.jface.viewers.IColorProvider; 19 import org.eclipse.swt.graphics.Color; 20 21 24 public class MemoryViewTabLabelProvider 25 extends AbstractTableViewTabLabelProvider implements IColorProvider{ 26 27 30 public MemoryViewTabLabelProvider() { 31 super(); 32 } 33 34 public MemoryViewTabLabelProvider(ITableMemoryViewTab viewTab, AbstractMemoryRenderer renderer){ 35 super(viewTab, renderer); 36 } 37 38 41 public String getColumnText(Object element, int columnIndex) { 42 43 String label = super.getColumnText(element, columnIndex); 44 45 if (columnIndex == 0) 47 { 48 if (fViewTab instanceof MemoryViewTab) 49 { 50 IDebugModelPresentation presentation = ((MemoryViewTab)fViewTab).getMemoryBlockPresentation(); 52 53 if (presentation instanceof IMemoryBlockModelPresentation) 54 { 55 IMemoryBlockModelPresentation memPresentation = (IMemoryBlockModelPresentation)presentation; 56 String address = ((MemoryViewLine)element).getAddress(); 57 58 String tempLabel = memPresentation.getAddressPresentation(fViewTab.getMemoryBlock(), new BigInteger (address, 16)); 60 61 if (tempLabel != null) 62 return tempLabel; 63 } 64 } 65 return label; 66 } 67 return label; 68 } 69 70 73 public Color getForeground(Object element) { 74 if (element instanceof MemoryViewLine) 75 { 76 MemoryViewLine line = (MemoryViewLine)element; 77 78 if (line.isMonitored) { 79 return null; 80 } 81 return DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.MEMORY_VIEW_UNBUFFERED_LINE_COLOR); 82 } 83 return null; 84 } 85 86 89 public Color getBackground(Object element) { 90 91 return null; 92 } 93 } 94 | Popular Tags |