|
Lines 76-82
Link Here
|
| 76 |
import org.eclipse.jface.util.IPropertyChangeListener; |
76 |
import org.eclipse.jface.util.IPropertyChangeListener; |
| 77 |
import org.eclipse.jface.util.LocalSelectionTransfer; |
77 |
import org.eclipse.jface.util.LocalSelectionTransfer; |
| 78 |
import org.eclipse.jface.util.PropertyChangeEvent; |
78 |
import org.eclipse.jface.util.PropertyChangeEvent; |
|
|
79 |
import org.eclipse.jface.viewers.ColumnViewerEditor; |
| 80 |
import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; |
| 81 |
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy; |
| 79 |
import org.eclipse.jface.viewers.DoubleClickEvent; |
82 |
import org.eclipse.jface.viewers.DoubleClickEvent; |
|
|
83 |
import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter; |
| 80 |
import org.eclipse.jface.viewers.ISelection; |
84 |
import org.eclipse.jface.viewers.ISelection; |
| 81 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
85 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
| 82 |
import org.eclipse.jface.viewers.ISelectionProvider; |
86 |
import org.eclipse.jface.viewers.ISelectionProvider; |
|
Lines 85-90
Link Here
|
| 85 |
import org.eclipse.jface.viewers.StructuredSelection; |
89 |
import org.eclipse.jface.viewers.StructuredSelection; |
| 86 |
import org.eclipse.jface.viewers.StructuredViewer; |
90 |
import org.eclipse.jface.viewers.StructuredViewer; |
| 87 |
import org.eclipse.jface.viewers.TreeViewer; |
91 |
import org.eclipse.jface.viewers.TreeViewer; |
|
|
92 |
import org.eclipse.jface.viewers.TreeViewerEditor; |
| 93 |
import org.eclipse.jface.viewers.TreeViewerFocusCellManager; |
| 88 |
import org.eclipse.jface.viewers.Viewer; |
94 |
import org.eclipse.jface.viewers.Viewer; |
| 89 |
import org.eclipse.swt.SWT; |
95 |
import org.eclipse.swt.SWT; |
| 90 |
import org.eclipse.swt.custom.SashForm; |
96 |
import org.eclipse.swt.custom.SashForm; |
|
Lines 358-363
Link Here
|
| 358 |
private SelectionProviderWrapper fSelectionProvider; |
364 |
private SelectionProviderWrapper fSelectionProvider; |
| 359 |
|
365 |
|
| 360 |
/** |
366 |
/** |
|
|
367 |
* Presentation context for this view. |
| 368 |
*/ |
| 369 |
private IPresentationContext fPresentationContext; |
| 370 |
|
| 371 |
/** |
| 361 |
* Remove myself as a selection listener |
372 |
* Remove myself as a selection listener |
| 362 |
* and preference change listener. |
373 |
* and preference change listener. |
| 363 |
* |
374 |
* |
|
Lines 374-379
Link Here
|
| 374 |
viewer.removeModelChangedListener(this); |
385 |
viewer.removeModelChangedListener(this); |
| 375 |
viewer.removeViewerUpdateListener(this); |
386 |
viewer.removeViewerUpdateListener(this); |
| 376 |
} |
387 |
} |
|
|
388 |
if (fPresentationContext != null) { |
| 389 |
fPresentationContext.dispose(); |
| 390 |
fPresentationContext = null; |
| 391 |
} |
| 377 |
if (fDetailPane != null) fDetailPane.dispose(); |
392 |
if (fDetailPane != null) fDetailPane.dispose(); |
| 378 |
fInputService.dispose(); |
393 |
fInputService.dispose(); |
| 379 |
fSelectionProvider.dispose(); |
394 |
fSelectionProvider.dispose(); |
|
Lines 581-588
Link Here
|
| 581 |
protected TreeModelViewer createTreeViewer(Composite parent) { |
596 |
protected TreeModelViewer createTreeViewer(Composite parent) { |
| 582 |
|
597 |
|
| 583 |
int style = getViewerStyle(); |
598 |
int style = getViewerStyle(); |
| 584 |
final TreeModelViewer variablesViewer = new TreeModelViewer(parent, style, |
599 |
fPresentationContext = new DebugModelPresentationContext(getPresentationContextId(), fModelPresentation); |
| 585 |
new DebugModelPresentationContext(getPresentationContextId(), getModelPresentation())); |
600 |
final TreeModelViewer variablesViewer = new TreeModelViewer(parent, style, fPresentationContext); |
| 586 |
|
601 |
|
| 587 |
variablesViewer.getControl().addFocusListener(new FocusAdapter() { |
602 |
variablesViewer.getControl().addFocusListener(new FocusAdapter() { |
| 588 |
public void focusGained(FocusEvent e) { |
603 |
public void focusGained(FocusEvent e) { |
|
Lines 602-607
Link Here
|
| 602 |
getViewSite().getActionBars().updateActionBars(); |
617 |
getViewSite().getActionBars().updateActionBars(); |
| 603 |
} |
618 |
} |
| 604 |
}); |
619 |
}); |
|
|
620 |
|
| 621 |
|
| 622 |
ColumnViewerEditorActivationStrategy activationStrategy = new ColumnViewerEditorActivationStrategy(variablesViewer) { |
| 623 |
protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) { |
| 624 |
return super.isEditorActivationEvent(event) || |
| 625 |
(event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && |
| 626 |
event.keyCode == SWT.F2); |
| 627 |
} |
| 628 |
}; |
| 629 |
|
| 630 |
TreeViewerEditor.create( |
| 631 |
variablesViewer, new TreeViewerFocusCellManager(variablesViewer, new FocusCellOwnerDrawHighlighter(variablesViewer)), |
| 632 |
activationStrategy, ColumnViewerEditor.DEFAULT | ColumnViewerEditor.KEYBOARD_ACTIVATION); |
| 633 |
|
| 605 |
variablesViewer.getPresentationContext().addPropertyChangeListener( |
634 |
variablesViewer.getPresentationContext().addPropertyChangeListener( |
| 606 |
new IPropertyChangeListener() { |
635 |
new IPropertyChangeListener() { |
| 607 |
public void propertyChange(PropertyChangeEvent event) { |
636 |
public void propertyChange(PropertyChangeEvent event) { |