Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorMikhail Khodjaiants2003-09-08 20:08:13 +0000
committerMikhail Khodjaiants2003-09-08 20:08:13 +0000
commit9fbe84c409c1d9195e15b61229c70d1d282e3ad1 (patch)
treec3cbe8f93d28ff48923e7f6f4b23d55cba1307ba /debug
parent8e62beb552d98ea5370d40c0e98742cf0ac356a8 (diff)
downloadorg.eclipse.cdt-9fbe84c409c1d9195e15b61229c70d1d282e3ad1.tar.gz
org.eclipse.cdt-9fbe84c409c1d9195e15b61229c70d1d282e3ad1.tar.xz
org.eclipse.cdt-9fbe84c409c1d9195e15b61229c70d1d282e3ad1.zip
New class - SolibSearchPathBlock. Implements the UI control block to set the shared library search path.
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/ChangeLog4
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/SolibSearchPathBlock.java167
2 files changed, 171 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog
index 77ca5e93bee..13cef002678 100644
--- a/debug/org.eclipse.cdt.debug.ui/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog
@@ -1,3 +1,7 @@
+2003-09-09 Mikhail Khodjaiants
+ New class - SolibSearchPathBlock. Implements the UI control block to set the shared library search path.
+ * SolibSearchPathBlock.java
+
2003-08-29 Mikhail Khodjaiants
Label for target suspended by shared library event.
* CDTDebugModelPresentation.java
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/SolibSearchPathBlock.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/SolibSearchPathBlock.java
new file mode 100644
index 00000000000..e0308188cc7
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/SolibSearchPathBlock.java
@@ -0,0 +1,167 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+
+package org.eclipse.cdt.debug.ui;
+
+import java.util.Collections;
+import java.util.Observable;
+
+import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
+import org.eclipse.cdt.debug.internal.ui.PixelConverter;
+import org.eclipse.cdt.debug.internal.ui.dialogfields.DialogField;
+import org.eclipse.cdt.debug.internal.ui.dialogfields.IListAdapter;
+import org.eclipse.cdt.debug.internal.ui.dialogfields.LayoutUtil;
+import org.eclipse.cdt.debug.internal.ui.dialogfields.ListDialogField;
+import org.eclipse.cdt.debug.internal.ui.dialogfields.Separator;
+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.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Enter type comment.
+ *
+ * @since Sep 4, 2003
+ */
+public class SolibSearchPathBlock extends Observable
+{
+ public class SolibSearchPathListDialogField extends ListDialogField
+ {
+ public SolibSearchPathListDialogField( IListAdapter adapter, String[] buttonLabels, ILabelProvider lprovider )
+ {
+ super( adapter, buttonLabels, lprovider );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.internal.ui.dialogfields.ListDialogField#managedButtonPressed(int)
+ */
+ protected boolean managedButtonPressed( int index )
+ {
+ boolean result = super.managedButtonPressed( index );
+ if ( result )
+ buttonPressed( index );
+ return result;
+ }
+
+ }
+
+ private Shell fShell;
+ private SolibSearchPathListDialogField fDirList;
+
+ public SolibSearchPathBlock()
+ {
+ super();
+
+ String[] buttonLabels = new String[]
+ {
+ /* 0 */ "Add...",
+ /* 1 */ null,
+ /* 2 */ "Up",
+ /* 3 */ "Down",
+ /* 4 */ null,
+ /* 5 */ "Remove",
+ };
+
+ IListAdapter listAdapter = new IListAdapter()
+ {
+ public void customButtonPressed( DialogField field, int index )
+ {
+ buttonPressed( index );
+ }
+
+ public void selectionChanged( DialogField field )
+ {
+ }
+ };
+
+ fDirList = new SolibSearchPathListDialogField( listAdapter, buttonLabels, new LabelProvider() );
+ fDirList.setLabelText( "Directories:" );
+ fDirList.setUpButtonIndex( 2 );
+ fDirList.setDownButtonIndex( 3 );
+ fDirList.setRemoveButtonIndex( 5 );
+ }
+
+ public void createBlock( Composite parent )
+ {
+ fShell = parent.getShell();
+ Composite comp = ControlFactory.createCompositeEx( parent, 2, GridData.FILL_BOTH );
+ ((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
+ ((GridLayout)comp.getLayout()).marginHeight = 0;
+ ((GridLayout)comp.getLayout()).marginWidth = 0;
+ comp.setFont( JFaceResources.getDialogFont() );
+
+ PixelConverter converter = new PixelConverter( comp );
+
+ fDirList.doFillIntoGrid( comp, 3 );
+ LayoutUtil.setHorizontalSpan( fDirList.getLabelControl( null ), 2 );
+ LayoutUtil.setWidthHint( fDirList.getLabelControl( null ), converter.convertWidthInCharsToPixels( 30 ) );
+ LayoutUtil.setHorizontalGrabbing( fDirList.getListControl( null ) );
+
+ new Separator().doFillIntoGrid( comp, 3, converter.convertHeightInCharsToPixels( 1 ) );
+ }
+
+ public void initializeFrom( ILaunchConfiguration configuration )
+ {
+ if ( fDirList != null )
+ {
+ try
+ {
+ fDirList.addElements( configuration.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST ) );
+ }
+ catch( CoreException e )
+ {
+ }
+ }
+ }
+
+ public void setDefaults( ILaunchConfigurationWorkingCopy configuration )
+ {
+ configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST );
+ }
+
+ public void performApply( ILaunchConfigurationWorkingCopy configuration )
+ {
+ if ( fDirList != null )
+ {
+ configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, fDirList.getElements() );
+ }
+ }
+
+ protected void buttonPressed( int index )
+ {
+ if ( index == 0 )
+ addDirectory();
+ setChanged();
+ notifyObservers();
+ }
+
+ protected Shell getShell()
+ {
+ return fShell;
+ }
+
+ private void addDirectory()
+ {
+ DirectoryDialog dialog = new DirectoryDialog( getShell() );
+ dialog.setMessage( "Select directory that contains shared library." );
+ String res = dialog.open();
+ if ( res != null )
+ fDirList.addElement( res );
+ }
+
+ public void dispose()
+ {
+ deleteObservers();
+ }
+}

Back to the top