mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
Support of update ('Refresh', 'Auto-Refresh) actions.
This commit is contained in:
parent
2990ce74f9
commit
f5cebfdef5
4 changed files with 101 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2003-02-10 Mikhail Khodjaiants
|
||||
Support of update ('Refresh', 'Auto-Refresh) actions.
|
||||
* ICUpdateManager.java: new
|
||||
* ICSharedLibraryManager.java
|
||||
* CSharedLibraryManager.java
|
||||
|
||||
2003-02-10 Mikhail Khodjaiants
|
||||
Disable the address breakpoints to prevent the debugger to insert them prematurely.
|
||||
* CDebugTarget.java
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.eclipse.core.runtime.IAdaptable;
|
|||
*
|
||||
* @since: Jan 15, 2003
|
||||
*/
|
||||
public interface ICSharedLibraryManager extends IAdaptable
|
||||
public interface ICSharedLibraryManager extends ICUpdateManager, IAdaptable
|
||||
{
|
||||
ICSharedLibrary[] getSharedLibraries();
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*/
|
||||
package org.eclipse.cdt.debug.core;
|
||||
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
|
||||
/**
|
||||
* Enter type comment.
|
||||
*
|
||||
* @since: Feb 10, 2003
|
||||
*/
|
||||
public interface ICUpdateManager
|
||||
{
|
||||
void setAutoModeEnabled( boolean enable );
|
||||
|
||||
boolean getAutoModeEnabled();
|
||||
|
||||
void update() throws DebugException;
|
||||
|
||||
boolean canUpdate();
|
||||
}
|
|
@ -9,11 +9,15 @@ import java.util.ArrayList;
|
|||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
|
||||
import org.eclipse.cdt.debug.core.ICUpdateManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
|
||||
import org.eclipse.cdt.debug.core.model.ICSharedLibrary;
|
||||
import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
|
||||
import org.eclipse.cdt.debug.internal.core.model.CSharedLibrary;
|
||||
import org.eclipse.debug.core.DebugEvent;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.debug.core.model.IDebugTarget;
|
||||
|
||||
/**
|
||||
|
@ -98,6 +102,10 @@ public class CSharedLibraryManager implements ICSharedLibraryManager
|
|||
*/
|
||||
public Object getAdapter( Class adapter )
|
||||
{
|
||||
if ( adapter.equals( ICUpdateManager.class ) )
|
||||
{
|
||||
return this;
|
||||
}
|
||||
if ( adapter.equals( ICSharedLibraryManager.class ) )
|
||||
{
|
||||
return this;
|
||||
|
@ -134,4 +142,66 @@ public class CSharedLibraryManager implements ICSharedLibraryManager
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.ICUpdateManager#getAutoModeEnabled()
|
||||
*/
|
||||
public boolean getAutoModeEnabled()
|
||||
{
|
||||
if ( getCDIManager() != null )
|
||||
{
|
||||
return getCDIManager().isAutoUpdate();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.ICUpdateManager#setAutoModeEnabled(boolean)
|
||||
*/
|
||||
public void setAutoModeEnabled( boolean enable )
|
||||
{
|
||||
if ( getCDIManager() != null )
|
||||
{
|
||||
getCDIManager().setAutoUpdate( enable );
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.ICUpdateManager#update()
|
||||
*/
|
||||
public void update() throws DebugException
|
||||
{
|
||||
if ( getCDIManager() != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
getCDIManager().update();
|
||||
}
|
||||
catch( CDIException e )
|
||||
{
|
||||
((CDebugTarget)getDebugTarget()).targetRequestFailed( e.toString(), null );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ICDISharedLibraryManager getCDIManager()
|
||||
{
|
||||
if ( getDebugTarget() != null )
|
||||
{
|
||||
return ((CDebugTarget)getDebugTarget()).getCDISession().getSharedLibraryManager();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.ICUpdateManager#canUpdate()
|
||||
*/
|
||||
public boolean canUpdate()
|
||||
{
|
||||
if ( getDebugTarget() != null )
|
||||
{
|
||||
return getDebugTarget().isSuspended();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue