mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Changed the error handling of the "Add Globals" and "Enable/Disable Variable" actions.
This commit is contained in:
parent
495d77744b
commit
e7fadca73f
4 changed files with 44 additions and 34 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-05-28 Mikhail Khodjaiants
|
||||||
|
Changed the error handling of the "Add Globals" and "Enable/Disable Variable" actions.
|
||||||
|
* AddGlobalsActionDelegate.java
|
||||||
|
* EnableVariablesActionDelegate.java
|
||||||
|
* ActionMessages.properties
|
||||||
|
|
||||||
2004-05-28 Mikhail Khodjaiants
|
2004-05-28 Mikhail Khodjaiants
|
||||||
Removed diassembly editor actions.
|
Removed diassembly editor actions.
|
||||||
* plugin.xml
|
* plugin.xml
|
||||||
|
|
|
@ -36,3 +36,4 @@ ResumeAtLineActionDelegate.Operation_failed_1=Operation failed.
|
||||||
ResumeAtLineActionDelegate.Missing_document=Missing document
|
ResumeAtLineActionDelegate.Missing_document=Missing document
|
||||||
ResumeAtLineActionDelegate.Empty_editor_1=Empty editor
|
ResumeAtLineActionDelegate.Empty_editor_1=Empty editor
|
||||||
ResumeAtLineActionDelegate.Operation_is_not_supported_1=Operation is not supported
|
ResumeAtLineActionDelegate.Operation_is_not_supported_1=Operation is not supported
|
||||||
|
AddGlobalsActionDelegate.Error(s)_occured_adding_globals_1=Error(s) occured adding globals.
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.debug.core.model.IExecFileInfo;
|
||||||
import org.eclipse.cdt.debug.core.model.IGlobalVariableDescriptor;
|
import org.eclipse.cdt.debug.core.model.IGlobalVariableDescriptor;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
import org.eclipse.core.runtime.MultiStatus;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.core.model.IDebugElement;
|
import org.eclipse.debug.core.model.IDebugElement;
|
||||||
import org.eclipse.debug.ui.DebugUITools;
|
import org.eclipse.debug.ui.DebugUITools;
|
||||||
|
@ -104,13 +105,17 @@ public class AddGlobalsActionDelegate extends ActionDelegate implements IViewAct
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
if ( getStatus() != null && !getStatus().isOK() ) {
|
IStatus status = getStatus();
|
||||||
|
if ( status != null && !status.isOK() ) {
|
||||||
|
if ( status.isMultiStatus() ) {
|
||||||
|
status = new MultiStatus( status.getPlugin(), status.getCode(), status.getChildren(), ActionMessages.getString( "AddGlobalsActionDelegate.Error(s)_occured_adding_globals_1" ), status.getException() ); //$NON-NLS-1$
|
||||||
|
}
|
||||||
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
||||||
if ( window != null ) {
|
if ( window != null ) {
|
||||||
CDebugUIPlugin.errorDialog( getErrorDialogMessage(), getStatus() );
|
CDebugUIPlugin.errorDialog( getErrorDialogMessage(), status );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CDebugUIPlugin.log( getStatus() );
|
CDebugUIPlugin.log( status );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
|
import org.eclipse.swt.custom.BusyIndicator;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.ui.IViewActionDelegate;
|
import org.eclipse.ui.IViewActionDelegate;
|
||||||
import org.eclipse.ui.IViewPart;
|
import org.eclipse.ui.IViewPart;
|
||||||
|
@ -81,43 +82,40 @@ public class EnableVariablesActionDelegate implements IViewActionDelegate
|
||||||
return;
|
return;
|
||||||
|
|
||||||
final Iterator enum = selection.iterator();
|
final Iterator enum = selection.iterator();
|
||||||
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, CDebugUIPlugin.getResourceString("internal.ui.actions.EnableVariablesActionDelegate.Enable_variables_failed."), null ); //$NON-NLS-1$
|
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, CDebugUIPlugin.getResourceString("internal.ui.actions.EnableVariablesActionDelegate.Exceptions_occurred_enabling_the_variables"), null ); //$NON-NLS-1$
|
||||||
Runnable runnable = new Runnable()
|
BusyIndicator.showWhile(
|
||||||
|
Display.getCurrent(),
|
||||||
|
new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
while( enum.hasNext() )
|
||||||
|
{
|
||||||
|
ICVariable var = (ICVariable)enum.next();
|
||||||
|
try
|
||||||
{
|
{
|
||||||
public void run()
|
if ( size > 1 )
|
||||||
{
|
{
|
||||||
while( enum.hasNext() )
|
if ( isEnableAction() )
|
||||||
{
|
var.setEnabled( true );
|
||||||
ICVariable var = (ICVariable)enum.next();
|
else
|
||||||
try
|
var.setEnabled( false );
|
||||||
{
|
|
||||||
if ( size > 1 )
|
|
||||||
{
|
|
||||||
if ( isEnableAction() )
|
|
||||||
var.setEnabled( true );
|
|
||||||
else
|
|
||||||
var.setEnabled( false );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
var.setEnabled( !var.isEnabled() );
|
|
||||||
}
|
|
||||||
catch( DebugException e )
|
|
||||||
{
|
|
||||||
ms.merge( e.getStatus() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
update();
|
|
||||||
}
|
}
|
||||||
};
|
else
|
||||||
|
var.setEnabled( !var.isEnabled() );
|
||||||
final Display display = CDebugUIPlugin.getStandardDisplay();
|
}
|
||||||
if ( display.isDisposed() )
|
catch( DebugException e )
|
||||||
return;
|
{
|
||||||
display.asyncExec( runnable );
|
ms.merge( e.getStatus() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
if ( !ms.isOK() )
|
if ( !ms.isOK() )
|
||||||
{
|
{
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.EnableVariablesActionDelegate.Exceptions_occurred_enabling_the_variables"), ms ); //$NON-NLS-1$
|
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.EnableVariablesActionDelegate.Enable_variables_failed."), ms ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue