mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 22:22:11 +02:00
Bug 122336: Use the asynchronous tree viewer in the Modules view. Adjustments to the platform changes in M5.
This commit is contained in:
parent
b0f0e7e414
commit
373ff106c3
10 changed files with 153 additions and 84 deletions
|
@ -1,3 +1,18 @@
|
||||||
|
2006-02-21 Mikhail Khodjaiants
|
||||||
|
Bug 122336: Use the asynchronous tree viewer in the Modules view.
|
||||||
|
Adjustments to the platform changes in M5.
|
||||||
|
+ src/org/eclipse/cdt/debug/internal/ui/elements/adapters (new package)
|
||||||
|
+ CDebugElementAdapterFactory.java
|
||||||
|
* AbstractViewerState.java
|
||||||
|
+ ModuleContentAdapter.java
|
||||||
|
+ ModuleProxyFactory.java
|
||||||
|
* ModulesView.java
|
||||||
|
* ModulesViewer.java
|
||||||
|
* ModulesViewerState.java
|
||||||
|
* ModulesViewEventHandler.java
|
||||||
|
- ModuleTreeContentAdapter.java
|
||||||
|
* CDebugUIPlugin.java
|
||||||
|
|
||||||
2006-02-03 Mikhail Khodjaiants
|
2006-02-03 Mikhail Khodjaiants
|
||||||
The "ICDebuggerPage" interface and "AbstractCDebuggerPage" class are added.
|
The "ICDebuggerPage" interface and "AbstractCDebuggerPage" class are added.
|
||||||
All extensions of the "CDebuggerPage" extension point must implement "ICDebuggerPage".
|
All extensions of the "CDebuggerPage" extension point must implement "ICDebuggerPage".
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.internal.ui.elements.adapters;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.debug.core.model.ICModule;
|
||||||
|
import org.eclipse.cdt.debug.core.model.IModuleRetrieval;
|
||||||
|
import org.eclipse.cdt.debug.internal.ui.views.modules.ModuleContentAdapter;
|
||||||
|
import org.eclipse.cdt.debug.internal.ui.views.modules.ModuleProxyFactory;
|
||||||
|
import org.eclipse.core.runtime.IAdapterFactory;
|
||||||
|
import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousContentAdapter;
|
||||||
|
import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousLabelAdapter;
|
||||||
|
import org.eclipse.debug.internal.ui.viewers.provisional.IModelProxyFactoryAdapter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Comment for .
|
||||||
|
*/
|
||||||
|
public class CDebugElementAdapterFactory implements IAdapterFactory {
|
||||||
|
|
||||||
|
// private static IAsynchronousLabelAdapter fgModuleLabelAdapter = new AsynchronousDebugLabelAdapter();
|
||||||
|
private static IAsynchronousContentAdapter fgModuleContentAdapter = new ModuleContentAdapter();
|
||||||
|
private static IModelProxyFactoryAdapter fgModuleProxyFactory = new ModuleProxyFactory();
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
|
||||||
|
*/
|
||||||
|
public Object getAdapter( Object adaptableObject, Class adapterType ) {
|
||||||
|
if ( adapterType.isInstance( adaptableObject ) ) {
|
||||||
|
return adaptableObject;
|
||||||
|
}
|
||||||
|
if ( adapterType.equals( IAsynchronousContentAdapter.class ) ) {
|
||||||
|
if ( adaptableObject instanceof IModuleRetrieval ) {
|
||||||
|
return fgModuleContentAdapter;
|
||||||
|
}
|
||||||
|
if ( adaptableObject instanceof ICModule ) {
|
||||||
|
return fgModuleContentAdapter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( adapterType.equals( IModelProxyFactoryAdapter.class ) ) {
|
||||||
|
if ( adaptableObject instanceof IModuleRetrieval ) {
|
||||||
|
return fgModuleProxyFactory;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
|
||||||
|
*/
|
||||||
|
public Class[] getAdapterList() {
|
||||||
|
return new Class[] {
|
||||||
|
IAsynchronousContentAdapter.class,
|
||||||
|
IAsynchronousLabelAdapter.class,
|
||||||
|
IModelProxyFactoryAdapter.class
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,10 +12,9 @@ package org.eclipse.cdt.debug.internal.ui.views;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer;
|
import org.eclipse.debug.internal.ui.model.viewers.AsynchronousTreeModelViewer;
|
||||||
import org.eclipse.debug.internal.ui.viewers.TreePath;
|
import org.eclipse.debug.internal.ui.viewers.TreePath;
|
||||||
import org.eclipse.debug.internal.ui.viewers.TreeSelection;
|
import org.eclipse.debug.internal.ui.viewers.TreeSelection;
|
||||||
import org.eclipse.swt.widgets.TreeItem;
|
import org.eclipse.swt.widgets.TreeItem;
|
||||||
|
@ -33,7 +32,7 @@ public abstract class AbstractViewerState {
|
||||||
/**
|
/**
|
||||||
* Constructs a memento for the given viewer.
|
* Constructs a memento for the given viewer.
|
||||||
*/
|
*/
|
||||||
public AbstractViewerState(AsynchronousTreeViewer viewer) {
|
public AbstractViewerState(AsynchronousTreeModelViewer viewer) {
|
||||||
saveState(viewer);
|
saveState(viewer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +42,7 @@ public abstract class AbstractViewerState {
|
||||||
*
|
*
|
||||||
* @param viewer viewer of which to save the state
|
* @param viewer viewer of which to save the state
|
||||||
*/
|
*/
|
||||||
public void saveState(AsynchronousTreeViewer viewer) {
|
public void saveState(AsynchronousTreeModelViewer viewer) {
|
||||||
List expanded = new ArrayList();
|
List expanded = new ArrayList();
|
||||||
fSavedExpansion = null;
|
fSavedExpansion = null;
|
||||||
TreeItem[] items = viewer.getTree().getItems();
|
TreeItem[] items = viewer.getTree().getItems();
|
||||||
|
@ -115,7 +114,7 @@ public abstract class AbstractViewerState {
|
||||||
*
|
*
|
||||||
* @param viewer viewer to which state is restored
|
* @param viewer viewer to which state is restored
|
||||||
*/
|
*/
|
||||||
public void restoreState(AsynchronousTreeViewer viewer) {
|
public void restoreState(AsynchronousTreeModelViewer viewer) {
|
||||||
boolean expansionComplete = true;
|
boolean expansionComplete = true;
|
||||||
if (fSavedExpansion != null && fSavedExpansion.size() > 0) {
|
if (fSavedExpansion != null && fSavedExpansion.size() > 0) {
|
||||||
for (int i = 0; i < fSavedExpansion.size(); i++) {
|
for (int i = 0; i < fSavedExpansion.size(); i++) {
|
||||||
|
@ -176,6 +175,6 @@ public abstract class AbstractViewerState {
|
||||||
* @return element represented by the path, or <code>null</code> if none
|
* @return element represented by the path, or <code>null</code> if none
|
||||||
* @throws DebugException if unable to locate a variable
|
* @throws DebugException if unable to locate a variable
|
||||||
*/
|
*/
|
||||||
protected abstract TreePath decodePath(IPath path, AsynchronousTreeViewer viewer) throws DebugException;
|
protected abstract TreePath decodePath(IPath path, AsynchronousTreeModelViewer viewer) throws DebugException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,16 +17,16 @@ import org.eclipse.cdt.debug.core.model.ICModule;
|
||||||
import org.eclipse.cdt.debug.core.model.IModuleRetrieval;
|
import org.eclipse.cdt.debug.core.model.IModuleRetrieval;
|
||||||
import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
|
import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeContentAdapter;
|
import org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter;
|
||||||
import org.eclipse.debug.internal.ui.viewers.IPresentationContext;
|
import org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comment for .
|
* Comment for .
|
||||||
*/
|
*/
|
||||||
public class ModuleTreeContentAdapter extends AsynchronousTreeContentAdapter {
|
public class ModuleContentAdapter extends AsynchronousContentAdapter {
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.debug.internal.ui.viewers.AsynchronousTreeContentAdapter#getChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.IPresentationContext)
|
* @see org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter#getChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
|
||||||
*/
|
*/
|
||||||
protected Object[] getChildren( Object parent, IPresentationContext context ) throws CoreException {
|
protected Object[] getChildren( Object parent, IPresentationContext context ) throws CoreException {
|
||||||
if ( parent instanceof IModuleRetrieval ) {
|
if ( parent instanceof IModuleRetrieval ) {
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.internal.ui.views.modules;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.debug.core.model.IModuleRetrieval;
|
||||||
|
import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
|
||||||
|
import org.eclipse.debug.internal.ui.viewers.provisional.IModelProxy;
|
||||||
|
import org.eclipse.debug.internal.ui.viewers.provisional.IModelProxyFactoryAdapter;
|
||||||
|
import org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext;
|
||||||
|
import org.eclipse.ui.IWorkbenchPart;
|
||||||
|
|
||||||
|
public class ModuleProxyFactory implements IModelProxyFactoryAdapter {
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelProxyFactoryAdapter#createModelProxy(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
|
||||||
|
*/
|
||||||
|
public IModelProxy createModelProxy( Object element, IPresentationContext context ) {
|
||||||
|
IWorkbenchPart part = context.getPart();
|
||||||
|
if ( part != null ) {
|
||||||
|
String id = part.getSite().getId();
|
||||||
|
if ( ICDebugUIConstants.ID_MODULES_VIEW.equals( id ) ) {
|
||||||
|
if ( element instanceof IModuleRetrieval ) {
|
||||||
|
return new ModulesViewModelProxy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -30,7 +30,7 @@ import org.eclipse.core.runtime.ListenerList;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.core.DebugPlugin;
|
import org.eclipse.debug.core.DebugPlugin;
|
||||||
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
|
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
|
||||||
import org.eclipse.debug.internal.ui.contexts.IDebugContextListener;
|
import org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener;
|
||||||
import org.eclipse.debug.internal.ui.viewers.PresentationContext;
|
import org.eclipse.debug.internal.ui.viewers.PresentationContext;
|
||||||
import org.eclipse.debug.ui.AbstractDebugView;
|
import org.eclipse.debug.ui.AbstractDebugView;
|
||||||
import org.eclipse.debug.ui.IDebugUIConstants;
|
import org.eclipse.debug.ui.IDebugUIConstants;
|
||||||
|
@ -374,7 +374,7 @@ public class ModulesView extends AbstractDebugView implements IDebugContextListe
|
||||||
// create the sash form that will contain the tree viewer & text viewer
|
// create the sash form that will contain the tree viewer & text viewer
|
||||||
setSashForm( new SashForm( parent, SWT.NONE ) );
|
setSashForm( new SashForm( parent, SWT.NONE ) );
|
||||||
// add tree viewer
|
// add tree viewer
|
||||||
final ModulesViewer modulesViewer = new ModulesViewer( getSashForm(), SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, this );
|
final ModulesViewer modulesViewer = new ModulesViewer( getSashForm(), this );
|
||||||
modulesViewer.setUseHashlookup( false );
|
modulesViewer.setUseHashlookup( false );
|
||||||
modulesViewer.getControl().addFocusListener( new FocusAdapter() {
|
modulesViewer.getControl().addFocusListener( new FocusAdapter() {
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ public class ModulesView extends AbstractDebugView implements IDebugContextListe
|
||||||
getSite().setSelectionProvider( getModulesViewSelectionProvider() );
|
getSite().setSelectionProvider( getModulesViewSelectionProvider() );
|
||||||
|
|
||||||
// listen to debug context
|
// listen to debug context
|
||||||
DebugContextManager.getDefault().addDebugContextListener(this, getSite().getWorkbenchWindow());
|
DebugContextManager.getDefault().addDebugContextListener( this, getSite().getWorkbenchWindow() );
|
||||||
return modulesViewer;
|
return modulesViewer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.debug.internal.ui.views.modules;
|
||||||
import org.eclipse.cdt.debug.core.model.ICModule;
|
import org.eclipse.cdt.debug.core.model.ICModule;
|
||||||
import org.eclipse.debug.core.DebugEvent;
|
import org.eclipse.debug.core.DebugEvent;
|
||||||
import org.eclipse.debug.core.model.IDebugTarget;
|
import org.eclipse.debug.core.model.IDebugTarget;
|
||||||
import org.eclipse.debug.internal.ui.viewers.AbstractModelProxy;
|
import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
|
||||||
import org.eclipse.debug.internal.ui.viewers.IModelDelta;
|
import org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta;
|
||||||
|
import org.eclipse.debug.internal.ui.viewers.provisional.ModelDelta;
|
||||||
import org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler;
|
import org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler;
|
||||||
import org.eclipse.debug.internal.ui.viewers.update.ModelDelta;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comment for .
|
* Comment for .
|
||||||
|
@ -46,7 +46,7 @@ public class ModulesViewEventHandler extends DebugEventHandler {
|
||||||
*/
|
*/
|
||||||
protected void handleChange( DebugEvent event ) {
|
protected void handleChange( DebugEvent event ) {
|
||||||
if ( event.getSource() instanceof ICModule )
|
if ( event.getSource() instanceof ICModule )
|
||||||
fireDelta( new ModelDelta( event.getSource(), IModelDelta.CHANGED | IModelDelta.STATE ) );
|
fireDelta( new ModelDelta( event.getSource(), IModelDelta.STATE ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -10,54 +10,19 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.views.modules;
|
package org.eclipse.cdt.debug.internal.ui.views.modules;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
|
|
||||||
import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
|
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.debug.internal.ui.elements.adapters.AsynchronousDebugLabelAdapter;
|
import org.eclipse.debug.internal.ui.model.viewers.AsynchronousTreeModelViewer;
|
||||||
import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer;
|
import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor;
|
||||||
import org.eclipse.debug.internal.ui.viewers.IAsynchronousLabelAdapter;
|
|
||||||
import org.eclipse.debug.internal.ui.viewers.IAsynchronousRequestMonitor;
|
|
||||||
import org.eclipse.debug.internal.ui.viewers.IAsynchronousTreeContentAdapter;
|
|
||||||
import org.eclipse.debug.internal.ui.viewers.IModelProxy;
|
|
||||||
import org.eclipse.debug.internal.ui.viewers.IModelProxyFactory;
|
|
||||||
import org.eclipse.debug.internal.ui.viewers.IPresentationContext;
|
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
|
||||||
import org.eclipse.ui.progress.UIJob;
|
import org.eclipse.ui.progress.UIJob;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asynchronous viewer used by the Modules view.
|
* Asynchronous viewer used by the Modules view.
|
||||||
*/
|
*/
|
||||||
public class ModulesViewer extends AsynchronousTreeViewer {
|
public class ModulesViewer extends AsynchronousTreeModelViewer {
|
||||||
|
|
||||||
static class ModuleProxyFactory implements IModelProxyFactory {
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.debug.internal.ui.viewers.IModelProxyFactory#createModelProxy(java.lang.Object, org.eclipse.debug.internal.ui.viewers.IPresentationContext)
|
|
||||||
*/
|
|
||||||
public IModelProxy createModelProxy( Object element, IPresentationContext context ) {
|
|
||||||
IWorkbenchPart part = context.getPart();
|
|
||||||
if ( part != null ) {
|
|
||||||
String id = part.getSite().getId();
|
|
||||||
if ( ICDebugUIConstants.ID_MODULES_VIEW.equals( id ) ) {
|
|
||||||
if ( element instanceof IAdaptable ) {
|
|
||||||
ICDebugTarget target = (ICDebugTarget)((IAdaptable)element).getAdapter( ICDebugTarget.class );
|
|
||||||
if ( target != null )
|
|
||||||
return new ModulesViewModelProxy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IAsynchronousLabelAdapter fgModuleLabelAdapter = new AsynchronousDebugLabelAdapter();
|
|
||||||
private static IAsynchronousTreeContentAdapter fgModuleTreeContentAdapter = new ModuleTreeContentAdapter();
|
|
||||||
private static IModelProxyFactory fgModuleProxyFactory = new ModuleProxyFactory();
|
|
||||||
|
|
||||||
protected ModulesView fView;
|
protected ModulesView fView;
|
||||||
|
|
||||||
private UIJob fRestoreJob = new UIJob( "restore viewer state" ) { //$NON-NLS-1$
|
private UIJob fRestoreJob = new UIJob( "restore viewer state" ) { //$NON-NLS-1$
|
||||||
|
@ -71,14 +36,14 @@ public class ModulesViewer extends AsynchronousTreeViewer {
|
||||||
/**
|
/**
|
||||||
* Constructor for ModulesViewer.
|
* Constructor for ModulesViewer.
|
||||||
*/
|
*/
|
||||||
public ModulesViewer( Composite parent, int style, ModulesView view ) {
|
public ModulesViewer( Composite parent, ModulesView view ) {
|
||||||
super( parent, style );
|
super( parent );
|
||||||
fView = view;
|
fView = view;
|
||||||
fRestoreJob.setSystem( true );
|
fRestoreJob.setSystem( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#updateComplete(org.eclipse.debug.internal.ui.viewers.IAsynchronousRequestMonitor)
|
* @see org.eclipse.debug.internal.ui.model.viewers.AsynchronousModelViewer#updateComplete(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
|
||||||
*/
|
*/
|
||||||
protected void updateComplete( IAsynchronousRequestMonitor update ) {
|
protected void updateComplete( IAsynchronousRequestMonitor update ) {
|
||||||
super.updateComplete( update );
|
super.updateComplete( update );
|
||||||
|
@ -88,30 +53,9 @@ public class ModulesViewer extends AsynchronousTreeViewer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#handlePresentationFailure(org.eclipse.debug.internal.ui.viewers.IAsynchronousRequestMonitor, org.eclipse.core.runtime.IStatus)
|
* @see org.eclipse.debug.internal.ui.model.viewers.AsynchronousModelViewer#handlePresentationFailure(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor, org.eclipse.core.runtime.IStatus)
|
||||||
*/
|
*/
|
||||||
protected void handlePresentationFailure( IAsynchronousRequestMonitor update, IStatus status ) {
|
protected void handlePresentationFailure( IAsynchronousRequestMonitor update, IStatus status ) {
|
||||||
fView.showMessage( status.getMessage() );
|
fView.showMessage( status.getMessage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer#getTreeContentAdapter(java.lang.Object)
|
|
||||||
*/
|
|
||||||
protected IAsynchronousTreeContentAdapter getTreeContentAdapter( Object element ) {
|
|
||||||
return fgModuleTreeContentAdapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#getLabelAdapter(java.lang.Object)
|
|
||||||
*/
|
|
||||||
protected IAsynchronousLabelAdapter getLabelAdapter( Object element ) {
|
|
||||||
return fgModuleLabelAdapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#getModelProxyFactoryAdapter(java.lang.Object)
|
|
||||||
*/
|
|
||||||
protected IModelProxyFactory getModelProxyFactoryAdapter( Object element ) {
|
|
||||||
return fgModuleProxyFactory;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.eclipse.cdt.debug.internal.ui.views.AbstractViewerState;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer;
|
import org.eclipse.debug.internal.ui.model.viewers.AsynchronousTreeModelViewer;
|
||||||
import org.eclipse.debug.internal.ui.viewers.TreePath;
|
import org.eclipse.debug.internal.ui.viewers.TreePath;
|
||||||
import org.eclipse.swt.widgets.Tree;
|
import org.eclipse.swt.widgets.Tree;
|
||||||
import org.eclipse.swt.widgets.TreeItem;
|
import org.eclipse.swt.widgets.TreeItem;
|
||||||
|
@ -29,7 +29,7 @@ public class ModulesViewerState extends AbstractViewerState {
|
||||||
/**
|
/**
|
||||||
* Constructor for ModulesViewerState.
|
* Constructor for ModulesViewerState.
|
||||||
*/
|
*/
|
||||||
public ModulesViewerState( AsynchronousTreeViewer viewer ) {
|
public ModulesViewerState( AsynchronousTreeModelViewer viewer ) {
|
||||||
super( viewer );
|
super( viewer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,9 +47,9 @@ public class ModulesViewerState extends AbstractViewerState {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.debug.internal.ui.views.AbstractViewerState#decodePath(org.eclipse.core.runtime.IPath, org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer)
|
* @see org.eclipse.cdt.debug.internal.ui.views.AbstractViewerState#decodePath(org.eclipse.core.runtime.IPath, org.eclipse.debug.internal.ui.model.viewers.AsynchronousTreeModelViewer)
|
||||||
*/
|
*/
|
||||||
protected TreePath decodePath( IPath path, AsynchronousTreeViewer viewer ) throws DebugException {
|
protected TreePath decodePath( IPath path, AsynchronousTreeModelViewer viewer ) throws DebugException {
|
||||||
String[] names = path.segments();
|
String[] names = path.segments();
|
||||||
Tree tree = viewer.getTree();
|
Tree tree = viewer.getTree();
|
||||||
TreeItem[] items = tree.getItems();
|
TreeItem[] items = tree.getItems();
|
||||||
|
|
|
@ -13,17 +13,21 @@ package org.eclipse.cdt.debug.ui;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
|
import org.eclipse.cdt.debug.core.model.ICModule;
|
||||||
|
import org.eclipse.cdt.debug.core.model.IModuleRetrieval;
|
||||||
import org.eclipse.cdt.debug.internal.ui.CBreakpointUpdater;
|
import org.eclipse.cdt.debug.internal.ui.CBreakpointUpdater;
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImageDescriptorRegistry;
|
import org.eclipse.cdt.debug.internal.ui.CDebugImageDescriptorRegistry;
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation;
|
import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation;
|
||||||
import org.eclipse.cdt.debug.internal.ui.ColorManager;
|
import org.eclipse.cdt.debug.internal.ui.ColorManager;
|
||||||
import org.eclipse.cdt.debug.internal.ui.EvaluationContextManager;
|
import org.eclipse.cdt.debug.internal.ui.EvaluationContextManager;
|
||||||
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
|
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
|
||||||
|
import org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory;
|
||||||
import org.eclipse.cdt.debug.ui.sourcelookup.DefaultSourceLocator;
|
import org.eclipse.cdt.debug.ui.sourcelookup.DefaultSourceLocator;
|
||||||
import org.eclipse.cdt.debug.ui.sourcelookup.OldDefaultSourceLocator;
|
import org.eclipse.cdt.debug.ui.sourcelookup.OldDefaultSourceLocator;
|
||||||
import org.eclipse.core.resources.IWorkspace;
|
import org.eclipse.core.resources.IWorkspace;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IAdapterManager;
|
||||||
import org.eclipse.core.runtime.IConfigurationElement;
|
import org.eclipse.core.runtime.IConfigurationElement;
|
||||||
import org.eclipse.core.runtime.IExtensionPoint;
|
import org.eclipse.core.runtime.IExtensionPoint;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
@ -250,6 +254,11 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
|
||||||
super.start( context );
|
super.start( context );
|
||||||
EvaluationContextManager.startup();
|
EvaluationContextManager.startup();
|
||||||
CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() );
|
CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() );
|
||||||
|
|
||||||
|
IAdapterManager manager= Platform.getAdapterManager();
|
||||||
|
CDebugElementAdapterFactory elementAdapterFactory = new CDebugElementAdapterFactory();
|
||||||
|
manager.registerAdapters( elementAdapterFactory, IModuleRetrieval.class );
|
||||||
|
manager.registerAdapters( elementAdapterFactory, ICModule.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue