1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Contributing new disassembly.

This commit is contained in:
Mikhail Khodjaiants 2008-04-10 17:09:12 +00:00
parent 0f97e58d2f
commit fe4b90d99a
3 changed files with 18 additions and 20 deletions

View file

@ -164,12 +164,10 @@ public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusa
if ( document != null && viewer != null ) { if ( document != null && viewer != null ) {
DocumentContentProvider contentProvider = document.getContentProvider(); DocumentContentProvider contentProvider = document.getContentProvider();
Object oldInput = contentProvider.getInput(); Object oldInput = contentProvider.getInput();
if ( !oldInput.equals( debugContext ) ) {
contentProvider.changeInput( getViewer(), document.getPresentationContext(), oldInput, debugContext, document.getCurrentOffset() ); contentProvider.changeInput( getViewer(), document.getPresentationContext(), oldInput, debugContext, document.getCurrentOffset() );
// getViewer().refresh( false, true ); // getViewer().refresh( false, true );
} }
} }
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent) * @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
@ -186,7 +184,6 @@ public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusa
if ( disassemblyContext != null ) { if ( disassemblyContext != null ) {
DisassemblyEditorInput oldInput = (DisassemblyEditorInput)getEditorInput(); DisassemblyEditorInput oldInput = (DisassemblyEditorInput)getEditorInput();
if ( oldInput.getDisassemblyContext().equals( disassemblyContext ) ) { if ( oldInput.getDisassemblyContext().equals( disassemblyContext ) ) {
if ( !oldInput.getDebugContext().equals( context ) ) {
setInput( new DisassemblyEditorInput( context, disassemblyContext ) ); setInput( new DisassemblyEditorInput( context, disassemblyContext ) );
} }
} }
@ -194,7 +191,6 @@ public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusa
} }
} }
} }
}
private IDisassemblyContextProvider getDisassemblyContextProvider( Object element ) { private IDisassemblyContextProvider getDisassemblyContextProvider( Object element ) {
IDisassemblyContextProvider adapter = null; IDisassemblyContextProvider adapter = null;

View file

@ -11,6 +11,8 @@
package org.eclipse.cdt.debug.internal.ui.disassembly.editor; package org.eclipse.cdt.debug.internal.ui.disassembly.editor;
import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.debug.ui.ICDebugUIConstants; import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
import org.eclipse.cdt.debug.ui.disassembly.IDocumentPresentation; import org.eclipse.cdt.debug.ui.disassembly.IDocumentPresentation;
import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
@ -21,19 +23,21 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationConte
*/ */
public class DisassemblyEditorPresentation extends PresentationContext implements IDocumentPresentation { public class DisassemblyEditorPresentation extends PresentationContext implements IDocumentPresentation {
private boolean fShowIntstructions = true; private boolean fShowInstructions = true;
private boolean fShowSource = false; private boolean fShowSource = false;
public DisassemblyEditorPresentation() { public DisassemblyEditorPresentation() {
super( ICDebugUIConstants.ID_DEFAULT_DISASSEMBLY_EDITOR ); super( ICDebugUIConstants.ID_DEFAULT_DISASSEMBLY_EDITOR );
fShowInstructions = CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_DISASM_SHOW_INSTRUCTIONS );
fShowSource = CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_DISASM_SHOW_SOURCE );
} }
public boolean showIntstructions() { public boolean showIntstructions() {
return fShowIntstructions; return fShowInstructions;
} }
public void setShowIntstructions( boolean showIntstructions ) { public void setShowIntstructions( boolean showIntstructions ) {
fShowIntstructions = showIntstructions; fShowInstructions = showIntstructions;
} }
public boolean showSource() { public boolean showSource() {

View file

@ -130,7 +130,6 @@ public class DocumentContentProvider implements IModelChangedListener {
public void changeInput( VirtualSourceViewer viewer, IDocumentPresentation presentationContext, Object oldInput, Object newInput, int offset ) { public void changeInput( VirtualSourceViewer viewer, IDocumentPresentation presentationContext, Object oldInput, Object newInput, int offset ) {
fViewer = viewer; fViewer = viewer;
if ( newInput != oldInput ) {
fInput = newInput; fInput = newInput;
IDocumentElementContentProvider contentAdapter = getContentAdapter( getInput() ); IDocumentElementContentProvider contentAdapter = getContentAdapter( getInput() );
if ( contentAdapter != null ) { if ( contentAdapter != null ) {
@ -141,7 +140,6 @@ public class DocumentContentProvider implements IModelChangedListener {
inputChanged( new DocumentBaseChangeUpdate( this, contentAdapter, presentationContext, getRoot(), getBase(), getInput(), offset ) ); inputChanged( new DocumentBaseChangeUpdate( this, contentAdapter, presentationContext, getRoot(), getBase(), getInput(), offset ) );
} }
} }
}
public synchronized void inputChanged( DocumentBaseChangeUpdate update ) { public synchronized void inputChanged( DocumentBaseChangeUpdate update ) {
if ( fUpdateInProgress == update ) { if ( fUpdateInProgress == update ) {