1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36: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,10 +164,8 @@ public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusa
if ( document != null && viewer != null ) {
DocumentContentProvider contentProvider = document.getContentProvider();
Object oldInput = contentProvider.getInput();
if ( !oldInput.equals( debugContext ) ) {
contentProvider.changeInput( getViewer(), document.getPresentationContext(), oldInput, debugContext, document.getCurrentOffset() );
// getViewer().refresh( false, true );
}
contentProvider.changeInput( getViewer(), document.getPresentationContext(), oldInput, debugContext, document.getCurrentOffset() );
// getViewer().refresh( false, true );
}
}
@ -186,9 +184,7 @@ public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusa
if ( disassemblyContext != null ) {
DisassemblyEditorInput oldInput = (DisassemblyEditorInput)getEditorInput();
if ( oldInput.getDisassemblyContext().equals( disassemblyContext ) ) {
if ( !oldInput.getDebugContext().equals( context ) ) {
setInput( new DisassemblyEditorInput( context, disassemblyContext ) );
}
setInput( new DisassemblyEditorInput( context, disassemblyContext ) );
}
}
}

View file

@ -11,6 +11,8 @@
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.disassembly.IDocumentPresentation;
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 {
private boolean fShowIntstructions = true;
private boolean fShowInstructions = true;
private boolean fShowSource = false;
public DisassemblyEditorPresentation() {
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() {
return fShowIntstructions;
return fShowInstructions;
}
public void setShowIntstructions( boolean showIntstructions ) {
fShowIntstructions = showIntstructions;
fShowInstructions = showIntstructions;
}
public boolean showSource() {

View file

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