Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Implementing the "Source Lookup" property page

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/ChangeLog,v
retrieving revision 1.59
diff -u -r1.59 ChangeLog
--- ChangeLog 18 Dec 2002 17:25:38 -0000 1.59
+++ ChangeLog 19 Dec 2002 02:12:42 -0000
@@ -1,4 +1,11 @@
 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
  Do not show the source lookup dialog if file name is not specified.
  * CUISourceLocator.java
 
Index: plugin.properties
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/plugin.properties,v
retrieving revision 1.24
diff -u -r1.24 plugin.properties
--- plugin.properties 17 Dec 2002 02:46:01 -0000 1.24
+++ plugin.properties 19 Dec 2002 02:12:42 -0000
@@ -46,3 +46,5 @@
 NaturalVariableFormatAction.label=Natural
 
 CDebugActionGroup.name=C/C++ Debug
+
+SourcePropertyPage.name=Source Lookup
Index: plugin.xml
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/plugin.xml,v
retrieving revision 1.39
diff -u -r1.39 plugin.xml
--- plugin.xml 17 Dec 2002 20:00:40 -0000 1.39
+++ plugin.xml 19 Dec 2002 02:12:43 -0000
@@ -711,5 +711,14 @@
          </action>
       </debugActionGroup>
    </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>
Index: src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java
===================================================================
RCS file: src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java
diff -N src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java 19 Dec 2002 02:12:44 -0000
@@ -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 )
+ {
+ }
+}
Index: src/org/eclipse/cdt/debug/ui/sourcelookup/SourcePropertyPage.java
===================================================================
RCS file: src/org/eclipse/cdt/debug/ui/sourcelookup/SourcePropertyPage.java
diff -N src/org/eclipse/cdt/debug/ui/sourcelookup/SourcePropertyPage.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/cdt/debug/ui/sourcelookup/SourcePropertyPage.java 19 Dec 2002 02:12:44 -0000
@@ -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();
+ }
+
+}

Back to the top