diff options
Diffstat (limited to 'org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text')
7 files changed, 91 insertions, 91 deletions
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 2782c92b9de..47d92444ce8 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 @@ -90,7 +90,7 @@ public class ConvertLineDelimitersAction extends FileBufferOperationAction { return filterUnacceptableFiles(files); } - final IFilter filter= new IFilter() { + final IFilter filter= new IFilter() { @Override public boolean accept(IResource resource) { return resource != null && isAcceptableLocation(resource.getFullPath()); 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 87ea350c397..05604cf898b 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 @@ -375,12 +375,12 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { * @param chars the number of characters * @return the number of pixels */ - protected int convertWidthInCharsToPixels(int chars) { - // test for failure to initialize for backward compatibility - if (fFontMetrics == null) - return 0; - return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars); - } + protected int convertWidthInCharsToPixels(int chars) { + // test for failure to initialize for backward compatibility + if (fFontMetrics == null) + return 0; + return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars); + } /** * Returns the number of pixels corresponding to the height of the given number of characters. @@ -394,12 +394,12 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { * @param chars the number of characters * @return the number of pixels */ - protected int convertHeightInCharsToPixels(int chars) { - // test for failure to initialize for backward compatibility - if (fFontMetrics == null) - return 0; - return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars); - } + protected int convertHeightInCharsToPixels(int chars) { + // test for failure to initialize for backward compatibility + if (fFontMetrics == null) + return 0; + return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars); + } /** * Initializes the computation of horizontal and vertical dialog units based on the size of @@ -410,13 +410,13 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { * * @param testControl a control from which to obtain the current font */ - protected void initializeDialogUnits(Control testControl) { - // Compute and store a font metric - GC gc = new GC(testControl); - gc.setFont(JFaceResources.getDialogFont()); - fFontMetrics = gc.getFontMetrics(); - gc.dispose(); - } + protected void initializeDialogUnits(Control testControl) { + // Compute and store a font metric + GC gc = new GC(testControl); + gc.setFont(JFaceResources.getDialogFont()); + fFontMetrics = gc.getFontMetrics(); + gc.dispose(); + } private void handleAnnotationListSelection() { ListItem item= getSelectedItem(); @@ -545,12 +545,12 @@ class LinkedModeConfigurationBlock implements IPreferenceConfigurationBlock { private void initializeFields() { - // Update slaves - Iterator<SelectionListener> iter= fMasterSlaveListeners.iterator(); - while (iter.hasNext()) { - SelectionListener listener= iter.next(); - listener.widgetSelected(null); - } + // Update slaves + Iterator<SelectionListener> iter= fMasterSlaveListeners.iterator(); + while (iter.hasNext()) { + SelectionListener listener= iter.next(); + listener.widgetSelected(null); + } } @Override diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PreviousPulldownActionDelegate.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PreviousPulldownActionDelegate.java index bf025618866..e73da307b01 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PreviousPulldownActionDelegate.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PreviousPulldownActionDelegate.java @@ -23,9 +23,9 @@ import org.eclipse.ui.texteditor.AnnotationPreference; */ public class PreviousPulldownActionDelegate extends NextPreviousPulldownActionDelegate { - @Override + @Override public String getPreferenceKey(AnnotationPreference annotationPreference) { - return annotationPreference.getIsGoToPreviousNavigationTargetKey(); - } + return annotationPreference.getIsGoToPreviousNavigationTargetKey(); + } } 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 3933e92a111..c25a0aa873b 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 @@ -65,7 +65,7 @@ public class RemoveTrailingWhitespaceHandler extends FileBufferOperationHandler if (containsOnlyFiles(resources)) return files; - final IFilter filter= new IFilter() { + final IFilter filter= new IFilter() { @Override public boolean accept(IResource resource) { return resource != null && isAcceptableLocation(resource.getFullPath()); 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 657bdedd70e..9ff215c94f0 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 @@ -78,7 +78,7 @@ class SelectResourcesBlock implements ICheckStateListener, ISelectionChangedList void filterElements(Collection<Object> elements) throws InterruptedException; - void filterElements(Object[] elements) throws InterruptedException; + void filterElements(Object[] elements) throws InterruptedException; } 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 0a21c76961f..75ec3955a69 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 @@ -63,11 +63,11 @@ class SelectResourcesDialog extends Dialog { } private SelectResourcesBlock fResourceGroup; - private List<Object> fAcceptedFileTypes = new ArrayList<>(); - private IResource[] fInput; - private String fTitle; - private String fInstruction; - private Label fCountIndication; + private List<Object> fAcceptedFileTypes = new ArrayList<>(); + private IResource[] fInput; + private String fTitle; + private String fInstruction; + private Label fCountIndication; private IFilter fAcceptableLocationsFilter; @@ -130,50 +130,50 @@ class SelectResourcesDialog extends Dialog { return (displayHeight / fontHeight) > 50; } - private ITreeContentProvider getResourceProvider(final int resourceType) { - return new WorkbenchContentProvider() { - @Override + private ITreeContentProvider getResourceProvider(final int resourceType) { + return new WorkbenchContentProvider() { + @Override public Object[] getChildren(Object o) { - if (o instanceof IWorkspaceRoot) { - HashSet<IResource> projects= new HashSet<>(); - for (int i= 0; i < fInput.length; i++) { - IResource project= fInput[i].getProject(); - if ((project.getType() & resourceType) > 0) - projects.add(project); - } - return projects.toArray(); - } - - if (o instanceof IContainer) { - IResource[] members = null; - try { - members = ((IContainer) o).members(); - } catch (CoreException e) { - //just return an empty set of children - return new Object[0]; - } - - //filter out the desired resource types - ArrayList<IResource> results = new ArrayList<>(); - for (int i = 0; i < members.length; i++) { - //And the test bits with the resource types to see if they are what we want - if ((members[i].getType() & resourceType) > 0 && (resourceType != IResource.FILE || fAcceptableLocationsFilter == null || fAcceptableLocationsFilter.accept(members[i]))) { - results.add(members[i]); - } - } - return results.toArray(); - } - - //input element case - if (o instanceof ArrayList) - return ((ArrayList<?>) o).toArray(); - - return new Object[0]; - } - }; - } - - protected Composite createSelectionButtonGroup(Composite parent) { + if (o instanceof IWorkspaceRoot) { + HashSet<IResource> projects= new HashSet<>(); + for (int i= 0; i < fInput.length; i++) { + IResource project= fInput[i].getProject(); + if ((project.getType() & resourceType) > 0) + projects.add(project); + } + return projects.toArray(); + } + + if (o instanceof IContainer) { + IResource[] members = null; + try { + members = ((IContainer) o).members(); + } catch (CoreException e) { + //just return an empty set of children + return new Object[0]; + } + + //filter out the desired resource types + ArrayList<IResource> results = new ArrayList<>(); + for (int i = 0; i < members.length; i++) { + //And the test bits with the resource types to see if they are what we want + if ((members[i].getType() & resourceType) > 0 && (resourceType != IResource.FILE || fAcceptableLocationsFilter == null || fAcceptableLocationsFilter.accept(members[i]))) { + results.add(members[i]); + } + } + return results.toArray(); + } + + //input element case + if (o instanceof ArrayList) + return ((ArrayList<?>) o).toArray(); + + return new Object[0]; + } + }; + } + + protected Composite createSelectionButtonGroup(Composite parent) { Font font= parent.getFont(); @@ -225,7 +225,7 @@ class SelectResourcesDialog extends Dialog { return buttonComposite; } - protected void handleSelectFileTypes() { + protected void handleSelectFileTypes() { Object[] acceptedFileTypes= queryFileTypes(); if (acceptedFileTypes != null) { fAcceptedFileTypes= Arrays.asList(acceptedFileTypes); @@ -233,13 +233,13 @@ class SelectResourcesDialog extends Dialog { } } - protected Object[] queryFileTypes() { + protected Object[] queryFileTypes() { TypeFilteringDialog dialog= new TypeFilteringDialog(getShell(), fAcceptedFileTypes); dialog.open(); return dialog.getResult(); } - private void filterSelection() { + private void filterSelection() { final IFilter filter= resource -> hasAcceptedFileType(resource); @@ -248,10 +248,10 @@ class SelectResourcesDialog extends Dialog { Runnable runnable= () -> setSelection(resources, filter); - BusyIndicator.showWhile(getShell().getDisplay(), runnable); - } + BusyIndicator.showWhile(getShell().getDisplay(), runnable); + } - protected boolean hasAcceptedFileType(IResource resource) { + protected boolean hasAcceptedFileType(IResource resource) { if (fAcceptedFileTypes == null) return true; 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 87036b60c4a..23e1615359b 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 @@ -1058,12 +1058,12 @@ public class TextEditorDefaultsPreferencePage extends PreferencePage implements fFieldsInitialized= true; updateStatus(new StatusInfo()); - // Update slaves - Iterator<SelectionListener> iter= fMasterSlaveListeners.iterator(); - while (iter.hasNext()) { - SelectionListener listener= iter.next(); - listener.widgetSelected(null); - } + // Update slaves + Iterator<SelectionListener> iter= fMasterSlaveListeners.iterator(); + while (iter.hasNext()) { + SelectionListener listener= iter.next(); + listener.widgetSelected(null); + } } |