mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 06:45:43 +02:00
@Override annotations.
This commit is contained in:
parent
227294f49a
commit
8c7b24b130
7 changed files with 48 additions and 13 deletions
|
@ -805,6 +805,7 @@ public class ASTManager implements IDisposable {
|
|||
/**
|
||||
* @see IDisposable#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
Assert.isTrue(!fDisposed, "ASTManager.dispose() called more than once"); //$NON-NLS-1$
|
||||
fDisposed = true;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Markus Schorn - initial API and implementation
|
||||
******************************************************************************/
|
||||
package org.eclipse.cdt.internal.ui.refactoring.rename;
|
||||
|
||||
|
@ -25,7 +25,6 @@ import org.eclipse.core.resources.IResource;
|
|||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
|
||||
public class CRefactoringMatchStore {
|
||||
private Map<IFile, IPath> fFileToPathMap= new HashMap<IFile, IPath>();
|
||||
private Map<IPath, SortedMap<CRefactoringMatch, CRefactoringMatch>> fPathToMatches= new HashMap<IPath, SortedMap<CRefactoringMatch, CRefactoringMatch>>();
|
||||
|
@ -33,7 +32,8 @@ public class CRefactoringMatchStore {
|
|||
|
||||
public CRefactoringMatchStore() {
|
||||
fOffsetComparator= new Comparator<CRefactoringMatch>() {
|
||||
public int compare(CRefactoringMatch o1, CRefactoringMatch o2) {
|
||||
@Override
|
||||
public int compare(CRefactoringMatch o1, CRefactoringMatch o2) {
|
||||
return o1.getOffset() - o2.getOffset();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -323,7 +323,8 @@ public abstract class CRenameProcessorDelegate {
|
|||
return null;
|
||||
}
|
||||
Collections.sort(fMatches, new Comparator<CRefactoringMatch>() {
|
||||
public int compare(CRefactoringMatch m1, CRefactoringMatch m2) {
|
||||
@Override
|
||||
public int compare(CRefactoringMatch m1, CRefactoringMatch m2) {
|
||||
IFile f1= m1.getFile();
|
||||
IFile f2= m2.getFile();
|
||||
int cmp= f1.getName().compareTo(f2.getName());
|
||||
|
|
|
@ -73,8 +73,8 @@ public class CRenameRefactoringInputPage extends UserInputWizardPage {
|
|||
return (fOptions & options) == options;
|
||||
}
|
||||
|
||||
// overrider
|
||||
public void createControl(Composite parent) {
|
||||
@Override
|
||||
public void createControl(Composite parent) {
|
||||
CRenameProcessor processor= getRenameProcessor();
|
||||
fSearchString= processor.getArgument().getName();
|
||||
fOptions= processor.getAvailableOptions();
|
||||
|
@ -226,7 +226,7 @@ public class CRenameRefactoringInputPage extends UserInputWizardPage {
|
|||
|
||||
private void hookSelectionListeners() {
|
||||
fNewName.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
onKeyReleaseInNameField();
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
* IBM Corporation - initial API and implementation
|
||||
* Sergey Prigogin (Google)
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.ui.refactoring.rename;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
@ -93,7 +92,8 @@ import org.eclipse.cdt.internal.ui.preferences.CPluginPreferencePage;
|
|||
|
||||
public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenKeeperExtension {
|
||||
|
||||
private class PopupVisibilityManager implements IPartListener2, ControlListener, MouseListener, KeyListener, ITextListener, IViewportListener {
|
||||
private class PopupVisibilityManager implements IPartListener2, ControlListener, MouseListener,
|
||||
KeyListener, ITextListener, IViewportListener {
|
||||
|
||||
public void start() {
|
||||
fEditor.getSite().getWorkbenchWindow().getPartService().addPartListener(this);
|
||||
|
@ -106,6 +106,7 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
|
|||
viewer.addTextListener(this);
|
||||
viewer.addViewportListener(this);
|
||||
fPopup.addDisposeListener(new DisposeListener() {
|
||||
@Override
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
fEditor.getSite().getWorkbenchWindow().getPartService().removePartListener(PopupVisibilityManager.this);
|
||||
if (!textWidget.isDisposed()) {
|
||||
|
@ -129,6 +130,7 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partActivated(IWorkbenchPartReference partRef) {
|
||||
IWorkbenchPart fPart= fEditor.getEditorSite().getPart();
|
||||
if (partRef.getPart(false) == fPart) {
|
||||
|
@ -136,12 +138,15 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partBroughtToTop(IWorkbenchPartReference partRef) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partClosed(IWorkbenchPartReference partRef) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partDeactivated(IWorkbenchPartReference partRef) {
|
||||
IWorkbenchPart fPart= fEditor.getEditorSite().getPart();
|
||||
if (fPopup != null && !fPopup.isDisposed() && partRef.getPart(false) == fPart) {
|
||||
|
@ -149,47 +154,59 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partHidden(IWorkbenchPartReference partRef) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partInputChanged(IWorkbenchPartReference partRef) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partOpened(IWorkbenchPartReference partRef) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partVisible(IWorkbenchPartReference partRef) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void controlMoved(ControlEvent e) {
|
||||
updatePopupLocation(true);
|
||||
updateVisibility(); //only for hiding outside editor area
|
||||
}
|
||||
|
||||
@Override
|
||||
public void controlResized(ControlEvent e) {
|
||||
updatePopupLocation(true);
|
||||
updateVisibility(); //only for hiding outside editor area
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDown(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseUp(MouseEvent e) {
|
||||
updatePopupLocation(false);
|
||||
updateVisibility();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
updatePopupLocation(false);
|
||||
updateVisibility();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void textChanged(TextEvent event) {
|
||||
if (!event.getViewerRedrawState())
|
||||
return;
|
||||
|
@ -197,6 +214,7 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
|
|||
updateVisibility(); //only for hiding outside editor area
|
||||
}
|
||||
|
||||
@Override
|
||||
public void viewportChanged(int verticalOffset) {
|
||||
updatePopupLocation(true);
|
||||
updateVisibility(); //only for hiding outside editor area
|
||||
|
@ -309,7 +327,8 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
|
|||
|
||||
final Shell editorShell= fEditor.getSite().getShell();
|
||||
display.asyncExec(new Runnable() {
|
||||
// post to UI thread since editor shell only gets activated after popup has lost focus
|
||||
// Post to UI thread since editor shell only gets activated after popup has lost focus
|
||||
@Override
|
||||
public void run() {
|
||||
Shell activeShell= display.getActiveShell();
|
||||
if (activeShell != editorShell) {
|
||||
|
@ -322,6 +341,7 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
|
|||
|
||||
if (!MAC) { // carbon and cocoa draw their own border...
|
||||
fPopup.addPaintListener(new PaintListener() {
|
||||
@Override
|
||||
public void paintControl(PaintEvent pe) {
|
||||
pe.gc.drawPolygon(getPolygon(true));
|
||||
}
|
||||
|
@ -722,9 +742,12 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
|
|||
fMenuManager.setRemoveAllWhenShown(true);
|
||||
|
||||
fMenuManager.addMenuListener(new IMenuListener2() {
|
||||
@Override
|
||||
public void menuAboutToHide(IMenuManager manager) {
|
||||
fIsMenuUp= false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void menuAboutToShow(IMenuManager manager) {
|
||||
boolean canRefactor= !fRenameLinkedMode.isOriginalName();
|
||||
|
||||
|
@ -840,14 +863,17 @@ public class RenameInformationPopup implements IWidgetTokenKeeper, IWidgetTokenK
|
|||
fEditor.getSite().getShell().setActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requestWidgetToken(IWidgetTokenOwner owner) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requestWidgetToken(IWidgetTokenOwner owner, int priority) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setFocus(IWidgetTokenOwner owner) {
|
||||
if (fToolBar != null && !fToolBar.isDisposed())
|
||||
showMenu(fToolBar);
|
||||
|
|
|
@ -83,6 +83,7 @@ import org.eclipse.cdt.internal.ui.text.correction.proposals.LinkedNamesAssistPr
|
|||
public class RenameLinkedMode {
|
||||
|
||||
private class FocusEditingSupport implements IEditingSupport {
|
||||
@Override
|
||||
public boolean ownsFocusShell() {
|
||||
if (fInfoPopup == null)
|
||||
return false;
|
||||
|
@ -97,12 +98,14 @@ public class RenameLinkedMode {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOriginator(DocumentEvent event, IRegion subjectRegion) {
|
||||
return false; //leave on external modification outside positions
|
||||
}
|
||||
}
|
||||
|
||||
private class EditorSynchronizer implements ILinkedModeListener {
|
||||
@Override
|
||||
public void left(LinkedModeModel model, int flags) {
|
||||
linkedModeLeft();
|
||||
if ((flags & ILinkedModeListener.UPDATE_CARET) != 0) {
|
||||
|
@ -110,9 +113,11 @@ public class RenameLinkedMode {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resume(LinkedModeModel model, int flags) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void suspend(LinkedModeModel model) {
|
||||
}
|
||||
}
|
||||
|
@ -194,7 +199,7 @@ public class RenameLinkedMode {
|
|||
|
||||
ASTProvider.getASTProvider().runOnAST(fEditor.getInputCElement(), ASTProvider.WAIT_ACTIVE_ONLY,
|
||||
new NullProgressMonitor(), new ASTRunnable() {
|
||||
|
||||
@Override
|
||||
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit astRoot) throws CoreException {
|
||||
if (astRoot == null)
|
||||
return Status.CANCEL_STATUS;
|
||||
|
@ -225,7 +230,7 @@ public class RenameLinkedMode {
|
|||
|
||||
// Sort the locations starting with the one @ offset.
|
||||
Arrays.sort(fLocations, new Comparator<IRegion>() {
|
||||
|
||||
@Override
|
||||
public int compare(IRegion n1, IRegion n2) {
|
||||
return rank(n1) - rank(n2);
|
||||
}
|
||||
|
@ -384,6 +389,7 @@ public class RenameLinkedMode {
|
|||
try {
|
||||
if (!fOriginalName.equals(newName)) {
|
||||
fEditor.getSite().getWorkbenchWindow().run(false, true, new IRunnableWithProgress() {
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
if (viewer instanceof ITextViewerExtension6) {
|
||||
IUndoManager undoManager= ((ITextViewerExtension6) viewer).getUndoManager();
|
||||
|
|
|
@ -313,7 +313,8 @@ public class TextSearchWrapper {
|
|||
}
|
||||
|
||||
final static Comparator<int[]> COMPARE_FIRST_INTEGER= new Comparator<int[]>() {
|
||||
public int compare(int[] o1, int[] o2) {
|
||||
@Override
|
||||
public int compare(int[] o1, int[] o2) {
|
||||
return (o1)[0] - (o2)[0];
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue