diff options
author | Dani Megert | 2008-09-11 12:01:34 +0000 |
---|---|---|
committer | Dani Megert | 2008-09-11 12:01:34 +0000 |
commit | 632fd1ce2f0a9ab9359727ceae521e223ae22973 (patch) | |
tree | b584161996bfb35f9dd2e5dd5ebf1ca5b15493d3 /org.eclipse.ui.editors | |
parent | ecd77176ea6b00c6d7f9f6d751105808d9309158 (diff) | |
download | eclipse.platform.text-632fd1ce2f0a9ab9359727ceae521e223ae22973.tar.gz eclipse.platform.text-632fd1ce2f0a9ab9359727ceae521e223ae22973.tar.xz eclipse.platform.text-632fd1ce2f0a9ab9359727ceae521e223ae22973.zip |
Removed trailing whitespace and organized the importsv20080909-ascu
Diffstat (limited to 'org.eclipse.ui.editors')
82 files changed, 620 insertions, 584 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/DefaultEncodingSupport.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/DefaultEncodingSupport.java index 52313cb7e35..504b243716a 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/DefaultEncodingSupport.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/DefaultEncodingSupport.java @@ -36,6 +36,7 @@ import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.editors.text.NLSUtility; + import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditorActionConstants; import org.eclipse.ui.texteditor.StatusTextEditor; @@ -305,7 +306,7 @@ public class DefaultEncodingSupport implements IEncodingSupport { /** * Returns the shell of the active workbench window. - * + * * @return the shell of the active workbench window or <code>null</code> if none * @since 3.2 */ @@ -313,7 +314,7 @@ public class DefaultEncodingSupport implements IEncodingSupport { IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window != null) return window.getShell(); - + return null; } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EditorsUI.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EditorsUI.java index 11d1984577a..db55e0eb9e3 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EditorsUI.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EditorsUI.java @@ -27,6 +27,7 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.editors.text.EditorsPlugin; import org.eclipse.ui.internal.editors.text.NLSUtility; import org.eclipse.ui.keys.IBindingService; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AnnotationPreferenceLookup; import org.eclipse.ui.texteditor.AnnotationTypeLookup; @@ -180,7 +181,7 @@ public final class EditorsUI { * Returns the registry that contains the hyperlink detectors contributed * by the <code>org.eclipse.ui.workbench.texteditor.hyperlinkDetectors</code> * extension point. - * + * * @return the hyperlink detector registry * @since 3.3 */ @@ -189,8 +190,8 @@ public final class EditorsUI { } // --------------- Status codes for this plug-in --------------- - - // NOTE: See also IEditorsStatusConstants + + // NOTE: See also IEditorsStatusConstants /** * Editor UI plug-in status code indicating that an operation failed @@ -198,7 +199,7 @@ public final class EditorsUI { * charset. * <p> * Value: {@value}</p> - * + * * @see UnmappableCharacterException * @since 3.2 */ @@ -209,7 +210,7 @@ public final class EditorsUI { * validation failed. * <p> * Value: {@value}</p> - * + * * @see IFileBuffer#validateState(org.eclipse.core.runtime.IProgressMonitor, Object) * @since 3.3 */ @@ -220,12 +221,12 @@ public final class EditorsUI { * a resource is marked derived. * <p> * Value: {@value}</p> - * + * * @see IResource#isDerived() * @since 3.3 */ public static final int DERIVED_FILE= IFileBufferStatusCodes.DERIVED_FILE; - + /** * Returns the tool tip affordance string. * @@ -237,7 +238,7 @@ public final class EditorsUI { public static final String getTooltipAffordanceString() { if (!getPreferenceStore().getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE)) return null; - + IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class); if (bindingService == null) return null; @@ -245,7 +246,7 @@ public final class EditorsUI { String keySequence= bindingService.getBestActiveBindingFormattedFor(ITextEditorActionDefinitionIds.SHOW_INFORMATION); if (keySequence == null) return ""; //$NON-NLS-1$ - + return NLSUtility.format(TextEditorMessages.Editor_toolTip_affordance, keySequence); } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EncodingActionGroup.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EncodingActionGroup.java index e8efe7f4a66..63d61d94a4a 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EncodingActionGroup.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EncodingActionGroup.java @@ -15,10 +15,11 @@ import java.util.Iterator; import java.util.List; import java.util.ResourceBundle; -import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.content.IContentDescription; +import org.eclipse.core.resources.IFile; + import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; @@ -34,6 +35,7 @@ import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.actions.ActionGroup; import org.eclipse.ui.internal.editors.text.NLSUtility; + import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.IUpdate; import org.eclipse.ui.texteditor.ResourceAction; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationAction.java index 3094f66fa02..a6dc509b8ee 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationAction.java @@ -105,7 +105,7 @@ public class FileBufferOperationAction extends Action implements IWorkbenchWindo } } } - + if (selection instanceof ITextSelection) { IWorkbenchWindow window= getWorkbenchWindow(); if (window != null) { @@ -222,7 +222,7 @@ public class FileBufferOperationAction extends Action implements IWorkbenchWindo /** * Tells whether this action accepts the given location. - * + * * @param location the location * @return <code>true</code> if the given location is acceptable */ diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationHandler.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationHandler.java index 88b0adc5ff7..2fdd1a36a5d 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationHandler.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationHandler.java @@ -65,7 +65,7 @@ public class FileBufferOperationHandler extends AbstractHandler { /** * Creates a new file buffer operation handler. - * + * * @param fileBufferOperation the file buffer operation */ public FileBufferOperationHandler(IFileBufferOperation fileBufferOperation) { @@ -142,7 +142,7 @@ public class FileBufferOperationHandler extends AbstractHandler { /** * Returns the selection of the active workbench window. - * + * * @return the current selection in the active workbench window or <code>null</code> */ protected final ISelection getSelection() { @@ -154,7 +154,7 @@ public class FileBufferOperationHandler extends AbstractHandler { /** * Returns the active workbench window. - * + * * @return the active workbench window or <code>null</code> if not available */ protected final IWorkbenchWindow getWorkbenchWindow() { @@ -165,7 +165,7 @@ public class FileBufferOperationHandler extends AbstractHandler { /** * Collects the files out of the given resources. - * + * * @param resources the resources from which to get the files * @return an array of files */ @@ -181,7 +181,7 @@ public class FileBufferOperationHandler extends AbstractHandler { /** * Runs the given operation. - * + * * @param files the file on which to run this operation * @param location the file buffer location * @param fileBufferOperation the operation to run @@ -227,7 +227,7 @@ public class FileBufferOperationHandler extends AbstractHandler { /** * Returns the shell of the active workbench window. - * + * * @return the shell */ protected final Shell getShell() { @@ -237,7 +237,7 @@ public class FileBufferOperationHandler extends AbstractHandler { /** * Generates the file buffer locations out of the given files. - * + * * @param files an array of files * @param progressMonitor the progress monitor * @return an array with the generated locations @@ -261,7 +261,7 @@ public class FileBufferOperationHandler extends AbstractHandler { /** * Tells whether the given location is accepted by this handler. - * + * * @param location a file buffer location * @return <code>true</code> if the given location is acceptable */ diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java index a0d3732052a..568fe753d73 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java @@ -738,7 +738,7 @@ public class FileDocumentProvider extends StorageDocumentProvider { s= x.getStatus(); d= createEmptyDocument(); } - + // Set the initial line delimiter if (d instanceof IDocumentExtension4) { String initalLineDelimiter= getLineDelimiterPreference(input.getFile()); @@ -769,10 +769,10 @@ public class FileDocumentProvider extends StorageDocumentProvider { return super.createElementInfo(element); } - + /** * Returns the default line delimiter preference for the given file. - * + * * @param file the file * @return the default line delimiter * @since 3.1 @@ -923,7 +923,7 @@ public class FileDocumentProvider extends StorageDocumentProvider { super.doValidateState(element, computationContext); } - + /* * * @see IResource#isDerived() @@ -976,7 +976,7 @@ public class FileDocumentProvider extends StorageDocumentProvider { /** * Refreshes the given file resource. - * + * * @param file the file * @throws CoreException if the refresh fails * @since 2.1 @@ -1237,7 +1237,7 @@ public class FileDocumentProvider extends StorageDocumentProvider { } } } - + /** * Computes the scheduling rule needed to create or modify a resource. If * the resource exists, its modify rule is returned. If it does not, the diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IFoldingCommandIds.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IFoldingCommandIds.java index f5bbb0d7c30..aa0d7a43e03 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IFoldingCommandIds.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IFoldingCommandIds.java @@ -18,7 +18,7 @@ package org.eclipse.ui.editors.text; * This interface contains constants only; it is not intended to be * implemented. * </p> - * + * * @since 3.0 * @noimplement This interface is not intended to be implemented by clients. */ @@ -56,16 +56,16 @@ public interface IFoldingCommandIds { * Identifier of the "collapse all folded regions" command. * <p> * Value: {@value}.</p> - * + * * @since 3.2 */ String FOLDING_COLLAPSE_ALL = "org.eclipse.ui.edit.text.folding.collapse_all"; //$NON-NLS-1$ - + /** * Identifier of the "restore folding structure" command. * <p> * Value: {@value}.</p> - * + * * @since 3.2 */ String FOLDING_RESTORE= "org.eclipse.ui.edit.text.folding.restore"; //$NON-NLS-1$ diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java index 2c539821609..717ff9726c5 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java @@ -11,6 +11,7 @@ package org.eclipse.ui.editors.text; import org.eclipse.ui.ide.IDEActionFactory; + import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds; import org.eclipse.ui.texteditor.ITextEditorActionConstants; @@ -28,7 +29,7 @@ public interface ITextEditorHelpContextIds extends IAbstractTextEditorHelpContex * Value: <code>"org.eclipse.ui.text_editor_preference_page_context"</code>. */ public static final String TEXT_EDITOR_PREFERENCE_PAGE= PREFIX + "text_editor_preference_page_context"; //$NON-NLS-1$ - + /** * Help context id for the Spelling preference page. * Value: <code>"org.eclipse.ui.spelling_preference_page_context"</code>. diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/StorageDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/StorageDocumentProvider.java index 95fa44aee99..f3773df519d 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/StorageDocumentProvider.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/StorageDocumentProvider.java @@ -46,6 +46,7 @@ import org.eclipse.ui.IStorageEditorInput; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.editors.text.EditorsPlugin; import org.eclipse.ui.internal.editors.text.NLSUtility; + import org.eclipse.ui.texteditor.AbstractDocumentProvider; @@ -348,13 +349,13 @@ public class StorageDocumentProvider extends AbstractDocumentProvider implements * @since 3.2 */ public boolean isNotSynchronizedException(Object element, CoreException ex) { - IStatus status= ex.getStatus(); + IStatus status= ex.getStatus(); if (status == null || status instanceof MultiStatus) return false; - + if (status.getException() != null) return false; - + return status.getCode() == IResourceStatus.OUT_OF_SYNC_LOCAL; } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java index cd940c39628..83638b3e4d5 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java @@ -21,6 +21,7 @@ import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.ISourceViewerExtension2; import org.eclipse.ui.IEditorInput; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor; import org.eclipse.ui.texteditor.ITextEditorActionConstants; import org.eclipse.ui.texteditor.IUpdate; @@ -186,7 +187,7 @@ public class TextEditor extends AbstractDecoratedTextEditor { if (fEncodingSupport != null) fEncodingSupport.reset(); } - + /* * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent) * @since 3.3 @@ -194,21 +195,21 @@ public class TextEditor extends AbstractDecoratedTextEditor { protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { if (event.getProperty().equals(SpellingService.PREFERENCE_SPELLING_ENABLED)) { ISourceViewer viewer= getSourceViewer(); - + if (!(viewer instanceof ISourceViewerExtension2)) return; // cannot unconfigure - do nothing // XXX: this is pretty heavy-weight ((ISourceViewerExtension2)viewer).unconfigure(); viewer.configure(getSourceViewerConfiguration()); - + if (Boolean.FALSE.equals(event.getNewValue())) SpellingProblem.removeAll(getSourceViewer(), null); - + IAction quickAssistAction= getAction(ITextEditorActionConstants.QUICK_ASSIST); if (quickAssistAction instanceof IUpdate) ((IUpdate)quickAssistAction).update(); - + return; } super.handlePreferenceStoreChanged(event); diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorActionContributor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorActionContributor.java index 35ef3949b79..e7a10780329 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorActionContributor.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorActionContributor.java @@ -19,6 +19,7 @@ import org.eclipse.ui.IActionBars; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.ide.IDEActionFactory; + import org.eclipse.ui.texteditor.BasicTextEditorActionContributor; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.ITextEditorActionConstants; @@ -56,7 +57,7 @@ public class TextEditorActionContributor extends BasicTextEditorActionContributo * @since 3.3 */ private IContributionItem fQuickAssistMenuEntry; - + private RetargetTextEditorAction fRetargetShowInformationAction; /** @@ -67,7 +68,7 @@ public class TextEditorActionContributor extends BasicTextEditorActionContributo fQuickAssistAction= new RetargetTextEditorAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.QuickAssist."); //$NON-NLS-1$ fQuickAssistAction.setActionDefinitionId(ITextEditorActionDefinitionIds.QUICK_ASSIST); fQuickAssistMenuEntry= new ActionContributionItem(fQuickAssistAction); - + fRetargetShowInformationAction= new RetargetTextEditorAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ShowInformation."); //$NON-NLS-1$ fRetargetShowInformationAction.setActionDefinitionId(ITextEditorActionDefinitionIds.SHOW_INFORMATION); } @@ -86,10 +87,10 @@ public class TextEditorActionContributor extends BasicTextEditorActionContributo /** The global actions to be connected with editor actions */ IActionBars actionBars= getActionBars(); - + actionBars.setGlobalActionHandler(IDEActionFactory.ADD_TASK.getId(), getAction(textEditor, IDEActionFactory.ADD_TASK.getId())); actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(textEditor, IDEActionFactory.BOOKMARK.getId())); - + IAction action= getAction(textEditor, ITextEditorActionConstants.NEXT); actionBars.setGlobalActionHandler(ITextEditorActionDefinitionIds.GOTO_NEXT_ANNOTATION, action); actionBars.setGlobalActionHandler(ITextEditorActionConstants.NEXT, action); @@ -101,32 +102,32 @@ public class TextEditorActionContributor extends BasicTextEditorActionContributo actionBars.setGlobalActionHandler(ITextEditorActionConstants.REFRESH, action); fChangeEncodingAction.setAction(getAction(textEditor, ITextEditorActionConstants.CHANGE_ENCODING)); - + IAction quickAssistAction= getAction(textEditor, ITextEditorActionConstants.QUICK_ASSIST); fQuickAssistAction.setAction(quickAssistAction); if (textEditor == null) return; - + // Update Quick Assist menu entry - for now don't show disabled entry IMenuManager menuMgr= textEditor.getEditorSite().getActionBars().getMenuManager(); IMenuManager editMenu= menuMgr.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); - if (editMenu != null) { + if (editMenu != null) { boolean isEnabled= quickAssistAction != null && quickAssistAction.isEnabled(); fQuickAssistMenuEntry.setVisible(isEnabled); editMenu.update(true); } - + fRetargetShowInformationAction.setAction(getAction(textEditor, ITextEditorActionConstants.SHOW_INFORMATION)); } - + /* * @see org.eclipse.ui.texteditor.BasicTextEditorActionContributor#contributeToMenu(org.eclipse.jface.action.IMenuManager) * @since 3.3 */ public void contributeToMenu(IMenuManager menu) { super.contributeToMenu(menu); - + IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); if (editMenu != null) { editMenu.appendToGroup(ITextEditorActionConstants.GROUP_ASSIST, fQuickAssistMenuEntry); diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferencePage.java index 266a7b1c646..558162c31d2 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferencePage.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferencePage.java @@ -30,6 +30,7 @@ import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.plugin.AbstractUIPlugin; + import org.eclipse.ui.texteditor.AbstractTextEditor; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java index 83df3da97fc..5712b33a806 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java @@ -117,7 +117,7 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro /** * The actual functionality of this operation. - * + * * @param monitor the progress monitor * @throws CoreException if the execution fails */ @@ -186,13 +186,13 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro public Object fElement; public int fCount; public ITextFileBuffer fTextFileBuffer; - + /** * The file buffer location kind. * @since 3.4 */ public LocationKind fTextFileBufferLocationKind; - + public IAnnotationModel fModel; public boolean fCachedReadOnlyState; } @@ -545,12 +545,12 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro if (!(element instanceof IAdaptable)) return null; IAdaptable adaptable= (IAdaptable) element; - + IFile file= null; ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager(); ITextFileBuffer fileBuffer= null; LocationKind locationKind= null; - + file= (IFile)adaptable.getAdapter(IFile.class); if (file != null) { IPath location= file.getFullPath(); @@ -602,14 +602,14 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro /** * Sets up the synchronization for the document * and the annotation mode. - * + * * @param info the file info * @since 3.2 */ protected void setUpSynchronization(FileInfo info) { if (info == null || info.fTextFileBuffer == null) return; - + IDocument document= info.fTextFileBuffer.getDocument(); IAnnotationModel model= info.fModel; @@ -856,7 +856,7 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro */ protected void commitFileBuffer(IProgressMonitor monitor, FileInfo info, boolean overwrite) throws CoreException { Assert.isNotNull(info); - + /* https://bugs.eclipse.org/bugs/show_bug.cgi?id=98327 * Make sure file gets save in commit() if the underlying file has been deleted */ if (info.fElement instanceof IFileEditorInput) { @@ -865,7 +865,7 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro if (!resource.isSynchronized(IResource.DEPTH_ZERO) && isDeleted(input)) info.fTextFileBuffer.setDirty(true); } - + info.fTextFileBuffer.commit(monitor, overwrite); if (info.fModel instanceof AbstractMarkerAnnotationModel) { AbstractMarkerAnnotationModel model= (AbstractMarkerAnnotationModel) info.fModel; @@ -1198,7 +1198,7 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro return info.fTextFileBuffer.isSynchronized(); return ((IDocumentProviderExtension3) getParentProvider()).isSynchronized(element); } - + /* * @see org.eclipse.ui.texteditor.IDocumentProviderExtension5#isNotSynchronizedException(Object, CoreException) * @since 3.2 @@ -1207,10 +1207,10 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro IStatus status= ex.getStatus(); if (status == null || status instanceof MultiStatus) return false; - + if (status.getException() != null) return false; - + return status.getCode() == IResourceStatus.OUT_OF_SYNC_LOCAL; } @@ -1280,7 +1280,7 @@ public class TextFileDocumentProvider implements IDocumentProvider, IDocumentPro protected IFileStore getFileStore(FileInfo info) { return info.fTextFileBuffer.getFileStore(); } - + /** * Returns the system file denoted by the given info. * diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java index 128067c6347..37390688dcb 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java @@ -16,15 +16,16 @@ import java.util.Map; import java.util.StringTokenizer; import java.util.Map.Entry; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.IAdaptable; - import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Shell; +import org.eclipse.core.runtime.Assert; +import org.eclipse.core.runtime.IAdaptable; + import org.eclipse.jface.action.Action; import org.eclipse.jface.preference.IPreferenceStore; + import org.eclipse.jface.text.DefaultInformationControl; import org.eclipse.jface.text.DefaultTextHover; import org.eclipse.jface.text.IInformationControl; @@ -49,6 +50,7 @@ import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.eclipse.ui.internal.editors.text.EditorsPlugin; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AnnotationPreference; import org.eclipse.ui.texteditor.HyperlinkDetectorRegistry; @@ -111,7 +113,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { // backward compatibility if (key != null && !fPreferenceStore.getBoolean(key)) return false; - + return true; } @@ -138,7 +140,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { String key= preference.getOverviewRulerPreferenceKey(); if (key == null || !fPreferenceStore.getBoolean(key)) return false; - + return true; } @@ -177,7 +179,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { } return true; } - + /** * Returns the annotation preference for the given annotation. * @@ -230,7 +232,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { if (!fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED)) return null; - + return getRegisteredHyperlinkDetectors(sourceViewer); } @@ -247,7 +249,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { Map targets= getHyperlinkDetectorTargets(sourceViewer); Assert.isNotNull(targets); - + IHyperlinkDetector[] result= null; Iterator iter= targets.entrySet().iterator(); while (iter.hasNext()) { @@ -265,7 +267,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { * <p> * Subclasses are allowed to modify the returned map. * </p> - * + * * @param sourceViewer the source viewer to be configured by this configuration * @return the hyperlink detector targets with target id (<code>String</code>) as key * and the target context (<code>IAdaptable</code>) as value @@ -372,7 +374,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { * This implementation currently returns a {@link MonoReconciler} which * is responsible for spell checking. In the future a different reconciler * taking over more responsibilities might be returned.</p> - * + * * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer) * @since 3.3 */ @@ -383,7 +385,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { SpellingService spellingService= EditorsUI.getSpellingService(); if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) return null; - + IReconcilingStrategy strategy= new SpellingReconcileStrategy(sourceViewer, spellingService); MonoReconciler reconciler= new MonoReconciler(strategy, false); reconciler.setDelay(500); @@ -401,7 +403,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { IQuickAssistAssistant assistant= new QuickAssistAssistant(); assistant.setQuickAssistProcessor(new SpellingCorrectionProcessor()); assistant.setInformationControlCreator(getQuickAssistAssistantInformationControlCreator()); - + return assistant; } @@ -421,7 +423,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { /** * Helper method to merge two {@link IHyperlinkDetector} arrays. - * + * * @param array1 an array of hyperlink detectors or <code>null</code> * @param array2 an array of hyperlink detectors or <code>null</code> * @return an array with the merged hyperlink detectors or <code>null</code> if both given arrays are <code>null</code> @@ -447,7 +449,7 @@ public class TextSourceViewerConfiguration extends SourceViewerConfiguration { /** * Text hover with custom control creator that * can show the tool tip affordance. - * + * * @since 3.3 */ private final class TextHover extends DefaultTextHover implements ITextHoverExtension { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java index 8bf4cbad3b0..fecd0114621 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java @@ -24,10 +24,10 @@ import org.eclipse.jface.text.templates.ContextTypeRegistry; import org.eclipse.jface.text.templates.TemplateContextType; import org.eclipse.jface.text.templates.TemplateVariableResolver; -import org.eclipse.ui.editors.text.EditorsUI; - import org.eclipse.ui.internal.editors.text.EditorsPlugin; +import org.eclipse.ui.editors.text.EditorsUI; + /** * A registry for context types. Editor implementors will usually instantiate a diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java index 52250c96155..c8e265c69c5 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java @@ -240,7 +240,7 @@ public class ContributionTemplateStore extends TemplateStore { bAutoInsert= true; else bAutoInsert= Boolean.valueOf(autoInsert).booleanValue(); - + Template template= new Template(name, desc, contextTypeId, pattern, bAutoInsert); TemplatePersistenceData data= new TemplatePersistenceData(template, true, id); if (validateTemplate(template)) @@ -254,7 +254,7 @@ public class ContributionTemplateStore extends TemplateStore { private static boolean isValidTemplateId(String id) { return id != null && id.trim().length() != 0; // TODO test validity? } - + /* * @see org.eclipse.jface.text.templates.persistence.TemplateStore#handleException(java.io.IOException) * @since 3.2 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/CompositeRevertAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/CompositeRevertAction.java index 734885f7570..70a337ad83b 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/CompositeRevertAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/CompositeRevertAction.java @@ -39,7 +39,7 @@ public final class CompositeRevertAction extends Action implements IUpdate, ISel /** * Creates an action combining the two given actions. * - * @param editor the editor + * @param editor the editor * @param actions the list of actions */ public CompositeRevertAction(ITextEditor editor, IAction[] actions) { @@ -48,11 +48,11 @@ public final class CompositeRevertAction extends Action implements IUpdate, ISel Assert.isNotNull(actions[i]); System.arraycopy(actions, 0, fActions, 0, actions.length); - + ISelectionProvider selectionProvider= editor.getSelectionProvider(); if (selectionProvider instanceof IPostSelectionProvider) ((IPostSelectionProvider)selectionProvider).addPostSelectionChangedListener(this); - + update(); } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/LastSaveReferenceProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/LastSaveReferenceProvider.java index e3cb9abb7da..aa7993875bb 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/LastSaveReferenceProvider.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/LastSaveReferenceProvider.java @@ -104,9 +104,9 @@ public class LastSaveReferenceProvider implements IQuickDiffReferenceProvider, I /** * Calls {@link LastSaveReferenceProvider#readDocument(IProgressMonitor, boolean)} and * returns {@link Status#OK_STATUS}. - * + * * {@inheritDoc} - * + * * @param monitor {@inheritDoc} * @return {@link Status#OK_STATUS} */ diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffRestoreAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffRestoreAction.java index a5de39761e2..42b7f136958 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffRestoreAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffRestoreAction.java @@ -98,7 +98,7 @@ public abstract class QuickDiffRestoreAction extends TextEditorAction implements setEnabled(computeEnablement()); } - + /* * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) * @since 3.3 @@ -153,7 +153,7 @@ public abstract class QuickDiffRestoreAction extends TextEditorAction implements /** * Returns the active line - * + * * @param useRulerInfo <code>true</code> if the ruler info should be used * @return the line of interest. * @since 3.1 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/RestoreAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/RestoreAction.java index ab57eef755d..8d27ae9ada0 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/RestoreAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/RestoreAction.java @@ -16,6 +16,7 @@ import org.eclipse.jface.text.source.ILineDiffInfo; import org.eclipse.jface.text.source.ILineDiffer; import org.eclipse.ui.internal.editors.text.NLSUtility; + import org.eclipse.ui.texteditor.ITextEditor; /** diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AccessibilityPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AccessibilityPreferencePage.java index 9d68588de97..ed274821dd3 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AccessibilityPreferencePage.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AccessibilityPreferencePage.java @@ -39,15 +39,15 @@ import org.eclipse.jface.dialogs.DialogPage; import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.preference.PreferencePage; - -import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; - import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.editors.text.AccessibilityPreferencePage.EnumeratedDomain.EnumValue; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; +import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; + /** * The preference page for setting the editor options. * <p> @@ -424,7 +424,7 @@ public class AccessibilityPreferencePage extends PreferencePage implements IWork fOverlayStore.start(); fContents= createAppearancePage(parent); - + initialize(); Dialog.applyDialogFont(fContents); return fContents; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsConfigurationBlock.java index 7f5a3b04673..3a2cb96a7ee 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsConfigurationBlock.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsConfigurationBlock.java @@ -55,6 +55,7 @@ import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; + import org.eclipse.ui.texteditor.AnnotationPreference; import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; @@ -101,7 +102,7 @@ class AnnotationsConfigurationBlock implements IPreferenceConfigurationBlock { } } - + private final class ItemLabelProvider extends LabelProvider { public String getText(Object element) { @@ -114,7 +115,7 @@ class AnnotationsConfigurationBlock implements IPreferenceConfigurationBlock { } } - + private static class ArrayLabelProvider extends LabelProvider { public String getText(Object element) { return ((String[]) element)[0].toString(); @@ -248,7 +249,7 @@ class AnnotationsConfigurationBlock implements IPreferenceConfigurationBlock { gd.horizontalAlignment= GridData.BEGINNING; gd.horizontalIndent= 20; fShowInTextCheckBox.setLayoutData(gd); - + fDecorationViewer= new ComboViewer(optionsComposite, SWT.READ_ONLY); fDecorationViewer.setContentProvider(new ArrayContentProvider()); @@ -382,7 +383,7 @@ class AnnotationsConfigurationBlock implements IPreferenceConfigurationBlock { /** * Applies the given data. - * + * * @param data the annotation type to select in the list or <code>null</code> * @see org.eclipse.ui.internal.editors.text.IPreferenceConfigurationBlock#applyData(java.lang.Object) * @since 3.4 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ConvertLineDelimitersAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ConvertLineDelimitersAction.java index 852b621490c..a4d37ebe015 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ConvertLineDelimitersAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ConvertLineDelimitersAction.java @@ -29,10 +29,10 @@ import org.eclipse.jface.window.Window; import org.eclipse.jface.text.ITextSelection; -import org.eclipse.ui.editors.text.FileBufferOperationAction; - import org.eclipse.ui.internal.editors.text.SelectResourcesDialog.IFilter; +import org.eclipse.ui.editors.text.FileBufferOperationAction; + /** * A file buffer operation action that changes the line delimiters to a specified @@ -64,7 +64,7 @@ public class ConvertLineDelimitersAction extends FileBufferOperationAction { ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager(); return location != null && manager.isTextFileLocation(location, fStrictCheckIfTextLocation); } - + public void selectionChanged(IAction action, ISelection selection) { super.selectionChanged(action, selection); fStrictCheckIfTextLocation= !(selection instanceof ITextSelection); @@ -99,7 +99,7 @@ public class ConvertLineDelimitersAction extends FileBufferOperationAction { /** * Checks whether the given resources array contains * only files. - * + * * @param resources the array with the resources * @return <code>true</code> if there array only contains <code>IFiles</code>s * @since 3.2 @@ -112,10 +112,10 @@ public class ConvertLineDelimitersAction extends FileBufferOperationAction { } return true; } - + /** * Filters the unacceptable files. - * + * * @param files the files to filter * @return an array of files * @since 3.2 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java index 60d57a28a48..5362bdba9ec 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java @@ -11,28 +11,31 @@ *******************************************************************************/ package org.eclipse.ui.internal.editors.text; +import org.osgi.framework.BundleContext; + import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.jface.text.source.ISharedTextColors; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; +import org.eclipse.jface.text.source.ISharedTextColors; + import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.editors.text.EditorsUI; import org.eclipse.ui.internal.texteditor.AnnotationTypeHierarchy; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.eclipse.ui.themes.IThemeManager; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AnnotationPreferenceLookup; import org.eclipse.ui.texteditor.AnnotationTypeLookup; import org.eclipse.ui.texteditor.HyperlinkDetectorRegistry; import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; import org.eclipse.ui.texteditor.spelling.SpellingService; -import org.eclipse.ui.themes.IThemeManager; -import org.osgi.framework.BundleContext; +import org.eclipse.ui.editors.text.EditorsUI; /** * Represents the editors plug-in. It provides a series of convenience methods such as @@ -97,7 +100,7 @@ public class EditorsPlugin extends AbstractUIPlugin { * @since 3.1 */ private SpellingService fSpellingService; - + /** * The hyperlink detector registry. * @since 3.3 @@ -156,7 +159,7 @@ public class EditorsPlugin extends AbstractUIPlugin { fAnnotationTypeHierarchy= new AnnotationTypeHierarchy(); return fAnnotationTypeHierarchy; } - + /** * Sets the marker annotation preferences. * <p> @@ -170,7 +173,7 @@ public class EditorsPlugin extends AbstractUIPlugin { Assert.isTrue(fMarkerAnnotationPreferences == null); fMarkerAnnotationPreferences= markerAnnotationPreferences; } - + /** * Tells whether the marker annotation preferences are initialized. * @@ -192,14 +195,14 @@ public class EditorsPlugin extends AbstractUIPlugin { new MarkerAnnotationPreferences().getAnnotationPreferences(); // force creation of shared preferences return fMarkerAnnotationPreferences; } - + /* * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) * @since 3.3 */ public void start(BundleContext context) throws Exception { super.start(context); - + if (PlatformUI.isWorkbenchRunning()) { fThemeListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { @@ -226,7 +229,7 @@ public class EditorsPlugin extends AbstractUIPlugin { PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(fThemeListener); fThemeListener= null; } - + fAnnotationTypeLookup= null; fAnnotationPreferenceLookup= null; fAnnotationTypeHierarchy= null; @@ -252,7 +255,7 @@ public class EditorsPlugin extends AbstractUIPlugin { * Returns the registry that contains the hyperlink detectors contributed * by the <code>org.eclipse.ui.workbench.texteditor.hyperlinkDetectors</code> * extension point. - * + * * @return the hyperlink detector registry * @since 3.3 */ @@ -261,7 +264,7 @@ public class EditorsPlugin extends AbstractUIPlugin { fHyperlinkDetectorRegistry= new HyperlinkDetectorRegistry(getPreferenceStore()); return fHyperlinkDetectorRegistry; } - + /** * Returns the content assist additional info focus affordance string. * @@ -274,8 +277,8 @@ public class EditorsPlugin extends AbstractUIPlugin { public static final String getAdditionalInfoAffordanceString() { if (!EditorsUI.getPreferenceStore().getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE)) return null; - + return TextEditorMessages.EditorsPlugin_additionalInfo_affordance; } - + } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPluginPreferenceInitializer.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPluginPreferenceInitializer.java index 87e5e2fe1a1..1a4050a09cf 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPluginPreferenceInitializer.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPluginPreferenceInitializer.java @@ -18,13 +18,14 @@ import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.resource.ColorRegistry; -import org.eclipse.ui.editors.text.TextEditorPreferenceConstants; - import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.texteditor.ITextEditorThemeConstants; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AbstractTextEditor; +import org.eclipse.ui.editors.text.TextEditorPreferenceConstants; + /** * Preference initializer for Editors UI plug-in. @@ -63,11 +64,11 @@ public class EditorsPluginPreferenceInitializer extends AbstractPreferenceInitia setDefault(store, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, findRGB(registry, ITextEditorThemeConstants.PREFERENCE_COLOR_BACKGROUND, new RGB(255, 255, 255)), fireEvent); - + setDefault(store, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, findRGB(registry, ITextEditorThemeConstants.PREFERENCE_COLOR_FOREGROUND, new RGB(0,0,0)), fireEvent); - + setDefault(store, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_COLOR, findRGB(registry,ITextEditorThemeConstants.HYPERLINK_COLOR, new RGB(0, 0, 255)), fireEvent); @@ -75,13 +76,13 @@ public class EditorsPluginPreferenceInitializer extends AbstractPreferenceInitia setDefault(store, AbstractTextEditor.PREFERENCE_COLOR_FIND_SCOPE, findRGB(registry, ITextEditorThemeConstants.FIND_SCOPE_COLOR, new RGB(185, 176 , 180)), fireEvent); - + } /** * Sets the default value and fires a property * change event if necessary. - * + * * @param store the preference store * @param key the preference key * @param newValue the new value @@ -106,7 +107,7 @@ public class EditorsPluginPreferenceInitializer extends AbstractPreferenceInitia /** * Returns the RGB for the given key in the given color registry. - * + * * @param registry the color registry * @param key the key for the constant in the registry * @param defaultRGB the default RGB if no entry is found @@ -116,14 +117,14 @@ public class EditorsPluginPreferenceInitializer extends AbstractPreferenceInitia private static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) { if (registry == null) return defaultRGB; - + RGB rgb= registry.getRGB(key); if (rgb != null) return rgb; - + return defaultRGB; } - + /** * Migrates the overview ruler preference by re-enabling it. diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/FileEditorInputAdapterFactory.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/FileEditorInputAdapterFactory.java index 68cde71007d..9f9b2225200 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/FileEditorInputAdapterFactory.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/FileEditorInputAdapterFactory.java @@ -11,11 +11,13 @@ package org.eclipse.ui.internal.editors.text; -import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.core.runtime.IPath; +import org.eclipse.core.resources.IFile; + import org.eclipse.ui.IFileEditorInput; + import org.eclipse.ui.editors.text.ILocationProvider; /** diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsConfigurationBlock.java index 4ea69468946..c32cb1b4589 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsConfigurationBlock.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/HyperlinkDetectorsConfigurationBlock.java @@ -70,8 +70,8 @@ import org.eclipse.ui.editors.text.EditorsUI; * @since 3.3 */ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBlock { - - + + private static final class ListItem { final String id; final String name; @@ -93,7 +93,7 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl } } - + private static final class ItemContentProvider implements IStructuredContentProvider { public Object[] getElements(Object inputElement) { @@ -106,10 +106,10 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } - + private final class ItemLabelProvider implements ITableLabelProvider { - + /* * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int) */ @@ -163,7 +163,7 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl } } - + private static final String MODIFIER_DELIMITER= TextEditorMessages.HyperlinkKeyModifier_delimiter; @@ -172,7 +172,7 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl private CheckboxTableViewer fHyperlinkDetectorsViewer; private ListItem[] fListModel; private final HyperlinkDetectorDescriptor[] fHyperlinkDetectorDescriptors; - + private Text fHyperlinkDefaultKeyModifierText; private Text fHyperlinkKeyModifierText; private Button fHyperlinksEnabledCheckBox; @@ -193,12 +193,12 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() { ArrayList overlayKeys= new ArrayList(); - + for (int i= 0; i < fHyperlinkDetectorDescriptors.length; i++) { overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, fHyperlinkDetectorDescriptors[i].getId())); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, fHyperlinkDetectorDescriptors[i].getId() + HyperlinkDetectorDescriptor.STATE_MASK_POSTFIX)); } - + overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED)); @@ -220,7 +220,7 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl layout.marginHeight= 0; layout.marginWidth= 0; composite.setLayout(layout); - + addFiller(composite, 2); String label= TextEditorMessages.HyperlinksEnabled_label; @@ -284,25 +284,25 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl handleHyperlinkDefaultKeyModifierModified(); } }); - + addFiller(composite, 2); Composite editorComposite= new Composite(composite, SWT.NONE); GridData gd; - + gd= new GridData(SWT.FILL, SWT.TOP, true, false); gd.horizontalSpan= 2; gd.horizontalIndent= 20; editorComposite.setLayoutData(gd); TableColumnLayout tableColumnlayout= new TableColumnLayout(); editorComposite.setLayout(tableColumnlayout); - + // Hyperlink detector table Table hyperlinkDetectorTable= new Table(editorComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION | SWT.CHECK); hyperlinkDetectorTable.setHeaderVisible(true); hyperlinkDetectorTable.setLinesVisible(true); hyperlinkDetectorTable.setFont(parent.getFont()); - + hyperlinkDetectorTable.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { handleListSelection(); @@ -310,24 +310,24 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl public void widgetDefaultSelected(SelectionEvent e) { } }); - + ColumnLayoutData columnLayoutData= new ColumnWeightData(1); - + TableColumn nameColumn= new TableColumn(hyperlinkDetectorTable, SWT.NONE, 0); nameColumn.setText(TextEditorMessages.HyperlinkDetectorTable_nameColumn); tableColumnlayout.setColumnData(nameColumn, columnLayoutData); - + TableColumn modifierKeysColumn= new TableColumn(hyperlinkDetectorTable, SWT.NONE, 1); modifierKeysColumn.setText(TextEditorMessages.HyperlinkDetectorTable_modifierKeysColumn); tableColumnlayout.setColumnData(modifierKeysColumn, columnLayoutData); - + TableColumn targetNameColumn= new TableColumn(hyperlinkDetectorTable, SWT.NONE, 2); targetNameColumn.setText(TextEditorMessages.HyperlinkDetectorTable_targetNameColumn); tableColumnlayout.setColumnData(targetNameColumn, columnLayoutData); fHyperlinkDetectorsViewer= new CheckboxTableViewer(hyperlinkDetectorTable); fHyperlinkDetectorsViewer.setUseHashlookup(true); - + fHyperlinkDetectorsViewer.addCheckStateListener(new ICheckStateListener() { /* * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent) @@ -339,15 +339,15 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl fStore.setValue(id, !event.getChecked()); } }); - + fHyperlinkDetectorsViewer.setLabelProvider(new ItemLabelProvider()); fHyperlinkDetectorsViewer.setContentProvider(new ItemContentProvider()); gd= new GridData(SWT.FILL, SWT.FILL, true , false); gd.heightHint= pixelConverter.convertHeightInCharsToPixels(10); fHyperlinkDetectorsViewer.getControl().setLayoutData(gd); - + // addFiller(composite, 2); - + // Text field for modifier string label= TextEditorMessages.HyperlinkKeyModifier_label; fHyperlinkKeyModifierText= (Text)addTextField(composite, label, null, 15, 20, pixelConverter)[1]; @@ -395,17 +395,17 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl handleHyperlinkKeyModifierModified(); } }); - + return composite; } - + /* * @see org.eclipse.ui.internal.editors.text.IPreferenceConfigurationBlock#applyData(java.lang.Object) * @since 3.4 */ public void applyData(Object data) { } - + private void addFiller(Composite composite, int horizontalSpan) { PixelConverter pixelConverter= new PixelConverter(composite); Label filler= new Label(composite, SWT.LEFT ); @@ -498,7 +498,7 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl if (text == null) text= fHyperlinkDefaultKeyModifierText.getText(); fHyperlinkKeyModifierText.setText(text); - + } public void initialize() { @@ -516,7 +516,7 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl fHyperlinksEnabledCheckBox.setSelection(isEnabled); fHyperlinkKeyModifierText.setEnabled(isEnabled); fHyperlinkDefaultKeyModifierText.setEnabled(isEnabled); - + fListModel= createListModel(); fHyperlinkDetectorsViewer.setInput(fListModel); fHyperlinkDetectorsViewer.setAllChecked(false); @@ -533,10 +533,10 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl for (int i= 0; i < fHyperlinkDetectorDescriptors.length; i++) { HyperlinkDetectorDescriptor desc= fHyperlinkDetectorDescriptors[i]; HyperlinkDetectorTargetDescriptor target= desc.getTarget(); - + int stateMask= fStore.getInt(desc.getId() + HyperlinkDetectorDescriptor.STATE_MASK_POSTFIX); String modifierKeys= getModifierString(stateMask); - + listModelItems.add(new ListItem( desc.getId(), desc.getName(), desc.getDescription(), desc.getTargetId(), target.getName(), target.getDescription(), modifierKeys)); } @@ -571,7 +571,7 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl private void handleHyperlinkKeyModifierModified() { String modifiers= fHyperlinkKeyModifierText.getText(); - + int stateMask= computeStateMask(modifiers); if (fHyperlinksEnabledCheckBox.getSelection() && (stateMask == -1 || (stateMask & SWT.SHIFT) != 0)) { @@ -594,12 +594,12 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl applyToStatusLine(fHyperlinkKeyModifierStatus); } } - + private void handleHyperlinkDefaultKeyModifierModified() { String modifiers= fHyperlinkDefaultKeyModifierText.getText(); - + int stateMask= computeStateMask(modifiers); - + if (fHyperlinksEnabledCheckBox.getSelection() && (stateMask == -1 || (stateMask & SWT.SHIFT) != 0)) { if (stateMask == -1) fHyperlinkKeyModifierStatus= new StatusInfo(IStatus.ERROR, NLSUtility.format(TextEditorMessages.HyperlinkKeyModifier_error_modifierIsNotValid, modifiers)); @@ -680,7 +680,7 @@ class HyperlinkDetectorsConfigurationBlock implements IPreferenceConfigurationBl private static final String getModifierString(int stateMask) { if (stateMask == -1) return null; - + String modifierString= ""; //$NON-NLS-1$ if ((stateMask & SWT.CTRL) == SWT.CTRL) modifierString= appendModifierString(modifierString, SWT.CTRL); diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IPreferenceConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IPreferenceConfigurationBlock.java index 999435c6fba..58d5e8f5594 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IPreferenceConfigurationBlock.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IPreferenceConfigurationBlock.java @@ -81,7 +81,7 @@ interface IPreferenceConfigurationBlock { * It is up to the implementor to define whether it supports this and which * kind of data it accepts. * </p> - * + * * @param data the data which is specified by each configuration block * @see PreferencePage#applyData(Object) * @since 3.4 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IURIEditorInputAdapterFactory.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IURIEditorInputAdapterFactory.java index f5cced5a3cf..ee8558b794e 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IURIEditorInputAdapterFactory.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IURIEditorInputAdapterFactory.java @@ -17,15 +17,15 @@ import org.eclipse.core.filesystem.URIUtil; import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.core.runtime.IPath; +import org.eclipse.ui.IURIEditorInput; + import org.eclipse.ui.editors.text.ILocationProvider; import org.eclipse.ui.editors.text.ILocationProviderExtension; -import org.eclipse.ui.IURIEditorInput; - /** * Adapter factory for <code>IURIEditorInput</code>. - * + * * @since 3.3 */ public class IURIEditorInputAdapterFactory implements IAdapterFactory { @@ -40,7 +40,7 @@ public class IURIEditorInputAdapterFactory implements IAdapterFactory { return URIUtil.toPath(uri); return null; } - + /* * @see org.eclipse.ui.editors.text.ILocationProviderExtension#getURI(java.lang.Object) */ @@ -53,7 +53,7 @@ public class IURIEditorInputAdapterFactory implements IAdapterFactory { } } - + /** The list of provided adapters. */ private static final Class[] ADAPTER_LIST= new Class[] { ILocationProvider.class }; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LanguageEditorPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LanguageEditorPreferencePage.java index c17261b87bd..ca0674b975e 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LanguageEditorPreferencePage.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LanguageEditorPreferencePage.java @@ -18,12 +18,12 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; - import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; + diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LinkedModeConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LinkedModeConfigurationBlock.java index f1bdb144ec8..2bd1a2e61ed 100755 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LinkedModeConfigurationBlock.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LinkedModeConfigurationBlock.java @@ -64,7 +64,7 @@ import org.eclipse.ui.editors.text.EditorsUI; * Configures the linked mode preferences. The preferences belong to * org.eclipse.ui.editors. However, as they are chiefly used in the java editor, * we keep the preferences here for the time being. - * + * * @since 3.2 (in jdt.ui since 3.1) */ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { @@ -97,7 +97,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { this.validStyles= validStyles; } } - + private static final class ItemContentProvider implements IStructuredContentProvider { public Object[] getElements(Object inputElement) { @@ -110,20 +110,20 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } - + private final class ItemLabelProvider extends LabelProvider { - + public String getText(Object element) { return ((ListItem) element).label; } } - + private static class ArrayLabelProvider extends LabelProvider { public String getText(Object element) { return ((String[]) element)[0].toString(); } } - + final static String[] HIGHLIGHT= new String[] {TextEditorMessages.LinkedModeConfigurationBlock_HIGHLIGHT, "unused"}; //$NON-NLS-1$ final static String[] UNDERLINE= new String[] {TextEditorMessages.LinkedModeConfigurationBlock_UNDERLINE, AnnotationPreference.STYLE_UNDERLINE}; final static String[] BOX= new String[] {TextEditorMessages.LinkedModeConfigurationBlock_BOX, AnnotationPreference.STYLE_BOX}; @@ -134,7 +134,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { private ColorSelector fAnnotationForegroundColorEditor; private Button fShowInTextCheckBox; - + private StructuredViewer fAnnotationTypeViewer; private final ListItem[] fListModel; @@ -142,13 +142,13 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { private FontMetrics fFontMetrics; protected static final int INDENT= 20; private OverlayPreferenceStore fStore; - + private ArrayList fMasterSlaveListeners= new ArrayList(); - + private OverlayPreferenceStore getPreferenceStore() { return fStore; } - + public LinkedModeConfigurationBlock(OverlayPreferenceStore store) { fStore= store; final MarkerAnnotationPreferences prefs= EditorsPlugin.getDefault().getMarkerAnnotationPreferences(); @@ -162,7 +162,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { Iterator e= preferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference info= (AnnotationPreference) e.next(); - + if (isLinkedModeAnnotation(info)) { overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey())); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getTextPreferenceKey())); @@ -170,7 +170,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getHighlightPreferenceKey())); } } - + OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()]; overlayKeys.toArray(keys); return keys; @@ -183,11 +183,11 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { || (type.equals(TARGET)) || (type.equals(EXIT)); } - + private ListItem[] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) { ArrayList listModelItems= new ArrayList(); Iterator e= preferences.getAnnotationPreferences().iterator(); - + while (e.hasNext()) { AnnotationPreference info= (AnnotationPreference) e.next(); if (isLinkedModeAnnotation(info)) { @@ -196,12 +196,12 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { listModelItems.add(new ListItem(label, null, info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getOverviewRulerPreferenceKey(), info.getHighlightPreferenceKey(), info.getVerticalRulerPreferenceKey(), info.getTextStylePreferenceKey(), styles)); } } - + ListItem[] items= new ListItem[listModelItems.size()]; listModelItems.toArray(items); return items; } - + private List getStyles(Object type) { if (type.equals(MASTER)) @@ -217,7 +217,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { /** * Creates page for hover preferences. - * + * * @param parent the parent composite * @return the control for the preference page */ @@ -225,7 +225,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { OverlayPreferenceStore store= getPreferenceStore(); store.load(); store.start(); - + initializeDialogUnits(parent); Composite composite= new Composite(parent, SWT.NONE); @@ -254,7 +254,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { gd= new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false); gd.heightHint= convertHeightInCharsToPixels(5); fAnnotationTypeViewer.getControl().setLayoutData(gd); - + Composite optionsComposite= new Composite(editorComposite, SWT.NONE); layout= new GridLayout(); layout.marginHeight= 0; @@ -262,15 +262,15 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { layout.numColumns= 2; optionsComposite.setLayout(layout); optionsComposite.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false)); - + // we only allow to set either "show in text" or "highlight in text", but not both - + fShowInTextCheckBox= new Button(optionsComposite, SWT.CHECK); fShowInTextCheckBox.setText(TextEditorMessages.LinkedModeConfigurationBlock_labels_showIn); gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalAlignment= GridData.BEGINNING; fShowInTextCheckBox.setLayoutData(gd); - + fDecorationViewer= new ComboViewer(optionsComposite, SWT.READ_ONLY); fDecorationViewer.setContentProvider(new ArrayContentProvider()); fDecorationViewer.setLabelProvider(new ArrayLabelProvider()); @@ -280,7 +280,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { gd.horizontalAlignment= GridData.BEGINNING; fDecorationViewer.getControl().setLayoutData(gd); fDecorationViewer.setInput(new Object[] {HIGHLIGHT, SQUIGGLES, BOX, DASHED_BOX, UNDERLINE, IBEAM}); - + label= new Label(optionsComposite, SWT.LEFT); label.setText(TextEditorMessages.LinkedModeConfigurationBlock_color); gd= new GridData(); @@ -292,7 +292,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalAlignment= GridData.BEGINNING; foregroundColorButton.setLayoutData(gd); - + createDependency(fShowInTextCheckBox, new Control[] {label, foregroundColorButton}); fAnnotationTypeViewer.addSelectionChangedListener(new ISelectionChangedListener() { @@ -300,12 +300,12 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { handleAnnotationListSelection(); } }); - + fShowInTextCheckBox.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { // do nothing } - + public void widgetSelected(SelectionEvent e) { ListItem item= getSelectedItem(); final boolean value= fShowInTextCheckBox.getSelection(); @@ -325,18 +325,18 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { updateDecorationViewer(item, false); } }); - + foregroundColorButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { // do nothing } - + public void widgetSelected(SelectionEvent e) { ListItem item= getSelectedItem(); PreferenceConverter.setValue(getPreferenceStore(), item.colorKey, fAnnotationForegroundColorEditor.getColorValue()); } }); - + fDecorationViewer.addSelectionChangedListener(new ISelectionChangedListener() { /* @@ -345,7 +345,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { public void selectionChanged(SelectionChangedEvent event) { String[] decoration= (String[]) ((IStructuredSelection) fDecorationViewer.getSelection()).getFirstElement(); ListItem item= getSelectedItem(); - + if (fShowInTextCheckBox.getSelection()) { if (HIGHLIGHT.equals(decoration)) { getPreferenceStore().setValue(item.highlightKey, true); @@ -359,11 +359,11 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { } } }); - + return composite; } - + /* * @see org.eclipse.ui.internal.editors.text.IPreferenceConfigurationBlock#applyData(java.lang.Object) * @since 3.4 @@ -379,7 +379,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { * <p> * Clients may call this framework method, but should not override it. * </p> - * + * * @param chars the number of characters * @return the number of pixels */ @@ -398,7 +398,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { * <p> * Clients may call this framework method, but should not override it. * </p> - * + * * @param chars the number of characters * @return the number of pixels */ @@ -415,7 +415,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { * <p> * This method must be called before any of the dialog unit based conversion methods are called. * </p> - * + * * @param testControl a control from which to obtain the current font */ protected void initializeDialogUnits(Control testControl) { @@ -425,26 +425,26 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { fFontMetrics = gc.getFontMetrics(); gc.dispose(); } - + private void handleAnnotationListSelection() { ListItem item= getSelectedItem(); - + RGB rgb= PreferenceConverter.getColor(getPreferenceStore(), item.colorKey); fAnnotationForegroundColorEditor.setColorValue(rgb); - + boolean highlight= item.highlightKey == null ? false : getPreferenceStore().getBoolean(item.highlightKey); boolean showInText = item.textKey == null ? false : getPreferenceStore().getBoolean(item.textKey); fShowInTextCheckBox.setSelection(showInText || highlight); - + updateDecorationViewer(item, true); } - + /* * @see org.eclipse.jdt.internal.ui.preferences.IPreferenceConfigurationBlock#initialize() */ public void initialize() { initializeFields(); - + fAnnotationTypeViewer.setInput(fListModel); fAnnotationTypeViewer.getControl().getDisplay().asyncExec(new Runnable() { public void run() { @@ -465,16 +465,16 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { // only one case where the combo is not enabled: if both the highlight and textStyle keys are null final boolean enabled= fShowInTextCheckBox.getSelection() && !(item.highlightKey == null && item.textStyleKey == null); fDecorationViewer.getControl().setEnabled(enabled); - + if (changed) { String[] selection= null; ArrayList list= new ArrayList(); - + list.addAll(item.validStyles); - + if (getPreferenceStore().getBoolean(item.highlightKey)) selection= HIGHLIGHT; - + // set selection if (selection == null) { String val= getPreferenceStore().getString(item.textStyleKey); @@ -486,29 +486,29 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { } } } - + fDecorationViewer.setInput(list.toArray(new Object[list.size()])); if (selection == null) selection= (String[]) list.get(0); fDecorationViewer.setSelection(new StructuredSelection((Object) selection), true); } } - - + + public void performOk() { getPreferenceStore().propagate(); - + try { Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE).node(EditorsUI.PLUGIN_ID).flush(); } catch (BackingStoreException e) { EditorsPlugin.log(e); } } - - + + public void performDefaults() { getPreferenceStore().loadDefaults(); - + /* * Only call super after updating fShowInTextCheckBox, so that * the master-slave dependencies get properly updated. @@ -517,7 +517,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { initializeFields(); } - + public void dispose() { OverlayPreferenceStore store= getPreferenceStore(); if (store != null) { @@ -528,7 +528,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { protected void createDependency(final Button master, final Control slave) { createDependency(master, new Control[] {slave}); } - + protected void createDependency(final Button master, final Control[] slaves) { Assert.isTrue(slaves.length > 0); indent(slaves[0]); @@ -551,7 +551,7 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { } private void initializeFields() { - + // Update slaves Iterator iter= fMasterSlaveListeners.iterator(); while (iter.hasNext()) { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LinkedModePreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LinkedModePreferencePage.java index 9b930a84757..ccd52c8b983 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LinkedModePreferencePage.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/LinkedModePreferencePage.java @@ -20,11 +20,11 @@ import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; /** * The page for setting the editor options. - * + * * @since 3.2 */ public final class LinkedModePreferencePage extends AbstractConfigurationBlockPreferencePage { - + /* * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#getHelpId() */ @@ -36,18 +36,18 @@ public final class LinkedModePreferencePage extends AbstractConfigurationBlockPr * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription() */ protected void setDescription() { - String description= TextEditorMessages.LinkedModeConfigurationBlock_linking_title; + String description= TextEditorMessages.LinkedModeConfigurationBlock_linking_title; setDescription(description); } - + /* * @see org.org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setPreferenceStore() */ protected void setPreferenceStore() { setPreferenceStore(EditorsUI.getPreferenceStore()); } - - + + protected Label createDescriptionLabel(Composite parent) { return null; // no description for new look. } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPreviousPulldownActionDelegate.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPreviousPulldownActionDelegate.java index 33587319f65..7db883e0894 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPreviousPulldownActionDelegate.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPreviousPulldownActionDelegate.java @@ -11,11 +11,12 @@ package org.eclipse.ui.internal.editors.text; -import com.ibm.icu.text.Collator; import java.util.Iterator; import java.util.SortedSet; import java.util.TreeSet; +import com.ibm.icu.text.Collator; + import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Menu; @@ -28,6 +29,7 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2; + import org.eclipse.ui.texteditor.AnnotationPreference; import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; @@ -52,7 +54,7 @@ public abstract class NextPreviousPulldownActionDelegate extends Action implemen /** The preference key for the value in the store. */ private String fKey; - + /** * The display string. * @since 3.2 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NonExistingFileEditorInput.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NonExistingFileEditorInput.java index 8487d167a2f..bd6a80ecdc9 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NonExistingFileEditorInput.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NonExistingFileEditorInput.java @@ -20,12 +20,11 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.jface.resource.ImageDescriptor; - -import org.eclipse.ui.editors.text.ILocationProvider; - import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IPersistableElement; +import org.eclipse.ui.editors.text.ILocationProvider; + /** * @since 3.1 */ diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OverlayPreferenceStore.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OverlayPreferenceStore.java index 4de30d45b5e..99e57d289e5 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OverlayPreferenceStore.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OverlayPreferenceStore.java @@ -523,7 +523,7 @@ class OverlayPreferenceStore implements IPreferenceStore { * <p> * Note: This method must be called before {@link #load()} is called. * </p> - * + * * @param keys an array with overlay keys * @since 3.0 */ diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java index 446e6b67704..2760a1ff611 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java @@ -93,7 +93,7 @@ class QuickDiffConfigurationBlock implements IPreferenceConfigurationBlock { */ private Button fEnablementCheckbox; - + public QuickDiffConfigurationBlock(OverlayPreferenceStore store) { Assert.isNotNull(store); fStore= store; @@ -197,7 +197,7 @@ class QuickDiffConfigurationBlock implements IPreferenceConfigurationBlock { public void widgetDefaultSelected(SelectionEvent e) { } }); - + addFiller(composite); label= TextEditorMessages.QuickDiffConfigurationBlock_showInOverviewRuler; @@ -308,7 +308,7 @@ class QuickDiffConfigurationBlock implements IPreferenceConfigurationBlock { return composite; } - + /* * @see org.eclipse.ui.internal.editors.text.IPreferenceConfigurationBlock#applyData(java.lang.Object) * @since 3.4 @@ -318,14 +318,14 @@ class QuickDiffConfigurationBlock implements IPreferenceConfigurationBlock { private void addFiller(Composite composite) { PixelConverter pixelConverter= new PixelConverter(composite); - + Label filler= new Label(composite, SWT.LEFT ); GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 2; gd.heightHint= pixelConverter.convertHeightInCharsToPixels(1) / 2; filler.setLayoutData(gd); } - + private void updateEnablement() { final boolean enabled= fEnablementCheckbox.getSelection(); fQuickDiffOverviewRulerCheckBox.setEnabled(enabled); diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/RefreshEditorAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/RefreshEditorAction.java index 0b798eea404..48d69da3ec9 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/RefreshEditorAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/RefreshEditorAction.java @@ -22,7 +22,7 @@ import org.eclipse.ui.texteditor.IUpdate; /** * Refresh text editor action. - * + * * @since 3.3 */ public class RefreshEditorAction extends RefreshAction implements IUpdate { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/RemoveTrailingWhitespaceHandler.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/RemoveTrailingWhitespaceHandler.java index 38255421f9a..22045262acd 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/RemoveTrailingWhitespaceHandler.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/RemoveTrailingWhitespaceHandler.java @@ -13,9 +13,10 @@ package org.eclipse.ui.internal.editors.text; import java.util.HashSet; import java.util.Set; +import org.eclipse.core.runtime.IPath; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IPath; import org.eclipse.core.filebuffers.FileBuffers; import org.eclipse.core.filebuffers.ITextFileBufferManager; @@ -23,10 +24,10 @@ import org.eclipse.core.filebuffers.manipulation.RemoveTrailingWhitespaceOperati import org.eclipse.jface.window.Window; -import org.eclipse.ui.editors.text.FileBufferOperationHandler; - import org.eclipse.ui.internal.editors.text.SelectResourcesDialog.IFilter; +import org.eclipse.ui.editors.text.FileBufferOperationHandler; + /** * A file buffer operation action that removes trailing whitespace. @@ -71,11 +72,11 @@ public class RemoveTrailingWhitespaceHandler extends FileBufferOperationHandler } return null; } - + /** * Checks whether the given resources array contains * only files. - * + * * @param resources the array with the resources * @return <code>true</code> if there array only contains <code>IFiles</code>s * @since 3.2 @@ -88,10 +89,10 @@ public class RemoveTrailingWhitespaceHandler extends FileBufferOperationHandler } return true; } - + /** * Filters the unacceptable files. - * + * * @param files the files to filter * @return an array of files * @since 3.2 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesBlock.java index 65158a10f2a..8f8f0d9677a 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesBlock.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesBlock.java @@ -106,7 +106,7 @@ class SelectResourcesBlock implements ICheckStateListener, ISelectionChangedList * Create an instance of this class. Use this constructor if you wish to specify the width * and/or height of the combined widget (to only hard code one of the sizing dimensions, specify * the other dimension's value as -1) - * + * * @param parent the parent composite * @param rootObject the root object * @param treeContentProvider the tree content provider @@ -322,7 +322,7 @@ class SelectResourcesBlock implements ICheckStateListener, ISelectionChangedList private void findAllSelectedListElements(Object treeElement, String parentLabel, boolean addAll, IElementFilter filter) throws InterruptedException { String fullLabel= null; - + if (addAll) filter.filterElements(listContentProvider.getElements(treeElement)); else { //Add what we have stored diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesDialog.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesDialog.java index 5bfccf6af15..0763997ea52 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesDialog.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesDialog.java @@ -99,7 +99,7 @@ class SelectResourcesDialog extends Dialog { */ protected void configureShell(Shell newShell) { super.configureShell(newShell); - + if (fTitle != null) newShell.setText(fTitle); } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SharedTextColors.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SharedTextColors.java index 014b94e9261..fe8bc230092 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SharedTextColors.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SharedTextColors.java @@ -72,16 +72,16 @@ class SharedTextColors implements ISharedTextColors { public void dispose() { if (fDisplayTable == null) return; - + Iterator iter= fDisplayTable.values().iterator(); while (iter.hasNext()) dispose((Map)iter.next()); fDisplayTable= null; } - + /** * Disposes the colors for the given display. - * + * * @param display the display for which to dispose the colors * @since 3.3 */ @@ -89,21 +89,21 @@ class SharedTextColors implements ISharedTextColors { if (fDisplayTable != null) dispose((Map)fDisplayTable.remove(display)); } - + /** * Disposes the given color table. - * + * * @param colorTable the color table that maps <code>RGB</code> to <code>Color</code> * @since 3.3 */ private void dispose(Map colorTable) { if (colorTable == null) return; - + Iterator iter= colorTable.values().iterator(); while (iter.hasNext()) ((Color) iter.next()).dispose(); - + colorTable.clear(); } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SpellingConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SpellingConfigurationBlock.java index 4e6e9d29ddb..4a0ef29449a 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SpellingConfigurationBlock.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SpellingConfigurationBlock.java @@ -155,7 +155,7 @@ class SpellingConfigurationBlock implements IPreferenceConfigurationBlock { /** * Initializes with the given status monitor to which status changes are forwarded. - * + * * @param forwardedMonitor the status monitor to which changes are forwarded */ public ForwardingStatusMonitor(IPreferenceStatusMonitor forwardedMonitor) { @@ -248,11 +248,11 @@ class SpellingConfigurationBlock implements IPreferenceConfigurationBlock { layout.numColumns= 2; layout.marginHeight= 0; layout.marginWidth= 0; - + PixelConverter pc= new PixelConverter(composite); layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2; composite.setLayout(layout); - + if (EditorsUI.getSpellingService().getSpellingEngineDescriptors().length == 0) { Label label= new Label(composite, SWT.NONE); label.setText(TextEditorMessages.SpellingConfigurationBlock_error_not_installed); @@ -278,7 +278,7 @@ class SpellingConfigurationBlock implements IPreferenceConfigurationBlock { Label label= new Label(composite, SWT.CENTER); gd= new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING); label.setLayoutData(gd); - + if (fProviderDescriptors.size() > 1) { fComboGroup= new Composite(composite, SWT.NONE); gd= new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING); @@ -573,7 +573,7 @@ class SpellingConfigurationBlock implements IPreferenceConfigurationBlock { private void restoreFromPreferences() { if (fEnablementCheckbox == null) return; - + boolean enabled= fStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED); fEnablementCheckbox.setSelection(enabled); diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SpellingPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SpellingPreferencePage.java index 350cdec9b2c..da720acce2e 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SpellingPreferencePage.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SpellingPreferencePage.java @@ -12,10 +12,10 @@ package org.eclipse.ui.internal.editors.text; import org.eclipse.core.runtime.IStatus; -import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; - import org.eclipse.ui.texteditor.spelling.IPreferenceStatusMonitor; +import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; + /** * Spelling preference page. diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/StatusInfo.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/StatusInfo.java index f827218ee03..df32bbd71d7 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/StatusInfo.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/StatusInfo.java @@ -13,7 +13,6 @@ package org.eclipse.ui.internal.editors.text; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IStatus; - import org.eclipse.ui.editors.text.EditorsUI; /** diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java index 2a70e296c47..44c4489f062 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java @@ -47,16 +47,17 @@ import org.eclipse.jface.preference.ColorSelector; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; - import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.dialogs.PreferencesUtil; import org.eclipse.ui.internal.editors.text.TextEditorDefaultsPreferencePage.EnumeratedDomain.EnumValue; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AbstractTextEditor; +import org.eclipse.ui.editors.text.ITextEditorHelpContextIds; + /** * The preference page for setting the editor options. @@ -395,7 +396,7 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements private java.util.List fInitializers= new ArrayList(); private InitializerFactory fInitializerFactory= new InitializerFactory(); - + private Map fDomains= new HashMap(); @@ -410,7 +411,7 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements ArrayList overlayKeys= new ArrayList(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractTextEditor.PREFERENCE_COLOR_FIND_SCOPE)); - + overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE)); @@ -493,67 +494,67 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements } private Control createAppearancePage(Composite parent) { - + Composite appearanceComposite= new Composite(parent, SWT.NONE); GridLayout layout= new GridLayout(); layout.numColumns= 2; layout.marginHeight= 0; layout.marginWidth= 0; - + appearanceComposite.setLayout(layout); - + String label= TextEditorMessages.TextEditorPreferencePage_undoHistorySize; Preference undoHistorySize= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_UNDO_HISTORY_SIZE, label, null); IntegerDomain undoHistorySizeDomain= new IntegerDomain(0, 99999); addTextField(appearanceComposite, undoHistorySize, undoHistorySizeDomain, 15, 0); - + label= TextEditorMessages.TextEditorPreferencePage_displayedTabWidth; Preference tabWidth= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, label, null); IntegerDomain tabWidthDomain= new IntegerDomain(1, 16); addTextField(appearanceComposite, tabWidth, tabWidthDomain, 15, 0); - + label= TextEditorMessages.TextEditorPreferencePage_convertTabsToSpaces; Preference spacesForTabs= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS, label, null); addCheckBox(appearanceComposite, spacesForTabs, new BooleanDomain(), 0); - - + + label= TextEditorMessages.TextEditorPreferencePage_highlightCurrentLine; Preference highlightCurrentLine= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, label, null); addCheckBox(appearanceComposite, highlightCurrentLine, new BooleanDomain(), 0); - + label= TextEditorMessages.TextEditorPreferencePage_showPrintMargin; Preference showPrintMargin= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, label, null); final Button showPrintMarginButton= addCheckBox(appearanceComposite, showPrintMargin, new BooleanDomain(), 0); - - + + label= TextEditorMessages.TextEditorPreferencePage_printMarginColumn; Preference printMarginColumn= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, label, null); final IntegerDomain printMarginDomain= new IntegerDomain(20, 200); final Control[] printMarginControls= addTextField(appearanceComposite, printMarginColumn, printMarginDomain, 15, 20); createDependency(showPrintMarginButton, showPrintMargin, printMarginControls); - + showPrintMarginButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { updateStatus(printMarginDomain); } }); - + label= TextEditorMessages.TextEditorPreferencePage_showLineNumbers; Preference showLineNumbers= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, label, null); addCheckBox(appearanceComposite, showLineNumbers, new BooleanDomain(), 0); - + label= TextEditorMessages.TextEditorDefaultsPreferencePage_range_indicator; Preference showMagnet= new Preference(AbstractDecoratedTextEditorPreferenceConstants.SHOW_RANGE_INDICATOR, label, null); addCheckBox(appearanceComposite, showMagnet, new BooleanDomain(), 0); - + label= TextEditorMessages.TextEditorDefaultsPreferencePage_showWhitespaceCharacters; Preference showWhitespaceCharacters= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_WHITESPACE_CHARACTERS, label, null); addCheckBox(appearanceComposite, showWhitespaceCharacters, new BooleanDomain(), 0); - + label= TextEditorMessages.TextEditorPreferencePage_showAffordance; Preference showAffordance= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE, label, null); addCheckBox(appearanceComposite, showAffordance, new BooleanDomain(), 0); - + label= TextEditorMessages.TextEditorDefaultsPreferencePage_enrichHoverMode; Preference hoverReplace= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HOVER_ENRICH_MODE, label, null); EnumeratedDomain hoverReplaceDomain= new EnumeratedDomain(); @@ -562,32 +563,32 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements hoverReplaceDomain.addValue(new EnumValue(0, TextEditorMessages.TextEditorDefaultsPreferencePage_enrichHover_afterDelay)); hoverReplaceDomain.addValue(new EnumValue(2, TextEditorMessages.TextEditorDefaultsPreferencePage_enrichHover_onClick)); addCombo(appearanceComposite, hoverReplace, hoverReplaceDomain, 0); - + label= TextEditorMessages.TextEditorDefaultsPreferencePage_textDragAndDrop; Preference textDragAndDrop= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TEXT_DRAG_AND_DROP_ENABLED, label, null); addCheckBox(appearanceComposite, textDragAndDrop, new BooleanDomain(), 0); - + label= TextEditorMessages.TextEditorDefaultsPreferencePage_warn_if_derived; Preference warnIfDerived= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_WARN_IF_INPUT_DERIVED, label, null); addCheckBox(appearanceComposite, warnIfDerived, new BooleanDomain(), 0); - + label= TextEditorMessages.TextEditorDefaultsPreferencePage_smartHomeEnd; Preference smartHomeEnd= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SMART_HOME_END, label, null); addCheckBox(appearanceComposite, smartHomeEnd, new BooleanDomain(), 0); - - + + Label l= new Label(appearanceComposite, SWT.LEFT ); GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 2; gd.heightHint= convertHeightInCharsToPixels(1) / 2; l.setLayoutData(gd); - + l= new Label(appearanceComposite, SWT.LEFT); l.setText(TextEditorMessages.TextEditorPreferencePage_appearanceOptions); gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 2; l.setLayoutData(gd); - + Composite editorComposite= new Composite(appearanceComposite, SWT.NONE); layout= new GridLayout(); layout.numColumns= 2; @@ -597,12 +598,12 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL); gd.horizontalSpan= 2; editorComposite.setLayoutData(gd); - + fAppearanceColorList= new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER); gd= new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_BOTH); gd.heightHint= fAppearanceColorList.getItemHeight() * 8; fAppearanceColorList.setLayoutData(gd); - + Composite stylesComposite= new Composite(editorComposite, SWT.NONE); layout= new GridLayout(); layout.marginHeight= 0; @@ -610,35 +611,35 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements layout.numColumns= 2; stylesComposite.setLayout(layout); stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - + l= new Label(stylesComposite, SWT.LEFT); l.setText(TextEditorMessages.TextEditorPreferencePage_color); gd= new GridData(); gd.horizontalAlignment= GridData.BEGINNING; l.setLayoutData(gd); - + fAppearanceColorEditor= new ColorSelector(stylesComposite); Button foregroundColorButton= fAppearanceColorEditor.getButton(); gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalAlignment= GridData.BEGINNING; foregroundColorButton.setLayoutData(gd); - + SelectionListener colorDefaultSelectionListener= new SelectionListener() { public void widgetSelected(SelectionEvent e) { boolean systemDefault= fAppearanceColorDefault.getSelection(); fAppearanceColorEditor.getButton().setEnabled(!systemDefault); - + int i= fAppearanceColorList.getSelectionIndex(); if (i == -1) return; - + String key= fAppearanceColorListModel[i][2]; if (key != null) fOverlayStore.setValue(key, systemDefault); } public void widgetDefaultSelected(SelectionEvent e) {} }; - + fAppearanceColorDefault= new Button(stylesComposite, SWT.CHECK); fAppearanceColorDefault.setText(TextEditorMessages.TextEditorPreferencePage_systemDefault); gd= new GridData(GridData.FILL_HORIZONTAL); @@ -647,7 +648,7 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements fAppearanceColorDefault.setLayoutData(gd); fAppearanceColorDefault.setVisible(false); fAppearanceColorDefault.addSelectionListener(colorDefaultSelectionListener); - + fAppearanceColorList.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { // do nothing @@ -664,12 +665,12 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements int i= fAppearanceColorList.getSelectionIndex(); if (i == -1) return; - + String key= fAppearanceColorListModel[i][1]; PreferenceConverter.setValue(fOverlayStore, key, fAppearanceColorEditor.getColorValue()); } }); - + Link link= new Link(appearanceComposite, SWT.NONE); link.setText(TextEditorMessages.TextEditorPreferencePage_colorsAndFonts_link); link.addSelectionListener(new SelectionAdapter() { @@ -680,16 +681,16 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements // TODO replace by link-specific tooltips when // bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=88866 gets fixed link.setToolTipText(TextEditorMessages.TextEditorPreferencePage_colorsAndFonts_link_tooltip); - + GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false); gridData.widthHint= 150; // only expand further if anyone else requires it gridData.horizontalSpan= 2; link.setLayoutData(gridData); - + addFiller(appearanceComposite, 2); - + appearanceComposite.layout(); - + return appearanceComposite; } @@ -940,7 +941,7 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements } fInitializers.add(fInitializerFactory.create(preference, textControl)); - + fDomains.put(domain, textControl); return new Control[] {labelControl, textControl}; @@ -980,14 +981,14 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements setValid(!status.matches(IStatus.ERROR)); applyToStatusLine(this, status); } - + void updateStatus(Domain checkedDomain) { if (!fFieldsInitialized) return; - + if (updateStatusOnError(checkedDomain)) return; - + Iterator iter= fDomains.keySet().iterator(); while (iter.hasNext()) { Domain domain= (Domain)iter.next(); @@ -998,7 +999,7 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements } updateStatus(new StatusInfo()); } - + private boolean updateStatusOnError(Domain domain) { Text textWidget= (Text)fDomains.get(domain); if (textWidget.isEnabled()) { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UISynchronizationContext.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UISynchronizationContext.java index 97955f22102..724f2366a97 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UISynchronizationContext.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UISynchronizationContext.java @@ -10,10 +10,10 @@ *******************************************************************************/ package org.eclipse.ui.internal.editors.text; -import org.eclipse.core.filebuffers.ISynchronizationContext; - import org.eclipse.swt.widgets.Display; +import org.eclipse.core.filebuffers.ISynchronizationContext; + import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/URLHyperlink.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/URLHyperlink.java index e2df401fa7e..2ca11abc24f 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/URLHyperlink.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/URLHyperlink.java @@ -31,14 +31,14 @@ final class URLHyperlink extends org.eclipse.jface.text.hyperlink.URLHyperlink { /** * Creates a new URL hyperlink. - * + * * @param region the region * @param urlString the URL string */ public URLHyperlink(IRegion region, String urlString) { super(region, urlString); } - + /* * @see org.eclipse.jface.text.hyperlink.URLHyperlink#open() * @since 3.1 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/URLHyperlinkDetector.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/URLHyperlinkDetector.java index be065bb26e7..7657d8b358b 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/URLHyperlinkDetector.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/URLHyperlinkDetector.java @@ -17,7 +17,7 @@ import org.eclipse.jface.text.hyperlink.IHyperlink; /** * URL hyperlink detector. - * + * * @since 3.1 */ public class URLHyperlinkDetector extends org.eclipse.jface.text.hyperlink.URLHyperlinkDetector { @@ -29,9 +29,9 @@ public class URLHyperlinkDetector extends org.eclipse.jface.text.hyperlink.URLHy IHyperlink[] result= super.detectHyperlinks(textViewer, region, canShowMultipleHyperlinks); if (result == null) return null; - + for (int i= 0; i < result.length; i++) { - org.eclipse.jface.text.hyperlink.URLHyperlink hyperlink= (org.eclipse.jface.text.hyperlink.URLHyperlink)result[i]; + org.eclipse.jface.text.hyperlink.URLHyperlink hyperlink= (org.eclipse.jface.text.hyperlink.URLHyperlink)result[i]; result[i]= new URLHyperlink(hyperlink.getHyperlinkRegion(), hyperlink.getURLString()); } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UntitledTextFileWizard.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UntitledTextFileWizard.java index 83aefa2d743..36626dffb2a 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UntitledTextFileWizard.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UntitledTextFileWizard.java @@ -18,8 +18,6 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.editors.text.EditorsUI; - import org.eclipse.ui.IEditorDescriptor; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorRegistry; @@ -29,10 +27,12 @@ import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PartInitException; +import org.eclipse.ui.editors.text.EditorsUI; + /** * Wizard with no page that creates the untitled text file * and opens the text editor. - * + * * @since 3.1 */ public class UntitledTextFileWizard extends Wizard implements INewWizard { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationColumn.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationColumn.java index 7ead82b4d44..54efed5e851 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationColumn.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationColumn.java @@ -32,22 +32,23 @@ import org.eclipse.jface.text.source.IVerticalRulerInfo; import org.eclipse.jface.text.source.IVerticalRulerInfoExtension; import org.eclipse.jface.text.source.IVerticalRulerListener; -import org.eclipse.ui.editors.text.EditorsUI; - import org.eclipse.ui.internal.editors.text.EditorsPlugin; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor; import org.eclipse.ui.texteditor.AnnotationPreference; import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; import org.eclipse.ui.texteditor.rulers.AbstractContributedRulerColumn; +import org.eclipse.ui.editors.text.EditorsUI; + /** * The annotation ruler contribution. Encapsulates an {@link AnnotationRulerColumn} as a * contribution to the <code>rulerColumns</code> extension point. Instead of instantiating the * delegate itself, it {@link AbstractDecoratedTextEditor} creates it using its * <code>createAnnotationRulerColumn()</code> method and sets it via * {@link #setDelegate(IVerticalRulerColumn)}. - * + * * @since 3.3 */ public class AnnotationColumn extends AbstractContributedRulerColumn implements IVerticalRulerInfo, IVerticalRulerInfoExtension { @@ -56,7 +57,7 @@ public class AnnotationColumn extends AbstractContributedRulerColumn implements /** The width of the vertical ruler. */ private final static int VERTICAL_RULER_WIDTH= 12; - + private IVerticalRulerColumn fDelegate; private final MarkerAnnotationPreferences fAnnotationPreferences= EditorsPlugin.getDefault().getMarkerAnnotationPreferences(); private IPropertyChangeListener fPropertyListener; @@ -137,7 +138,7 @@ public class AnnotationColumn extends AbstractContributedRulerColumn implements column.addAnnotationType(preference.getAnnotationType()); } column.addAnnotationType(Annotation.TYPE_UNKNOWN); - + // link to preference store fPropertyListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { @@ -156,7 +157,7 @@ public class AnnotationColumn extends AbstractContributedRulerColumn implements store.addPropertyChangeListener(fPropertyListener); } } - + /** * Returns the annotation preference for which the given * preference matches a vertical ruler preference key. @@ -183,7 +184,7 @@ public class AnnotationColumn extends AbstractContributedRulerColumn implements /** * Sets the compatibility delegate. Called by {@link AbstractDecoratedTextEditor}. - * + * * @param column the delegate column implementation */ public void setDelegate(IVerticalRulerColumn column) { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationType.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationType.java index 6b3256698db..b2d4f199592 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationType.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationType.java @@ -11,6 +11,7 @@ package org.eclipse.ui.internal.texteditor; import org.eclipse.jface.text.TextUtilities; + import org.eclipse.ui.texteditor.AnnotationPreference; /** diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/BooleanPreferenceToggleAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/BooleanPreferenceToggleAction.java index c936c7731cc..1e4d53a76ce 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/BooleanPreferenceToggleAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/BooleanPreferenceToggleAction.java @@ -15,11 +15,12 @@ import java.util.ResourceBundle; import org.eclipse.core.runtime.Assert; import org.eclipse.jface.preference.IPreferenceStore; + import org.eclipse.ui.texteditor.IUpdate; import org.eclipse.ui.texteditor.ResourceAction; /** - * + * * @since 3.3 */ public class BooleanPreferenceToggleAction extends ResourceAction implements IUpdate { @@ -33,7 +34,7 @@ public class BooleanPreferenceToggleAction extends ResourceAction implements IUp Assert.isLegal(key != null); fPreferences= preferences; fKey= key; - + update(); } @@ -43,7 +44,7 @@ public class BooleanPreferenceToggleAction extends ResourceAction implements IUp public void update() { setChecked(fPreferences.getBoolean(fKey)); } - + /* * @see org.eclipse.jface.action.Action#run() */ diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/DelegatingAnnotationPreference.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/DelegatingAnnotationPreference.java index 1962184478b..fd8afb4d9d9 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/DelegatingAnnotationPreference.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/DelegatingAnnotationPreference.java @@ -18,6 +18,7 @@ import org.eclipse.swt.graphics.RGB; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.text.source.IAnnotationAccessExtension; + import org.eclipse.ui.texteditor.AnnotationPreference; import org.eclipse.ui.texteditor.AnnotationPreferenceLookup; import org.eclipse.ui.texteditor.IAnnotationImageProvider; @@ -139,7 +140,7 @@ public class DelegatingAnnotationPreference extends AnnotationPreference { public ImageDescriptor getImageDescriptor() { return (ImageDescriptor) getAttributeValue(IMAGE_DESCRIPTOR); } - + /* * @see org.eclipse.ui.texteditor.AnnotationPreference#getQuickFixImageDescriptor() */ diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/ITextEditorThemeConstants.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/ITextEditorThemeConstants.java index 80eda85afa3..a64882007f6 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/ITextEditorThemeConstants.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/ITextEditorThemeConstants.java @@ -14,7 +14,7 @@ package org.eclipse.ui.internal.texteditor; /** * Defines the constants used in the <code>org.eclipse.ui.themes</code> * extension contributed by this plug-in. - * + * * @since 3.3 */ public interface ITextEditorThemeConstants { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/LineNumberColumn.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/LineNumberColumn.java index 5bd753697bf..fab3d4b0e62 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/LineNumberColumn.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/LineNumberColumn.java @@ -52,9 +52,8 @@ import org.eclipse.jface.text.source.IVerticalRulerListener; import org.eclipse.jface.text.source.LineNumberChangeRulerColumn; import org.eclipse.jface.text.source.LineNumberRulerColumn; -import org.eclipse.ui.editors.text.EditorsUI; - import org.eclipse.ui.internal.editors.text.EditorsPlugin; + import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor; import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AbstractTextEditor; @@ -66,13 +65,15 @@ import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; import org.eclipse.ui.texteditor.quickdiff.QuickDiff; import org.eclipse.ui.texteditor.rulers.AbstractContributedRulerColumn; +import org.eclipse.ui.editors.text.EditorsUI; + /** * The line number ruler contribution. Encapsulates a {@link LineNumberChangeRulerColumn} as a * contribution to the <code>rulerColumns</code> extension point. Instead of instantiating the * delegate itself, it calls <code>createLineNumberRulerColumn()</code> in * {@link AbstractDecoratedTextEditor} via {@link ICompatibilityForwarder} to maintain compatibility * with previous releases. - * + * * @since 3.3 */ public class LineNumberColumn extends AbstractContributedRulerColumn implements IVerticalRulerInfo, IVerticalRulerInfoExtension { @@ -85,7 +86,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements boolean isQuickDiffEnabled(); boolean isLineNumberRulerVisible(); } - + /** The contribution id of the line number / change ruler. */ public static final String ID= "org.eclipse.ui.editors.columns.linenumbers"; //$NON-NLS-1$ @@ -160,7 +161,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements if (getQuickDiffPreference()) fDelegate.setModel(model); } - + /* * @see org.eclipse.jface.text.source.IVerticalRulerInfo#getLineOfLastMouseButtonActivity() */ @@ -242,7 +243,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements // initial set up updateForegroundColor(store, fDelegate); updateBackgroundColor(store, fDelegate); - + updateLineNumbersVisibility(fDelegate); updateQuickDiffVisibility(fDelegate); updateCharacterMode(store, fDelegate); @@ -296,19 +297,19 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements updateRevisionRenderingMode(store, fDelegate); } }); - + fDispatcher.addPropertyChangeListener(AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_SHOW_AUTHOR, new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { updateRevisionAuthorVisibility(store, fDelegate); } }); - + fDispatcher.addPropertyChangeListener(AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_SHOW_REVISION, new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { updateRevisionIdVisibility(store, fDelegate); } }); - + fDispatcher.addPropertyChangeListener(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON, new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { updateQuickDiffVisibility(fDelegate); @@ -351,7 +352,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements } return annotationPrefs; } - + private void updateForegroundColor(IPreferenceStore store, IVerticalRulerColumn column) { RGB rgb= getColorFromStore(store, FG_COLOR_KEY); if (rgb == null) @@ -360,7 +361,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements if (column instanceof LineNumberRulerColumn) ((LineNumberRulerColumn) column).setForeground(sharedColors.getColor(rgb)); } - + private void updateBackgroundColor(IPreferenceStore store, IVerticalRulerColumn column) { // background color: same as editor, or system default RGB rgb; @@ -386,14 +387,14 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements ((IChangeRulerColumn) column).setAddedColor(getSharedColors().getColor(rgb)); } } - + private void updateDeletedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) { if (pref != null && column instanceof IChangeRulerColumn) { RGB rgb= getColorFromAnnotationPreference(store, pref); ((IChangeRulerColumn) column).setDeletedColor(getSharedColors().getColor(rgb)); } } - + private void updateCharacterMode(IPreferenceStore store, IVerticalRulerColumn column) { if (column instanceof LineNumberChangeRulerColumn) { LineNumberChangeRulerColumn lncrc= (LineNumberChangeRulerColumn) column; @@ -405,7 +406,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements if (column instanceof LineNumberChangeRulerColumn) ((LineNumberChangeRulerColumn) column).showLineNumbers(getLineNumberPreference()); } - + private void updateRevisionRenderingMode(IPreferenceStore store, IVerticalRulerColumn column) { if (column instanceof IRevisionRulerColumnExtension) { String option= store.getString(AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_RENDERING_MODE); @@ -418,32 +419,32 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements } } } - + private void updateRevisionAuthorVisibility(IPreferenceStore store, IVerticalRulerColumn column) { if (column instanceof IRevisionRulerColumnExtension) { boolean show= store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_SHOW_AUTHOR); ((IRevisionRulerColumnExtension) column).showRevisionAuthor(show); } } - + private void updateRevisionIdVisibility(IPreferenceStore store, IVerticalRulerColumn column) { if (column instanceof IRevisionRulerColumnExtension) { boolean show= store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_SHOW_REVISION); ((IRevisionRulerColumnExtension) column).showRevisionId(show); } } - + private void updateQuickDiffVisibility(IVerticalRulerColumn column) { boolean show= getQuickDiffPreference(); if (show == isShowingChangeInformation()) return; - + if (show) installChangeRulerModel(column); else uninstallChangeRulerModel(column); } - + /** * Returns whether the line number ruler column should be * visible according to the preference store settings. Subclasses may override this @@ -457,7 +458,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements IPreferenceStore store= getPreferenceStore(); return store != null ? store.getBoolean(LINE_NUMBER_KEY) : false; } - + /** * Returns whether quick diff info should be visible upon opening an editor * according to the preference store settings. @@ -471,7 +472,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements boolean setting= store != null ? store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON) : false; if (!setting) return false; - + boolean modifiable; ITextEditor editor= getEditor(); if (editor instanceof ITextEditorExtension2) { @@ -515,7 +516,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements rgb= pref.getColorPreferenceValue(); return rgb; } - + private static RGB getColorFromStore(IPreferenceStore store, String key) { RGB rgb= null; if (store.contains(key)) { @@ -526,12 +527,12 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements } return rgb; } - + /** * Ensures that quick diff information is displayed and the quick diff provider is the one with * the specified id. If a different quick diff provider is in use, the user may be asked whether * he wants to switch. - * + * * @param diffProviderId the quick diff provider id to use * @return <code>true</code> if quick diff could be enabled for the given id, * <code>false</code> otherwise @@ -539,7 +540,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements private boolean ensureQuickDiffProvider(String diffProviderId) { if (!isShowingChangeInformation()) installChangeRulerModel(fDelegate); // FIXME pass provider id - + IAnnotationModel annotationModel= fViewer.getAnnotationModel(); IAnnotationModel oldDiffer= getDiffer(); if (oldDiffer == null && annotationModel != null) @@ -565,7 +566,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements ((ILineDifferExtension) oldDiffer).resume(); return true; } - + // quick diff is showing with the wrong provider - ask the user whether he wants to switch IPreferenceStore store= EditorsUI.getPreferenceStore(); if (oldDiffer != null && !store.getString(REVISION_ASK_BEFORE_QUICKDIFF_SWITCH_KEY).equals(MessageDialogWithToggle.ALWAYS)) { @@ -580,22 +581,22 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements if (toggleDialog.getReturnCode() != Window.OK) return false; } - + IAnnotationModelExtension modelExtension=(IAnnotationModelExtension) annotationModel; modelExtension.removeAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID); - + modelExtension.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, newDiffer); - + if (fDelegate instanceof IChangeRulerColumn) ((IChangeRulerColumn) fDelegate).setModel(annotationModel); // picks up the new model attachment - + return true; } /** * Installs the differ annotation model with the current quick diff display. - * + * * @param column the column to install the model on */ private void installChangeRulerModel(IVerticalRulerColumn column) { @@ -612,7 +613,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements /** * Uninstalls the differ annotation model from the current quick diff display. - * + * * @param column the column to remove the model from */ private void uninstallChangeRulerModel(IVerticalRulerColumn column) { @@ -640,12 +641,12 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements ISourceViewer viewer= fViewer; if (viewer == null) return null; - + IAnnotationModel m= viewer.getAnnotationModel(); IAnnotationModelExtension model= null; if (m instanceof IAnnotationModelExtension) model= (IAnnotationModelExtension) m; - + IAnnotationModel differ= getDiffer(); // create diff model if it doesn't if (differ == null) { @@ -665,7 +666,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements } else if (differ instanceof ILineDifferExtension) { ((ILineDifferExtension) differ).resume(); } - + return (IAnnotationModel)model; } @@ -684,10 +685,10 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements IAnnotationModel m= viewer.getAnnotationModel(); if (m == null && fDelegate instanceof IChangeRulerColumn) m= ((IChangeRulerColumn)fDelegate).getModel(); - + if (!(m instanceof IAnnotationModelExtension)) return null; - + IAnnotationModelExtension model= (IAnnotationModelExtension)m; // get diff model if it exists already @@ -697,7 +698,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements /** * Sets the forwarder. Used by {@link AbstractDecoratedTextEditor} to maintain the contract of * its {@link AbstractDecoratedTextEditor#createLineNumberRulerColumn} method. - * + * * @param forwarder the forwarder */ public void setForwarder(ICompatibilityForwarder forwarder) { @@ -723,17 +724,17 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements /** * Returns <code>true</code> if the ruler is showing line numbers, <code>false</code> if it * is only showing change information. - * + * * @return <code>true</code> if line numbers are shown, <code>false</code> otherwise */ public boolean isShowingLineNumbers() { return fDelegate instanceof LineNumberChangeRulerColumn && ((LineNumberChangeRulerColumn) fDelegate).isShowingLineNumbers(); } - + /** * Returns <code>true</code> if the ruler is showing change information, <code>false</code> * if it is only showing line numbers. - * + * * @return <code>true</code> if change information is shown, <code>false</code> otherwise */ public boolean isShowingChangeInformation() { @@ -742,7 +743,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements /** * Shows revision information on the receiver. - * + * * @param info the revision information to show * @param quickDiffProviderId the id of the corresponding quick diff provider */ @@ -761,11 +762,11 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements if (fDelegate instanceof IRevisionRulerColumn) ((IRevisionRulerColumn) fDelegate).setRevisionInformation(null); } - + /** * Returns <code>true</code> if the ruler is showing revision information, <code>false</code> * if it is only showing line numbers. - * + * * @return <code>true</code> if revision information is shown, <code>false</code> otherwise */ public boolean isShowingRevisionInformation() { @@ -777,7 +778,7 @@ public class LineNumberColumn extends AbstractContributedRulerColumn implements /** * Returns the selection provider of the revision column, <code>null</code> if none is * available. - * + * * @return the revision selection provider */ public ISelectionProvider getRevisionSelectionProvider() { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/RulerMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/RulerMessages.java index 0ad4f14d8bb..4d0e214a896 100755 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/RulerMessages.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/RulerMessages.java @@ -26,7 +26,7 @@ final class RulerMessages extends NLS { public static String AbstractDecoratedTextEditor_revision_quickdiff_switch_title; public static String AbstractDecoratedTextEditor_revision_quickdiff_switch_message; public static String AbstractDecoratedTextEditor_revision_quickdiff_switch_rememberquestion; - + static { NLS.initializeMessages(BUNDLE_NAME, RulerMessages.class); } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java index 2c51cbb577d..0c6c559827c 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java @@ -44,10 +44,10 @@ import org.eclipse.jface.text.IInformationControlExtension5; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; - import org.eclipse.ui.internal.editors.text.EditorsPlugin; +import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; + /** * Source viewer based implementation of <code>IInformationControl</code>. * Displays information in a source viewer configured with the text editor @@ -97,7 +97,7 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio public SourceViewerInformationControl(Shell parent,boolean isResizable, String symbolicFontName, String statusFieldText) { GridLayout layout; GridData gd; - + int shellStyle= SWT.TOOL | SWT.ON_TOP | (isResizable ? SWT.RESIZE : 0); int textStyle= isResizable ? SWT.V_SCROLL | SWT.H_SCROLL : SWT.NONE; @@ -197,7 +197,7 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio IDocument doc= new Document(content); fViewer.setInput(doc); - + // ensure that we can scroll enough ensureScrollable(); @@ -357,7 +357,7 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio scrollIndex= Math.max(0, scrollIndex); fHorizontalScrollPixel= scrollIndex; } - + /** * Ensures that the control can be scrolled at least to * <code>fHorizontalScrollPixel</code> and adjusts <code>fMaxWidth</code> @@ -400,8 +400,8 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio // but never more than the configured max size (viewport size). fMaxWidth= Math.max(0, Math.min(fMaxWidth, maxWidth - fHorizontalScrollPixel + 8)); } - - + + /* * @see org.eclipse.jface.text.IInformationControlExtension3#computeTrim() * @since 3.4 @@ -414,7 +414,7 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio /** * Adds the internal trimmings to the given trim of the shell. - * + * * @param trim the shell's trim, will be updated * @since 3.4 */ @@ -483,7 +483,7 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio public boolean isVisible() { return fShell != null && !fShell.isDisposed() && fShell.isVisible(); } - + /* * @see org.eclipse.jface.text.IInformationControlExtension5#computeSizeConstraints(int, int) * @since 3.4 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/TextChangeHover.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/TextChangeHover.java index ce0be325848..b5b5190e369 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/TextChangeHover.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/TextChangeHover.java @@ -61,7 +61,7 @@ public class TextChangeHover extends LineChangeHover { } }; } - + /* * @see org.eclipse.jface.text.information.IInformationProviderExtension2#getInformationPresenterControlCreator() * @since 3.3 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java index 4abd8098d4d..1cae1a27c07 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java @@ -188,7 +188,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { private final static String DISABLE_OVERWRITE_MODE= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_DISABLE_OVERWRITE_MODE; /** * Menu id for the overview ruler context menu. - * + * * @since 3.4 */ public final static String DEFAULT_OVERVIEW_RULER_CONTEXT_MENU_ID= "#OverviewRulerContext"; //$NON-NLS-1$ @@ -207,7 +207,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { * The annotation preferences. */ private MarkerAnnotationPreferences fAnnotationPreferences; - + /** * The overview ruler of this editor. * @@ -218,11 +218,11 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { protected IOverviewRuler fOverviewRuler; /** * The overview ruler's context menu id. - * + * * @since 3.4 */ private String fOverviewRulerContextMenuId; - + /** * Helper for accessing annotation from the perspective of this editor. * @@ -277,7 +277,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { */ private boolean fIsDerivedStateValidated= false; - + /* * Workaround for IllegalAccessError thrown because we are accessing * a protected method in a different bundle from an inner class. @@ -286,7 +286,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { private IVerticalRuler internalGetVerticalRuler() { return getVerticalRuler(); } - + /** * Creates a new text editor. */ @@ -327,10 +327,10 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { fAnnotationAccess= null; fAnnotationPreferences= null; - + fLineNumberRulerColumn= null; fLineColumn= null; - + super.dispose(); } @@ -355,7 +355,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { protected IOverviewRuler createOverviewRuler(ISharedTextColors sharedColors) { IOverviewRuler ruler= new OverviewRuler(getAnnotationAccess(), VERTICAL_RULER_WIDTH, sharedColors); - + Iterator e= fAnnotationPreferences.getAnnotationPreferences().iterator(); while (e.hasNext()) { AnnotationPreference preference= (AnnotationPreference) e.next(); @@ -400,7 +400,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { fSourceViewerDecorationSupport.install(getPreferenceStore()); IColumnSupport columnSupport= (IColumnSupport)getAdapter(IColumnSupport.class); - + if (isLineNumberRulerVisible()) { RulerColumnDescriptor lineNumberColumnDescriptor= RulerColumnRegistry.getDefault().getColumnDescriptor(LineNumberColumn.ID); if (lineNumberColumnDescriptor != null) @@ -431,16 +431,16 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { * <p> * Subclasses may extend or replace this method. * </p> - * + * * @since 3.4 */ protected void createOverviewRulerContextMenu() { if (fOverviewRulerContextMenuId == null) fOverviewRulerContextMenuId= DEFAULT_OVERVIEW_RULER_CONTEXT_MENU_ID; - + if (fOverviewRuler == null || fOverviewRuler.getControl() == null) return; - + MenuManager menuManager= new MenuManager(fOverviewRulerContextMenuId, fOverviewRulerContextMenuId); menuManager.setRemoveAllWhenShown(true); menuManager.addMenuListener(getContextMenuListener()); @@ -537,7 +537,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { return; IColumnSupport columnSupport= (IColumnSupport)getAdapter(IColumnSupport.class); - + // only handle visibility of the combined column, but not the number/change only state if (show && fLineColumn == null) { RulerColumnDescriptor lineNumberColumnDescriptor= RulerColumnRegistry.getDefault().getColumnDescriptor(LineNumberColumn.ID); @@ -548,14 +548,14 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { fLineColumn= null; } } - + /* * @see org.eclipse.ui.texteditor.ITextEditorExtension3#isChangeInformationShowing() */ public boolean isChangeInformationShowing() { return fLineColumn != null && fLineColumn.isShowingChangeInformation(); } - + /* * @see org.eclipse.ui.texteditor.ITextEditorExtension4#showRevisionInformation(org.eclipse.jface.text.revisions.RevisionInformation, java.lang.String) * @since 3.2 @@ -565,7 +565,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { info.setHoverControlCreator(new RevisionHoverInformationControlCreator(false)); if (info.getInformationPresenterControlCreator() == null) info.setInformationPresenterControlCreator(new RevisionHoverInformationControlCreator(true)); - + showChangeInformation(true); if (fLineColumn != null) fLineColumn.showRevisionInformation(info, quickDiffProviderId); @@ -608,7 +608,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { IPreferenceStore store= getPreferenceStore(); return store != null ? store.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.SHOW_RANGE_INDICATOR) : true; } - + /** * Returns whether quick diff info should be visible upon opening an editor * according to the preference store settings. @@ -687,7 +687,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { protected IVerticalRuler createVerticalRuler() { return createCompositeRuler(); } - + /** * Creates a composite ruler to be used as the vertical ruler by this editor. @@ -699,10 +699,10 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { return new CompositeRuler(); } - + /** * Creates the annotation ruler column. Subclasses may re-implement or extend. - * + * * @param ruler the composite ruler that the column will be added * @return an annotation ruler column * @since 3.2 @@ -808,7 +808,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { } return; } - + if (AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SPACES_FOR_TABS.equals(property)) { if (isTabsToSpacesConversionEnabled()) installTabsToSpacesConverter(); @@ -940,13 +940,13 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { public void gotoMarker(IMarker marker) { if (fIsUpdatingMarkerViews) return; - + if (getSourceViewer() == null) return; int start= MarkerUtilities.getCharStart(marker); int end= MarkerUtilities.getCharEnd(marker); - + boolean selectLine= start < 0 || end < 0; // look up the current range of the marker when the document has been edited @@ -990,7 +990,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { if (end - 1 < length && start < length) selectAndReveal(start, end - start); } - + /* * @see org.eclipse.ui.texteditor.AbstractTextEditor#isEditable() * @since 3.3 @@ -1017,7 +1017,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { * If the given input is derived then this method * can show a dialog asking whether to edit the * derived file. - * + * * @return <code>true</code> if the input is OK for editing, <code>false</code> otherwise * @since 3.3 */ @@ -1038,7 +1038,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { IPreferenceStore store= getPreferenceStore(); if (!store.getBoolean(warnKey)) return true; - + MessageDialogWithToggle toggleDialog= MessageDialogWithToggle.openYesNoQuestion( getSite().getShell(), TextEditorMessages.AbstractDecoratedTextEditor_warning_derived_title, @@ -1047,7 +1047,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { false, null, null); - + EditorsUI.getPreferenceStore().setValue(warnKey, !toggleDialog.getToggleState()); fIsDerivedStateValidated= true; return fIsEditingDerivedFileAllowed= toggleDialog.getReturnCode() == IDialogConstants.YES_ID; @@ -1056,29 +1056,29 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { /* * For an explanation why we override this method see: * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=42230 - * + * * @see org.eclipse.ui.texteditor.StatusTextEditor#isErrorStatus(org.eclipse.core.runtime.IStatus) */ protected boolean isErrorStatus(IStatus status) { if (!super.isErrorStatus(status)) return false; - + if (!status.isMultiStatus()) return !isReadOnlyLocalStatus(status); - + IStatus[] childrenStatus= status.getChildren(); for (int i= 0; i < childrenStatus.length; i++) { if (childrenStatus[i].getSeverity() == IStatus.ERROR && !isReadOnlyLocalStatus(childrenStatus[i])) return true; } - + return false; } /** * Check whether the given status is a <code>IResourceStatus.READ_ONLY_LOCAL</code> * error. - * + * * @param status the status to be checked * @return <code>true</code> if the given status is a <code>IResourceStatus.READ_ONLY_LOCAL</code> error * @since 3.3 @@ -1145,7 +1145,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { getAction(ITextEditorActionConstants.QUICKDIFF_REVERTLINE)}); action2.setActionDefinitionId(ITextEditorActionDefinitionIds.QUICKDIFF_REVERT); setAction(ITextEditorActionConstants.QUICKDIFF_REVERT, action2); - + action= new ResourceAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.HideRevisionInformationAction.") { //$NON-NLS-1$ public void run() { if (fLineColumn != null) @@ -1171,15 +1171,15 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { }; action.setActionDefinitionId(ITextEditorActionDefinitionIds.REVISION_RENDERING_CYCLE); setAction(ITextEditorActionConstants.REVISION_RENDERING_CYCLE, action); - + action= new BooleanPreferenceToggleAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ToggleRevisionAuthorAction.", IAction.AS_CHECK_BOX, EditorsUI.getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_SHOW_AUTHOR); //$NON-NLS-1$ action.setActionDefinitionId(ITextEditorActionDefinitionIds.REVISION_AUTHOR_TOGGLE); setAction(ITextEditorActionConstants.REVISION_SHOW_AUTHOR_TOGGLE, action); - + action= new BooleanPreferenceToggleAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ToggleRevisionIdAction.", IAction.AS_CHECK_BOX, EditorsUI.getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.REVISION_RULER_SHOW_REVISION); //$NON-NLS-1$ action.setActionDefinitionId(ITextEditorActionDefinitionIds.REVISION_ID_TOGGLE); setAction(ITextEditorActionConstants.REVISION_SHOW_ID_TOGGLE, action); - + final Shell shell; if (getSourceViewer() != null) shell= getSourceViewer().getTextWidget().getShell(); @@ -1207,10 +1207,10 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { IAction showWhitespaceCharactersAction= getAction(ITextEditorActionConstants.SHOW_WHITESPACE_CHARACTERS); if (showWhitespaceCharactersAction instanceof ShowWhitespaceCharactersAction) ((ShowWhitespaceCharactersAction)showWhitespaceCharactersAction).setPreferenceStore(EditorsUI.getPreferenceStore()); - + setAction(ITextEditorActionConstants.REFRESH, new RefreshEditorAction(this)); markAsPropertyDependentAction(ITextEditorActionConstants.REFRESH, true); - + // Override print action to provide additional options if (getAction(ITextEditorActionConstants.PRINT).isEnabled() && getSourceViewer() instanceof ITextViewerExtension8) createPrintAction(); @@ -1218,7 +1218,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { /** * Creates and registers the print action. - * + * * @since 3.4 */ private void createPrintAction() { @@ -1242,7 +1242,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { for (int i= 0; i < options.lineLabels.length; i++) options.lineLabels[i]= String.valueOf(JFaceTextUtil.widgetLine2ModelLine(viewer, i) + 1); } - + ((ITextViewerExtension8)viewer).print(options); } }; @@ -1277,7 +1277,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { } return super.getAdapter(adapter); - + } /* @@ -1322,19 +1322,19 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { protected void doSetInput(IEditorInput input) throws CoreException { fIsDerivedStateValidated= false; fIsEditingDerivedFileAllowed= true; - + if (fLineColumn != null) fLineColumn.hideRevisionInformation(); super.doSetInput(input); - + RulerColumnDescriptor lineNumberColumnDescriptor= RulerColumnRegistry.getDefault().getColumnDescriptor(LineNumberColumn.ID); if (lineNumberColumnDescriptor != null) { IColumnSupport columnSupport= (IColumnSupport)getAdapter(IColumnSupport.class); columnSupport.setColumnVisible(lineNumberColumnDescriptor, isLineNumberRulerVisible() || isPrefQuickDiffAlwaysOn()); } } - + /** * This implementation asks the user for the workspace path of a file resource and saves the document there. * @@ -1347,7 +1347,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { IDocumentProvider provider= getDocumentProvider(); final IEditorInput newInput; - + if (input instanceof IURIEditorInput && !(input instanceof IFileEditorInput)) { FileDialog dialog= new FileDialog(shell, SWT.SAVE); IPath oldPath= URIUtil.toPath(((IURIEditorInput)input).getURI()); @@ -1355,7 +1355,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { dialog.setFileName(oldPath.lastSegment()); dialog.setFilterPath(oldPath.toOSString()); } - + String path= dialog.open(); if (path == null) { if (progressMonitor != null) @@ -1392,13 +1392,13 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { MessageDialog.openError(shell, title, msg); return; } - + IFile file= getWorkspaceFile(fileStore); if (file != null) newInput= new FileEditorInput(file); else newInput= new FileStoreEditorInput(fileStore); - + } else { SaveAsDialog dialog= new SaveAsDialog(shell); @@ -1419,20 +1419,20 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { progressMonitor.setCanceled(true); return; } - + IPath filePath= dialog.getResult(); if (filePath == null) { if (progressMonitor != null) progressMonitor.setCanceled(true); return; } - + IWorkspace workspace= ResourcesPlugin.getWorkspace(); IFile file= workspace.getRoot().getFile(filePath); newInput= new FileEditorInput(file); } - + if (provider == null) { // editor has programmatically been closed while the dialog was open return; @@ -1466,7 +1466,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { * Checks whether there given file store points * to a file in the workspace. Only returns a * workspace file if there's a single match. - * + * * @param fileStore the file store * @return the <code>IFile</code> that matches the given file store * @since 3.2 @@ -1481,7 +1481,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { /** * Sets the ruler's overview context menu id. - * + * * @param contextMenuId the overview ruler context menu id * @since 3.4 */ @@ -1493,7 +1493,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { /** * Returns the ruler's overview context menu id. May return * <code>null</code> before the editor's part has been created. - * + * * @return the ruler's context menu id which may be <code>null</code> * @since 3.4 */ @@ -1506,7 +1506,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { * <p> * Subclasses may extend to add other actions. * </p> - * + * * @param menu the menu * @since 3.4 */ @@ -1539,7 +1539,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { if (p.getOffset() == selection.x && p.getLength() == selection.y) break; } - + if (annotation != null) { AnnotationPreference ap= getAnnotationPreferenceLookup().getAnnotationPreference(annotation); if (ap != null) @@ -1568,7 +1568,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { menu.add(new Separator(ITextEditorActionConstants.GROUP_REST)); super.rulerContextMenuAboutToShow(menu); - + addRulerContributionActions(menu); /* quick diff */ @@ -1599,16 +1599,16 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { menu.appendToGroup(ITextEditorActionConstants.GROUP_RESTORE, revertDeletion); } } - + // revision info if (fLineColumn != null && fLineColumn.isShowingRevisionInformation()) { IMenuManager revisionMenu= new MenuManager(TextEditorMessages.AbstractDecoratedTextEditor_revisions_menu); menu.appendToGroup(ITextEditorActionConstants.GROUP_RULERS, revisionMenu); - + IAction hideRevisionInfoAction= getAction(ITextEditorActionConstants.REVISION_HIDE_INFO); revisionMenu.add(hideRevisionInfoAction); revisionMenu.add(new Separator()); - + String[] labels= { TextEditorMessages.AbstractDecoratedTextEditor_revision_colors_option_by_date, TextEditorMessages.AbstractDecoratedTextEditor_revision_colors_option_by_author, TextEditorMessages.AbstractDecoratedTextEditor_revision_colors_option_by_author_and_date }; final RenderingMode[] modes= { IRevisionRulerColumnExtension.AGE, IRevisionRulerColumnExtension.AUTHOR, IRevisionRulerColumnExtension.AUTHOR_SHADED_BY_AGE}; final IPreferenceStore uiStore= EditorsUI.getPreferenceStore(); @@ -1624,7 +1624,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { action.setChecked(mode.equals(current)); revisionMenu.add(action); } - + revisionMenu.add(new Separator()); revisionMenu.add(getAction(ITextEditorActionConstants.REVISION_SHOW_AUTHOR_TOGGLE)); @@ -1639,10 +1639,10 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { menu.appendToGroup(ITextEditorActionConstants.GROUP_RULERS, new Separator(ITextEditorActionConstants.GROUP_SETTINGS)); menu.appendToGroup(ITextEditorActionConstants.GROUP_SETTINGS, preferencesAction); } - + /** * Adds "show" actions for all contributed rulers that support it. - * + * * @param menu the ruler context menu * @since 3.3 */ @@ -1672,7 +1672,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { menu.appendToGroup(ITextEditorActionConstants.GROUP_RULERS, action); } } - + /** * Toggles the line number global preference and shows the line number ruler * accordingly. @@ -1712,7 +1712,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { IAction preferencesAction= getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES); menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator(ITextEditorActionConstants.GROUP_SETTINGS)); menu.appendToGroup(ITextEditorActionConstants.GROUP_SETTINGS, preferencesAction); - + menu.appendToGroup(ITextEditorActionConstants.GROUP_SAVE, new Separator(ITextEditorActionConstants.GROUP_OPEN)); MenuManager showInSubMenu= new MenuManager(getShowInMenuLabel()); showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(getEditorSite().getWorkbenchWindow())); @@ -1721,20 +1721,20 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { /** * Returns the menu label for 'Show In' together with its key binding string. - * + * * @return the 'Show In' menu label * @since 3.2 */ private String getShowInMenuLabel() { String keyBinding= null; - + IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class); if (bindingService != null) keyBinding= bindingService.getBestActiveBindingFormattedFor("org.eclipse.ui.navigate.showInQuickMenu"); //$NON-NLS-1$ - + if (keyBinding == null) keyBinding= ""; //$NON-NLS-1$ - + return NLSUtility.format(TextEditorMessages.AbstractDecoratedTextEditor_showIn_menu, keyBinding); } @@ -1776,7 +1776,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { protected String[] collectRulerMenuPreferencePages() { return collectContextMenuPreferencePages(); } - + /** * Returns the preference page ids of the preference pages to be shown when * executing the preferences action from the editor overview ruler context menu. @@ -1797,7 +1797,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { "org.eclipse.ui.editors.preferencePages.QuickDiff" //$NON-NLS-1$ }; } - + /* * @see AbstractTextEditor#getUndoRedoOperationApprover(IUndoContext) * @since 3.1 @@ -1808,7 +1808,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { return new NonLocalUndoUserApprover(undoContext, this, new Object [] { input }, IResource.class); return super.getUndoRedoOperationApprover(undoContext); } - + /** * Returns whether the given annotation is configured as a target for the * "Go to Next/Previous Annotation" actions. @@ -1828,7 +1828,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { String key= preference == null ? null : preference.getIsGoToNextNavigationTargetKey(); return (key != null && getPreferenceStore().getBoolean(key)); } - + /** * {@inheritDoc} * <p> @@ -1850,7 +1850,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { * If the given annotation can be associated with a marker then this method tries select the * this marker in views that show markers. * </p> - * + * * @param annotation the annotation * @since 3.2 */ @@ -1858,7 +1858,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { IMarker marker= null; if (annotation instanceof MarkerAnnotation) marker= ((MarkerAnnotation)annotation).getMarker(); - + if (marker != null) { try { fIsUpdatingMarkerViews= true; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java index e14099f8b2e..e0fb8c71a74 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java @@ -22,12 +22,13 @@ import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter; import org.eclipse.jface.text.revisions.IRevisionRulerColumnExtension; -import org.eclipse.ui.editors.text.EditorsUI; - import org.eclipse.ui.internal.editors.text.EditorsPlugin; import org.eclipse.ui.internal.editors.text.EditorsPluginPreferenceInitializer; + import org.eclipse.ui.texteditor.spelling.SpellingService; +import org.eclipse.ui.editors.text.EditorsUI; + /** * Preference constants used in the extended text editor preference store. @@ -356,7 +357,7 @@ public class AbstractDecoratedTextEditorPreferenceConstants { * @since 3.1 */ public static final String EDITOR_DISABLE_OVERWRITE_MODE= "disable_overwrite_mode"; //$NON-NLS-1$ - + /** * A named preference that controls whether a confirmation * dialog is shown before editing derived input. @@ -367,7 +368,7 @@ public class AbstractDecoratedTextEditorPreferenceConstants { * @since 3.3 */ public static final String EDITOR_WARN_IF_INPUT_DERIVED= "warn_if_input_derived"; //$NON-NLS-1$ - + /** * A named preference that controls if smart home/end navigation is on or off * <p> @@ -404,7 +405,7 @@ public class AbstractDecoratedTextEditorPreferenceConstants { * <p> * Value is of type <code>String</code>. * </p> - * + * * @since 3.2 */ public static final String REVISION_ASK_BEFORE_QUICKDIFF_SWITCH= "quickdiff.nowarn.before.switch"; //$NON-NLS-1$ @@ -415,7 +416,7 @@ public class AbstractDecoratedTextEditorPreferenceConstants { * Value is of type <code>String</code> and should contain the name of a * {@link org.eclipse.jface.text.revisions.IRevisionRulerColumnExtension.RenderingMode}. * </p> - * + * * @since 3.3 */ public static final String REVISION_RULER_RENDERING_MODE= "revisionRulerRenderingMode"; //$NON-NLS-1$ @@ -425,7 +426,7 @@ public class AbstractDecoratedTextEditorPreferenceConstants { * <p> * Value is of type <code>Boolean</code>. * </p> - * + * * @since 3.3 */ public static final String REVISION_RULER_SHOW_AUTHOR= "revisionRulerShowAuthor"; //$NON-NLS-1$ @@ -435,11 +436,11 @@ public class AbstractDecoratedTextEditorPreferenceConstants { * <p> * Value is of type <code>Boolean</code>. * </p> - * + * * @since 3.3 */ public static final String REVISION_RULER_SHOW_REVISION= "revisionRulerShowRevision"; //$NON-NLS-1$ - + /** * A named preference that controls whether text drag and drop is enabled. * <p> @@ -449,13 +450,13 @@ public class AbstractDecoratedTextEditorPreferenceConstants { * @since 3.3 */ public static final String EDITOR_TEXT_DRAG_AND_DROP_ENABLED= AbstractTextEditor.PREFERENCE_TEXT_DRAG_AND_DROP_ENABLED; - + /** * A named preference that defines whether the hint to make hover sticky should be shown. * <p> * Value is of type <code>Boolean</code>. * </p> - * + * * @since 3.3 */ public static final String EDITOR_SHOW_TEXT_HOVER_AFFORDANCE= "showTextHoverAffordance"; //$NON-NLS-1$ @@ -473,11 +474,11 @@ public class AbstractDecoratedTextEditorPreferenceConstants { * <li>1: {@link org.eclipse.jface.text.ITextViewerExtension8.EnrichMode#IMMEDIATELY},</li> * <li>2: {@link org.eclipse.jface.text.ITextViewerExtension8.EnrichMode#ON_CLICK}.</li> * </ul> - * + * * @since 3.4 */ public static final String EDITOR_HOVER_ENRICH_MODE= AbstractTextEditor.PREFERENCE_HOVER_ENRICH_MODE; - + /** * Initializes the given preference store with the default values. * @@ -496,7 +497,7 @@ public class AbstractDecoratedTextEditorPreferenceConstants { store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, false); store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 80); - + store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, false); if (!store.getBoolean(USE_QUICK_DIFF_PREFERENCE_PAGE)) { @@ -518,14 +519,14 @@ public class AbstractDecoratedTextEditorPreferenceConstants { store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR, true); store.setDefault(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, true); - + store.setDefault(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, true); - + String mod1Name= Action.findModifierString(SWT.MOD1); // SWT.COMMAND on MAC; SWT.CONTROL elsewhere store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED, true); store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER, mod1Name); store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER_MASK, SWT.MOD1); - + HyperlinkDetectorDescriptor[] descriptors= EditorsUI.getHyperlinkDetectorRegistry().getHyperlinkDetectorDescriptors(); for (int i= 0; i < descriptors.length; i++) { int stateMask= computeStateMask(descriptors[i].getModifierKeys()); @@ -545,10 +546,10 @@ public class AbstractDecoratedTextEditorPreferenceConstants { boolean isInstalled= EditorsUI.getSpellingService().getSpellingEngineDescriptors().length > 0; store.setDefault(SpellingService.PREFERENCE_SPELLING_ENABLED, !isInTestMode && isInstalled); store.setDefault(SpellingService.PREFERENCE_SPELLING_ENGINE, ""); //$NON-NLS-1$ - + store.setDefault(SHOW_RANGE_INDICATOR, true); store.setDefault(REVISION_ASK_BEFORE_QUICKDIFF_SWITCH, ""); //$NON-NLS-1$ - + store.setDefault(AbstractTextEditor.PREFERENCE_RULER_CONTRIBUTIONS, ""); //$NON-NLS-1$ store.setDefault(REVISION_RULER_RENDERING_MODE, IRevisionRulerColumnExtension.AGE.name()); store.setDefault(REVISION_RULER_SHOW_AUTHOR, false); @@ -560,12 +561,12 @@ public class AbstractDecoratedTextEditorPreferenceConstants { store.setDefault(EDITOR_TEXT_DRAG_AND_DROP_ENABLED, true); store.setDefault(EDITOR_SHOW_TEXT_HOVER_AFFORDANCE, true); store.setDefault(EDITOR_HOVER_ENRICH_MODE, 0); - + MarkerAnnotationPreferences.initializeDefaultValues(store); - + EditorsPluginPreferenceInitializer.setThemeBasedPreferences(store, false); } - + /** * Computes the state mask out of the given modifiers string. * @@ -622,5 +623,5 @@ public class AbstractDecoratedTextEditorPreferenceConstants { return SWT.NONE; } - + } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java index c858c82760f..f30cad5216a 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java @@ -16,9 +16,6 @@ import java.util.List; import org.osgi.framework.Bundle; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResourceStatus; - import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; @@ -28,6 +25,9 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResourceStatus; + import org.eclipse.core.filebuffers.IPersistableAnnotationModel; import org.eclipse.jface.text.BadLocationException; @@ -37,10 +37,10 @@ import org.eclipse.jface.text.source.Annotation; import org.eclipse.jface.text.source.AnnotationModel; import org.eclipse.jface.text.source.IAnnotationMap; -import org.eclipse.ui.editors.text.EditorsUI; - import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.editors.text.EditorsUI; + /** * Abstract implementation of a marker-based annotation model. @@ -477,7 +477,7 @@ public abstract class AbstractMarkerAnnotationModel extends AnnotationModel impl * <p> * <strong>Note:</strong> This implementation queries the registered * {@linkplain IMarkerUpdater}s. If any of these updaters returns - * <code>false</code> this method also returns <code>false</code>. + * <code>false</code> this method also returns <code>false</code>. * </p> * * @param marker the marker to be updated diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AddMarkerAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AddMarkerAction.java index 73d27ba1300..e9fb07a03e9 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AddMarkerAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AddMarkerAction.java @@ -130,10 +130,10 @@ public class AddMarkerAction extends TextEditorAction { if (!askForLabel(attributes)) return; } - + String name= getToolTipText(); name= name == null ? TextEditorMessages.AddMarkerAction_addMarker : name; - + final Shell shell= getTextEditor().getSite().getShell(); IAdaptable context= new IAdaptable() { public Object getAdapter(Class adapter) { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationPreferenceLookup.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationPreferenceLookup.java index c80e4eb6c7c..92cabad1709 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationPreferenceLookup.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationPreferenceLookup.java @@ -17,7 +17,9 @@ import java.util.Map; import org.eclipse.jface.text.source.Annotation; import org.eclipse.ui.internal.editors.text.EditorsPlugin; -import org.eclipse.ui.internal.texteditor.*; +import org.eclipse.ui.internal.texteditor.AnnotationType; +import org.eclipse.ui.internal.texteditor.AnnotationTypeHierarchy; +import org.eclipse.ui.internal.texteditor.DelegatingAnnotationPreference; /** * Provides the strategy for finding the annotation preference for a given diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationTypeLookup.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationTypeLookup.java index eebc259dddf..d0ae78514f8 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationTypeLookup.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationTypeLookup.java @@ -15,11 +15,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.resources.IMarker; + import org.eclipse.jface.resource.StringConverter; import org.eclipse.ui.editors.text.EditorsUI; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/BasicMarkerUpdater.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/BasicMarkerUpdater.java index c48fcf516d6..84e1e208e43 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/BasicMarkerUpdater.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/BasicMarkerUpdater.java @@ -10,12 +10,12 @@ *******************************************************************************/ package org.eclipse.ui.texteditor; +import org.eclipse.core.resources.IMarker; + import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.Position; -import org.eclipse.core.resources.IMarker; - /** * Updates a marker's positional attributes which are diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChangeEncodingAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChangeEncodingAction.java index 87d6c238efb..84dd3997763 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChangeEncodingAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChangeEncodingAction.java @@ -30,12 +30,12 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceStore; -import org.eclipse.ui.editors.text.IEncodingSupport; - import org.eclipse.ui.ide.dialogs.AbstractEncodingFieldEditor; import org.eclipse.ui.ide.dialogs.EncodingFieldEditor; import org.eclipse.ui.ide.dialogs.ResourceEncodingFieldEditor; +import org.eclipse.ui.editors.text.IEncodingSupport; + /** * Action for changing the encoding of the editor's * input element. diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DefaultMarkerAnnotationAccess.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DefaultMarkerAnnotationAccess.java index ab3bf90338e..1485f1222e8 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DefaultMarkerAnnotationAccess.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DefaultMarkerAnnotationAccess.java @@ -119,14 +119,14 @@ public class DefaultMarkerAnnotationAccess implements IAnnotationAccess, IAnnota /** * An optional quick assist processor. - * + * * @since 3.2 */ private IQuickAssistAssistant fQuickAssistAssistant; /** * Returns a new default marker annotation access with the given preferences. - * + * * @param markerAnnotationPreferences the marker annotation preference * @deprecated As of 3.0, replaced by * {@link org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess#DefaultMarkerAnnotationAccess()} @@ -178,17 +178,17 @@ public class DefaultMarkerAnnotationAccess implements IAnnotationAccess, IAnnota /** * {@inheritDoc} - * + * * @deprecated use <code>Annotation.getType()</code> */ - + public Object getType(Annotation annotation) { return annotation.getType(); } /** * {@inheritDoc} - * + * * @deprecated assumed to always return <code>true</code> */ public boolean isMultiLine(Annotation annotation) { @@ -197,7 +197,7 @@ public class DefaultMarkerAnnotationAccess implements IAnnotationAccess, IAnnota /** * {@inheritDoc} - * + * * @deprecated assumed to always return <code>true</code> */ public boolean isTemporary(Annotation annotation) { @@ -222,11 +222,11 @@ public class DefaultMarkerAnnotationAccess implements IAnnotationAccess, IAnnota IAnnotationPresentation presentation= (IAnnotationPresentation) annotation; return presentation.getLayer(); } - + AnnotationPreference preference= getAnnotationPreference(annotation); if (preference != null) return preference.getPresentationLayer(); - + // backward compatibility, ignore exceptions, just return default layer try { @@ -332,7 +332,7 @@ public class DefaultMarkerAnnotationAccess implements IAnnotationAccess, IAnnota * defined in {@link org.eclipse.ui.ISharedImages}. * <p> * The symbolic image name must be one of the - * + * * @param symbolicImageName the symbolic image name, which must be one of * the valid values defined for the <code>symbolicIcon</code> * attribute in the @@ -423,7 +423,7 @@ public class DefaultMarkerAnnotationAccess implements IAnnotationAccess, IAnnota * Checks whether there's a quick assist assistant and if so, * whether the assistant has a possible fix for the given * annotation. - * + * * @param annotation the annotation * @return <code>true</code> if there is quick fix * @since 3.2 diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DocumentProviderRegistry.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DocumentProviderRegistry.java index 0c36b998be6..f37a93a5729 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DocumentProviderRegistry.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DocumentProviderRegistry.java @@ -22,7 +22,6 @@ import java.util.StringTokenizer; import org.osgi.framework.Bundle; -import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionPoint; @@ -31,12 +30,14 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; -import org.eclipse.ui.editors.text.EditorsUI; +import org.eclipse.core.resources.IFile; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.editors.text.NLSUtility; +import org.eclipse.ui.editors.text.EditorsUI; + /** * This registry manages shared document providers. Document diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/IMarkerUpdater.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/IMarkerUpdater.java index b97a8d99a62..aff37359f48 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/IMarkerUpdater.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/IMarkerUpdater.java @@ -10,11 +10,11 @@ *******************************************************************************/ package org.eclipse.ui.texteditor; +import org.eclipse.core.resources.IMarker; + import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.Position; -import org.eclipse.core.resources.IMarker; - /** * A marker updater is responsible for saving changes to markers. diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotation.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotation.java index 94a0e6eb98b..3a90c7c03be 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotation.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotation.java @@ -129,7 +129,7 @@ public class MarkerAnnotation extends SimpleMarkerAnnotation implements IQuickFi */ private boolean fIsQuickFixableStateSet; - + /** * Creates a new annotation for the given marker. * @@ -325,7 +325,7 @@ public class MarkerAnnotation extends SimpleMarkerAnnotation implements IQuickFi /** * {@inheritDoc} - * + * * @since 3.4 */ public void setQuickFixable(boolean state) { @@ -335,7 +335,7 @@ public class MarkerAnnotation extends SimpleMarkerAnnotation implements IQuickFi /** * {@inheritDoc} - * + * * @since 3.4 */ public boolean isQuickFixableStateSet() { @@ -344,7 +344,7 @@ public class MarkerAnnotation extends SimpleMarkerAnnotation implements IQuickFi /** * {@inheritDoc} - * + * * @since 3.4 */ public boolean isQuickFixable() { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java index fb04331518a..b28583e11be 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java @@ -36,10 +36,10 @@ import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.StringConverter; -import org.eclipse.ui.editors.text.EditorsUI; - import org.eclipse.ui.internal.editors.text.EditorsPlugin; +import org.eclipse.ui.editors.text.EditorsUI; + /** * Objects of this class provide access to all extensions declared for the <code>markerAnnotationSpecification</code> extension point. @@ -230,7 +230,7 @@ public class MarkerAnnotationPreferences { * Creates a new marker annotation preferences to access * marker annotation preferences. * @param initFromPreferences tells this instance to initialize itself from the preferences - * + * * @since 3.2 */ private MarkerAnnotationPreferences(boolean initFromPreferences) { @@ -275,7 +275,7 @@ public class MarkerAnnotationPreferences { fFragments= cloneAnnotationPreferences(sharedPrefs.fFragments); fPreferences= cloneAnnotationPreferences(sharedPrefs.fPreferences); } - + /** * Reads all extensions provided for the <code>markerAnnotationSpecification</code> extension point and * translates them into <code>AnnotationPreference</code> objects. @@ -327,10 +327,10 @@ public class MarkerAnnotationPreferences { } }); } - + /** * Deeply clones the given list of <code>AnnotationPreference</code>. - * + * * @param annotationPreferences a list of <code>AnnotationPreference</code> * @return the cloned list of cloned annotation preferences * @since 3.1 @@ -344,10 +344,10 @@ public class MarkerAnnotationPreferences { clone.add(clone(((AnnotationPreference)iter.next()))); return clone; } - + /** * Clones the given annotation preference. - * + * * @param annotationPreference the annotation preference to clone * @return the cloned annotation preference * @since 3.1 @@ -355,13 +355,13 @@ public class MarkerAnnotationPreferences { private AnnotationPreference clone(AnnotationPreference annotationPreference) { if (annotationPreference == null) return null; - + AnnotationPreference clone= new AnnotationPreference(); if (annotationPreference.getAnnotationType() != null) { clone.setAnnotationType(annotationPreference.getAnnotationType()); clone.merge(annotationPreference); } - + return clone; } @@ -512,7 +512,7 @@ public class MarkerAnnotationPreferences { s= element.getAttribute("icon"); //$NON-NLS-1$ if (s != null && s.trim().length() > 0) info.setImageDescriptor(getImageDescriptor(s, element)); - + s= element.getAttribute("quickFixIcon"); //$NON-NLS-1$ if (s != null && s.trim().length() > 0) info.setQuickFixImageDescriptor(getImageDescriptor(s, element)); @@ -544,7 +544,7 @@ public class MarkerAnnotationPreferences { info.setIncludeOnPreferencePage(s == null || StringConverter.asBoolean(s, true)); info.markReadOnly(); - + return info; } @@ -566,7 +566,7 @@ public class MarkerAnnotationPreferences { URL url= FileLocator.find(bundle, new Path(iconPath), null); if (url != null) return ImageDescriptor.createFromURL(url); - + return ImageDescriptor.getMissingImageDescriptor(); } } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java index 26f76756e9a..884247a1622 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java @@ -107,7 +107,7 @@ public class MarkerRulerAction extends ResourceAction implements IUpdate { public MarkerRulerAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo ruler, String markerType, boolean askForLabel) { super(bundle, prefix); Assert.isLegal(editor != null); - + fRuler= ruler; fTextEditor= editor; fMarkerType= markerType; @@ -207,7 +207,7 @@ public class MarkerRulerAction extends ResourceAction implements IUpdate { /** * Returns whether the given markers are all editable by the user. - * + * * @param markers the list of markers to test * @return boolean <code>true</code> if they are all editable * @since 3.2 @@ -223,7 +223,7 @@ public class MarkerRulerAction extends ResourceAction implements IUpdate { /** * Returns whether the given marker is editable by the user. - * + * * @param marker the marker to test * @return boolean <code>true</code> if it is editable * @since 3.2 @@ -488,7 +488,7 @@ public class MarkerRulerAction extends ResourceAction implements IUpdate { /** * Returns the name to be used for the operation. - * + * * @return the operation name * @since 3.3 */ @@ -499,7 +499,7 @@ public class MarkerRulerAction extends ResourceAction implements IUpdate { /** * Execute the specified undoable operation. - * + * * @param operation the operation to execute * @since 3.3 */ diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerInfoAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerInfoAction.java index 3b5a7285ad3..6cf7951d755 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerInfoAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerInfoAction.java @@ -11,6 +11,7 @@ package org.eclipse.ui.texteditor; import java.util.ResourceBundle; + import org.eclipse.jface.text.source.IVerticalRulerInfo; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerUtilities.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerUtilities.java index 2395d26ecc4..6f397a2f6b7 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerUtilities.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerUtilities.java @@ -17,11 +17,6 @@ import java.util.Map; import org.osgi.framework.Bundle; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; @@ -30,6 +25,12 @@ import org.eclipse.core.runtime.ILog; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.IWorkspaceRunnable; +import org.eclipse.core.resources.ResourcesPlugin; + import org.eclipse.ui.PlatformUI; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MessageRegion.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MessageRegion.java index 7369f13d6ac..0ac361633e0 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MessageRegion.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MessageRegion.java @@ -58,7 +58,7 @@ class MessageRegion { /** * Create the contents for the receiver. - * + * * @param parent the Composite that the children will be created in */ public void createContents(Composite parent) { @@ -97,7 +97,7 @@ class MessageRegion { /** * Set the layoutData for the messageArea. In most cases this will be a copy of the layoutData * used in setTitleLayoutData. - * + * * @param layoutData the layoutData for the message area composite. */ public void setMessageLayoutData(Object layoutData) { @@ -107,7 +107,7 @@ class MessageRegion { /** * Show the new message in the message text and update the image. Base the background color on * whether or not there are errors. - * + * * @param newMessage The new value for the message * @param newType One of the IMessageProvider constants. If newType is IMessageProvider.NONE * show the title. @@ -170,7 +170,7 @@ class MessageRegion { /** * Set the colors of the message area. - * + * * @param color the color to be use in the message area. */ private void setMessageColors(Color color) { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ReadOnlyAnnotationPreference.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ReadOnlyAnnotationPreference.java index 81267b4bfde..56b30686fe7 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ReadOnlyAnnotationPreference.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ReadOnlyAnnotationPreference.java @@ -22,9 +22,9 @@ import org.eclipse.jface.resource.ImageDescriptor; * is allowed. * <p> * In the read-only state a {@link UnsupportedOperationException} - * is thrown by methods that modify the preference. + * is thrown by methods that modify the preference. * </p> - * + * * @since 3.2 */ class ReadOnlyAnnotationPreference extends AnnotationPreference { @@ -239,5 +239,5 @@ class ReadOnlyAnnotationPreference extends AnnotationPreference { public void markReadOnly() { fIsReadOnly= true; } - + } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ResourceMarkerAnnotationModel.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ResourceMarkerAnnotationModel.java index e88b11c012a..3cf258bd20b 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ResourceMarkerAnnotationModel.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ResourceMarkerAnnotationModel.java @@ -94,7 +94,7 @@ public class ResourceMarkerAnnotationModel extends AbstractMarkerAnnotationModel if (markerDeltas.length == 0) return; - + if (markerDeltas.length == 1) { IMarkerDelta delta= markerDeltas[0]; switch (delta.getKind()) { @@ -110,7 +110,7 @@ public class ResourceMarkerAnnotationModel extends AbstractMarkerAnnotationModel } } else batchedUpdate(markerDeltas); - + fireModelChanged(); } @@ -140,14 +140,14 @@ public class ResourceMarkerAnnotationModel extends AbstractMarkerAnnotationModel if (modifiedMarkers.isEmpty() && removedMarkers.isEmpty()) return; - + Iterator e= getAnnotationIterator(false); while (e.hasNext()) { Object o= e.next(); if (o instanceof MarkerAnnotation) { MarkerAnnotation a= (MarkerAnnotation)o; IMarker marker= a.getMarker(); - + if (removedMarkers.remove(marker)) removeAnnotation(a, false); @@ -158,10 +158,10 @@ public class ResourceMarkerAnnotationModel extends AbstractMarkerAnnotationModel modifyAnnotationPosition(a, p, false); } } - + if (modifiedMarkers.isEmpty() && removedMarkers.isEmpty()) return; - + } } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/RevisionHoverInformationControlCreator.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/RevisionHoverInformationControlCreator.java index f4ad4a4b8b6..f5baea48dd6 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/RevisionHoverInformationControlCreator.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/RevisionHoverInformationControlCreator.java @@ -26,7 +26,7 @@ import org.eclipse.ui.editors.text.EditorsUI; /** * The revision information control creator that can show the tool tip affordance. - * + * * @since 3.3 */ class RevisionHoverInformationControlCreator extends AbstractReusableInformationControlCreator { @@ -62,8 +62,8 @@ class RevisionHoverInformationControlCreator extends AbstractReusableInformation "var { font-style: italic }\n" + //$NON-NLS-1$ "th { font-weight: bold }\n" + //$NON-NLS-1$ ""; //$NON-NLS-1$ - - + + private static final class RevisionInformationControl extends BrowserInformationControl { public RevisionInformationControl(Shell parent, String statusFieldText) { @@ -76,7 +76,7 @@ class RevisionHoverInformationControlCreator extends AbstractReusableInformation /** * {@inheritDoc} - * + * * @deprecated use {@link #setInput(Object)} */ public void setInformation(String content) { @@ -87,7 +87,7 @@ class RevisionHoverInformationControlCreator extends AbstractReusableInformation /** * Adds a HTML header and CSS info if <code>html</code> is only an HTML fragment (has no * <html> section). - * + * * @param html the html / text produced by a revision * @return modified html */ @@ -104,11 +104,11 @@ class RevisionHoverInformationControlCreator extends AbstractReusableInformation return info.toString(); } } - + private boolean fIsFocusable; - + public RevisionHoverInformationControlCreator(boolean isFocusable) { fIsFocusable= isFocusable; } diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectMarkerRulerAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectMarkerRulerAction.java index 13034a09f4c..162fa1b642c 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectMarkerRulerAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectMarkerRulerAction.java @@ -124,27 +124,27 @@ public class SelectMarkerRulerAction extends ResourceAction implements IUpdate { IWorkbenchPage page= fTextEditor.getSite().getPage(); MarkerViewUtil.showMarker(page, marker, false); - + gotoMarker(marker); } - + private void gotoMarker(IMarker marker) { - + // Use the provided adapter if any IGotoMarker gotoMarkerAdapter= (IGotoMarker)fTextEditor.getAdapter(IGotoMarker.class); if (gotoMarkerAdapter != null) { gotoMarkerAdapter.gotoMarker(marker); return; } - + int start= MarkerUtilities.getCharStart(marker); int end= MarkerUtilities.getCharEnd(marker); - - boolean selectLine= start < 0 || end < 0; + + boolean selectLine= start < 0 || end < 0; IDocumentProvider documentProvider= fTextEditor.getDocumentProvider(); IEditorInput editorInput= fTextEditor.getEditorInput(); - + // look up the current range of the marker when the document has been edited IAnnotationModel model= documentProvider.getAnnotationModel(editorInput); if (model instanceof AbstractMarkerAnnotationModel) { @@ -185,7 +185,7 @@ public class SelectMarkerRulerAction extends ResourceAction implements IUpdate { if (end - 1 < length && start < length) fTextEditor.selectAndReveal(start, end - start); } - + /** * Chooses the marker with the highest layer. If there are multiple @@ -353,7 +353,7 @@ public class SelectMarkerRulerAction extends ResourceAction implements IUpdate { /** * Log status. - * + * * @param status the status to log * @since 3.4 */ @@ -396,7 +396,7 @@ public class SelectMarkerRulerAction extends ResourceAction implements IUpdate { final int activeLine= fRuler.getLineOfLastMouseButtonActivity(); if (activeLine == -1) return Collections.EMPTY_LIST; - + Iterator it; try { IRegion line= document.getLineInformation(activeLine); @@ -404,10 +404,10 @@ public class SelectMarkerRulerAction extends ResourceAction implements IUpdate { } catch (BadLocationException e) { Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID); Platform.getLog(bundle).log(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, e.getLocalizedMessage(), e)); - + it= model.getAnnotationIterator(); } - + List markers= null; while (it.hasNext()) { Annotation annotation= (Annotation) it.next(); @@ -462,7 +462,7 @@ public class SelectMarkerRulerAction extends ResourceAction implements IUpdate { final int activeLine= fRuler.getLineOfLastMouseButtonActivity(); if (activeLine == -1) return false; - + Iterator it; try { IRegion line= document.getLineInformation(activeLine); @@ -471,7 +471,7 @@ public class SelectMarkerRulerAction extends ResourceAction implements IUpdate { logException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, e.getLocalizedMessage(), e)); it= model.getAnnotationIterator(); } - + while (it.hasNext()) { Annotation annotation= (Annotation) it.next(); if (annotation instanceof MarkerAnnotation) { diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SimpleMarkerAnnotation.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SimpleMarkerAnnotation.java index be969742f38..4529cd26a4a 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SimpleMarkerAnnotation.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SimpleMarkerAnnotation.java @@ -13,7 +13,9 @@ package org.eclipse.ui.texteditor; import org.eclipse.core.runtime.Assert; import org.eclipse.core.resources.IMarker; + import org.eclipse.jface.text.source.Annotation; + import org.eclipse.ui.internal.editors.text.EditorsPlugin; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TaskRulerAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TaskRulerAction.java index 5a268f1fdaf..0088a298d5f 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TaskRulerAction.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TaskRulerAction.java @@ -19,6 +19,7 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.jface.action.IAction; + import org.eclipse.jface.text.source.IVerticalRulerInfo; import org.eclipse.ui.views.tasklist.TaskPropertiesDialog; diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TextEditorMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TextEditorMessages.java index 8a27619319f..ca0de82a3cb 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TextEditorMessages.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TextEditorMessages.java @@ -66,11 +66,11 @@ final class TextEditorMessages extends NLS { public static String AbstractDecoratedTextEditor_warning_derived_title; public static String AbstractDecoratedTextEditor_warning_derived_message; public static String AbstractDecoratedTextEditor_warning_derived_dontShowAgain; - + public static String AbstractDecoratedTextEditor_showIn_menu; public static String AbstractDecoratedTextEditor_printPageNumber; - - + + static { NLS.initializeMessages(BUNDLE_NAME, TextEditorMessages.class); } |