diff options
author | Alexander Kurtakov | 2016-12-08 13:42:29 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2016-12-08 13:42:29 +0000 |
commit | 6e0d743aa727b580561a08d9fc2b2953b40cc3c1 (patch) | |
tree | 26f5ef36b31137b2e0e27eedb392a57793b56681 | |
parent | 43de8b2da8c00569a086c2e99ec8d171bd401c31 (diff) | |
download | org.eclipse.dltk.python-6e0d743aa727b580561a08d9fc2b2953b40cc3c1.tar.gz org.eclipse.dltk.python-6e0d743aa727b580561a08d9fc2b2953b40cc3c1.tar.xz org.eclipse.dltk.python-6e0d743aa727b580561a08d9fc2b2953b40cc3c1.zip |
Move o.e.dltk.python.ui to Java 8.
Bump BREE and enable save actions to clean up warnings.
Change-Id: Ic199fa3e3f9b459525a442483c89f4fab29115c3
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
42 files changed, 391 insertions, 296 deletions
diff --git a/plugins/org.eclipse.dltk.python.ui/.classpath b/plugins/org.eclipse.dltk.python.ui/.classpath index 64c5e31..eca7bdb 100644 --- a/plugins/org.eclipse.dltk.python.ui/.classpath +++ b/plugins/org.eclipse.dltk.python.ui/.classpath @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/> diff --git a/plugins/org.eclipse.dltk.python.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.dltk.python.ui/.settings/org.eclipse.jdt.core.prefs index 61cfac4..e810b81 100644 --- a/plugins/org.eclipse.dltk.python.ui/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.dltk.python.ui/.settings/org.eclipse.jdt.core.prefs @@ -1,15 +1,109 @@ -#Fri Oct 22 23:47:01 CEST 2010 eclipse.preferences.version=1 +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.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +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=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +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=warning +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=ignore +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.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +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=ignore +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=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=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=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +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=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 @@ -88,9 +182,12 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert diff --git a/plugins/org.eclipse.dltk.python.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.dltk.python.ui/.settings/org.eclipse.jdt.ui.prefs index fdaa6bf..1aa00bf 100644 --- a/plugins/org.eclipse.dltk.python.ui/.settings/org.eclipse.jdt.ui.prefs +++ b/plugins/org.eclipse.dltk.python.ui/.settings/org.eclipse.jdt.ui.prefs @@ -1,4 +1,61 @@ -#Fri Oct 22 23:47:01 CEST 2010 eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile formatter_settings_version=11 +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=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=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +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_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=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=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +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=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +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=true +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=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +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=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=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/plugins/org.eclipse.dltk.python.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.dltk.python.ui/META-INF/MANIFEST.MF index 98a5899..e281e11 100644 --- a/plugins/org.eclipse.dltk.python.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.dltk.python.ui/META-INF/MANIFEST.MF @@ -19,9 +19,9 @@ Require-Bundle: org.eclipse.ui, org.eclipse.dltk.launching;bundle-version="0.0.0", org.eclipse.core.resources, org.eclipse.search -Eclipse-LazyStart: true +Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.dltk.python.internal.ui, org.eclipse.dltk.python.internal.ui.text, org.eclipse.dltk.python.ui, org.eclipse.dltk.python.ui.text -Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUI.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUI.java index 3634a3b..946331e 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUI.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUI.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui; @@ -24,9 +23,9 @@ public class PythonUI extends AbstractUIPlugin { // The shared instance private static PythonUI plugin; - + private PythonTextTools fPythonTextTools; - + /** * The constructor */ @@ -34,18 +33,12 @@ public class PythonUI extends AbstractUIPlugin { plugin = this; } - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ + @Override public void start(BundleContext context) throws Exception { super.start(context); } - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ + @Override public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); @@ -59,11 +52,11 @@ public class PythonUI extends AbstractUIPlugin { public static PythonUI getDefault() { return plugin; } - + public synchronized PythonTextTools getTextTools() { if (fPythonTextTools == null) fPythonTextTools= new PythonTextTools(true); return fPythonTextTools; - } + } } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUILanguageToolkit.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUILanguageToolkit.java index 827072b..b1ba893 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUILanguageToolkit.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUILanguageToolkit.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui; @@ -26,6 +25,7 @@ import org.eclipse.jface.preference.IPreferenceStore; public class PythonUILanguageToolkit extends AbstractDLTKUILanguageToolkit { private static ScriptElementLabels sInstance = new ScriptElementLabels() { + @Override protected void getScriptFolderLabel(IScriptFolder folder, StringBuffer buf) { String name = folder.getElementName(); @@ -34,14 +34,17 @@ public class PythonUILanguageToolkit extends AbstractDLTKUILanguageToolkit { } }; + @Override public ScriptElementLabels getScriptElementLabels() { return sInstance; } + @Override public IPreferenceStore getPreferenceStore() { return PythonUI.getDefault().getPreferenceStore(); } + @Override public IDLTKLanguageToolkit getCoreToolkit() { return PythonLanguageToolkit.getDefault(); } @@ -50,30 +53,37 @@ public class PythonUILanguageToolkit extends AbstractDLTKUILanguageToolkit { return PythonUI.getDefault().getDialogSettings(); } + @Override public String getPartitioningId() { return PythonConstants.PYTHON_PARTITIONING; } + @Override public String getEditorId(Object inputElement) { return PythonEditor.EDITOR_ID; } + @Override public String getInterpreterContainerId() { return "org.eclipse.dltk.python.launching.INTERPRETER_CONTAINER"; } + @Override public ScriptUILabelProvider createScriptUILabelProvider() { return null; } + @Override public boolean getProvideMembers(ISourceModule element) { return true; } + @Override public ScriptTextTools getTextTools() { return PythonUI.getDefault().getTextTools(); } + @Override public ScriptSourceViewerConfiguration createSourceViewerConfiguration() { return new SimplePythonSourceViewerConfiguration(getTextTools() .getColorManager(), getPreferenceStore(), null, @@ -83,20 +93,23 @@ public class PythonUILanguageToolkit extends AbstractDLTKUILanguageToolkit { private static final String INTERPRETERS_PREFERENCE_PAGE_ID = "org.eclipse.dltk.python.preferences.interpreters"; private static final String DEBUG_PREFERENCE_PAGE_ID = "org.eclipse.dltk.python.preferences.debug"; private static final String[] EDITOR_PREFERENCE_PAGES_IDS = { - "org.eclipse.dltk.python.preferences.editor", - "org.eclipse.dltk.python.ui.editor.SyntaxColoring", - "org.eclipse.dltk.python.ui.editor.SmartTyping", + "org.eclipse.dltk.python.preferences.editor", + "org.eclipse.dltk.python.ui.editor.SyntaxColoring", + "org.eclipse.dltk.python.ui.editor.SmartTyping", "org.eclipse.dltk.python.ui.editor.PythonFolding" }; + @Override public String getInterpreterPreferencePage() { return INTERPRETERS_PREFERENCE_PAGE_ID; } + @Override public String getDebugPreferencePage() { return DEBUG_PREFERENCE_PAGE_ID; } + @Override public String[] getEditorPreferencePages() { return EDITOR_PREFERENCE_PAGES_IDS; } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUIPreferenceInitializer.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUIPreferenceInitializer.java index f184e20..20b30d7 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUIPreferenceInitializer.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/PythonUIPreferenceInitializer.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui; @@ -18,6 +17,7 @@ import org.eclipse.ui.editors.text.EditorsUI; public class PythonUIPreferenceInitializer extends AbstractPreferenceInitializer { + @Override public void initializeDefaultPreferences() { IPreferenceStore store = PythonUI.getDefault().getPreferenceStore(); diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonDocumentSetupParticipant.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonDocumentSetupParticipant.java index b0f43c0..fb41e86 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonDocumentSetupParticipant.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonDocumentSetupParticipant.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.editor; @@ -25,9 +24,7 @@ public class PythonDocumentSetupParticipant implements public PythonDocumentSetupParticipant() { } - /* - * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument) - */ + @Override public void setup(IDocument document) { PythonTextTools tools = PythonUI.getDefault().getTextTools(); tools.setupDocumentPartitioner(document, diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonEditor.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonEditor.java index 23756c7..047eb7c 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonEditor.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonEditor.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.editor; @@ -31,25 +30,30 @@ public class PythonEditor extends ScriptEditor { public static final String RULER_CONTEXT = "#PythonRulerContext"; + @Override protected void initializeEditor() { super.initializeEditor(); setEditorContextMenuId(EDITOR_CONTEXT); setRulerContextMenuId(RULER_CONTEXT); } + @Override public IPreferenceStore getScriptPreferenceStore() { return PythonUI.getDefault().getPreferenceStore(); } + @Override public ScriptTextTools getTextTools() { return PythonUI.getDefault().getTextTools(); } + @Override protected ScriptOutlinePage doCreateOutlinePage() { return new PythonOutlinePage(this, PythonUI.getDefault() .getPreferenceStore()); } + @Override protected void connectPartitioningToElement(IEditorInput input, IDocument document) { if (document instanceof IDocumentExtension3) { @@ -64,6 +68,7 @@ public class PythonEditor extends ScriptEditor { IFoldingStructureProvider fFoldingProvider = null; + @Override protected IFoldingStructureProvider getFoldingStructureProvider() { if (fFoldingProvider == null) { fFoldingProvider = new PythonFoldingStructureProvider(); @@ -71,18 +76,22 @@ public class PythonEditor extends ScriptEditor { return fFoldingProvider; } + @Override public String getEditorId() { return EDITOR_ID; } + @Override public IDLTKLanguageToolkit getLanguageToolkit() { return PythonLanguageToolkit.getDefault(); } + @Override public String getCallHierarchyID() { return null; } + @Override protected void initializeKeyBindingScopes() { setKeyBindingScopes(new String[] { "org.eclipse.dltk.ui.pythonEditorScope" }); //$NON-NLS-1$ } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonOutlinePage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonOutlinePage.java index 9543279..ab91b07 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonOutlinePage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/editor/PythonOutlinePage.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.editor; @@ -26,10 +25,11 @@ import org.eclipse.ui.IActionBars; public class PythonOutlinePage extends ScriptOutlinePage { public PythonOutlinePage(ScriptEditor editor, IPreferenceStore store) { - super(editor, store); + super(editor, store); } - + + @Override protected void registerSpecialToolbarActions(IActionBars actionBars) { IToolBarManager toolBarManager = actionBars.getToolBarManager(); @@ -39,7 +39,7 @@ public class PythonOutlinePage extends ScriptOutlinePage { ArrayList actions = new ArrayList(3); // fill-in actions variables - + title = ActionMessages.MemberFilterActionGroup_hide_variables_label; // TODO help support helpContext = "";// IDLTKHelpContextIds.FILTER_FIELDS_ACTION; @@ -53,7 +53,7 @@ public class PythonOutlinePage extends ScriptOutlinePage { "filter_fields.gif"); //$NON-NLS-1$ actions.add(hideVariables); - // procedures + // procedures title = ActionMessages.MemberFilterActionGroup_hide_functions_label; // TODO help support @@ -87,9 +87,9 @@ public class PythonOutlinePage extends ScriptOutlinePage { // order corresponds to order in toolbar MemberFilterAction[] fFilterActions = (MemberFilterAction[]) actions .toArray(new MemberFilterAction[actions.size()]); - + fMemberFilterActionGroup.setActions(fFilterActions); - + fMemberFilterActionGroup.contributeToToolBar(toolBarManager); } } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonBuildPathPropertyPage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonBuildPathPropertyPage.java index 775a9ff..3a9dfe5 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonBuildPathPropertyPage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonBuildPathPropertyPage.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.preferences; @@ -29,6 +28,7 @@ public class PythonBuildPathPropertyPage extends BuildPathsPropertyPage this, getSettings().getInt(INDEX), false, pageContainer); } + @Override public IDLTKLanguageToolkit getLanguageToolkit() { return PythonLanguageToolkit.getDefault(); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorColoringConfigurationBlock.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorColoringConfigurationBlock.java index 499623b..ce29e1c 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorColoringConfigurationBlock.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorColoringConfigurationBlock.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.preferences; @@ -41,7 +40,7 @@ public class PythonEditorColoringConfigurationBlock extends PythonPreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR, sCommentsCategory }, { PreferencesMessages.DLTKEditorPreferencePage_CommentTaskTags, - PythonPreferenceConstants.COMMENT_TASK_TAGS, + PythonPreferenceConstants.COMMENT_TASK_TAGS, sCommentsCategory }, { PreferencesMessages.DLTKEditorPreferencePage_keywords, PythonPreferenceConstants.EDITOR_KEYWORD_COLOR, @@ -80,10 +79,12 @@ public class PythonEditorColoringConfigurationBlock extends super(store); } + @Override protected String[][] getSyntaxColorListModel() { return fSyntaxColorListModel; } + @Override protected ProjectionViewer createPreviewViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles, IPreferenceStore store) { @@ -91,6 +92,7 @@ public class PythonEditorColoringConfigurationBlock extends showAnnotationsOverview, styles, store); } + @Override protected ScriptSourceViewerConfiguration createSimpleSourceViewerConfiguration( IColorManager colorManager, IPreferenceStore preferenceStore, ITextEditor editor, boolean configureFormatter) { @@ -99,11 +101,13 @@ public class PythonEditorColoringConfigurationBlock extends configureFormatter); } + @Override protected void setDocumentPartitioning(IDocument document) { PythonDocumentSetupParticipant participant = new PythonDocumentSetupParticipant(); participant.setup(document); } + @Override protected InputStream getPreviewContentReader() { return getClass().getResourceAsStream(PREVIEW_FILE_NAME); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorPreferencesPage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorPreferencesPage.java index 4142531..6d72901 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorPreferencesPage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorPreferencesPage.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.preferences; @@ -18,41 +17,31 @@ import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; - - - public class PythonEditorPreferencesPage extends AbstractConfigurationBlockPreferencePage { - /* - * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#getHelpId() - */ + @Override protected String getHelpId() { return ""; } - /* - * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription() - */ + @Override protected void setDescription() { String description = PythonPreferencesMessages.PythonEditorPreferencePage_general; setDescription(description); } + @Override protected Label createDescriptionLabel(Composite parent) { return null; } - /* - * @see org.org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setPreferenceStore() - */ + @Override protected void setPreferenceStore() { setPreferenceStore(PythonUI.getDefault().getPreferenceStore()); } - /* - * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#createConfigurationBlock(org.eclipse.ui.internal.editors.text.OverlayPreferenceStore) - */ + @Override protected IPreferenceConfigurationBlock createConfigurationBlock( OverlayPreferenceStore overlayPreferenceStore) { return new EditorConfigurationBlock(this, overlayPreferenceStore); diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorSyntaxColoringPreferencePage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorSyntaxColoringPreferencePage.java index 40a4855..9d97abd 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorSyntaxColoringPreferencePage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonEditorSyntaxColoringPreferencePage.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.preferences; @@ -21,35 +20,28 @@ import org.eclipse.swt.widgets.Label; public class PythonEditorSyntaxColoringPreferencePage extends AbstractConfigurationBlockPreferencePage { - /* - * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#getHelpId() - */ + @Override protected String getHelpId() { return ""; } - /* - * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription() - */ + @Override protected void setDescription() { String description = PreferencesMessages.DLTKEditorPreferencePage_colors; setDescription(description); } + @Override protected Label createDescriptionLabel(Composite parent) { return null; } - /* - * @see org.org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setPreferenceStore() - */ + @Override protected void setPreferenceStore() { setPreferenceStore(PythonUI.getDefault().getPreferenceStore()); } - /* - * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#createConfigurationBlock(org.eclipse.ui.internal.editors.text.OverlayPreferenceStore) - */ + @Override protected IPreferenceConfigurationBlock createConfigurationBlock( OverlayPreferenceStore overlayPreferenceStore) { return new PythonEditorColoringConfigurationBlock(overlayPreferenceStore); diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonFoldingPreferencePage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonFoldingPreferencePage.java index 7690dd8..b5359df 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonFoldingPreferencePage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonFoldingPreferencePage.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.preferences; @@ -27,26 +26,32 @@ import org.eclipse.swt.widgets.Label; public final class PythonFoldingPreferencePage extends AbstractConfigurationBlockPreferencePage { + @Override protected String getHelpId() { return null; } + @Override protected void setDescription() { // setDescription(PreferencesMessages.EditorPreferencePage_folding_title); } + @Override protected void setPreferenceStore() { setPreferenceStore(PythonUI.getDefault().getPreferenceStore()); } + @Override protected Label createDescriptionLabel(Composite parent) { return null; // no description for new look. } + @Override protected IPreferenceConfigurationBlock createConfigurationBlock( OverlayPreferenceStore overlayPreferenceStore) { return new DefaultFoldingPreferenceConfigurationBlock( overlayPreferenceStore, this) { + @Override protected IFoldingPreferenceBlock createSourceCodeBlock( OverlayPreferenceStore store, PreferencePage page) { return new PythonFoldingPreferenceBlock(store, page); diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonGlobalConfigurationBlock.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonGlobalConfigurationBlock.java index 30f5bd4..6f96463 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonGlobalConfigurationBlock.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonGlobalConfigurationBlock.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.preferences; @@ -25,6 +24,7 @@ public class PythonGlobalConfigurationBlock extends AbstractConfigurationBlock { // TODO Auto-generated constructor stub } + @Override public Control createControl(Composite parent) { initializeDialogUnits(parent); diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonGlobalPreferencesPage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonGlobalPreferencesPage.java index e42896b..415fb51 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonGlobalPreferencesPage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonGlobalPreferencesPage.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.preferences; @@ -16,23 +15,27 @@ import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore; public class PythonGlobalPreferencesPage extends AbstractConfigurationBlockPreferencePage { + @Override protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) { // TODO Auto-generated method stub return new PythonGlobalConfigurationBlock(overlayPreferenceStore, this); } + @Override protected String getHelpId() { // TODO Auto-generated method stub return null; } + @Override protected void setDescription() { String description = PythonPreferencesMessages.PythonGlobalPreferencePage_description; setDescription(description); } + @Override protected void setPreferenceStore() { - setPreferenceStore(PythonUI.getDefault().getPreferenceStore()); + setPreferenceStore(PythonUI.getDefault().getPreferenceStore()); } } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonPropertyPage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonPropertyPage.java index ada47d3..08667d0 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonPropertyPage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonPropertyPage.java @@ -7,6 +7,7 @@ import org.eclipse.ui.dialogs.PropertyPage; public class PythonPropertyPage extends PropertyPage { + @Override protected Control createContents(Composite parent) { return new Composite(parent, SWT.NONE); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonSmartTypingConfigurationBlock.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonSmartTypingConfigurationBlock.java index 0208584..829a48a 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonSmartTypingConfigurationBlock.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonSmartTypingConfigurationBlock.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.preferences; @@ -23,7 +22,7 @@ import org.eclipse.swt.widgets.Control; /** * Configures Editor typing preferences. - * + * */ class PythonSmartTypingConfigurationBlock extends AbstractConfigurationBlock { @@ -42,7 +41,7 @@ class PythonSmartTypingConfigurationBlock extends AbstractConfigurationBlock { PythonPreferenceConstants.EDITOR_CLOSE_STRINGS)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey( OverlayPreferenceStore.BOOLEAN, - PythonPreferenceConstants.EDITOR_CLOSE_BRACKETS)); + PythonPreferenceConstants.EDITOR_CLOSE_BRACKETS)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey( OverlayPreferenceStore.BOOLEAN, PythonPreferenceConstants.EDITOR_SMART_TAB)); @@ -59,11 +58,12 @@ class PythonSmartTypingConfigurationBlock extends AbstractConfigurationBlock { /** * Creates page for mark occurrences preferences. - * + * * @param parent * the parent composite * @return the control for the preference page */ + @Override public Control createControl(Composite parent) { Composite control = new Composite(parent, SWT.NONE);// parent=scrolled GridLayout layout = new GridLayout(); @@ -125,6 +125,6 @@ class PythonSmartTypingConfigurationBlock extends AbstractConfigurationBlock { label = PythonPreferencesMessages.PythonSmartTypingConfigurationBlock_closeBrackets; addCheckBox(composite, label, PythonPreferenceConstants.EDITOR_CLOSE_BRACKETS, 0); - + } } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonSmartTypingPreferencePage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonSmartTypingPreferencePage.java index 24e2a5a..8acd149 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonSmartTypingPreferencePage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonSmartTypingPreferencePage.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.preferences; @@ -15,7 +14,6 @@ import org.eclipse.dltk.python.internal.ui.PythonUI; import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPreferencePage; import org.eclipse.dltk.ui.preferences.IPreferenceConfigurationBlock; import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore; -import org.eclipse.dltk.ui.preferences.PreferencesMessages; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; @@ -25,39 +23,35 @@ import org.eclipse.swt.widgets.Label; * The page for setting the editor options. */ public final class PythonSmartTypingPreferencePage extends AbstractConfigurationBlockPreferencePage { - - /* - * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription() - */ + + @Override protected void setDescription() { - String description= org.eclipse.dltk.python.internal.ui.preferences.PythonPreferencesMessages.PythonSmartTypingConfigurationBlock_typing_tabTitle; + String description= org.eclipse.dltk.python.internal.ui.preferences.PythonPreferencesMessages.PythonSmartTypingConfigurationBlock_typing_tabTitle; setDescription(description); } - - /* - * @see org.org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setPreferenceStore() - */ - protected void setPreferenceStore() { + + @Override + protected void setPreferenceStore() { setPreferenceStore(PythonUI.getDefault().getPreferenceStore()); } - - + + + @Override protected Label createDescriptionLabel(Composite parent) { return null; // no description for new look. } - - /* - * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#createConfigurationBlock(org.eclipse.ui.internal.editors.text.OverlayPreferenceStore) - */ + + @Override protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) { return new PythonSmartTypingConfigurationBlock(overlayPreferenceStore); } + @Override protected String getHelpId() { // TODO Auto-generated method stub return ""; } - + } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonTodoTaskPreferencePage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonTodoTaskPreferencePage.java index e4a5bd3..e973da3 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonTodoTaskPreferencePage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/preferences/PythonTodoTaskPreferencePage.java @@ -13,14 +13,17 @@ import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; public class PythonTodoTaskPreferencePage extends AbstractConfigurationBlockPropertyAndPreferencePage { + @Override protected String getHelpId() { return null; } + @Override protected void setDescription() { setDescription(PythonPreferencesMessages.TodoTaskDescription); } + @Override protected AbstractOptionsBlock createOptionsBlock( IStatusChangeListener newStatusChangedListener, IProject project, IWorkbenchPreferenceContainer container) { @@ -28,23 +31,28 @@ public class PythonTodoTaskPreferencePage extends container, PythonPlugin.PLUGIN_ID); } + @Override protected String getNatureId() { return PythonNature.NATURE_ID; } + @Override protected String getProjectHelpId() { return null; } + @Override protected void setPreferenceStore() { setPreferenceStore(new PreferencesAdapter(PythonPlugin.getDefault() .getPluginPreferences())); } + @Override protected String getPreferencePageId() { return "org.eclipse.dltk.python.preferences.todo"; //$NON-NLS-1$ } + @Override protected String getPropertyPageId() { return "org.eclipse.dltk.python.propertyPage.todo"; //$NON-NLS-1$ } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/rules/PythonFloatNumberRule.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/rules/PythonFloatNumberRule.java index 9ee00bb..26e837e 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/rules/PythonFloatNumberRule.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/rules/PythonFloatNumberRule.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.rules; @@ -34,6 +33,7 @@ public class PythonFloatNumberRule implements IRule { fColumn = column; } + @Override public IToken evaluate(ICharacterScanner scanner) { if( scanner.getColumn() > 0 ) { scanner.unread(); @@ -58,7 +58,7 @@ public class PythonFloatNumberRule implements IRule { } while (Character.isDigit((char) c)); if (c != 'e' && c != 'E') { scanner.unread(); - } + } if (p == '.') { scanner.unread(); return Token.UNDEFINED; diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/search/PythonSearchPage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/search/PythonSearchPage.java index be97b3b..721ff6e 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/search/PythonSearchPage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/search/PythonSearchPage.java @@ -9,9 +9,7 @@ import org.eclipse.dltk.ui.search.ScriptSearchPage; */ public class PythonSearchPage extends ScriptSearchPage { - /* - * @see org.eclipse.dltk.ui.search.ScriptSearchPage#getLanguageToolkit() - */ + @Override protected IDLTKLanguageToolkit getLanguageToolkit() { return PythonLanguageToolkit.getDefault(); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonCodeTemplatesPreferencePage.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonCodeTemplatesPreferencePage.java index e96f077..3b6dd1b 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonCodeTemplatesPreferencePage.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonCodeTemplatesPreferencePage.java @@ -15,33 +15,25 @@ import org.eclipse.jface.text.IDocument; public class PythonCodeTemplatesPreferencePage extends ScriptTemplatePreferencePage { - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplatePreferencePage#createSourceViewerConfiguration() - */ + @Override protected ScriptSourceViewerConfiguration createSourceViewerConfiguration() { return new SimplePythonSourceViewerConfiguration(getTextTools() .getColorManager(), getPreferenceStore(), null, IPythonPartitions.PYTHON_PARTITIONING, false); } - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplatePreferencePage#setDocumentParticioner(org.eclipse.jface.text.IDocument) - */ + @Override protected void setDocumentPartitioner(IDocument document) { getTextTools().setupDocumentPartitioner(document, IPythonPartitions.PYTHON_PARTITIONING); } - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplatePreferencePage#setPreferenceStore() - */ + @Override protected void setPreferenceStore() { setPreferenceStore(PythonUI.getDefault().getPreferenceStore()); } - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplatePreferencePage#getTemplateAccess() - */ + @Override protected ScriptTemplateAccess getTemplateAccess() { return PythonTemplateAccess.getInstance(); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonTemplateAccess.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonTemplateAccess.java index 6247f90..dc42fce 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonTemplateAccess.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonTemplateAccess.java @@ -21,23 +21,17 @@ public class PythonTemplateAccess extends ScriptTemplateAccess { return instance; } - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplateAccess#getContextTypeId() - */ + @Override protected String getContextTypeId() { return PythonUniversalTemplateContextType.CONTEXT_TYPE_ID; } - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplateAccess#getCustomTemplatesKey() - */ + @Override protected String getCustomTemplatesKey() { return CUSTOM_TEMPLATES_KEY; } - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplateAccess#getPreferenceStore() - */ + @Override protected IPreferenceStore getPreferenceStore() { return PythonUI.getDefault().getPreferenceStore(); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonTemplateCompletionProcessor.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonTemplateCompletionProcessor.java index 36d27c5..43d68c2 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonTemplateCompletionProcessor.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonTemplateCompletionProcessor.java @@ -17,23 +17,17 @@ public class PythonTemplateCompletionProcessor extends super(context); } - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplateCompletionProcessor#getContextTypeId() - */ + @Override protected String getContextTypeId() { return PythonUniversalTemplateContextType.CONTEXT_TYPE_ID; } - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplateCompletionProcessor#getIgnore() - */ + @Override protected char[] getIgnore() { return IGNORE; } - /* - * @see org.eclipse.dltk.ui.templates.ScriptTemplateCompletionProcessor#getTemplateAccess() - */ + @Override protected ScriptTemplateAccess getTemplateAccess() { return PythonTemplateAccess.getInstance(); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonUniversalTemplateContextType.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonUniversalTemplateContextType.java index 51e985c..fa4fc59 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonUniversalTemplateContextType.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/templates/PythonUniversalTemplateContextType.java @@ -9,11 +9,11 @@ public class PythonUniversalTemplateContextType extends ScriptTemplateContextType { public static final String CONTEXT_TYPE_ID = "pythonUniversalTemplateContextType"; - + public PythonUniversalTemplateContextType() { // empty constructor } - + public PythonUniversalTemplateContextType(String id, String name) { super(id, name); } @@ -22,6 +22,7 @@ public class PythonUniversalTemplateContextType extends super(id); } + @Override public ScriptTemplateContext createContext(IDocument document, int completionPosition, int length, ISourceModule sourceModule) { return new PythonTemplateContext(this, document, completionPosition, diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonAutoEditStrategy.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonAutoEditStrategy.java index 7b3dbe6..c40e24c 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonAutoEditStrategy.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonAutoEditStrategy.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.text; @@ -41,7 +40,7 @@ public class PythonAutoEditStrategy extends /* * possible prefereces: - * + * * general indent on/off smart tab key behaviour autoclose "strings", * 'strings' autoclose {brackets}, [], () smart paste */ @@ -68,7 +67,7 @@ public class PythonAutoEditStrategy extends /** * Returns the leading whitespaces and tabs. - * + * * @param document * - the document being parsed * @param line @@ -90,7 +89,7 @@ public class PythonAutoEditStrategy extends /** * Returns the leading whitespaces and tabs. - * + * * @param line * - the line being searched * @return the leading whitespace @@ -113,7 +112,7 @@ public class PythonAutoEditStrategy extends /** * Find line with number <=line, that is not empty and is not a comment line * starting with # - * + * * @param d * the document to search in * @param line @@ -137,7 +136,7 @@ public class PythonAutoEditStrategy extends /** * Fetched line from document - * + * * @param d * the document * @param line @@ -155,7 +154,7 @@ public class PythonAutoEditStrategy extends /** * Get partition type covering offset - * + * * @param d * @param offset * @return @@ -173,7 +172,7 @@ public class PythonAutoEditStrategy extends * Searchs an pair from offset, forward of backwards. Can skip strings and * comments (uses python partitioning). Doesn't goes more maxCharsAway chars * away from offset. - * + * * @param d * @param offset * @param forward @@ -248,7 +247,7 @@ public class PythonAutoEditStrategy extends /** * Finds line < <b>line</b>, such the indent of it is less than of * <b>line</b> - * + * * @param d * the document to search in * @param line @@ -274,7 +273,7 @@ public class PythonAutoEditStrategy extends /** * Calculates real length of string. So any char except \t has length 1, \t * has length 8. - * + * * @param str * string to process * @return length @@ -292,7 +291,7 @@ public class PythonAutoEditStrategy extends /** * Return pair to brace. Ex. '(' for ')', e.t.c. - * + * * @param b * input brace * @return peer brace @@ -321,7 +320,7 @@ public class PythonAutoEditStrategy extends /** * Installs a partitioner with <code>document</code>. - * + * * @param document * the document */ @@ -338,7 +337,7 @@ public class PythonAutoEditStrategy extends /** * Removes partitioner with <code>document</code>. - * + * * @param document * the document */ @@ -353,7 +352,7 @@ public class PythonAutoEditStrategy extends /** * Main indenting algorithm. Needs correct partitioning to work. - * + * * @param d * the processed document * @param line @@ -599,7 +598,7 @@ public class PythonAutoEditStrategy extends /** * If we have pressed ":" for example, than we need to reindent line. This * function changes document and sets correct indent for current line. - * + * * @param d * @param c */ @@ -622,7 +621,7 @@ public class PythonAutoEditStrategy extends /** * Processes command in work with brackets, strings, etc - * + * * @param d * @param c */ @@ -725,7 +724,7 @@ public class PythonAutoEditStrategy extends /** * When we have pressed \t, sometimes we wanna not to tabulate, and jump to * correct line start position. - * + * * @param d * @param c * @return @@ -791,7 +790,7 @@ public class PythonAutoEditStrategy extends /** * Reindents c.text when pasting. - * + * * @param d * @param c */ @@ -855,13 +854,7 @@ public class PythonAutoEditStrategy extends } - /* - * (non-Javadoc) - * - * @see - * org.eclipse.jface.text.IAutoEditStrategy#customizeDocumentCommand(org - * .eclipse.jface.text.IDocument, org.eclipse.jface.text.DocumentCommand) - */ + @Override public void customizeDocumentCommand(IDocument d, DocumentCommand c) { if (c.doit == false) return; diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonCodeScanner.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonCodeScanner.java index 2394bc5..aa148a0 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonCodeScanner.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonCodeScanner.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.text; @@ -39,10 +38,12 @@ public class PythonCodeScanner extends AbstractScriptScanner { initialize(); } + @Override protected String[] getTokenProperties() { return fgTokenProperties; } + @Override protected List createRules() { List/* <IRule> */rules = new ArrayList/* <IRule> */(); IToken keyword = getToken(PythonColorConstants.PYTHON_KEYWORD); @@ -58,17 +59,17 @@ public class PythonCodeScanner extends AbstractScriptScanner { // Add generic whitespace rule. rules.add(new WhitespaceRule(new PythonWhitespaceDetector())); // Add word rule for keywords, types, and constants. - + ScriptWordRule wordRule = new ScriptWordRule(new PythonWordDetector(), other); wordRule.addNextTokenAfterSeen("class", cls); wordRule.addNextTokenAfterSeen("def", def); - + for (int i = 0; i < fgKeywords.length; i++) { wordRule.addWord(fgKeywords[i], keyword); } wordRule.addWord(fgReturnKeyword, keywordReturn); - + rules.add(wordRule); rules.add(new WordRule(new PythonDecoratorDetector(), decorator)); rules.add(new PythonFloatNumberRule(number)); diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonDecoratorDetector.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonDecoratorDetector.java index bbe6350..ecd01a5 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonDecoratorDetector.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonDecoratorDetector.java @@ -1,33 +1,25 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ -/** - * - */ package org.eclipse.dltk.python.internal.ui.text; import org.eclipse.jface.text.rules.IWordDetector; class PythonDecoratorDetector implements IWordDetector{ - /** - * @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char) - */ - public boolean isWordStart(char c) { + @Override + public boolean isWordStart(char c) { return c == '@'; } - /** - * @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char) - */ - public boolean isWordPart(char c) { + @Override + public boolean isWordPart(char c) { return c != '\n' && c != '\r' && c != '('; } - + } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonPartitionScanner.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonPartitionScanner.java index 7b541f5..e6f4144 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonPartitionScanner.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonPartitionScanner.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.text; import java.util.ArrayList; @@ -26,24 +25,24 @@ public class PythonPartitionScanner extends RuleBasedPartitionScanner { */ public PythonPartitionScanner() { super(); - + IToken string = new Token( IPythonPartitions.PYTHON_STRING ); IToken comment = new Token( IPythonPartitions.PYTHON_COMMENT ); List/*< IPredicateRule >*/ rules= new ArrayList/*<IPredicateRule>*/(); - + rules.add(new EndOfLineRule("#", comment )); - + rules.add(new MultiLineRule("\"\"\"", "\"\"\"", string, '\\')); - + rules.add(new MultiLineRule("\'\'\'", "\'\'\'", string, '\\')); - + rules.add(new MultiLineRule("\'", "\'", string, '\\')); - + rules.add(new MultiLineRule("\"", "\"", string, '\\')); - - + + IPredicateRule[] result= new IPredicateRule[rules.size()]; rules.toArray(result); setPredicateRules(result); diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonSourceViewerConfiguration.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonSourceViewerConfiguration.java index 248f28c..c58462d 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonSourceViewerConfiguration.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonSourceViewerConfiguration.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.text; @@ -47,10 +46,12 @@ public class PythonSourceViewerConfiguration extends super(colorManager, preferenceStore, editor, partitioning); } + @Override public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { return IPythonPartitions.PYTHON_PARTITION_TYPES; } + @Override protected void initializeScanners() { Assert.isTrue(isNewSetup()); fCodeScanner = new PythonCodeScanner(getColorManager(), @@ -72,7 +73,7 @@ public class PythonSourceViewerConfiguration extends /** * Returns the Python string scanner for this configuration. - * + * * @return the Python string scanner */ protected RuleBasedScanner getStringScanner() { @@ -81,13 +82,14 @@ public class PythonSourceViewerConfiguration extends /** * Returns the Python comment scanner for this configuration. - * + * * @return the Python comment scanner */ protected RuleBasedScanner getCommentScanner() { return fCommentScanner; } + @Override public IPresentationReconciler getPresentationReconciler( ISourceViewer sourceViewer) { PresentationReconciler reconciler = new ScriptPresentationReconciler(); @@ -117,12 +119,13 @@ public class PythonSourceViewerConfiguration extends * Clients are not allowed to call this method if the old setup with text * tools is in use. * </p> - * + * * @param event * the event to which to adapt * @see PythonSourceViewerConfiguration#ScriptSourceViewerConfiguration(IColorManager, * IPreferenceStore, ITextEditor, String) */ + @Override public void handlePropertyChangeEvent(PropertyChangeEvent event) { Assert.isTrue(isNewSetup()); if (fCodeScanner.affectsBehavior(event)) @@ -134,24 +137,19 @@ public class PythonSourceViewerConfiguration extends /** * Determines whether the preference change encoded by the given event * changes the behavior of one of its contained components. - * + * * @param event * the event to be investigated * @return <code>true</code> if event causes a behavioral change - * + * */ + @Override public boolean affectsTextPresentation(PropertyChangeEvent event) { return fCodeScanner.affectsBehavior(event) || fStringScanner.affectsBehavior(event); } - /* - * (non-Javadoc) - * - * @see - * org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies - * (org.eclipse.jface.text.source.ISourceViewer, java.lang.String) - */ + @Override public IAutoEditStrategy[] getAutoEditStrategies( ISourceViewer sourceViewer, String contentType) { // TODO: check contentType. think, do we really need it? :) @@ -160,10 +158,12 @@ public class PythonSourceViewerConfiguration extends fPreferenceStore, partitioning) }; } + @Override protected ContentAssistPreference getContentAssistPreference() { return PythonContentAssistPreference.getDefault(); } + @Override protected void alterContentAssistant(ContentAssistant assistant) { PythonCompletionProcessor processor = new PythonCompletionProcessor( getEditor(), assistant, IDocument.DEFAULT_CONTENT_TYPE); diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonStringScanner.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonStringScanner.java index 2962039..690691b 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonStringScanner.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonStringScanner.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.text; @@ -21,7 +20,7 @@ import org.eclipse.jface.text.rules.WhitespaceRule; public class PythonStringScanner extends AbstractScriptScanner { private static final String[] fgTokenProperties = new String[] { - PythonColorConstants.PYTHON_STRING + PythonColorConstants.PYTHON_STRING }; public PythonStringScanner(IColorManager manager, IPreferenceStore store) { @@ -30,20 +29,22 @@ public class PythonStringScanner extends AbstractScriptScanner { initialize(); } - + + @Override protected String[] getTokenProperties() { return fgTokenProperties; } - + + @Override protected List createRules() { List/*<IRule>*/ rules = new ArrayList/*<IRule>*/(); // Add generic whitespace rule. rules.add(new WhitespaceRule(new PythonWhitespaceDetector())); - + //TODO: Add here % and %{name} variables handling. - + setDefaultReturnToken(getToken(PythonColorConstants.PYTHON_STRING)); return rules; diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonTextTools.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonTextTools.java index 62bf59f..dd08d9c 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonTextTools.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonTextTools.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.text; @@ -26,6 +25,7 @@ public class PythonTextTools extends ScriptTextTools { autoDisposeOnDisplayDispose); } + @Override public ScriptSourceViewerConfiguration createSourceViewerConfiguraton( IPreferenceStore preferenceStore, ITextEditor editor, String partitioning) { @@ -33,6 +33,7 @@ public class PythonTextTools extends ScriptTextTools { preferenceStore, editor, partitioning); } + @Override public IPartitionTokenScanner getPartitionScanner() { return new PythonPartitionScanner(); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonWhitespaceDetector.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonWhitespaceDetector.java index 2753129..6421e4a 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonWhitespaceDetector.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonWhitespaceDetector.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.text; @@ -16,9 +15,7 @@ import org.eclipse.jface.text.rules.IWhitespaceDetector; */ public class PythonWhitespaceDetector implements IWhitespaceDetector { - /* (non-Javadoc) - * Method declared on IWhitespaceDetector - */ + @Override public boolean isWhitespace(char character) { return Character.isWhitespace(character); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonWordDetector.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonWordDetector.java index 87239d1..8021393 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonWordDetector.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/PythonWordDetector.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.text; @@ -16,16 +15,12 @@ import org.eclipse.jface.text.rules.IWordDetector; */ public class PythonWordDetector implements IWordDetector { - /* (non-Javadoc) - * Method declared on IWordDetector. - */ + @Override public boolean isWordPart(char character) { return Character.isJavaIdentifierPart(character); } - - /* (non-Javadoc) - * Method declared on IWordDetector. - */ + + @Override public boolean isWordStart(char character) { return Character.isJavaIdentifierStart(character); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/SimplePythonSourceViewerConfiguration.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/SimplePythonSourceViewerConfiguration.java index 7911cea..6bf7678 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/SimplePythonSourceViewerConfiguration.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/SimplePythonSourceViewerConfiguration.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.text; @@ -21,15 +20,13 @@ import org.eclipse.jface.text.source.IAnnotationHover; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.ui.texteditor.ITextEditor; - - /** * A simple {@linkplain org.eclipse.dltk.ui.text.PythonSourceViewerConfiguration Python source viewer configuration}. * <p> * This simple source viewer configuration basically provides syntax coloring * and disables all other features like code assist, quick outlines, hyperlinking, etc. * </p> - * + * * */ public class SimplePythonSourceViewerConfiguration extends PythonSourceViewerConfiguration { @@ -51,52 +48,38 @@ public class SimplePythonSourceViewerConfiguration extends PythonSourceViewerCon super(colorManager, preferenceStore, editor, partitioning); fConfigureFormatter= configureFormatter; } - - /* - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String) - */ + + @Override public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) { return null; } - /* - * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer) - */ + @Override public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { return null; } - /* - * @see SourceViewerConfiguration#getOverviewRulerAnnotationHover(ISourceViewer) - */ + @Override public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) { return null; } - /* - * @see SourceViewerConfiguration#getConfiguredTextHoverStateMasks(ISourceViewer, String) - */ + @Override public int[] getConfiguredTextHoverStateMasks(ISourceViewer sourceViewer, String contentType) { return null; } - /* - * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String, int) - */ + @Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) { return null; } - /* - * @see SourceViewerConfiguration#getTextHover(ISourceViewer, String) - */ + @Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { return null; } - /* - * @see SourceViewerConfiguration#getContentFormatter(ISourceViewer) - */ + @Override public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) { if (fConfigureFormatter) return super.getContentFormatter(sourceViewer); @@ -104,37 +87,26 @@ public class SimplePythonSourceViewerConfiguration extends PythonSourceViewerCon return null; } - /* - * @see SourceViewerConfiguration#getInformationControlCreator(ISourceViewer) - */ + @Override public IInformationControlCreator getInformationControlCreator(ISourceViewer sourceViewer) { return null; } - /* - * @see SourceViewerConfiguration#getInformationPresenter(ISourceViewer) - */ + @Override public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) { return null; } - /* - * @see org.eclipse.dltk.ui.text.PythonSourceViewerConfiguration#getOutlinePresenter(org.eclipse.jface.text.source.ISourceViewer, boolean) - */ + @Override public IInformationPresenter getOutlinePresenter(ISourceViewer sourceViewer, boolean doCodeResolve) { return null; } - /* - * @see org.eclipse.dltk.ui.text.PythonSourceViewerConfiguration#getHierarchyPresenter(org.eclipse.jface.text.source.ISourceViewer, boolean) - */ public IInformationPresenter getHierarchyPresenter(ISourceViewer sourceViewer, boolean doCodeResolve) { return null; } - /* - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getHyperlinkDetectors(org.eclipse.jface.text.source.ISourceViewer) - */ + @Override public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { return null; } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/completion/PythonContentAssistPreference.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/completion/PythonContentAssistPreference.java index fac456e..b94238a 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/completion/PythonContentAssistPreference.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/completion/PythonContentAssistPreference.java @@ -16,9 +16,7 @@ public class PythonContentAssistPreference extends ContentAssistPreference { return instance; } - /* - * @see org.eclipse.dltk.ui.text.completion.ContentAssistPreference#getTextTools() - */ + @Override protected ScriptTextTools getTextTools() { return PythonUI.getDefault().getTextTools(); } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/completion/PythonTypeCompletionProposalComputer.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/completion/PythonTypeCompletionProposalComputer.java index 4168ab0..f9b0430 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/completion/PythonTypeCompletionProposalComputer.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/completion/PythonTypeCompletionProposalComputer.java @@ -9,6 +9,7 @@ import org.eclipse.jface.text.templates.TemplateCompletionProcessor; public class PythonTypeCompletionProposalComputer extends ScriptCompletionProposalComputer { + @Override protected TemplateCompletionProcessor createTemplateProposalComputer( ScriptContentAssistInvocationContext context) { return new PythonTemplateCompletionProcessor(context); diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/folding/PythonFoldingStructureProvider.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/folding/PythonFoldingStructureProvider.java index 3421366..4ab928d 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/folding/PythonFoldingStructureProvider.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/text/folding/PythonFoldingStructureProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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,31 +14,35 @@ import org.eclipse.dltk.python.ui.text.IPythonPartitions; import org.eclipse.dltk.ui.text.folding.AbstractASTFoldingStructureProvider; import org.eclipse.jface.text.rules.IPartitionTokenScanner; -/** - */ public class PythonFoldingStructureProvider extends AbstractASTFoldingStructureProvider { + @Override public String getCommentPartition() { return IPythonPartitions.PYTHON_COMMENT; } + @Override protected ILog getLog() { return PythonUI.getDefault().getLog(); } + @Override protected String getPartition() { return IPythonPartitions.PYTHON_PARTITIONING; } + @Override protected IPartitionTokenScanner getPartitionScanner() { return PythonUI.getDefault().getTextTools().getPartitionScanner(); } + @Override protected String[] getPartitionTypes() { return IPythonPartitions.PYTHON_PARTITION_TYPES; } + @Override protected String getNatureId() { return PythonNature.NATURE_ID; } diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/wizards/PythonProjectCreationWizard.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/wizards/PythonProjectCreationWizard.java index 83d78b9..2246450 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/wizards/PythonProjectCreationWizard.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/internal/ui/wizards/PythonProjectCreationWizard.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.internal.ui.wizards; @@ -52,6 +51,7 @@ public class PythonProjectCreationWizard extends ProjectWizard { .setDescription(PythonWizardMessages.ProjectCreationWizardFirstPage_description); addPage(fFirstPage); fSecondPage = new ProjectWizardSecondPage(fFirstPage) { + @Override protected BuildpathsBlock createBuildpathBlock( IStatusChangeListener listener) { return new PythonBuildPathsBlock( diff --git a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/ui/PythonPerspective.java b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/ui/PythonPerspective.java index 4f32524..1a11748 100644 --- a/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/ui/PythonPerspective.java +++ b/plugins/org.eclipse.dltk.python.ui/src/org/eclipse/dltk/python/ui/PythonPerspective.java @@ -1,11 +1,10 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.python.ui; @@ -18,6 +17,7 @@ import org.eclipse.ui.progress.IProgressConstants; public class PythonPerspective implements IPerspectiveFactory { + @Override public void createInitialLayout(IPageLayout layout) { String editorArea = layout.getEditorArea(); |