diff --git a/bundles/com.e1c.v8codestyle.form/markdown/form-list-ref-use-always-flag-disabled.md b/bundles/com.e1c.v8codestyle.form/markdown/form-list-ref-use-always-flag-disabled.md index 87ca2f09..221b5fbe 100644 --- a/bundles/com.e1c.v8codestyle.form/markdown/form-list-ref-use-always-flag-disabled.md +++ b/bundles/com.e1c.v8codestyle.form/markdown/form-list-ref-use-always-flag-disabled.md @@ -1,6 +1,6 @@ # Check if Use Always flag is enabled for the Reference attribute in dynamic list -In developing print commands (the Print subsystem of **Standard Subsystems Library**), the **Reference** attribute with the **Always Use** flag is required for these commands. +In developing print commands (the Print subsystem of **Standard Subsystems Library**), the **Reference** attribute with the **Use Always** flag is required for these commands. ## Noncompliant Code Example diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/FormListRefUseAlwaysFlagDisabledCheck.java b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/FormListRefUseAlwaysFlagDisabledCheck.java index 613d057e..068245cf 100644 --- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/FormListRefUseAlwaysFlagDisabledCheck.java +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/FormListRefUseAlwaysFlagDisabledCheck.java @@ -17,7 +17,6 @@ import static com._1c.g5.v8.dt.form.model.FormPackage.Literals.FORM_ATTRIBUTE; import static com._1c.g5.v8.dt.form.model.FormPackage.Literals.FORM_ATTRIBUTE__NOT_DEFAULT_USE_ALWAYS_ATTRIBUTES; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; import com._1c.g5.v8.dt.form.model.DynamicListExtInfo; import com._1c.g5.v8.dt.form.model.FormAttribute; @@ -39,7 +38,7 @@ public class FormListRefUseAlwaysFlagDisabledCheck { private static final String CHECK_ID = "form-list-ref-use-always-flag-disabled"; //$NON-NLS-1$ - private static final String REF_ABSTRACT_DATA_PATH = "List/Ref"; //$NON-NLS-1$ + private static final String REF_ABSTRACT_DATA_PATH = "/List/Ref"; //$NON-NLS-1$ @Override public String getCheckId() @@ -66,18 +65,21 @@ public class FormListRefUseAlwaysFlagDisabledCheck IProgressMonitor monitor) { - FormAttribute formAttribute = (FormAttribute)object; - - if (monitor.isCanceled() || !(object instanceof EObject)) + if (monitor.isCanceled() || !(object instanceof FormAttribute)) { return; } - if (formAttribute.getExtInfo() instanceof DynamicListExtInfo - && !formAttribute.getNotDefaultUseAlwaysAttributes().toString().trim().contains(REF_ABSTRACT_DATA_PATH)) + FormAttribute formAttribute = (FormAttribute)object; + if (formAttribute.getExtInfo() instanceof DynamicListExtInfo && formAttribute.getNotDefaultUseAlwaysAttributes() + .stream() + .noneMatch(p -> p.toString().equals(REF_ABSTRACT_DATA_PATH))) { - resultAceptor.addIssue(Messages.FormListRefUseAlwaysFlagDisabledCheck_UseAlways_flag_is_disabled_for_the_Ref_field, formAttribute); + resultAceptor.addIssue( + Messages.FormListRefUseAlwaysFlagDisabledCheck_UseAlways_flag_is_disabled_for_the_Ref_field, + formAttribute); } + } } diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages.properties b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages.properties index c9210b7e..b0d4e763 100644 --- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages.properties +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages.properties @@ -1,6 +1,6 @@ #Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/) ############################################################################### -# Copyright (C) 2022, 1C-Soft LLC and others. +# Copyright (C) 2021-2022, 1C-Soft LLC and others. # # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages_ru.properties b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages_ru.properties index fd12d34f..410b17b8 100644 --- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages_ru.properties +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/messages_ru.properties @@ -1,6 +1,6 @@ #Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/) ############################################################################### -# Copyright (C) 2022, 1C-Soft LLC and others. +# Copyright (C) 2021-2022, 1C-Soft LLC and others. # # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 @@ -19,8 +19,6 @@ FormListRefUseAlwaysFlagDisabledCheck_description = У реквизита "Сс FormListRefUseAlwaysFlagDisabledCheck_title = У реквизита "Ссылка" динамического списка выключен признак "Использовать всегда" -InputFieldListChoiceMode_Form_input_field_the_list_choice_mode_not_set_with_filled_choice_list = - InputFieldListChoiceMode_Form_input_field_the_list_choice_mode_not_set_with_filled_choice_list = У поля ввода формы с заполненным списком выбора отключено свойство "Режим выбора из списка" InputFieldListChoiceMode_description = Проверяет, что поле ввода содержит корректный режим ввыбора из списка, если список выбора заполнен