From dc54385eaedbf1e5c1c1f12ab308ad2fdff6d2b5 Mon Sep 17 00:00:00 2001 From: Vadim Geraskin Date: Wed, 6 Jul 2022 20:30:44 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20=D0=B2?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B5=20form-item?= =?UTF-8?q?s-single-event-handler=20#1059?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/check/EventHandlerChangeExtension.java | 7 ++++--- .../com/e1c/v8codestyle/form/check/messages.properties | 8 ++++---- .../com/e1c/v8codestyle/form/check/messages_ru.properties | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/EventHandlerChangeExtension.java b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/EventHandlerChangeExtension.java index 1e609047..6996bcfb 100644 --- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/EventHandlerChangeExtension.java +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/EventHandlerChangeExtension.java @@ -45,7 +45,7 @@ public class EventHandlerChangeExtension { OnModelFeatureChangeContextCollector collector = (IBmObject bmObject, EStructuralFeature feature, BmSubEvent bmEvent, CheckContextCollectingSession contextSession) -> { - if (isHandlerChanged(feature) || isItemRemoved(feature, bmEvent)) + if (isHandlerChanged(feature) || isItemChanged(feature, bmEvent)) { IBmObject top = bmObject.bmIsTop() ? bmObject : bmObject.bmGetTopObject(); if (top instanceof Form) @@ -68,13 +68,14 @@ public class EventHandlerChangeExtension || feature == FormPackage.Literals.EVENT_HANDLER_CONTAINER__HANDLERS; } - private boolean isItemRemoved(EStructuralFeature feature, BmSubEvent bmEvent) + private boolean isItemChanged(EStructuralFeature feature, BmSubEvent bmEvent) { if (feature == FormPackage.Literals.FORM_ITEM_CONTAINER__ITEMS) { for (Notification notification : ((BmChangeEvent)bmEvent).getNotifications(feature)) { - if (notification.getEventType() == Notification.REMOVE) + if (notification.getEventType() == Notification.ADD + || notification.getEventType() == Notification.REMOVE) { return true; } 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 834ab614..eea0177e 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 @@ -12,13 +12,13 @@ # 1C-Soft LLC - initial API and implementation # Manaev Konstantin - issue #855 ############################################################################### -FormItemsSingleEventHandlerCheck_description = An each event has a own handler +FormItemsSingleEventHandlerCheck_description = Each event in the form items should have a unique handler FormItemsSingleEventHandlerCheck_itemName_dot_eventName = {0}.{1} -FormItemsSingleEventHandlerCheck_the_handler_is_already_assigned_to_event = The "{0}" handler is already assigned to "{1}" +FormItemsSingleEventHandlerCheck_the_handler_is_already_assigned_to_event = The handler "{0}" is already assigned to "{1}" -FormItemsSingleEventHandlerCheck_title = An each event has a own handler +FormItemsSingleEventHandlerCheck_title = Event should have a unique handler FormListRefUseAlwaysFlagDisabledCheck_UseAlways_flag_is_disabled_for_the_Ref_field = UseAlways flag is disabled for the Ref field @@ -34,6 +34,6 @@ FormListRefUserVisibilityEnabledCheck_title = User visibility is not disabled fo InputFieldListChoiceMode_Form_input_field_the_list_choice_mode_not_set_with_filled_choice_list = Form input field the "list choice mode" not set with filled choice list -InputFieldListChoiceMode_description = Check input field has correct list choice mode if choice list is not empty +InputFieldListChoiceMode_description = Input field should have correct list choice mode if choice list is not empty InputFieldListChoiceMode_title = Form input field list choice mode 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 4337827f..5a85732a 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 @@ -14,13 +14,13 @@ ############################################################################### #Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/) -FormItemsSingleEventHandlerCheck_description = У каждого события своя процедура-обработчик +FormItemsSingleEventHandlerCheck_description = У каждого события должна быть назначена своя процедура-обработчик FormItemsSingleEventHandlerCheck_itemName_dot_eventName = {0}.{1} FormItemsSingleEventHandlerCheck_the_handler_is_already_assigned_to_event = Обработчик события "{0}" уже назначен для "{1}" -FormItemsSingleEventHandlerCheck_title = У каждого события своя процедура-обработчик +FormItemsSingleEventHandlerCheck_title = У события должен быть уникальный обработчик FormListRefUseAlwaysFlagDisabledCheck_UseAlways_flag_is_disabled_for_the_Ref_field = У реквизита "Ссылка" динамического списка выключен признак "Использовать всегда" @@ -36,6 +36,6 @@ FormListRefUserVisibilityEnabledCheck_title = У поля "Ссылка" таб InputFieldListChoiceMode_Form_input_field_the_list_choice_mode_not_set_with_filled_choice_list = У поля ввода формы с заполненным списком выбора отключено свойство "Режим выбора из списка" -InputFieldListChoiceMode_description = Проверяет, что поле ввода содержит корректный режим ввыбора из списка, если список выбора заполнен +InputFieldListChoiceMode_description = Поле ввода должно содержать корректный режим выбора из списка, если список выбора заполнен InputFieldListChoiceMode_title = Режим выбора из списка поля ввода формы