mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-18 06:25:23 +02:00
Commit changes for bug 232002
This commit is contained in:
parent
02a8fc8a6a
commit
adc7f34b97
8 changed files with 21 additions and 38 deletions
|
@ -22,6 +22,7 @@ import org.eclipse.jface.text.hyperlink.IHyperlink;
|
||||||
* A hyperlink detector detecting words and numbers to support navigation
|
* A hyperlink detector detecting words and numbers to support navigation
|
||||||
* to a symbolic address.
|
* to a symbolic address.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
class DisassemblyHyperlinkDetector extends AbstractHyperlinkDetector {
|
class DisassemblyHyperlinkDetector extends AbstractHyperlinkDetector {
|
||||||
|
|
||||||
public class DisassemblyHyperlink implements IHyperlink {
|
public class DisassemblyHyperlink implements IHyperlink {
|
||||||
|
|
|
@ -190,6 +190,7 @@ import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
|
||||||
/**
|
/**
|
||||||
* DisassemblyPart
|
* DisassemblyPart
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
public abstract class DisassemblyPart extends WorkbenchPart implements IDisassemblyPart, IViewportListener, ITextPresentationListener {
|
public abstract class DisassemblyPart extends WorkbenchPart implements IDisassemblyPart, IViewportListener, ITextPresentationListener {
|
||||||
|
|
||||||
private final static boolean DEBUG = DsfDebugUIPlugin.getDefault().isDebugging();
|
private final static boolean DEBUG = DsfDebugUIPlugin.getDefault().isDebugging();
|
||||||
|
@ -255,7 +256,6 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
private Color fSourceColor;
|
private Color fSourceColor;
|
||||||
private Color fLabelColor;
|
private Color fLabelColor;
|
||||||
private Control fRedrawControl;
|
private Control fRedrawControl;
|
||||||
private Point fContextClickLocation;
|
|
||||||
private RGB fPCAnnotationRGB;
|
private RGB fPCAnnotationRGB;
|
||||||
private Composite fComposite;
|
private Composite fComposite;
|
||||||
|
|
||||||
|
@ -561,6 +561,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
* @see IAdaptable#getAdapter(java.lang.Class)
|
* @see IAdaptable#getAdapter(java.lang.Class)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Object getAdapter(Class required) {
|
public Object getAdapter(Class required) {
|
||||||
if (IVerticalRulerInfo.class.equals(required)) {
|
if (IVerticalRulerInfo.class.equals(required)) {
|
||||||
if (fVerticalRuler != null) {
|
if (fVerticalRuler != null) {
|
||||||
|
@ -612,9 +613,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
} else if (IRunToLineTarget.class.equals(required)) {
|
} else if (IRunToLineTarget.class.equals(required)) {
|
||||||
return new IRunToLineTarget() {
|
return new IRunToLineTarget() {
|
||||||
public void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException {
|
public void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException {
|
||||||
ITextSelection textSelection = (ITextSelection)selection;
|
// ITextSelection textSelection = (ITextSelection)selection;
|
||||||
int line = textSelection.getStartLine();
|
// int line = textSelection.getStartLine();
|
||||||
BigInteger address = getAddressOfLine(line);
|
// BigInteger address = getAddressOfLine(line);
|
||||||
// TLETODO [disassembly] run to line
|
// TLETODO [disassembly] run to line
|
||||||
// getRunControl().runUntil(...);
|
// getRunControl().runUntil(...);
|
||||||
}
|
}
|
||||||
|
@ -1288,7 +1289,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
|
|
||||||
protected void fillContextMenu(IMenuManager manager) {
|
protected void fillContextMenu(IMenuManager manager) {
|
||||||
Point cursorLoc = getSite().getShell().getDisplay().getCursorLocation();
|
Point cursorLoc = getSite().getShell().getDisplay().getCursorLocation();
|
||||||
fContextClickLocation = fViewer.getTextWidget().toControl(cursorLoc);
|
fViewer.getTextWidget().toControl(cursorLoc);
|
||||||
fActionToggleSource.update();
|
fActionToggleSource.update();
|
||||||
fActionToggleSymbols.update();
|
fActionToggleSymbols.update();
|
||||||
manager.add(new GroupMarker("group.top")); // ICommonMenuConstants.GROUP_TOP //$NON-NLS-1$
|
manager.add(new GroupMarker("group.top")); // ICommonMenuConstants.GROUP_TOP //$NON-NLS-1$
|
||||||
|
@ -2254,32 +2255,6 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
return fDocument.getAddressOfLine(line);
|
return fDocument.getAddressOfLine(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BigInteger getAddressOfOffset(int offset) {
|
|
||||||
return fDocument.getAddressOfOffset(offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
private BigInteger getAddressOfPoint(Point location) {
|
|
||||||
int offset = getOffsetOfPoint(location);
|
|
||||||
if (offset < 0) {
|
|
||||||
return PC_UNKNOWN;
|
|
||||||
}
|
|
||||||
return getAddressOfOffset(offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getOffsetOfPoint(Point location) {
|
|
||||||
if (location == null) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
StyledText text= fViewer.getTextWidget();
|
|
||||||
int line= ((location.y + text.getTopPixel()) / text.getLineHeight());
|
|
||||||
try {
|
|
||||||
return fDocument.getLineOffset(line);
|
|
||||||
} catch (BadLocationException e) {
|
|
||||||
internalError(e);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Passing the focus request to the viewer's control.
|
* Passing the focus request to the viewer's control.
|
||||||
*/
|
*/
|
||||||
|
@ -3177,6 +3152,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.jface.text.ITextPresentationListener#applyTextPresentation(org.eclipse.jface.text.TextPresentation)
|
* @see org.eclipse.jface.text.ITextPresentationListener#applyTextPresentation(org.eclipse.jface.text.TextPresentation)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void applyTextPresentation(TextPresentation textPresentation) {
|
public void applyTextPresentation(TextPresentation textPresentation) {
|
||||||
IRegion coverage = textPresentation.getExtent();
|
IRegion coverage = textPresentation.getExtent();
|
||||||
if (coverage == null) {
|
if (coverage == null) {
|
||||||
|
|
|
@ -39,6 +39,7 @@ import org.eclipse.jface.text.ITextViewer;
|
||||||
/**
|
/**
|
||||||
* A text hover to evaluate registers and variables under the cursor.
|
* A text hover to evaluate registers and variables under the cursor.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
public class DisassemblyTextHover implements ITextHover {
|
public class DisassemblyTextHover implements ITextHover {
|
||||||
|
|
||||||
private final DisassemblyPart fDisassemblyPart;
|
private final DisassemblyPart fDisassemblyPart;
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.jface.text.IRegion;
|
||||||
import org.eclipse.jface.text.ITextViewer;
|
import org.eclipse.jface.text.ITextViewer;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
public final class ActionGotoSymbol extends AbstractDisassemblyAction {
|
public final class ActionGotoSymbol extends AbstractDisassemblyAction {
|
||||||
public ActionGotoSymbol(IDisassemblyPart disassemblyPart) {
|
public ActionGotoSymbol(IDisassemblyPart disassemblyPart) {
|
||||||
super(disassemblyPart);
|
super(disassemblyPart);
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.eclipse.ui.editors.text.StorageDocumentProvider;
|
||||||
/**
|
/**
|
||||||
* SourceDocumentProvider
|
* SourceDocumentProvider
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
public class SourceDocumentProvider extends StorageDocumentProvider {
|
public class SourceDocumentProvider extends StorageDocumentProvider {
|
||||||
|
|
||||||
public SourceDocumentProvider() {
|
public SourceDocumentProvider() {
|
||||||
|
|
|
@ -54,6 +54,7 @@ import org.eclipse.ui.texteditor.ITextEditor;
|
||||||
/**
|
/**
|
||||||
* A presentation creator based on CDT syntax highlighting.
|
* A presentation creator based on CDT syntax highlighting.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
public class CSourcePresentationCreator extends PresentationReconciler implements ISourcePresentationCreator, IPropertyChangeListener {
|
public class CSourcePresentationCreator extends PresentationReconciler implements ISourcePresentationCreator, IPropertyChangeListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -40,6 +40,7 @@ import org.eclipse.swt.graphics.RGB;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
public class SourceTagDamagerRepairer extends DefaultDamagerRepairer implements ISourceTagListener {
|
public class SourceTagDamagerRepairer extends DefaultDamagerRepairer implements ISourceTagListener {
|
||||||
|
|
||||||
private ISourceTagProvider fSourceTagProvider;
|
private ISourceTagProvider fSourceTagProvider;
|
||||||
|
@ -252,7 +253,7 @@ public class SourceTagDamagerRepairer extends DefaultDamagerRepairer implements
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sourceTag = sourceTagIdx < sourceTagCount ? (ISourceTag)fSourceTags.get(sourceTagIdx++) : null;
|
sourceTag = sourceTagIdx < sourceTagCount ? fSourceTags.get(sourceTagIdx++) : null;
|
||||||
if (sourceTag != null) {
|
if (sourceTag != null) {
|
||||||
range = sourceTag.getRangeOfIdentifier();
|
range = sourceTag.getRangeOfIdentifier();
|
||||||
sourceTagStart = range.getBeginOffset();
|
sourceTagStart = range.getBeginOffset();
|
||||||
|
@ -331,7 +332,7 @@ public class SourceTagDamagerRepairer extends DefaultDamagerRepairer implements
|
||||||
fSourceTags.clear();
|
fSourceTags.clear();
|
||||||
if (sourceTagProvider != null) {
|
if (sourceTagProvider != null) {
|
||||||
sourceTagProvider.getSourceTags(fSourceTags);
|
sourceTagProvider.getSourceTags(fSourceTags);
|
||||||
Collections.sort(fSourceTags, new Comparator() {
|
Collections.sort(fSourceTags, new Comparator<Object>() {
|
||||||
public int compare(Object o1, Object o2) {
|
public int compare(Object o1, Object o2) {
|
||||||
ISourceRange sr1 = ((ISourceTag)o1).getRangeOfIdentifier();
|
ISourceRange sr1 = ((ISourceTag)o1).getRangeOfIdentifier();
|
||||||
ISourceRange sr2 = ((ISourceTag)o2).getRangeOfIdentifier();
|
ISourceRange sr2 = ((ISourceTag)o2).getRangeOfIdentifier();
|
||||||
|
|
|
@ -105,6 +105,7 @@ abstract public class StorageEditorInput implements IStorageEditorInput {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue