1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-02 22:55:26 +02:00

Commit changes for bug 232002

This commit is contained in:
Francois Chouinard 2008-05-15 20:56:03 +00:00
parent 02a8fc8a6a
commit adc7f34b97
8 changed files with 21 additions and 38 deletions

View file

@ -22,6 +22,7 @@ import org.eclipse.jface.text.hyperlink.IHyperlink;
* A hyperlink detector detecting words and numbers to support navigation
* to a symbolic address.
*/
@SuppressWarnings("restriction")
class DisassemblyHyperlinkDetector extends AbstractHyperlinkDetector {
public class DisassemblyHyperlink implements IHyperlink {

View file

@ -190,6 +190,7 @@ import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
/**
* DisassemblyPart
*/
@SuppressWarnings("restriction")
public abstract class DisassemblyPart extends WorkbenchPart implements IDisassemblyPart, IViewportListener, ITextPresentationListener {
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 fLabelColor;
private Control fRedrawControl;
private Point fContextClickLocation;
private RGB fPCAnnotationRGB;
private Composite fComposite;
@ -560,8 +560,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
/*
* @see IAdaptable#getAdapter(java.lang.Class)
*/
@Override
public Object getAdapter(Class required) {
@Override
@SuppressWarnings("unchecked")
public Object getAdapter(Class required) {
if (IVerticalRulerInfo.class.equals(required)) {
if (fVerticalRuler != null) {
return fVerticalRuler;
@ -612,9 +613,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
} else if (IRunToLineTarget.class.equals(required)) {
return new IRunToLineTarget() {
public void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException {
ITextSelection textSelection = (ITextSelection)selection;
int line = textSelection.getStartLine();
BigInteger address = getAddressOfLine(line);
// ITextSelection textSelection = (ITextSelection)selection;
// int line = textSelection.getStartLine();
// BigInteger address = getAddressOfLine(line);
// TLETODO [disassembly] run to line
// getRunControl().runUntil(...);
}
@ -1288,7 +1289,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
protected void fillContextMenu(IMenuManager manager) {
Point cursorLoc = getSite().getShell().getDisplay().getCursorLocation();
fContextClickLocation = fViewer.getTextWidget().toControl(cursorLoc);
fViewer.getTextWidget().toControl(cursorLoc);
fActionToggleSource.update();
fActionToggleSymbols.update();
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);
}
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.
*/
@ -3177,7 +3152,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
/*
* @see org.eclipse.jface.text.ITextPresentationListener#applyTextPresentation(org.eclipse.jface.text.TextPresentation)
*/
public void applyTextPresentation(TextPresentation textPresentation) {
@SuppressWarnings("unchecked")
public void applyTextPresentation(TextPresentation textPresentation) {
IRegion coverage = textPresentation.getExtent();
if (coverage == null) {
coverage= new Region(0, fDocument.getLength());

View file

@ -39,6 +39,7 @@ import org.eclipse.jface.text.ITextViewer;
/**
* A text hover to evaluate registers and variables under the cursor.
*/
@SuppressWarnings("restriction")
public class DisassemblyTextHover implements ITextHover {
private final DisassemblyPart fDisassemblyPart;
@ -53,7 +54,7 @@ public class DisassemblyTextHover implements ITextHover {
/* (non-Javadoc)
* @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer, int)
*/
public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
IDocument doc = textViewer.getDocument();
return CWordFinder.findWord(doc, offset);
}

View file

@ -22,6 +22,7 @@ import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.swt.widgets.Shell;
@SuppressWarnings("restriction")
public final class ActionGotoSymbol extends AbstractDisassemblyAction {
public ActionGotoSymbol(IDisassemblyPart disassemblyPart) {
super(disassemblyPart);

View file

@ -29,6 +29,7 @@ import org.eclipse.ui.editors.text.StorageDocumentProvider;
/**
* SourceDocumentProvider
*/
@SuppressWarnings("restriction")
public class SourceDocumentProvider extends StorageDocumentProvider {
public SourceDocumentProvider() {

View file

@ -54,6 +54,7 @@ import org.eclipse.ui.texteditor.ITextEditor;
/**
* A presentation creator based on CDT syntax highlighting.
*/
@SuppressWarnings("restriction")
public class CSourcePresentationCreator extends PresentationReconciler implements ISourcePresentationCreator, IPropertyChangeListener {
/**

View file

@ -40,6 +40,7 @@ import org.eclipse.swt.graphics.RGB;
/**
*
*/
@SuppressWarnings("restriction")
public class SourceTagDamagerRepairer extends DefaultDamagerRepairer implements ISourceTagListener {
private ISourceTagProvider fSourceTagProvider;
@ -252,7 +253,7 @@ public class SourceTagDamagerRepairer extends DefaultDamagerRepairer implements
break;
}
}
sourceTag = sourceTagIdx < sourceTagCount ? (ISourceTag)fSourceTags.get(sourceTagIdx++) : null;
sourceTag = sourceTagIdx < sourceTagCount ? fSourceTags.get(sourceTagIdx++) : null;
if (sourceTag != null) {
range = sourceTag.getRangeOfIdentifier();
sourceTagStart = range.getBeginOffset();
@ -331,7 +332,7 @@ public class SourceTagDamagerRepairer extends DefaultDamagerRepairer implements
fSourceTags.clear();
if (sourceTagProvider != null) {
sourceTagProvider.getSourceTags(fSourceTags);
Collections.sort(fSourceTags, new Comparator() {
Collections.sort(fSourceTags, new Comparator<Object>() {
public int compare(Object o1, Object o2) {
ISourceRange sr1 = ((ISourceTag)o1).getRangeOfIdentifier();
ISourceRange sr2 = ((ISourceTag)o2).getRangeOfIdentifier();

View file

@ -105,7 +105,8 @@ abstract public class StorageEditorInput implements IStorageEditorInput {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
public Object getAdapter(Class adapter) {
@SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
return null;
}