Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-12-08 09:28:38 -0500
committerAlexander Kurtakov2017-12-08 09:28:38 -0500
commite9ec42db30a0fd8b7bf361afddd0e14c3fb3d540 (patch)
tree210c55ab70cfb127a41110b2dbb4fe257276b77d
parented108a008a975414bae0ab68083b20569ec76bed (diff)
downloadeclipse.platform.team-e9ec42db30a0fd8b7bf361afddd0e14c3fb3d540.tar.gz
eclipse.platform.team-e9ec42db30a0fd8b7bf361afddd0e14c3fb3d540.tar.xz
eclipse.platform.team-e9ec42db30a0fd8b7bf361afddd0e14c3fb3d540.zip
Bug 528323 - Modernize o.e.ui.net bundle
* Add automatic bundle name for Java 9. * Add missing Override annotations * Enable more warnings and save actions to automate many conversions. * Generify * Convert to lambda Change-Id: Ief52d2c47c4619db4886566db5f40ca973f951f0 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs45
-rw-r--r--bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.ui.prefs24
-rw-r--r--bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/Activator.java4
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsComposite.java80
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsContentProvider.java6
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsLabelProvider.java13
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesComposite.java96
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesContentProvider.java6
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesLabelProvider.java19
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java29
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyPreferencePage.java17
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/NetAuthenticator.java6
-rw-r--r--bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java8
14 files changed, 185 insertions, 169 deletions
diff --git a/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs
index 1bc3b69c9..2a8d15bb3 100644
--- a/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.core.prefs
@@ -7,6 +7,15 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
@@ -17,6 +26,7 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=error
@@ -28,6 +38,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -35,6 +46,7 @@ org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=error
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
@@ -45,7 +57,9 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
@@ -54,43 +68,66 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=error
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.ui.prefs b/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.ui.prefs
index 27b88105a..d129c3877 100644
--- a/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.ui.prefs
+++ b/bundles/org.eclipse.ui.net/.settings/org.eclipse.jdt.ui.prefs
@@ -8,22 +8,22 @@ org.eclipse.jdt.ui.staticondemandthreshold=99
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\r\n * Copyright (c) ${year} IBM Corporation and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n *******************************************************************************/\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
sp_cleanup.add_default_serial_version_id=false
sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=false
-sp_cleanup.add_missing_deprecated_annotations=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=false
-sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=false
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_functional_interfaces=true
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=true
sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.make_local_variable_final=false
sp_cleanup.make_parameters_final=false
@@ -33,20 +33,20 @@ sp_cleanup.make_variable_declarations_final=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=false
sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=false
+sp_cleanup.organize_imports=true
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=false
-sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_redundant_type_arguments=true
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_casts=true
sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_imports=true
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=false
sp_cleanup.remove_unused_private_members=false
@@ -57,7 +57,7 @@ sp_cleanup.sort_members_all=false
sp_cleanup.use_anonymous_class_creation=false
sp_cleanup.use_blocks=false
sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_lambda=false
+sp_cleanup.use_lambda=true
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
diff --git a/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
index 9eaa28c7c..c638fc594 100644
--- a/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
@@ -13,3 +13,4 @@ Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.ui.internal.net;x-internal:=true,
org.eclipse.ui.internal.net.auth;x-internal:=true
+Automatic-Module-Name: org.eclipse.ui.net
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/Activator.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/Activator.java
index 581c6818f..deeac4049 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/Activator.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -43,10 +43,12 @@ public class Activator extends AbstractUIPlugin {
return plugin;
}
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
}
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsComposite.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsComposite.java
index efa726d95..c8b5755dc 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsComposite.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,28 +23,14 @@ import org.eclipse.core.internal.net.StringUtil;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.*;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.*;
/**
* This class is the Composite that consists of controls for proxy bypass hosts
@@ -59,7 +45,7 @@ public class NonProxyHostsComposite extends Composite {
private Button removeButton;
protected String currentProvider;
- private ArrayList bypassHosts = new ArrayList();
+ private ArrayList<ProxyBypassData> bypassHosts = new ArrayList<>();
NonProxyHostsComposite(Composite parent, int style) {
super(parent, style);
@@ -100,31 +86,37 @@ public class NonProxyHostsComposite extends Composite {
hostsViewer
.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
enableButtons();
}
});
hostsViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
setProvider(currentProvider);
}
});
hostsViewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
editSelection();
}
});
addButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
addHost();
}
});
editButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
editSelection();
}
});
removeButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
removeSelection();
}
@@ -134,6 +126,7 @@ public class NonProxyHostsComposite extends Composite {
enableButtons();
}
+ @Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
hostsViewer.getTable().setEnabled(enabled);
@@ -155,9 +148,8 @@ public class NonProxyHostsComposite extends Composite {
}
private boolean isSelectionEditable() {
- IStructuredSelection selection = (IStructuredSelection) hostsViewer
- .getSelection();
- Iterator iterator = selection.iterator();
+ IStructuredSelection selection = hostsViewer.getStructuredSelection();
+ Iterator<?> iterator = selection.iterator();
boolean editable = iterator.hasNext();
while (iterator.hasNext()) {
String provider = ((ProxyBypassData) iterator.next()).getSource();
@@ -191,9 +183,9 @@ public class NonProxyHostsComposite extends Composite {
}
protected void removeSelection() {
- IStructuredSelection selection = (IStructuredSelection) hostsViewer
- .getSelection();
- Iterator it = selection.iterator();
+ IStructuredSelection selection = hostsViewer
+ .getStructuredSelection();
+ Iterator<?> it = selection.iterator();
while (it.hasNext()) {
ProxyBypassData data = (ProxyBypassData) it.next();
bypassHosts.remove(data);
@@ -205,8 +197,8 @@ public class NonProxyHostsComposite extends Composite {
if (!isSelectionEditable()) {
return;
}
- IStructuredSelection selection = (IStructuredSelection) hostsViewer
- .getSelection();
+ IStructuredSelection selection = hostsViewer.getStructuredSelection();
+ @SuppressWarnings("unchecked")
String selectedHosts = getStringList(selection.iterator());
String hosts[] = promptForHost(selectedHosts);
if (hosts != null) {
@@ -219,15 +211,15 @@ public class NonProxyHostsComposite extends Composite {
}
}
- String getStringList(Iterator iterator) {
+ String getStringList(Iterator<ProxyBypassData> iterator) {
StringBuilder buffer = new StringBuilder();
if (iterator.hasNext()) {
- ProxyBypassData data = (ProxyBypassData) iterator.next();
+ ProxyBypassData data = iterator.next();
buffer.append(data.getHost());
}
while (iterator.hasNext()) {
buffer.append(';');
- ProxyBypassData data = (ProxyBypassData) iterator.next();
+ ProxyBypassData data = iterator.next();
buffer.append(data.getHost());
}
return buffer.toString();
@@ -239,6 +231,7 @@ public class NonProxyHostsComposite extends Composite {
NetUIMessages.ProxyBypassDialog_1, selectedHosts, null) {
private ControlDecoration decorator;
+ @Override
protected Control createDialogArea(Composite parent) {
Control createDialogArea = super.createDialogArea(parent);
decorator = new ControlDecoration(getText(), SWT.TOP | SWT.LEFT);
@@ -250,6 +243,7 @@ public class NonProxyHostsComposite extends Composite {
return createDialogArea;
}
+ @Override
public boolean close() {
decorator.dispose();
return super.close();
@@ -259,13 +253,13 @@ public class NonProxyHostsComposite extends Composite {
if (result != Window.CANCEL) {
String value = dialog.getValue();
String hosts[] = StringUtil.split(value, new String[] { ";", "|" }); //$NON-NLS-1$ //$NON-NLS-2$
- ArrayList filtered = new ArrayList();
+ ArrayList<String> filtered = new ArrayList<>();
for (int i = 0; i < hosts.length; i++) {
if (hosts[i].length() != 0) {
filtered.add(hosts[i]);
}
}
- return (String[]) filtered.toArray(new String[0]);
+ return filtered.toArray(new String[0]);
}
return null;
}
@@ -292,10 +286,10 @@ public class NonProxyHostsComposite extends Composite {
} else {
currentProvider = item;
}
- ArrayList selected = new ArrayList();
- Iterator it = bypassHosts.iterator();
+ ArrayList<ProxyBypassData> selected = new ArrayList<>();
+ Iterator<ProxyBypassData> it = bypassHosts.iterator();
while (it.hasNext()) {
- ProxyBypassData data = (ProxyBypassData) it.next();
+ ProxyBypassData data = it.next();
if (data.getSource().equalsIgnoreCase(item)) {
selected.add(data);
}
@@ -306,24 +300,24 @@ public class NonProxyHostsComposite extends Composite {
public void performApply() {
String provider = getEditableProvider();
- Iterator it = bypassHosts.iterator();
- ArrayList hosts = new ArrayList();
+ Iterator<ProxyBypassData> it = bypassHosts.iterator();
+ ArrayList<String> hosts = new ArrayList<>();
while (it.hasNext()) {
- ProxyBypassData data = (ProxyBypassData) it.next();
+ ProxyBypassData data = it.next();
if (data.getSource().equals(provider)) {
hosts.add(data.getHost());
}
}
- String data[] = (String[]) hosts.toArray(new String[0]);
+ String data[] = hosts.toArray(new String[0]);
ProxySelector.setBypassHosts(provider, data);
}
public void refresh() {
- ArrayList natives = new ArrayList();
+ ArrayList<ProxyBypassData> natives = new ArrayList<>();
String provider = getEditableProvider();
- Iterator it = bypassHosts.iterator();
+ Iterator<ProxyBypassData> it = bypassHosts.iterator();
while (it.hasNext()) {
- ProxyBypassData data = (ProxyBypassData) it.next();
+ ProxyBypassData data = it.next();
if (!data.getSource().equals(provider)) {
natives.add(data);
}
@@ -339,8 +333,8 @@ public class NonProxyHostsComposite extends Composite {
setProvider(currentProvider);
}
- private List getProxyBypassData(String provider) {
- List bypassProxyData = new ArrayList();
+ private List<ProxyBypassData> getProxyBypassData(String provider) {
+ List<ProxyBypassData> bypassProxyData = new ArrayList<>();
String[] hosts = ProxySelector.getBypassHosts(provider);
for (int j = 0; hosts != null && j < hosts.length; j++) {
ProxyBypassData data = new ProxyBypassData(hosts[j], provider);
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsContentProvider.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsContentProvider.java
index 5f88adac1..13f5deb71 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsContentProvider.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,15 +24,19 @@ public class NonProxyHostsContentProvider implements IStructuredContentProvider
super();
}
+ @Override
public void dispose() {
// Do nothing
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
public Object[] getElements(Object inputElement) {
Collection coll = (Collection) inputElement;
return coll.toArray(new ProxyBypassData[0]);
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// Do nothing
}
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsLabelProvider.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsLabelProvider.java
index 46dd140d6..f9ab37002 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsLabelProvider.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NonProxyHostsLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,11 +14,7 @@
package org.eclipse.ui.internal.net;
import org.eclipse.core.internal.net.ProxySelector;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
@@ -32,10 +28,12 @@ public class NonProxyHostsLabelProvider extends BaseLabelProvider implements
super();
}
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
+ @Override
public String getColumnText(Object element, int columnIndex) {
if (element == null) {
return null;
@@ -53,6 +51,7 @@ public class NonProxyHostsLabelProvider extends BaseLabelProvider implements
}
}
+ @Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
@@ -70,6 +69,7 @@ public class NonProxyHostsLabelProvider extends BaseLabelProvider implements
}
}
+ @Override
public Color getBackground(Object element) {
if (element instanceof ProxyBypassData) {
String provider = ((ProxyBypassData) element).getSource();
@@ -81,6 +81,7 @@ public class NonProxyHostsLabelProvider extends BaseLabelProvider implements
return null;
}
+ @Override
public Color getForeground(Object element) {
return null;
}
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesComposite.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesComposite.java
index 9e0b2f163..eb3eb374b 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesComposite.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,27 +16,14 @@ import java.util.List;
import org.eclipse.core.internal.net.ProxyData;
import org.eclipse.core.internal.net.ProxySelector;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.*;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.*;
/**
* This class is the Composite that consists of the controls for proxy entries
@@ -51,7 +38,7 @@ public class ProxyEntriesComposite extends Composite {
private Button removeButton;
protected String currentProvider;
- private ArrayList proxyEntries = new ArrayList();
+ private ArrayList<ProxyData> proxyEntries = new ArrayList<>();
ProxyEntriesComposite(Composite parent, int style) {
super(parent, style);
@@ -97,32 +84,22 @@ public class ProxyEntriesComposite extends Composite {
removeButton = createButton(NetUIMessages.ProxyPreferencePage_11);
entriesViewer
- .addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- enableButtons();
- }
- });
- entriesViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- setProvider(currentProvider);
- }
- });
- entriesViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- editSelection();
- }
- });
+ .addSelectionChangedListener(event -> enableButtons());
+ entriesViewer.addCheckStateListener(event -> setProvider(currentProvider));
+ entriesViewer.addDoubleClickListener(event -> editSelection());
// addButton.addSelectionListener(new SelectionAdapter() {
// public void widgetSelected(SelectionEvent e) {
// addEntry();
// }
// });
editButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
editSelection();
}
});
removeButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
removeSelection();
}
@@ -146,15 +123,13 @@ public class ProxyEntriesComposite extends Composite {
}
private boolean isSelectionEditable() {
- IStructuredSelection selection = (IStructuredSelection) entriesViewer
- .getSelection();
+ IStructuredSelection selection = entriesViewer.getStructuredSelection();
return isSelectionRemovable() && selection.size() == 1;
}
private boolean isSelectionRemovable() {
- IStructuredSelection selection = (IStructuredSelection) entriesViewer
- .getSelection();
- Iterator iterator = selection.iterator();
+ IStructuredSelection selection = entriesViewer.getStructuredSelection();
+ Iterator<?> iterator = selection.iterator();
boolean editable = iterator.hasNext();
while (iterator.hasNext()) {
String provider = ((ProxyData) iterator.next()).getSource();
@@ -166,16 +141,16 @@ public class ProxyEntriesComposite extends Composite {
}
protected void addEntry() {
- Iterator it = proxyEntries.iterator();
- ArrayList added = new ArrayList();
+ Iterator<ProxyData> it = proxyEntries.iterator();
+ ArrayList<String> added = new ArrayList<>();
String editableProvider = getEditableProvider();
while (it.hasNext()) {
- ProxyData data = (ProxyData) it.next();
+ ProxyData data = it.next();
if (data.getSource().equalsIgnoreCase(editableProvider)) {
added.add(data.getType());
}
}
- String addedArray[] = (String[]) added.toArray(new String[0]);
+ String addedArray[] = added.toArray(new String[0]);
ProxyData data = promptForEntry(null, addedArray,
NetUIMessages.ProxyEntryDialog_0);
if (data != null) {
@@ -210,25 +185,25 @@ public class ProxyEntriesComposite extends Composite {
if (!isSelectionRemovable()) {
return;
}
- Iterator itsel = ((IStructuredSelection) entriesViewer.getSelection()).iterator();
+ Iterator<?> itsel = entriesViewer.getStructuredSelection().iterator();
ProxyData toEdit = null;
if (itsel.hasNext()) {
toEdit = ((ProxyData) itsel.next());
} else {
return;
}
- Iterator it = proxyEntries.iterator();
- ArrayList added = new ArrayList();
+ Iterator<ProxyData> it = proxyEntries.iterator();
+ ArrayList<String> added = new ArrayList<>();
String editableProvider = getEditableProvider();
while (it.hasNext()) {
- ProxyData data = (ProxyData) it.next();
+ ProxyData data = it.next();
if (data.getSource().equalsIgnoreCase(editableProvider)) {
if (data.getType() != toEdit.getType()) {
added.add(data.getType());
}
}
}
- String addedArray[] = (String[]) added.toArray(new String[0]);
+ String addedArray[] = added.toArray(new String[0]);
ProxyData data = promptForEntry(toEdit, addedArray,
NetUIMessages.ProxyEntryDialog_1);
if (data != null) {
@@ -237,9 +212,8 @@ public class ProxyEntriesComposite extends Composite {
}
protected void removeSelection() {
- IStructuredSelection selection = (IStructuredSelection) entriesViewer
- .getSelection();
- Iterator it = selection.iterator();
+ IStructuredSelection selection = entriesViewer.getStructuredSelection();
+ Iterator<?> it = selection.iterator();
while (it.hasNext()) {
ProxyData data = (ProxyData) it.next();
data.setHost(""); //$NON-NLS-1$
@@ -272,10 +246,10 @@ public class ProxyEntriesComposite extends Composite {
} else {
currentProvider = item;
}
- ArrayList checked = new ArrayList();
- Iterator it = proxyEntries.iterator();
+ ArrayList<ProxyData> checked = new ArrayList<>();
+ Iterator<ProxyData> it = proxyEntries.iterator();
while (it.hasNext()) {
- ProxyData data = (ProxyData) it.next();
+ ProxyData data = it.next();
if (data.getSource().equalsIgnoreCase(item)) {
checked.add(data);
}
@@ -285,24 +259,24 @@ public class ProxyEntriesComposite extends Composite {
public void performApply() {
String provider = getEditableProvider();
- Iterator it = proxyEntries.iterator();
- ArrayList proxies = new ArrayList();
+ Iterator<ProxyData> it = proxyEntries.iterator();
+ ArrayList<ProxyData> proxies = new ArrayList<>();
while (it.hasNext()) {
- ProxyData data = (ProxyData) it.next();
+ ProxyData data = it.next();
if (data.getSource().equals(provider)) {
proxies.add(data);
}
}
- ProxyData data[] = (ProxyData[]) proxies.toArray(new ProxyData[0]);
+ ProxyData data[] = proxies.toArray(new ProxyData[0]);
ProxySelector.setProxyData(provider, data);
}
public void refresh() {
String provider = getEditableProvider();
- Iterator it = proxyEntries.iterator();
- ArrayList natives = new ArrayList();
+ Iterator<ProxyData> it = proxyEntries.iterator();
+ ArrayList<ProxyData> natives = new ArrayList<>();
while (it.hasNext()) {
- ProxyData data = (ProxyData) it.next();
+ ProxyData data = it.next();
if (!data.getSource().equals(provider)) {
natives.add(data);
}
@@ -318,8 +292,8 @@ public class ProxyEntriesComposite extends Composite {
setProvider(currentProvider);
}
- private List getProxyData(String provider) {
- List proxyDatas = new ArrayList();
+ private List<ProxyData> getProxyData(String provider) {
+ List<ProxyData> proxyDatas = new ArrayList<>();
ProxyData[] entries = ProxySelector.getProxyData(provider);
for (int j = 0; j < entries.length; j++) {
entries[j].setSource(provider);
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesContentProvider.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesContentProvider.java
index bb3b4b6f6..4c212a083 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesContentProvider.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,15 +22,19 @@ public class ProxyEntriesContentProvider implements IStructuredContentProvider {
super();
}
+ @Override
public void dispose() {
// Do nothing
}
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
public Object[] getElements(Object inputElement) {
Collection coll = (Collection) inputElement;
return coll.toArray(new ProxyData[0]);
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// Do nothing
}
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesLabelProvider.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesLabelProvider.java
index 1a1414ce3..97c35121f 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesLabelProvider.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntriesLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,21 +10,15 @@
*******************************************************************************/
package org.eclipse.ui.internal.net;
+import org.eclipse.core.internal.net.ProxyData;
+import org.eclipse.core.internal.net.ProxySelector;
+import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.core.internal.net.ProxyData;
-import org.eclipse.core.internal.net.ProxySelector;
-
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-
public class ProxyEntriesLabelProvider extends BaseLabelProvider implements
ITableLabelProvider, IColorProvider {
@@ -32,10 +26,12 @@ public class ProxyEntriesLabelProvider extends BaseLabelProvider implements
super();
}
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
+ @Override
public String getColumnText(Object element, int columnIndex) {
if (element == null) {
return null;
@@ -79,6 +75,7 @@ public class ProxyEntriesLabelProvider extends BaseLabelProvider implements
}
}
+ @Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
@@ -101,6 +98,7 @@ public class ProxyEntriesLabelProvider extends BaseLabelProvider implements
}
}
+ @Override
public Color getBackground(Object element) {
if (element instanceof ProxyData) {
String provider = ((ProxyData) element).getSource();
@@ -112,6 +110,7 @@ public class ProxyEntriesLabelProvider extends BaseLabelProvider implements
return null;
}
+ @Override
public Color getForeground(Object element) {
return null;
}
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java
index fa04e08a0..87d1edae5 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyEntryDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,18 +19,10 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.StatusDialog;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.*;
public class ProxyEntryDialog extends StatusDialog {
@@ -66,6 +58,7 @@ public class ProxyEntryDialog extends StatusDialog {
return data;
}
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(4, false));
@@ -120,11 +113,7 @@ public class ProxyEntryDialog extends StatusDialog {
passwordText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true,
3, 1));
- ModifyListener validationListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updateStatus();
- }
- };
+ ModifyListener validationListener = e -> updateStatus();
typeText.addModifyListener(validationListener);
hostText.addModifyListener(validationListener);
portText.addModifyListener(validationListener);
@@ -132,11 +121,13 @@ public class ProxyEntryDialog extends StatusDialog {
passwordText.addModifyListener(validationListener);
requiresAuthentificationButton
.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
enableButtons();
updateStatus();
}
+ @Override
public void widgetSelected(SelectionEvent e) {
enableButtons();
updateStatus();
@@ -150,15 +141,18 @@ public class ProxyEntryDialog extends StatusDialog {
return composite;
}
+ @Override
public void create() {
super.create();
validateHostName();
}
+ @Override
public boolean isHelpAvailable() {
return false;
}
+ @Override
public boolean isResizable() {
return true;
}
@@ -199,8 +193,9 @@ public class ProxyEntryDialog extends StatusDialog {
return true;
}
+ @Override
protected void okPressed() {
- ((ProxyData) data).setType(typeText.getText());
+ data.setType(typeText.getText());
data.setHost(hostText.getText());
data.setPort(Integer.parseInt(portText.getText()));
if (requiresAuthentificationButton.getSelection()) {
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyPreferencePage.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyPreferencePage.java
index e0b532b4f..bf77f815a 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyPreferencePage.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyPreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,13 +25,8 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.*;
public class ProxyPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
@@ -43,6 +38,7 @@ public class ProxyPreferencePage extends PreferencePage implements
private ProxyEntriesComposite proxyEntriesComposite;
private NonProxyHostsComposite nonProxyHostsComposite;
+ @Override
protected Control createContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(1, false);
@@ -73,6 +69,7 @@ public class ProxyPreferencePage extends PreferencePage implements
providerLabel.setText(NetUIMessages.ProxyPreferencePage_0);
providerCombo = new Combo(composite, SWT.READ_ONLY | SWT.DROP_DOWN);
providerCombo.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
setProvider(ProxySelector.unlocalizeProvider(providerCombo.getText()));
}
@@ -91,10 +88,12 @@ public class ProxyPreferencePage extends PreferencePage implements
true, true));
}
+ @Override
public void init(IWorkbench workbench) {
// Nothing to do
}
+ @Override
protected void performApply() {
refresh();
int sel = providerCombo.getSelectionIndex();
@@ -104,6 +103,7 @@ public class ProxyPreferencePage extends PreferencePage implements
.unlocalizeProvider(providerCombo.getItem(sel)));
}
+ @Override
protected void performDefaults() {
int index = 1;
if (providerCombo.getItemCount() == 3) {
@@ -113,6 +113,7 @@ public class ProxyPreferencePage extends PreferencePage implements
setProvider(ProxySelector.unlocalizeProvider(providerCombo.getItem(index)));
}
+ @Override
public boolean performOk() {
performApply();
return super.performOk();
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/NetAuthenticator.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/NetAuthenticator.java
index e1e9a9c52..dd4b4344b 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/NetAuthenticator.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/NetAuthenticator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,9 +14,7 @@ import java.net.*;
public class NetAuthenticator extends Authenticator {
- /*
- * @see Authenticator#getPasswordAuthentication()
- */
+ @Override
protected PasswordAuthentication getPasswordAuthentication() {
// String protocol = getRequestingProtocol();
InetAddress address = getRequestingSite(); // can be null;
diff --git a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java
index 622168ba8..a74d1495e 100644
--- a/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java
+++ b/bundles/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,6 +42,8 @@ public class UserValidationDialog extends Dialog {
final String message) {
class UIOperation implements Runnable {
public Authentication authentication;
+
+ @Override
public void run() {
authentication = UserValidationDialog.askForAuthentication(
host, message);
@@ -83,12 +85,14 @@ public class UserValidationDialog extends Dialog {
}
/**
*/
+ @Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(NetUIMessages.UserValidationDialog_0);
}
/**
*/
+ @Override
public void create() {
super.create();
//give focus to username field
@@ -97,6 +101,7 @@ public class UserValidationDialog extends Dialog {
}
/**
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite main = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -155,6 +160,7 @@ public class UserValidationDialog extends Dialog {
/**
* Notifies that the ok button of this dialog has been pressed.
*/
+ @Override
protected void okPressed() {
userAuthentication = new Authentication(usernameField.getText(),
passwordField.getText());

Back to the top