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
|
||||
Removed diassembly editor actions.
|
||||
* plugin.xml
|
||||
|
|
|
@ -36,3 +36,4 @@ ResumeAtLineActionDelegate.Operation_failed_1=Operation failed.
|
|||
ResumeAtLineActionDelegate.Missing_document=Missing document
|
||||
ResumeAtLineActionDelegate.Empty_editor_1=Empty editor
|
||||
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.ui.CDebugUIPlugin;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.MultiStatus;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.debug.core.model.IDebugElement;
|
||||
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();
|
||||
if ( window != null ) {
|
||||
CDebugUIPlugin.errorDialog( getErrorDialogMessage(), getStatus() );
|
||||
CDebugUIPlugin.errorDialog( getErrorDialogMessage(), status );
|
||||
}
|
||||
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.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.custom.BusyIndicator;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.ui.IViewActionDelegate;
|
||||
import org.eclipse.ui.IViewPart;
|
||||
|
@ -81,8 +82,10 @@ public class EnableVariablesActionDelegate implements IViewActionDelegate
|
|||
return;
|
||||
|
||||
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$
|
||||
Runnable runnable = new Runnable()
|
||||
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$
|
||||
BusyIndicator.showWhile(
|
||||
Display.getCurrent(),
|
||||
new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
|
@ -108,16 +111,11 @@ public class EnableVariablesActionDelegate implements IViewActionDelegate
|
|||
}
|
||||
update();
|
||||
}
|
||||
};
|
||||
|
||||
final Display display = CDebugUIPlugin.getStandardDisplay();
|
||||
if ( display.isDisposed() )
|
||||
return;
|
||||
display.asyncExec( runnable );
|
||||
} );
|
||||
|
||||
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