1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-15 12:15:47 +02:00

Implementing the "Source Lookup" property page.

This commit is contained in:
Mikhail Khodjaiants 2002-12-19 02:13:39 +00:00
parent 3a90ab9274
commit 9d8f0a4a52
5 changed files with 142 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2002-12-18 Mikhail Khodjaiants
Implementing the "Source Lookup" property page.
* SourceLookupBlock.java: common control block.
* SourcePropertyPage.java: implementation
* plugin.properties: page name
* plugin.xml: contribution to ICDebugTarget properties
2002-12-18 Mikhail Khodjaiants 2002-12-18 Mikhail Khodjaiants
Do not show the source lookup dialog if file name is not specified. Do not show the source lookup dialog if file name is not specified.
* CUISourceLocator.java * CUISourceLocator.java

View file

@ -46,3 +46,5 @@ DecVariableFormatAction.label=Decimal
NaturalVariableFormatAction.label=Natural NaturalVariableFormatAction.label=Natural
CDebugActionGroup.name=C/C++ Debug CDebugActionGroup.name=C/C++ Debug
SourcePropertyPage.name=Source Lookup

View file

@ -711,5 +711,14 @@
</action> </action>
</debugActionGroup> </debugActionGroup>
</extension> </extension>
<extension
point="org.eclipse.ui.propertyPages">
<page
objectClass="org.eclipse.cdt.debug.core.model.ICDebugTarget"
name="%SourcePropertyPage.name"
class="org.eclipse.cdt.debug.ui.sourcelookup.SourcePropertyPage"
id="org.eclipse.cdt.debug.ui.sourcelookup.SourcePropertyPage">
</page>
</extension>
</plugin> </plugin>

View file

@ -0,0 +1,85 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.ui.sourcelookup;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
/**
*
* Enter type comment.
*
* @since Dec 18, 2002
*/
public class SourceLookupBlock
{
private Composite fControl = null;
private Shell fShell = null;
private FontMetrics fFontMetrics = null;
/**
* Constructor for SourceLookupBlock.
*/
public SourceLookupBlock()
{
super();
}
public void createControl( Composite parent )
{
fShell = parent.getShell();
fControl = new Composite( parent, SWT.NONE );
fControl.setLayout( new GridLayout( 2, false ) );
fControl.setLayoutData( new GridData( GridData.FILL_BOTH ) );
fControl.setFont( JFaceResources.getDialogFont() );
createListControl( fControl );
createButtonBar( fControl );
}
public Control getControl()
{
return fControl;
}
protected void initializeDialogUnits( Control control )
{
// Compute and store a font metric
GC gc = new GC( control );
gc.setFont( control.getFont() );
fFontMetrics = gc.getFontMetrics();
gc.dispose();
}
protected int convertVerticalDLUsToPixels( int dlus )
{
if ( fFontMetrics == null )
return 0;
return Dialog.convertVerticalDLUsToPixels( fFontMetrics, dlus );
}
protected int convertHorizontalDLUsToPixels( int dlus )
{
if ( fFontMetrics == null )
return 0;
return Dialog.convertHorizontalDLUsToPixels( fFontMetrics, dlus );
}
protected void createListControl( Composite parent )
{
}
protected void createButtonBar( Composite parent )
{
}
}

View file

@ -0,0 +1,39 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.ui.sourcelookup;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.dialogs.PropertyPage;
/**
*
* Enter type comment.
*
* @since Dec 18, 2002
*/
public class SourcePropertyPage extends PropertyPage
{
private SourceLookupBlock fBlock = null;
/**
* Constructor for SourcePropertyPage.
*/
public SourcePropertyPage()
{
fBlock = new SourceLookupBlock();
}
/**
* @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
*/
protected Control createContents( Composite parent )
{
fBlock.createControl( parent );
return fBlock.getControl();
}
}