mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Bug 84816: The modification of the signal properties should be done in the background.
This commit is contained in:
parent
a5450e9b94
commit
152ee3e5ec
2 changed files with 46 additions and 41 deletions
|
@ -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.
|
||||||
|
|
|
@ -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,46 +109,45 @@ 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();
|
new Runnable() {
|
||||||
}
|
public void run() {
|
||||||
catch( DebugException e ) {
|
|
||||||
DebugUIPlugin.errorDialog( getShell(), PropertyPageMessages.getString( "SignalPropertyPage.3" ), PropertyPageMessages.getString( "SignalPropertyPage.4" ), e.getStatus() ); //$NON-NLS-1$ //$NON-NLS-2$
|
|
||||||
}
|
try {
|
||||||
|
Thread.sleep( 10000 );
|
||||||
|
}
|
||||||
|
catch( InterruptedException e1 ) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !getSignal().canModify() )
|
||||||
|
return;
|
||||||
|
if ( getPassButton() != null ) {
|
||||||
|
try {
|
||||||
|
getSignal().setPassEnabled( getPassButton().isSelected() );
|
||||||
|
}
|
||||||
|
catch( DebugException e ) {
|
||||||
|
failed( PropertyPageMessages.getString( "SignalPropertyPage.4" ), e ); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( getStopButton() != null ) {
|
||||||
|
try {
|
||||||
|
getSignal().setStopEnabled( getStopButton().isSelected() );
|
||||||
|
}
|
||||||
|
catch( DebugException e ) {
|
||||||
|
failed( PropertyPageMessages.getString( "SignalPropertyPage.4" ), e ); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSignalProperties() throws DebugException {
|
protected void failed( String message, Throwable e ) {
|
||||||
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(),
|
MultiStatus ms = new MultiStatus( CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, message, null );
|
||||||
DebugException.REQUEST_FAILED,
|
ms.add( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, e.getMessage(), null ) );
|
||||||
PropertyPageMessages.getString( "SignalPropertyPage.5" ), //$NON-NLS-1$
|
CDebugUtils.error( ms, getSignal() );
|
||||||
null );
|
|
||||||
BusyIndicator.showWhile( Display.getCurrent(),
|
|
||||||
new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
if ( !getSignal().canModify() )
|
|
||||||
return;
|
|
||||||
if ( getPassButton() != null ) {
|
|
||||||
try {
|
|
||||||
getSignal().setPassEnabled( getPassButton().isSelected() );
|
|
||||||
}
|
|
||||||
catch( DebugException e ) {
|
|
||||||
ms.merge( e.getStatus() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( getStopButton() != null ) {
|
|
||||||
try {
|
|
||||||
getSignal().setStopEnabled( getStopButton().isSelected() );
|
|
||||||
}
|
|
||||||
catch( DebugException e ) {
|
|
||||||
ms.merge( e.getStatus() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
if ( !ms.isOK() ) {
|
|
||||||
throw new DebugException( ms );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue