1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Bug 84816: The modification of the signal properties should be done in the background.

This commit is contained in:
Mikhail Khodjaiants 2005-05-31 21:14:04 +00:00
parent a5450e9b94
commit 152ee3e5ec
2 changed files with 46 additions and 41 deletions

View file

@ -1,3 +1,7 @@
2005-05-31 Mikhail Khodjaiants
Bug 84816: The modification of the signal properties should be done in the background.
* SignalPropertyPage.java
2005-05-24 Mikhail Khodjaiants 2005-05-24 Mikhail Khodjaiants
Bug 88558: run-to-line not thread oriented. Bug 88558: run-to-line not thread oriented.
The "Run to Line" action should be enabled on stack frames and threads, not on targets. The "Run to Line" action should be enabled on stack frames and threads, not on targets.

View file

@ -11,21 +11,23 @@
package org.eclipse.cdt.debug.internal.ui.propertypages; package org.eclipse.cdt.debug.internal.ui.propertypages;
import java.text.MessageFormat; import java.text.MessageFormat;
import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.model.ICSignal; import org.eclipse.cdt.debug.core.model.ICSignal;
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
import org.eclipse.cdt.debug.internal.ui.dialogfields.SelectionButtonDialogField; import org.eclipse.cdt.debug.internal.ui.dialogfields.SelectionButtonDialogField;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.dialogs.PropertyPage; import org.eclipse.ui.dialogs.PropertyPage;
@ -107,24 +109,18 @@ public class SignalPropertyPage extends PropertyPage {
public boolean performOk() { public boolean performOk() {
boolean result = super.performOk(); boolean result = super.performOk();
if ( result ) { if ( result ) {
try { DebugPlugin.getDefault().asyncExec(
setSignalProperties();
}
catch( DebugException e ) {
DebugUIPlugin.errorDialog( getShell(), PropertyPageMessages.getString( "SignalPropertyPage.3" ), PropertyPageMessages.getString( "SignalPropertyPage.4" ), e.getStatus() ); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return result;
}
private void setSignalProperties() throws DebugException {
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(),
DebugException.REQUEST_FAILED,
PropertyPageMessages.getString( "SignalPropertyPage.5" ), //$NON-NLS-1$
null );
BusyIndicator.showWhile( Display.getCurrent(),
new Runnable() { new Runnable() {
public void run() { public void run() {
try {
Thread.sleep( 10000 );
}
catch( InterruptedException e1 ) {
// TODO Auto-generated catch block
}
if ( !getSignal().canModify() ) if ( !getSignal().canModify() )
return; return;
if ( getPassButton() != null ) { if ( getPassButton() != null ) {
@ -132,7 +128,7 @@ public class SignalPropertyPage extends PropertyPage {
getSignal().setPassEnabled( getPassButton().isSelected() ); getSignal().setPassEnabled( getPassButton().isSelected() );
} }
catch( DebugException e ) { catch( DebugException e ) {
ms.merge( e.getStatus() ); failed( PropertyPageMessages.getString( "SignalPropertyPage.4" ), e ); //$NON-NLS-1$
} }
} }
if ( getStopButton() != null ) { if ( getStopButton() != null ) {
@ -140,13 +136,18 @@ public class SignalPropertyPage extends PropertyPage {
getSignal().setStopEnabled( getStopButton().isSelected() ); getSignal().setStopEnabled( getStopButton().isSelected() );
} }
catch( DebugException e ) { catch( DebugException e ) {
ms.merge( e.getStatus() ); failed( PropertyPageMessages.getString( "SignalPropertyPage.4" ), e ); //$NON-NLS-1$
} }
} }
} }
} ); } );
if ( !ms.isOK() ) {
throw new DebugException( ms );
} }
return result;
}
protected void failed( String message, Throwable e ) {
MultiStatus ms = new MultiStatus( CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, message, null );
ms.add( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, e.getMessage(), null ) );
CDebugUtils.error( ms, getSignal() );
} }
} }