2  * Created on 25.11.2004
 
   4  * TODO To change the template for this generated file go to
 
   5  * Window - Preferences - Java - Code Style - Code Templates
 
   7 package net.sourceforge.phpeclipse.xdebug.ui;
 
   9 import org.eclipse.core.resources.IFile;
 
  10 import org.eclipse.debug.core.DebugException;
 
  11 import org.eclipse.debug.core.model.ILineBreakpoint;
 
  12 import org.eclipse.debug.core.model.IValue;
 
  13 import org.eclipse.debug.ui.IDebugModelPresentation;
 
  14 import org.eclipse.debug.ui.IValueDetailListener;
 
  15 import org.eclipse.jface.viewers.LabelProvider;
 
  16 import org.eclipse.swt.graphics.Image;
 
  17 import org.eclipse.ui.IEditorInput;
 
  18 import org.eclipse.ui.part.FileEditorInput;
 
  23  * TODO To change the template for this generated type comment go to
 
  24  * Window - Preferences - Java - Code Style - Code Templates
 
  26 public class XDebugModelPresentation  extends LabelProvider implements IDebugModelPresentation {
 
  28          * @see org.eclipse.debug.ui.IDebugModelPresentation#setAttribute(java.lang.String, java.lang.Object)
 
  30         public void setAttribute(String attribute, Object value) {
 
  33          * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
 
  35         public Image getImage(Object element) {
 
  39          * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
 
  41         public String getText(Object element) {
 
  45          * @see org.eclipse.debug.ui.IDebugModelPresentation#computeDetail(org.eclipse.debug.core.model.IValue, org.eclipse.debug.ui.IValueDetailListener)
 
  47         public void computeDetail(IValue value, IValueDetailListener listener) {
 
  50                         detail = value.getValueString();
 
  51                 } catch (DebugException e) {
 
  53                 listener.detailComputed(value, detail);
 
  56          * @see org.eclipse.debug.ui.ISourcePresentation#getEditorInput(java.lang.Object)
 
  58         public IEditorInput getEditorInput(Object element) {
 
  59                 if (element instanceof IFile) {
 
  60                         return new FileEditorInput((IFile)element);
 
  62                 if (element instanceof ILineBreakpoint) {
 
  63                         return new FileEditorInput((IFile)((ILineBreakpoint)element).getMarker().getResource());
 
  68          * @see org.eclipse.debug.ui.ISourcePresentation#getEditorId(org.eclipse.ui.IEditorInput, java.lang.Object)
 
  70         public String getEditorId(IEditorInput input, Object element) {
 
  71                 if (element instanceof IFile || element instanceof ILineBreakpoint) {
 
  72                         return "org.eclipse.ui.DefaultTextEditor";