1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

2004-10-29 Alain Magloire

Changes to the CDI interface
	* SeAutoSolibActionDelegate.java
This commit is contained in:
Alain Magloire 2004-10-29 15:12:43 +00:00
parent e945252b3c
commit 080a687752
2 changed files with 25 additions and 8 deletions

View file

@ -1,3 +1,7 @@
2004-10-29 Alain Magloire
Changes to the CDI interface
* SeAutoSolibActionDelegate.java
2004-08-23 Mikhail Khodjaiants 2004-08-23 Mikhail Khodjaiants
Added API to allow the access to the internal MI UI components by client plugins. Added API to allow the access to the internal MI UI components by client plugins.
Changed the "Solib search path" component. Changed the "Solib search path" component.

View file

@ -12,10 +12,12 @@ package org.eclipse.cdt.debug.mi.internal.ui.actions;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate; import org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate;
import org.eclipse.cdt.debug.mi.core.MIPlugin; import org.eclipse.cdt.debug.mi.core.MIPlugin;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager; import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
@ -193,11 +195,11 @@ public class SetAutoSolibActionDelegate implements IViewActionDelegate, ISelecti
protected boolean getCheckStateForSelection( IAdaptable element ) { protected boolean getCheckStateForSelection( IAdaptable element ) {
SharedLibraryManager slm = getSharedLibraryManager( element ); SharedLibraryManager slm = getSharedLibraryManager( element );
if ( slm != null ) { Target target = getTarget(element);
if ( slm != null && target != null) {
try { try {
return slm.isAutoLoadSymbols(); return slm.isAutoLoadSymbols(target);
} } catch( CDIException e ) {
catch( CDIException e ) {
} }
} }
return false; return false;
@ -230,9 +232,10 @@ public class SetAutoSolibActionDelegate implements IViewActionDelegate, ISelecti
if ( getView() == null ) if ( getView() == null )
return; return;
SharedLibraryManager slm = getSharedLibraryManager( element ); SharedLibraryManager slm = getSharedLibraryManager( element );
if ( slm != null && getAction() != null ) { Target target = getTarget(element);
if ( slm != null && target != null && getAction() != null ) {
try { try {
slm.setAutoLoadSymbols( getAction().isChecked() ); slm.setAutoLoadSymbols( target, getAction().isChecked() );
} }
catch( CDIException e ) { catch( CDIException e ) {
getAction().setChecked( !getAction().isChecked() ); getAction().setChecked( !getAction().isChecked() );
@ -244,8 +247,18 @@ public class SetAutoSolibActionDelegate implements IViewActionDelegate, ISelecti
private SharedLibraryManager getSharedLibraryManager( IAdaptable element ) { private SharedLibraryManager getSharedLibraryManager( IAdaptable element ) {
if ( element != null ) { if ( element != null ) {
ICDISession session = (ICDISession)element.getAdapter( ICDISession.class ); ICDISession session = (ICDISession)element.getAdapter( ICDISession.class );
if ( session instanceof Session && ((Session)session).getSharedLibraryManager() instanceof SharedLibraryManager ) if ( session instanceof Session )
return (SharedLibraryManager)((Session)session).getSharedLibraryManager(); return ((Session)session).getSharedLibraryManager();
}
return null;
}
private Target getTarget( IAdaptable element ) {
if (element != null) {
ICDITarget target = (ICDITarget)element.getAdapter( ICDITarget.class );
if (target instanceof Target) {
return (Target)target;
}
} }
return null; return null;
} }