1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 108723: Create a separate tab for gdb server's conection options.

This commit is contained in:
Mikhail Khodjaiants 2005-09-02 21:25:55 +00:00
parent 3df6aeb4e9
commit 7fb7da6e35
7 changed files with 35 additions and 110 deletions

View file

@ -1,3 +1,12 @@
2005-09-02 Mikhail Khodjaiants
Bug 108723: Create a separate tab for gdb server's conection options.
* GDBDebuggerPage.java
* GDBServerDebuggerPage.java
* MIUIMessages.properties
* SerialPortSettingsBlock.java
* TCPSettingsBlock.java
* SolibSearchPathBlock.java
2005-07-22 Alain Magloire
Fix the copyright.

View file

@ -154,11 +154,13 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
public void createMainTab( TabFolder tabFolder ) {
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
tabItem.setText( MIUIMessages.getString( "GDBDebuggerPage.2" ) ); //$NON-NLS-1$
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
Composite comp = ControlFactory.createCompositeEx( tabFolder, 1, GridData.FILL_BOTH );
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
comp.setFont( tabFolder.getFont() );
tabItem.setControl( comp );
Composite subComp = ControlFactory.createCompositeEx( comp, 3, GridData.FILL_HORIZONTAL );
((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false;
subComp.setFont( tabFolder.getFont() );
Label label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "GDBDebuggerPage.3" ) ); //$NON-NLS-1$
GridData gd = new GridData();
// gd.horizontalSpan = 2;
@ -243,6 +245,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
tabItem.setText( MIUIMessages.getString( "GDBDebuggerPage.10" ) ); //$NON-NLS-1$
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
comp.setFont( tabFolder.getFont() );
tabItem.setControl( comp );
fSolibBlock = createSolibBlock( comp );
if ( fSolibBlock instanceof Observable )

View file

@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.debug.mi.internal.ui;
import java.io.File;
import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.ComboDialogField;
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField;
@ -22,16 +21,9 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
@ -65,101 +57,16 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage {
fSerialBlock.addObserver( this );
}
public void createMainTab( TabFolder tabFolder ) {
protected void createConnectionTab( TabFolder tabFolder ) {
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
tabItem.setText( MIUIMessages.getString( "GDBServerDebuggerPage.2" ) ); //$NON-NLS-1$
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
tabItem.setControl( comp );
Composite subComp = ControlFactory.createCompositeEx( comp, 3, GridData.FILL_HORIZONTAL );
((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false;
Label label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "GDBServerDebuggerPage.3" ) ); //$NON-NLS-1$
GridData gd = new GridData();
// gd.horizontalSpan = 2;
label.setLayoutData( gd );
fGDBCommandText = ControlFactory.createTextField( subComp, SWT.SINGLE | SWT.BORDER );
fGDBCommandText.addModifyListener( new ModifyListener() {
public void modifyText( ModifyEvent evt ) {
if ( !isInitializing() )
updateLaunchConfigurationDialog();
}
} );
Button button = createPushButton( subComp, MIUIMessages.getString( "GDBServerDebuggerPage.4" ), null ); //$NON-NLS-1$
button.addSelectionListener( new SelectionAdapter() {
public void widgetSelected( SelectionEvent evt ) {
if ( !isInitializing() ) {
handleGDBButtonSelected();
updateLaunchConfigurationDialog();
}
}
private void handleGDBButtonSelected() {
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
dialog.setText( MIUIMessages.getString( "GDBServerDebuggerPage.5" ) ); //$NON-NLS-1$
String gdbCommand = fGDBCommandText.getText().trim();
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
if ( lastSeparatorIndex != -1 ) {
dialog.setFilterPath( gdbCommand.substring( 0, lastSeparatorIndex ) );
}
String res = dialog.open();
if ( res == null ) {
return;
}
fGDBCommandText.setText( res );
}
} );
label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "GDBServerDebuggerPage.6" ) ); //$NON-NLS-1$
gd = new GridData();
// gd.horizontalSpan = 2;
label.setLayoutData( gd );
fGDBInitText = ControlFactory.createTextField( subComp, SWT.SINGLE | SWT.BORDER );
gd = new GridData( GridData.FILL_HORIZONTAL );
fGDBInitText.setLayoutData( gd );
fGDBInitText.addModifyListener( new ModifyListener() {
public void modifyText( ModifyEvent evt ) {
if ( !isInitializing() )
updateLaunchConfigurationDialog();
}
} );
button = createPushButton( subComp, MIUIMessages.getString( "GDBServerDebuggerPage.7" ), null ); //$NON-NLS-1$
button.addSelectionListener( new SelectionAdapter() {
public void widgetSelected( SelectionEvent evt ) {
if ( !isInitializing() ) {
handleGDBInitButtonSelected();
updateLaunchConfigurationDialog();
}
}
private void handleGDBInitButtonSelected() {
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
dialog.setText( MIUIMessages.getString( "GDBServerDebuggerPage.8" ) ); //$NON-NLS-1$
String gdbCommand = fGDBInitText.getText().trim();
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
if ( lastSeparatorIndex != -1 ) {
dialog.setFilterPath( gdbCommand.substring( 0, lastSeparatorIndex ) );
}
String res = dialog.open();
if ( res == null ) {
return;
}
fGDBInitText.setText( res );
}
} );
extendMainTab( comp );
}
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.debug.mi.internal.ui.GDBDebuggerPage#extendMainTab(org.eclipse.swt.widgets.Composite)
*/
protected void extendMainTab( Composite parent ) {
Composite comp = ControlFactory.createCompositeEx( parent, 2, GridData.FILL_BOTH );
tabItem.setText( MIUIMessages.getString( "GDBServerDebuggerPage.10" ) ); //$NON-NLS-1$
Composite comp1 = ControlFactory.createCompositeEx( tabFolder, 1, GridData.FILL_BOTH );
((GridLayout)comp1.getLayout()).makeColumnsEqualWidth = false;
comp1.setFont( tabFolder.getFont() );
tabItem.setControl( comp1 );
Composite comp = ControlFactory.createCompositeEx( comp1, 2, GridData.FILL_BOTH );
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
comp.setFont( comp1.getFont() );
fConnectionField.doFillIntoGrid( comp, 2 );
((GridData)fConnectionField.getComboControl( null ).getLayoutData()).horizontalAlignment = GridData.BEGINNING;
PixelConverter converter = new PixelConverter( comp );
@ -169,7 +76,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage {
fConnectionStack.setLayout( stackLayout );
((GridData)fConnectionStack.getLayoutData()).horizontalSpan = 2;
fTCPBlock.createBlock( fConnectionStack );
fSerialBlock.createBlock( fConnectionStack );
fSerialBlock.createBlock( fConnectionStack );
}
private ComboDialogField createConnectionField() {
@ -267,4 +174,12 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage {
private void setInitializing( boolean isInitializing ) {
fIsInitializing = isInitializing;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.mi.internal.ui.GDBDebuggerPage#createTabs(org.eclipse.swt.widgets.TabFolder)
*/
public void createTabs( TabFolder tabFolder ) {
super.createTabs( tabFolder );
createConnectionTab( tabFolder );
}
}

View file

@ -23,6 +23,7 @@ GDBDebuggerPage.9=(Warning: Some commands in this file may interfere with the st
GDBDebuggerPage.10=Shared Libraries
GDBServerDebuggerPage.0=TCP
GDBServerDebuggerPage.1=Serial
GDBServerDebuggerPage.10=Connection
GDBServerDebuggerPage.2=Main
GDBServerDebuggerPage.3=GDB debugger
GDBServerDebuggerPage.4=&Browse...
@ -30,7 +31,7 @@ GDBServerDebuggerPage.5=GDB Debugger
GDBServerDebuggerPage.6=GDB command file:
GDBServerDebuggerPage.7=B&rowse...
GDBServerDebuggerPage.8=GDB Command File
GDBServerDebuggerPage.9=Connection:
GDBServerDebuggerPage.9=Type:
GDBSolibBlock.0=Load shared library symbols automatically
GDBSolibBlock.1=Stop on shared library events
SerialPortSettingsBlock.0=Device:

View file

@ -22,7 +22,6 @@ import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@ -60,7 +59,7 @@ public class SerialPortSettingsBlock extends Observable {
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
((GridLayout)comp.getLayout()).marginHeight = 0;
((GridLayout)comp.getLayout()).marginWidth = 0;
comp.setFont( JFaceResources.getDialogFont() );
comp.setFont( parent.getFont() );
PixelConverter converter = new PixelConverter( comp );
fDeviceField.doFillIntoGrid( comp, 2 );
LayoutUtil.setWidthHint( fDeviceField.getTextControl( null ), converter.convertWidthInCharsToPixels( 20 ) );

View file

@ -29,7 +29,6 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.SWT;
@ -209,7 +208,7 @@ public class SolibSearchPathBlock extends Observable implements IMILaunchConfigu
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
((GridLayout)comp.getLayout()).marginHeight = 0;
((GridLayout)comp.getLayout()).marginWidth = 0;
comp.setFont( JFaceResources.getDialogFont() );
comp.setFont( parent.getFont() );
PixelConverter converter = new PixelConverter( comp );
fDirList.doFillIntoGrid( comp, 3 );
LayoutUtil.setHorizontalSpan( fDirList.getLabelControl( null ), 2 );

View file

@ -21,7 +21,6 @@ import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@ -56,7 +55,7 @@ public class TCPSettingsBlock extends Observable {
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
((GridLayout)comp.getLayout()).marginHeight = 0;
((GridLayout)comp.getLayout()).marginWidth = 0;
comp.setFont( JFaceResources.getDialogFont() );
comp.setFont( parent.getFont() );
PixelConverter converter = new PixelConverter( comp );
fHostNameField.doFillIntoGrid( comp, 2 );
LayoutUtil.setWidthHint( fHostNameField.getTextControl( null ), converter.convertWidthInCharsToPixels( 20 ) );