1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-13 03:05:39 +02:00

Fix for bug 51519: Enable 'Format' action if multiple variables are selected.

This commit is contained in:
Mikhail Khodjaiants 2004-02-10 20:15:00 +00:00
parent a69ae2ccf2
commit 7fb590779b
2 changed files with 24 additions and 8 deletions

View file

@ -1,3 +1,7 @@
2004-02-10 Mikhail Khodjaiants
Fix for bug 51519: Enable 'Format' action if multiple variables are selected.
* VariableFormatActionDelegate.java
2004-02-03 Alain Magloire 2004-02-03 Alain Magloire
Derived from a patch by Chris Songer. Derived from a patch by Chris Songer.

View file

@ -54,7 +54,8 @@ public class VariableFormatActionDelegate implements IObjectActionDelegate
*/ */
public void run( IAction action ) public void run( IAction action )
{ {
if ( fVariables != null && fVariables.length > 0 ) ICVariable[] vars = getVariables();
if ( vars != null && vars.length > 0 )
{ {
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(),
DebugException.REQUEST_FAILED, "", null ); DebugException.REQUEST_FAILED, "", null );
@ -65,7 +66,7 @@ public class VariableFormatActionDelegate implements IObjectActionDelegate
{ {
try try
{ {
doAction( fVariables ); doAction( getVariables() );
} }
catch( DebugException e ) catch( DebugException e )
{ {
@ -114,9 +115,10 @@ public class VariableFormatActionDelegate implements IObjectActionDelegate
} }
} }
} }
fVariables = new ICVariable[list.size()]; setVariables( (ICVariable[])list.toArray( new ICVariable[list.size()] ) );
list.toArray(fVariables); }
} else { else
{
action.setChecked( false ); action.setChecked( false );
action.setEnabled( false ); action.setEnabled( false );
} }
@ -129,4 +131,14 @@ public class VariableFormatActionDelegate implements IObjectActionDelegate
vars[i].setFormat( fFormat ); vars[i].setFormat( fFormat );
} }
} }
protected ICVariable[] getVariables()
{
return fVariables;
}
private void setVariables( ICVariable[] variables )
{
fVariables = variables;
}
} }