Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Removed the 'Type' field from the 'Display As Array' dialog

 
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/ChangeLog,v
retrieving revision 1.231
diff -u -r1.231 ChangeLog
--- ChangeLog	13 Aug 2003 18:19:53 -0000	1.231
+++ ChangeLog	13 Aug 2003 21:00:11 -0000
@@ -1,4 +1,9 @@
 2003-08-13 Mikhail Khodjaiants
+	* ICDIVariableManager.java: removed the 'type' parameter from the 'getVariableObjectAsArray' method
+	* ICastToArray.java: removed the 'type' parameter from the 'castToArray' method
+	* CVariable.java: changed the implementation of the 'ICastToArray' interface
+
+2003-08-13 Mikhail Khodjaiants
 	* ICDIVariable.java: removed the 'isEditable' method
 	* ICDIVariableObject.java: added the 'isEditable', 'getQualifiedName' and 'sizeof' methods
 	* ICDIArrayValue.java: added the 'getVariables(int start, int length)' method
Index: src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java,v
retrieving revision 1.9
diff -u -r1.9 ICDIVariableManager.java
--- src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java	8 Aug 2003 01:58:09 -0000	1.9
+++ src/org/eclipse/cdt/debug/core/cdi/ICDIVariableManager.java	13 Aug 2003 21:00:12 -0000
@@ -48,7 +48,7 @@
 	 * @return ICDIVariableObject
 	 * @throws CDIException
 	 */
-	ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject var, String type, int start, int length) throws CDIException;
+	ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject var, int start, int length) throws CDIException;
 
 	/**
 	 * Consider the variable object as type.
Index: src/org/eclipse/cdt/debug/core/model/ICastToArray.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICastToArray.java,v
retrieving revision 1.2
diff -u -r1.2 ICastToArray.java
--- src/org/eclipse/cdt/debug/core/model/ICastToArray.java	17 Mar 2003 21:22:07 -0000	1.2
+++ src/org/eclipse/cdt/debug/core/model/ICastToArray.java	13 Aug 2003 21:00:15 -0000
@@ -17,5 +17,5 @@
 {
 	boolean supportsCastToArray();
 
-	void castToArray( String type, int startIndex, int length ) throws DebugException;
+	void castToArray( int startIndex, int length ) throws DebugException;
 }
Index: src/org/eclipse/cdt/debug/internal/core/model/CVariable.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java,v
retrieving revision 1.49
diff -u -r1.49 CVariable.java
--- src/org/eclipse/cdt/debug/internal/core/model/CVariable.java	13 Aug 2003 18:19:53 -0000	1.49
+++ src/org/eclipse/cdt/debug/internal/core/model/CVariable.java	13 Aug 2003 21:00:17 -0000
@@ -818,11 +818,11 @@
 		return null;
 	}
 	
-	private InternalVariable createShadow( ICDIStackFrame cdiFrame, String type, int start, int length ) throws DebugException
+	private InternalVariable createShadow( ICDIStackFrame cdiFrame, int start, int length ) throws DebugException
 	{
 		try
 		{
-			return new InternalVariable( getCDISession().getVariableManager().getVariableObjectAsArray( getOriginalCDIVariable(), type, start, length ) );
+			return new InternalVariable( getCDISession().getVariableManager().getVariableObjectAsArray( getCDIVariable(), start, length ) );
 		}
 		catch( CDIException e )
 		{
@@ -840,13 +840,13 @@
 	}
 
 	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.debug.core.model.ICastToArray#castToArray(java.lang.String, int, int)
+	 * @see org.eclipse.cdt.debug.core.model.ICastToArray#castToArray(int, int)
 	 */
-	public void castToArray( String type, int startIndex, int length ) throws DebugException
+	public void castToArray( int startIndex, int length ) throws DebugException
 	{
 		try
 		{
-			InternalVariable newVar = createShadow( getOriginalCDIVariable().getStackFrame(), type, startIndex, length );
+			InternalVariable newVar = createShadow( getOriginalCDIVariable().getStackFrame(), startIndex, length );
 			if ( getShadow() != null )
 				getShadow().dispose();
 			setShadow( newVar );
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/ChangeLog,v
retrieving revision 1.160
diff -u -r1.160 ChangeLog
--- ChangeLog	11 Aug 2003 21:22:47 -0000	1.160
+++ ChangeLog	13 Aug 2003 21:04:34 -0000
@@ -1,5 +1,10 @@
 2003-08-11 Mikhail Khodjaiants
 	* src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java:
+	* src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java:
+	Removed the 'type' parameter from the 'getVariableObjectAsArray' method.
+
+2003-08-11 Mikhail Khodjaiants
+	* src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java:
 	The 'type' argument of the 'getVariableObjectAsArray' method shouldn't be null.
  
 2003-08-11 Mikhail Khodjaiants
Index: src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java,v
retrieving revision 1.39
diff -u -r1.39 VariableManager.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java	11 Aug 2003 19:38:00 -0000	1.39
+++ src/org/eclipse/cdt/debug/mi/core/cdi/VariableManager.java	13 Aug 2003 21:04:42 -0000
@@ -292,17 +292,15 @@
 	}
 
 	/**
-	 * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, String, int, int)
+	 * @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, int, int)
 	 */
-	public ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject object, String type, int start, int length)
+	public ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject object, int start, int length)
 		throws CDIException {
 		VariableObject obj = null;
 		if (object instanceof VariableObject) {
 			obj = (VariableObject) object;
 		}
 		if (obj != null) {
-			// Check if the type is valid.
-			checkType(type);
 			VariableObject vo =
 				new VariableObject(
 					obj.getTarget(),
Index: src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java,v
retrieving revision 1.4
diff -u -r1.4 ArrayValue.java
--- src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java	11 Aug 2003 21:22:47 -0000	1.4
+++ src/org/eclipse/cdt/debug/mi/core/cdi/model/type/ArrayValue.java	13 Aug 2003 21:04:45 -0000
@@ -56,7 +56,7 @@
 		ICDITarget target = getTarget();
 		Session session = (Session) (target.getSession());
 		ICDIVariableManager mgr = session.getVariableManager();
-		ICDIVariableObject vo = mgr.getVariableObjectAsArray(variable, variable.getTypeName(), index, length);
+		ICDIVariableObject vo = mgr.getVariableObjectAsArray(variable, index, length);
 		return mgr.createVariable(vo).getValue().getVariables();
 	}
 }
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/ChangeLog,v
retrieving revision 1.177
diff -u -r1.177 ChangeLog
--- ChangeLog	13 Aug 2003 18:20:20 -0000	1.177
+++ ChangeLog	13 Aug 2003 21:12:15 -0000
@@ -1,4 +1,9 @@
 2003-08-13 Mikhail Khodjaiants
+	* CDebugImages.java: new images for the 'Cast to type" and 'Display As Array' dialogs
+	* CastToTypeActionDelegate.java: new image
+	* CastToArrayActionDelegate.java: removed the 'type' field, added new image
+
+2003-08-13 Mikhail Khodjaiants
 	Display the proper image for reference types.
 	* CDTDebugModelPresentation.java
 
Index: src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java,v
retrieving revision 1.24
diff -u -r1.24 CDebugImages.java
--- src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java	24 Jul 2003 19:25:06 -0000	1.24
+++ src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java	13 Aug 2003 21:12:20 -0000
@@ -95,6 +95,8 @@
 	public static final String IMG_LCL_MEMORY_CLEAR = NAME_PREFIX + "memory_clear.gif";	//$NON-NLS-1$
 	public static final String IMG_LCL_SHOW_ASCII = NAME_PREFIX + "show_ascii.gif";	//$NON-NLS-1$
 	public static final String IMG_LCL_LOAD_ALL_SYMBOLS = NAME_PREFIX + "load_all_symbols_co.gif";	//$NON-NLS-1$
+	public static final String IMG_LCL_CAST_TO_TYPE = NAME_PREFIX + "casttotype_co.gif";	//$NON-NLS-1$
+	public static final String IMG_LCL_DISPLAY_AS_ARRAY = NAME_PREFIX + "showasarray_co.gif";	//$NON-NLS-1$
 
 	public static final String IMG_TOOLS_ADD_DIR_SOURCE_LOCATION = NAME_PREFIX + "adddirsource_wiz.gif";	//$NON-NLS-1$
 	public static final String IMG_TOOLS_ADD_PRJ_SOURCE_LOCATION = NAME_PREFIX + "addprjsource_wiz.gif";	//$NON-NLS-1$
@@ -110,6 +112,7 @@
 	private static final String T_OVR = "ovr16"; //$NON-NLS-1$
 	private static final String T_WIZBAN = "wizban"; //$NON-NLS-1$
 	private static final String T_LCL = "lcl16"; //$NON-NLS-1$
+	private static final String T_CLCL = "clcl16"; //$NON-NLS-1$
 	private static final String T_CTOOL = "ctool16"; //$NON-NLS-1$
 //	private static final String T_CVIEW = "cview16"; //$NON-NLS-1$
 //	private static final String T_DTOOL = "dtool16"; //$NON-NLS-1$
@@ -153,6 +156,8 @@
 	public static final ImageDescriptor DESC_WIZBAN_ADD_DIR_SOURCE_LOCATION = createManaged( T_WIZBAN, IMG_WIZBAN_ADD_DIR_SOURCE_LOCATION ); 		//$NON-NLS-1$
 	public static final ImageDescriptor DESC_TOOLS_ADD_PRJ_SOURCE_LOCATION = createManaged( T_CTOOL, IMG_TOOLS_ADD_PRJ_SOURCE_LOCATION ); 		//$NON-NLS-1$
 	public static final ImageDescriptor DESC_TOOLS_ADD_DIR_SOURCE_LOCATION = createManaged( T_CTOOL, IMG_TOOLS_ADD_DIR_SOURCE_LOCATION ); 		//$NON-NLS-1$
+	public static final ImageDescriptor DESC_LCL_CAST_TO_TYPE = createManaged( T_CLCL, IMG_LCL_CAST_TO_TYPE ); 		//$NON-NLS-1$
+	public static final ImageDescriptor DESC_LCL_DISPLAY_AS_ARRAY = createManaged( T_CLCL, IMG_LCL_DISPLAY_AS_ARRAY ); 		//$NON-NLS-1$
 
 	/**
 	 * Returns the image managed under the given key in this registry.
Index: src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionDelegate.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionDelegate.java,v
retrieving revision 1.3
diff -u -r1.3 CastToArrayActionDelegate.java
--- src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionDelegate.java	17 Mar 2003 21:25:20 -0000	1.3
+++ src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionDelegate.java	13 Aug 2003 21:12:21 -0000
@@ -7,6 +7,7 @@
 package org.eclipse.cdt.debug.internal.ui.actions;
 
 import org.eclipse.cdt.debug.core.model.ICastToArray;
+import org.eclipse.cdt.debug.internal.ui.CDebugImages;
 import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
 import org.eclipse.cdt.utils.ui.controls.ControlFactory;
 import org.eclipse.core.runtime.IStatus;
@@ -51,7 +52,6 @@
 		private Button fOkButton;
 		private Label fErrorMessageLabel;
 
-		private Text fTypeText;
 		private Text fFirstIndexText;
 		private Text fLengthText;
 
@@ -85,6 +85,7 @@
 		{
 			super.configureShell( newShell );
 			newShell.setText( "Display As Array" );
+			newShell.setImage( CDebugImages.get( CDebugImages.IMG_LCL_DISPLAY_AS_ARRAY ) );
 		}
 
 		/* (non-Javadoc)
@@ -97,6 +98,7 @@
 			createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
 
 			//do this here because setting the text will set enablement on the ok button
+/*
 			fTypeText.setFocus();
 			if ( fType != null ) 
 			{
@@ -105,6 +107,9 @@
 				fFirstIndexText.setText( String.valueOf( fFirstIndex ) );
 				fLengthText.setText( String.valueOf( fLength ) );
 			}
+*/
+			fFirstIndexText.setText( String.valueOf( fFirstIndex ) );
+			fLengthText.setText( String.valueOf( fLength ) );
 		}
 
 		protected Label getErrorMessageLabel()
@@ -133,23 +138,6 @@
 			((GridData)composite.getLayoutData()).widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
 			((GridLayout)composite.getLayout()).makeColumnsEqualWidth = true;
 			
-			ControlFactory.createLabel( composite, "Type:" );
-			
-			fTypeText = ControlFactory.createTextField( composite );
-			GridData data = new GridData( GridData.FILL_HORIZONTAL );
-			data.horizontalSpan = 3;
-			data.horizontalAlignment = GridData.FILL;
-			data.grabExcessHorizontalSpace = true;
-			fTypeText.setLayoutData( data );
-			fTypeText.addModifyListener( 
-								new ModifyListener()
-									{
-										public void modifyText( ModifyEvent e )
-										{
-											validateInput();
-										}
-									} );
-
 			Label label = ControlFactory.createLabel( composite, "Start index:" );
 			((GridData)label.getLayoutData()).horizontalSpan = 3;
 			fFirstIndexText = ControlFactory.createTextField( composite );
@@ -179,55 +167,47 @@
 		{
 			boolean enabled = true;
 			String message = "";
-			if ( fTypeText.getText().trim().length() == 0 )
+			String firstIndex = fFirstIndexText.getText().trim();
+			if ( firstIndex.length() == 0 )
 			{
-				message = "The 'Type' field must not be empty.";
+				message = "The 'First index' field must not be empty.";
 				enabled = false;
 			}
 			else
 			{
-				String firstIndex = fFirstIndexText.getText().trim();
-				if ( firstIndex.length() == 0 )
+				try
 				{
-					message = "The 'First index' field must not be empty.";
+					Integer.parseInt( firstIndex );
+				}
+				catch( NumberFormatException e )
+				{
+					message = "Invalid first index.";
 					enabled = false;
 				}
-				else
+				if ( enabled )
 				{
-					try
+					String lengthText = fLengthText.getText().trim();
+					if ( lengthText.length() == 0 )
 					{
-						Integer.parseInt( firstIndex );
-					}
-					catch( NumberFormatException e )
-					{
-						message = "Invalid first index.";
+						message = "The 'Last index' field must not be empty.";
 						enabled = false;
 					}
-					if ( enabled )
+					else
 					{
-						String lengthText = fLengthText.getText().trim();
-						if ( lengthText.length() == 0 )
+						int length = -1;
+						try
 						{
-							message = "The 'Last index' field must not be empty.";
+							length = Integer.parseInt( lengthText );
+						}
+						catch( NumberFormatException e )
+						{
+							message = "Invalid last index.";
 							enabled = false;
 						}
-						else
+						if ( enabled && length < 1 )
 						{
-							int length = -1;
-							try
-							{
-								length = Integer.parseInt( lengthText );
-							}
-							catch( NumberFormatException e )
-							{
-								message = "Invalid last index.";
-								enabled = false;
-							}
-							if ( enabled && length < 1 )
-							{
-								message = "The length must be greater than 0.";
-								enabled = false;
-							}
+							message = "The length must be greater than 0.";
+							enabled = false;
 						}
 					}
 				}
@@ -243,7 +223,6 @@
 		{
 			if ( buttonId == IDialogConstants.OK_ID )
 			{
-				fType = fTypeText.getText().trim();
 				String firstIndex = fFirstIndexText.getText().trim();
 				String lengthText = fLengthText.getText().trim();
 				try
@@ -366,10 +345,9 @@
 		CastToArrayDialog dialog = new CastToArrayDialog( CDebugUIPlugin.getActiveWorkbenchShell(), currentType, 0, 1 );
 		if ( dialog.open() == Window.OK )
 		{
-			String newType = dialog.getType().trim();
 			int firstIndex = dialog.getFirstIndex();
 			int lastIndex = dialog.getLength();
-			castToArray.castToArray( newType, firstIndex, lastIndex );
+			castToArray.castToArray( firstIndex, lastIndex );
 		}
 	}
 }
Index: src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionDelegate.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionDelegate.java,v
retrieving revision 1.3
diff -u -r1.3 CastToTypeActionDelegate.java
--- src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionDelegate.java	11 Mar 2003 23:46:55 -0000	1.3
+++ src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionDelegate.java	13 Aug 2003 21:12:21 -0000
@@ -7,6 +7,7 @@
 package org.eclipse.cdt.debug.internal.ui.actions;
 
 import org.eclipse.cdt.debug.core.model.ICastToType;
+import org.eclipse.cdt.debug.internal.ui.CDebugImages;
 import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.debug.core.DebugException;
@@ -55,6 +56,16 @@
 		{
 			super( parentShell, "Cast To Type", "Enter type:", initialValue, new CastToTypeInputValidator() );
 		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+		 */
+		protected void configureShell( Shell shell )
+		{
+			super.configureShell( shell );
+			shell.setImage( CDebugImages.get( CDebugImages.IMG_LCL_CAST_TO_TYPE ) );
+		}
+
 	}
 
 	private ICastToType fCastToType = null;

Back to the top