mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Fix for PR 43624: The "Show Types Name" action of the Registers view doesn't work.
This commit is contained in:
parent
6945eff592
commit
c7b323e4fb
3 changed files with 42 additions and 13 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-10-24 Mikhail Khodjaiants
|
||||
Fix for PR 43624: The "Show Types Name" action of the Registers view doesn't work.
|
||||
* ShowRegisterTypesAction.java
|
||||
* RegistersView.java
|
||||
|
||||
2003-10-22 Mikhail Khodjaiants
|
||||
Moved the 'AddAddressBreakpointActionDelegate' action
|
||||
to the 'org.eclipse.cdt.debug.internal.ui.actions' package.
|
||||
|
|
|
@ -9,8 +9,8 @@ import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
|||
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
|
||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||
import org.eclipse.debug.ui.IDebugModelPresentation;
|
||||
import org.eclipse.debug.ui.IDebugView;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.StructuredViewer;
|
||||
import org.eclipse.swt.custom.BusyIndicator;
|
||||
import org.eclipse.ui.help.WorkbenchHelp;
|
||||
|
@ -24,15 +24,15 @@ import org.eclipse.ui.help.WorkbenchHelp;
|
|||
*/
|
||||
public class ShowRegisterTypesAction extends Action
|
||||
{
|
||||
private StructuredViewer fViewer;
|
||||
private IDebugView fView;
|
||||
|
||||
/**
|
||||
* Constructor for ShowRegisterTypesAction.
|
||||
*/
|
||||
public ShowRegisterTypesAction( StructuredViewer viewer )
|
||||
public ShowRegisterTypesAction( IDebugView view )
|
||||
{
|
||||
super( "Show &Type Names", Action.AS_CHECK_BOX );
|
||||
setViewer( viewer );
|
||||
setView( view );
|
||||
setToolTipText( "Show Type Names" );
|
||||
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_TYPE_NAMES );
|
||||
setId( CDebugUIPlugin.getUniqueIdentifier() + ".ShowTypesAction" ); //$NON-NLS-1$
|
||||
|
@ -53,11 +53,10 @@ public class ShowRegisterTypesAction extends Action
|
|||
{
|
||||
return;
|
||||
}
|
||||
ILabelProvider labelProvider = (ILabelProvider)getViewer().getLabelProvider();
|
||||
if ( labelProvider instanceof IDebugModelPresentation )
|
||||
IDebugModelPresentation debugLabelProvider = (IDebugModelPresentation)getView().getAdapter( IDebugModelPresentation.class );
|
||||
if ( debugLabelProvider != null )
|
||||
{
|
||||
IDebugModelPresentation debugLabelProvider = (IDebugModelPresentation)labelProvider;
|
||||
debugLabelProvider.setAttribute( IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, ( on ? Boolean.TRUE : Boolean.FALSE ) );
|
||||
debugLabelProvider.setAttribute( IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, ( on ? Boolean.TRUE : Boolean.FALSE ) );
|
||||
BusyIndicator.showWhile( getViewer().getControl().getDisplay(),
|
||||
new Runnable()
|
||||
{
|
||||
|
@ -80,11 +79,18 @@ public class ShowRegisterTypesAction extends Action
|
|||
|
||||
protected StructuredViewer getViewer()
|
||||
{
|
||||
return fViewer;
|
||||
if ( getView() != null && getView().getViewer() instanceof StructuredViewer )
|
||||
return (StructuredViewer)getView().getViewer();
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void setViewer( StructuredViewer viewer )
|
||||
protected IDebugView getView()
|
||||
{
|
||||
fViewer = viewer;
|
||||
return fView;
|
||||
}
|
||||
|
||||
public void setView( IDebugView view )
|
||||
{
|
||||
fView = view;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.eclipse.jface.action.IToolBarManager;
|
|||
import org.eclipse.jface.action.Separator;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.jface.viewers.IBaseLabelProvider;
|
||||
import org.eclipse.jface.viewers.IColorProvider;
|
||||
import org.eclipse.jface.viewers.IContentProvider;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
|
@ -174,7 +175,7 @@ public class RegistersView extends AbstractDebugEventHandlerView
|
|||
*/
|
||||
protected void createActions()
|
||||
{
|
||||
IAction action = new ShowRegisterTypesAction( getStructuredViewer() );
|
||||
IAction action = new ShowRegisterTypesAction( this );
|
||||
setAction( "ShowTypeNames", action ); //$NON-NLS-1$
|
||||
|
||||
action = new ChangeRegisterValueAction( getViewer() );
|
||||
|
@ -229,7 +230,7 @@ public class RegistersView extends AbstractDebugEventHandlerView
|
|||
menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
|
||||
|
||||
menu.appendToGroup( ICDebugUIConstants.REGISTER_GROUP, getAction( "ChangeRegisterValue" ) ); //$NON-NLS-1$
|
||||
menu.appendToGroup( IDebugUIConstants.RENDER_GROUP, getAction( "ShowTypeNames" ) ); //$NON-NLS-1$
|
||||
// menu.appendToGroup( IDebugUIConstants.RENDER_GROUP, getAction( "ShowTypeNames" ) ); //$NON-NLS-1$
|
||||
menu.appendToGroup( ICDebugUIConstants.REFRESH_GROUP, getAction( "AutoRefresh" ) ); //$NON-NLS-1$
|
||||
menu.appendToGroup( ICDebugUIConstants.REFRESH_GROUP, getAction( "Refresh" ) ); //$NON-NLS-1$
|
||||
}
|
||||
|
@ -395,4 +396,21 @@ public class RegistersView extends AbstractDebugEventHandlerView
|
|||
{
|
||||
fExpandedRegisters.remove( rm );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
||||
*/
|
||||
public Object getAdapter( Class adapter )
|
||||
{
|
||||
if ( IDebugModelPresentation.class.equals( adapter ) )
|
||||
{
|
||||
IBaseLabelProvider labelProvider = getStructuredViewer().getLabelProvider();
|
||||
if ( labelProvider instanceof VariablesViewLabelProvider )
|
||||
{
|
||||
return ((VariablesViewLabelProvider)labelProvider).getPresentation();
|
||||
}
|
||||
}
|
||||
return super.getAdapter( adapter );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue