1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2025-07-17 13:07:50 +02:00

#856 Добавлена проверка одного обработчика для нескольких команд (#1115)

This commit is contained in:
Artem Iliukhin
2022-10-28 16:44:56 +03:00
committed by GitHub
parent 3b38873182
commit c53faa11a5
23 changed files with 1095 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#### Формы
- Один обработчик выполнения назначен нескольким элементам
#### Код модулей

View File

@ -21,6 +21,7 @@ Import-Package: com._1c.g5.v8.bm.core;version="[7.5.0,8.0.0)",
com._1c.g5.v8.dt.dcs.model.core;version="[2.6.0,3.0.0)",
com._1c.g5.v8.dt.dcs.model.schema;version="[2.2.0,3.0.0)",
com._1c.g5.v8.dt.form.model;version="[10.0.0,11.0.0)",
com._1c.g5.v8.dt.form.model.util;version="[7.2.0,8.0.0)",
com._1c.g5.v8.dt.form.service;version="[6.1.0,7.0.0)",
com._1c.g5.v8.dt.form.service.datasourceinfo;version="[3.0.0,4.0.0)",
com._1c.g5.v8.dt.mcore;version="[6.0.0,7.0.0)",

View File

@ -0,0 +1,18 @@
# Check handler has assigned to a single command
Check handler has assigned to a single command.
## Noncompliant Code Example
If you mix two event in a single procedure, its logic gets complicated and decreases its stability.
## Compliant Solution
Assign a handler for each event. If different actions are required in case of events in different form commands:
- Create a separate procedure or a function that executes the required action.
- Сreate a separate handler for each form item.
- Call the required procedure or function from each handler.
## See
[Module structure](https://kb.1ci.com/1C_Enterprise_Platform/Guides/Developer_Guides/1C_Enterprise_Development_Standards/Code_conventions/Module_formatting/Module_structure)

View File

@ -0,0 +1,20 @@
# У каждого действия команды должна быть назначена своя процедура-обработчик
У каждого действия команды должна быть назначена своя процедура-обработчик.
## Неправильно
Смешение нескольких событий в одной процедуре неоправданно усложняет ее логику и снижает ее стабильность
(вместо одного предусмотренного вызова по событию из платформы код процедуры должен рассчитывать и на другие вызовы).
## Правильно
У каждого события должна быть назначена своя процедура-обработчик.
Если одинаковые действия должны выполняться при возникновении событий в разных командах формы, следует:
- создать отдельную процедуру (функцию), выполняющую необходимые действия
- для каждого элемента формы создать отдельный обработчик с именем, назначаемым по умолчанию
- из каждого обработчика вызвать требуемую процедуру (функцию).
## См.
[Структура модуля](https://its.1c.ru/db/v8std/content/455/hdoc#2.4.3)

View File

@ -46,6 +46,10 @@
category="com.e1c.v8codestyle.form"
class="com.e1c.v8codestyle.internal.form.ExecutableExtensionFactory:com.e1c.v8codestyle.form.check.FormListFieldRefNotAddedCheck">
</check>
<check
category="com.e1c.v8codestyle.form"
class="com.e1c.v8codestyle.internal.form.ExecutableExtensionFactory:com.e1c.v8codestyle.form.check.FormCommandsSingleEventHandlerCheck">
</check>
</extension>
<extension
point="com.e1c.g5.v8.dt.check.fixes">

View File

@ -0,0 +1,84 @@
/*******************************************************************************
* Copyright (C) 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
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* 1C-Soft LLC - initial API and implementation
*******************************************************************************/
package com.e1c.v8codestyle.form.check;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import com._1c.g5.v8.bm.core.IBmObject;
import com._1c.g5.v8.bm.core.event.BmChangeEvent;
import com._1c.g5.v8.bm.core.event.BmSubEvent;
import com._1c.g5.v8.dt.form.model.Form;
import com._1c.g5.v8.dt.form.model.FormPackage;
import com.e1c.g5.v8.dt.check.ICheckDefinition;
import com.e1c.g5.v8.dt.check.components.IBasicCheckExtension;
import com.e1c.g5.v8.dt.check.context.CheckContextCollectingSession;
import com.e1c.g5.v8.dt.check.context.OnModelFeatureChangeContextCollector;
/**
* The extension that registers {@link Form} for model check if a command handler
* or an item contained in the form has been changed
*
* @author Artem Iliukhin
*/
public class CommandHandlerChangeExtension
implements IBasicCheckExtension
{
@Override
public void configureContextCollector(final ICheckDefinition definition)
{
OnModelFeatureChangeContextCollector collector = (IBmObject bmObject, EStructuralFeature feature,
BmSubEvent bmEvent, CheckContextCollectingSession contextSession) -> {
if (isActionChanged(feature) || isCommandChanged(feature, bmEvent))
{
IBmObject top = bmObject.bmIsTop() ? bmObject : bmObject.bmGetTopObject();
if (top instanceof Form)
{
contextSession.addModelCheck(top);
}
}
};
definition.addModelFeatureChangeContextCollector(collector, FormPackage.Literals.FORM_COMMAND);
Set<EClass> containdedObjects = new HashSet<>();
containdedObjects.add(FormPackage.Literals.FORM_COMMAND);
definition.addCheckedModelObjects(FormPackage.Literals.FORM, true, containdedObjects);
}
private boolean isActionChanged(EStructuralFeature feature)
{
return feature == FormPackage.Literals.FORM_COMMAND__ACTION;
}
private boolean isCommandChanged(EStructuralFeature feature, BmSubEvent bmEvent)
{
if (feature == FormPackage.Literals.FORM__FORM_COMMANDS)
{
for (Notification notification : ((BmChangeEvent)bmEvent).getNotifications(feature))
{
if (notification.getEventType() == Notification.ADD
|| notification.getEventType() == Notification.REMOVE)
{
return true;
}
}
}
return false;
}
}

View File

@ -0,0 +1,111 @@
/*******************************************************************************
* Copyright (C) 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
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* 1C-Soft LLC - initial API and implementation
*******************************************************************************/
package com.e1c.v8codestyle.form.check;
import static com._1c.g5.v8.dt.form.model.FormPackage.Literals.FORM;
import static com._1c.g5.v8.dt.form.model.FormPackage.Literals.FORM_COMMAND__ACTION;
import java.text.MessageFormat;
import java.util.Map;
import java.util.TreeMap;
import org.eclipse.core.runtime.IProgressMonitor;
import com._1c.g5.v8.dt.form.model.CommandHandler;
import com._1c.g5.v8.dt.form.model.Form;
import com._1c.g5.v8.dt.form.model.FormCommand;
import com._1c.g5.v8.dt.form.model.util.ModelUtils;
import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.components.BasicCheck;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.form.CorePlugin;
/**
* The check for the {@link Form} that each command is assigned to single action handler
*
* @author Artem Iliukhin
*/
public class FormCommandsSingleEventHandlerCheck
extends BasicCheck
{
private static final String CHECK_ID = "form-commands-single-action-handler"; //$NON-NLS-1$
@Override
public String getCheckId()
{
return CHECK_ID;
}
@Override
protected void configureCheck(CheckConfigurer builder)
{
builder.title(Messages.FormCommandsSingleEventHandlerCheck_Title)
.description(Messages.FormCommandsSingleEventHandlerCheck_Description)
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MAJOR)
.issueType(IssueType.WARNING)
.extension(new CommandHandlerChangeExtension())
.extension(new StandardCheckExtension(455, getCheckId(), CorePlugin.PLUGIN_ID))
.topObject(FORM)
.checkTop();
}
@Override
protected void check(Object object, ResultAcceptor resultAceptor, ICheckParameters parameters,
IProgressMonitor monitor)
{
if (!(object instanceof Form))
{
return;
}
Form form = (Form)object;
Map<String, String> handlers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
for (FormCommand formCommand : form.getFormCommands())
{
if (monitor.isCanceled())
{
return;
}
check(resultAceptor, handlers, formCommand);
}
}
private void check(ResultAcceptor resultAceptor, Map<String, String> handlers, FormCommand formCommand)
{
String commandName = formCommand.getName();
for (CommandHandler commandHandler : ModelUtils.getCommandHandlers(formCommand))
{
String nameHandler = commandHandler.getName();
if (handlers.containsKey(nameHandler))
{
resultAceptor.addIssue(
MessageFormat.format(
Messages.FormCommandsSingleEventHandlerCheck_Handler__0__command__1__assigned_to_command__2,
nameHandler, commandName, handlers.get(nameHandler)),
formCommand, FORM_COMMAND__ACTION);
}
else
{
handlers.put(nameHandler, commandName);
}
}
}
}

View File

@ -26,6 +26,9 @@ final class Messages
public static String DynamicListItemTitleCheck_Description;
public static String DynamicListItemTitleCheck_message;
public static String DynamicListItemTitleCheck_title;
public static String FormCommandsSingleEventHandlerCheck_Description;
public static String FormCommandsSingleEventHandlerCheck_Handler__0__command__1__assigned_to_command__2;
public static String FormCommandsSingleEventHandlerCheck_Title;
public static String FormItemsSingleEventHandlerCheck_description;
public static String FormItemsSingleEventHandlerCheck_itemName_dot_eventName;
public static String FormItemsSingleEventHandlerCheck_the_handler_is_already_assigned_to_event;

View File

@ -19,6 +19,12 @@ DynamicListItemTitleCheck_message = Title of field of dynamic list is not filled
DynamicListItemTitleCheck_title = Dynamic list field title is empty
FormCommandsSingleEventHandlerCheck_Description=Each event must have its own handler procedure
FormCommandsSingleEventHandlerCheck_Handler__0__command__1__assigned_to_command__2=The handler "{0}" of command "{1}" is already assigned to command {2}
FormCommandsSingleEventHandlerCheck_Title=One handler assigned to multiple commands
FormItemsSingleEventHandlerCheck_description = Each event in the form items should have a unique handler
FormItemsSingleEventHandlerCheck_itemName_dot_eventName = {0}.{1}

View File

@ -13,6 +13,12 @@
# Manaev Konstantin - issue #855
###############################################################################
FormCommandsSingleEventHandlerCheck_Description=У каждого события должна быть назначена своя процедура-обработчик
FormCommandsSingleEventHandlerCheck_Handler__0__command__1__assigned_to_command__2=Обработчик "{0}" команды "{1}" уже назначен для команды {2}
FormCommandsSingleEventHandlerCheck_Title=Один обработчик назначен нескольким командам
FormListFieldRefNotAddedCheck_The_Ref_field_is_not_added_to_dynamic_list = Реквизит "Ссылка" динамического списка не выведен в таблицу на форме
FormListFieldRefNotAddedCheck_description = Реквизит "Ссылка" динамического списка не выведен в таблицу на форме

View File

@ -0,0 +1,112 @@
/*******************************************************************************
* Copyright (C) 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
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* 1C-Soft LLC - initial API and implementation
*******************************************************************************/
package com.e1c.v8codestyle.form.check.itests;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.eclipse.core.runtime.IProgressMonitor;
import org.junit.Test;
import com._1c.g5.v8.bm.core.IBmObject;
import com._1c.g5.v8.bm.core.IBmTransaction;
import com._1c.g5.v8.bm.integration.AbstractBmTask;
import com._1c.g5.v8.bm.integration.IBmModel;
import com._1c.g5.v8.dt.core.platform.IDtProject;
import com._1c.g5.v8.dt.form.model.CommandHandler;
import com._1c.g5.v8.dt.form.model.Form;
import com._1c.g5.v8.dt.form.model.FormCommand;
import com._1c.g5.v8.dt.form.model.FormCommandHandlerContainer;
import com._1c.g5.v8.dt.form.model.FormFactory;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com.e1c.g5.v8.dt.testing.check.CheckTestBase;
import com.e1c.v8codestyle.form.check.FormCommandsSingleEventHandlerCheck;
/**
* Tests for {@link FormCommandsSingleEventHandlerCheck} check.
*
* @author Artem Iliukhin
*/
public class FormCommandsSingleEventHandlerCheckTest
extends CheckTestBase
{
private static final String CHECK_ID = "form-commands-single-action-handler"; //$NON-NLS-1$
private static final String PROJECT_NAME = "FormCommandsSingleEventHandlerCheck";
private static final String FQN_FORM = "Catalog.Catalog.Form.CompliantForm.Form";
private static final String FQN_FORM_NON_COMPLIANT = "Catalog.Catalog.Form.NonCompliantForm.Form";
@Test
public void testFormCommandHandlerRegion() throws Exception
{
IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME);
assertNotNull(dtProject);
IBmObject object = getTopObjectByFqn(FQN_FORM, dtProject);
assertTrue(object instanceof Form);
Marker marker = getFirstNestedMarker(CHECK_ID, object, dtProject);
assertNull(marker);
}
@Test
public void testFormCommandsOneHandlerRegion() throws Exception
{
IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME);
assertNotNull(dtProject);
IBmObject object = getTopObjectByFqn(FQN_FORM_NON_COMPLIANT, dtProject);
assertTrue(object instanceof Form);
Marker marker = getFirstNestedMarker(CHECK_ID, object, dtProject);
assertNotNull(marker);
}
@Test
public void testAddSameAction() throws Exception
{
IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME);
assertNotNull(dtProject);
IBmModel bmModel = bmModelManager.getModel(dtProject);
bmModel.execute(new AbstractBmTask<Void>("change")
{
@Override
public Void execute(IBmTransaction transaction, IProgressMonitor monitor)
{
Form form = (Form)transaction.getTopObjectByFqn(FQN_FORM);
FormCommand formCommand = form.getFormCommands().get(0);
CommandHandler handler = FormFactory.eINSTANCE.createCommandHandler();
handler.setName("Command2");
FormCommandHandlerContainer container = FormFactory.eINSTANCE.createFormCommandHandlerContainer();
container.setHandler(handler);
formCommand.setAction(container);
form.getFormCommands().add(formCommand);
return null;
}
});
waitForDD(dtProject);
IBmObject object = getTopObjectByFqn(FQN_FORM, dtProject);
assertTrue(object instanceof Form);
Marker marker = getFirstNestedMarker(CHECK_ID, object.bmGetId(), dtProject);
assertNotNull(marker);
}
}

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>FormCommandsSingleEventHandlerCheck</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>com._1c.g5.v8.dt.core.V8ConfigurationNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -0,0 +1,2 @@
Manifest-Version: 1.0
Runtime-Version: 8.3.19

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:Catalog xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="4672b0cb-df9f-4894-bc81-51b8501fc284">
<producedTypes>
<objectType typeId="cb4ef2e9-d7fc-4e49-8753-61107985ad19" valueTypeId="23d972b8-43e1-41b9-98b5-db3a4f572206"/>
<refType typeId="544b3a07-3b53-4809-9afa-56027fdacf50" valueTypeId="ce6275e1-865e-40e0-8547-e75ba8fba9b0"/>
<selectionType typeId="c0fa4c8b-a065-4777-bc5f-07aafd283246" valueTypeId="2c05c5cb-2bf3-4711-a6fa-ad0ab5d62576"/>
<listType typeId="84d401c1-33fc-445e-ad9e-c126ead25fc8" valueTypeId="eef8f4e6-0514-4179-ab61-b86480cb7c26"/>
<managerType typeId="c110c313-6f57-4fde-8039-5b0b91d2af8f" valueTypeId="b96e5e93-7a01-4345-bf83-02ad23c74330"/>
</producedTypes>
<name>Catalog</name>
<synonym>
<key>en</key>
<value>Catalog</value>
</synonym>
<useStandardCommands>true</useStandardCommands>
<inputByString>Catalog.Catalog.StandardAttribute.Code</inputByString>
<inputByString>Catalog.Catalog.StandardAttribute.Description</inputByString>
<fullTextSearchOnInputByString>DontUse</fullTextSearchOnInputByString>
<createOnInput>Use</createOnInput>
<dataLockControlMode>Managed</dataLockControlMode>
<fullTextSearch>Use</fullTextSearch>
<levelCount>2</levelCount>
<foldersOnTop>true</foldersOnTop>
<codeLength>9</codeLength>
<descriptionLength>25</descriptionLength>
<codeType>String</codeType>
<codeAllowedLength>Variable</codeAllowedLength>
<checkUnique>true</checkUnique>
<autonumbering>true</autonumbering>
<defaultPresentation>AsDescription</defaultPresentation>
<editType>InDialog</editType>
<choiceMode>BothWays</choiceMode>
<defaultObjectForm>Catalog.Catalog.Form.CompliantForm</defaultObjectForm>
<defaultListForm>Catalog.Catalog.Form.NonCompliantForm</defaultListForm>
<forms uuid="876bf32a-83e3-424d-8b96-9d09abda2dab">
<name>CompliantForm</name>
<synonym>
<key>en</key>
<value>Compliant form</value>
</synonym>
<usePurposes>PersonalComputer</usePurposes>
<usePurposes>MobileDevice</usePurposes>
</forms>
<forms uuid="e281ac5e-08fb-4d35-842d-a80bd2dc22c2">
<name>NonCompliantForm</name>
<synonym>
<key>en</key>
<value>Non compliant form</value>
</synonym>
<usePurposes>PersonalComputer</usePurposes>
<usePurposes>MobileDevice</usePurposes>
</forms>
</mdclass:Catalog>

View File

@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8"?>
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:form="http://g5.1c.ru/v8/dt/form">
<items xsi:type="form:FormField">
<name>Code</name>
<id>1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.Code</segments>
</dataPath>
<extendedTooltip>
<name>CodeExtendedTooltip</name>
<id>3</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>CodeContextMenu</name>
<id>2</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>Description</name>
<id>4</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.Description</segments>
</dataPath>
<extendedTooltip>
<name>DescriptionExtendedTooltip</name>
<id>6</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>DescriptionContextMenu</name>
<id>5</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<autoCommandBar>
<name>FormCommandBar</name>
<id>-1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<windowOpeningMode>LockOwnerWindow</windowOpeningMode>
<autoTitle>true</autoTitle>
<autoUrl>true</autoUrl>
<group>Vertical</group>
<autoFillCheck>true</autoFillCheck>
<allowFormCustomize>true</allowFormCustomize>
<enabled>true</enabled>
<showTitle>true</showTitle>
<showCloseButton>true</showCloseButton>
<attributes>
<name>Object</name>
<id>1</id>
<valueType>
<types>CatalogObject.Catalog</types>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
<main>true</main>
<savedData>true</savedData>
</attributes>
<formCommands>
<name>Command1</name>
<id>1</id>
<use>
<common>true</common>
</use>
<action xsi:type="form:FormCommandHandlerContainer">
<handler>
<name>Command1</name>
</handler>
</action>
<currentRowUse>Auto</currentRowUse>
</formCommands>
<formCommands>
<name>Command2</name>
<id>2</id>
<use>
<common>true</common>
</use>
<action xsi:type="form:FormCommandHandlerContainer">
<handler>
<name>Command2</name>
</handler>
</action>
<currentRowUse>Auto</currentRowUse>
</formCommands>
<commandInterface>
<navigationPanel/>
<commandBar/>
</commandInterface>
<extInfo xsi:type="form:CatalogFormExtInfo"/>
</form:Form>

View File

@ -0,0 +1,11 @@
&AtClient
Procedure Command1(Command)
//TODO: Insert the handler content
EndProcedure
&AtClient
Procedure Command2(Command)
//TODO: Insert the handler content
EndProcedure

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<Settings xmlns="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core">
<filter>
<viewMode>Normal</viewMode>
<userSettingID>b39404fc-da2a-46d2-b170-c207c3328d01</userSettingID>
</filter>
<order>
<viewMode>Normal</viewMode>
<userSettingID>182c363d-8869-46dc-af0d-d2d815ae108f</userSettingID>
</order>
<conditionalAppearance>
<viewMode>Normal</viewMode>
<userSettingID>ade970d0-b8aa-4db3-af3e-dea1b30d08b6</userSettingID>
</conditionalAppearance>
<itemsViewMode>Normal</itemsViewMode>
<itemsUserSettingID>b3ecca0f-f2e8-424e-9e9c-839e715c0b6a</itemsUserSettingID>
</Settings>

View File

@ -0,0 +1,406 @@
<?xml version="1.0" encoding="UTF-8"?>
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:core="http://g5.1c.ru/v8/dt/mcore" xmlns:form="http://g5.1c.ru/v8/dt/form">
<items xsi:type="form:FormGroup">
<name>ListSettingsComposerUserSettings</name>
<id>1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<title>
<key>en</key>
<value>User settings group</value>
</title>
<verticalStretch>false</verticalStretch>
<extendedTooltip>
<name>ListSettingsComposerUserSettingsExtendedTooltip</name>
<id>2</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<type>UsualGroup</type>
<extInfo xsi:type="form:UsualGroupExtInfo">
<group>Vertical</group>
<representation>WeakSeparation</representation>
<showLeftMargin>true</showLeftMargin>
<united>true</united>
<throughAlign>Auto</throughAlign>
<currentRowUse>Auto</currentRowUse>
</extInfo>
</items>
<items xsi:type="form:Table">
<name>List</name>
<id>3</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>List</segments>
</dataPath>
<defaultItem>true</defaultItem>
<titleLocation>None</titleLocation>
<items xsi:type="form:FormField">
<name>Code</name>
<id>16</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>List.Code</segments>
</dataPath>
<defaultItem>true</defaultItem>
<extendedTooltip>
<name>CodeExtendedTooltip</name>
<id>18</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>CodeContextMenu</name>
<id>17</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>LabelField</type>
<editMode>Enter</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:LabelFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>Description</name>
<id>19</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>List.Description</segments>
</dataPath>
<extendedTooltip>
<name>DescriptionExtendedTooltip</name>
<id>21</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>DescriptionContextMenu</name>
<id>20</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>LabelField</type>
<editMode>Enter</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:LabelFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
</extInfo>
</items>
<commandBarLocation>None</commandBarLocation>
<autoCommandBar>
<name>ListCommandBar</name>
<id>5</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<horizontalAlign>Left</horizontalAlign>
</autoCommandBar>
<searchStringAddition>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<name>ListSearchString</name>
<id>7</id>
<extendedTooltip>
<name>ListSearchStringExtendedTooltip</name>
<id>9</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>ListSearchStringContextMenu</name>
<id>8</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<source>ListSearchString</source>
<extInfo xsi:type="form:SearchStringAdditionExtInfo">
<autoMaxWidth>true</autoMaxWidth>
</extInfo>
</searchStringAddition>
<viewStatusAddition>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<name>ListViewStatus</name>
<id>10</id>
<extendedTooltip>
<name>ListViewStatusExtendedTooltip</name>
<id>12</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>ListViewStatusContextMenu</name>
<id>11</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>ViewStatusAddition</type>
<source>ListViewStatus</source>
<extInfo xsi:type="form:ViewStatusAdditionExtInfo">
<autoMaxWidth>true</autoMaxWidth>
</extInfo>
</viewStatusAddition>
<searchControlAddition>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<name>ListSearchControl</name>
<id>13</id>
<extendedTooltip>
<name>ListSearchControlExtendedTooltip</name>
<id>15</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>ListSearchControlContextMenu</name>
<id>14</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>SearchControlAddition</type>
<source>ListSearchControl</source>
<extInfo xsi:type="form:SearchControlAdditionExtInfo">
<autoMaxWidth>true</autoMaxWidth>
</extInfo>
</searchControlAddition>
<extendedTooltip>
<name>ListExtendedTooltip</name>
<id>6</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>ListContextMenu</name>
<id>4</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<changeRowSet>true</changeRowSet>
<changeRowOrder>true</changeRowOrder>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<autoMaxRowsCount>true</autoMaxRowsCount>
<selectionMode>MultiRow</selectionMode>
<header>true</header>
<headerHeight>1</headerHeight>
<footerHeight>1</footerHeight>
<horizontalScrollBar>AutoUse</horizontalScrollBar>
<verticalScrollBar>AutoUse</verticalScrollBar>
<horizontalLines>true</horizontalLines>
<verticalLines>true</verticalLines>
<useAlternationRowColor>true</useAlternationRowColor>
<searchOnInput>Auto</searchOnInput>
<initialListView>Auto</initialListView>
<initialTreeView>ExpandTopLevel</initialTreeView>
<horizontalStretch>true</horizontalStretch>
<verticalStretch>true</verticalStretch>
<enableStartDrag>true</enableStartDrag>
<enableDrag>true</enableDrag>
<fileDragMode>AsFileRef</fileDragMode>
<rowPictureDataPath xsi:type="form:DataPath">
<segments>List.DefaultPicture</segments>
</rowPictureDataPath>
<extInfo xsi:type="form:DynamicListTableExtInfo">
<autoRefreshPeriod>60</autoRefreshPeriod>
<period>
<startDate>0001-01-01T00:00:00</startDate>
<endDate>0001-01-01T00:00:00</endDate>
</period>
<topLevelParent xsi:type="core:UndefinedValue"/>
<showRoot>true</showRoot>
<userSettingsGroup>ListSettingsComposerUserSettings</userSettingsGroup>
</extInfo>
</items>
<autoCommandBar>
<name>FormCommandBar</name>
<id>-1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<autoTitle>true</autoTitle>
<autoUrl>true</autoUrl>
<group>Vertical</group>
<autoFillCheck>true</autoFillCheck>
<allowFormCustomize>true</allowFormCustomize>
<enabled>true</enabled>
<showTitle>true</showTitle>
<showCloseButton>true</showCloseButton>
<attributes>
<name>List</name>
<id>1</id>
<valueType>
<types>DynamicList</types>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
<main>true</main>
<extInfo xsi:type="form:DynamicListExtInfo">
<mainTable>Catalog.Catalog</mainTable>
<dynamicDataRead>true</dynamicDataRead>
<autoFillAvailableFields>true</autoFillAvailableFields>
<autoSaveUserSettings>true</autoSaveUserSettings>
<getInvisibleFieldPresentations>true</getInvisibleFieldPresentations>
</extInfo>
</attributes>
<formCommands>
<name>Command1</name>
<id>1</id>
<use>
<common>true</common>
</use>
<action xsi:type="form:FormCommandHandlerContainer">
<handler>
<name>Command1</name>
</handler>
</action>
<currentRowUse>Auto</currentRowUse>
</formCommands>
<formCommands>
<name>Command2</name>
<id>2</id>
<use>
<common>true</common>
</use>
<action xsi:type="form:FormCommandHandlerContainer">
<handler>
<name>Command1</name>
</handler>
</action>
<currentRowUse>Auto</currentRowUse>
</formCommands>
<commandInterface>
<navigationPanel/>
<commandBar/>
</commandInterface>
<extInfo xsi:type="form:DynamicListFormExtInfo"/>
</form:Form>

View File

@ -0,0 +1,5 @@
&AtClient
Procedure Command1(Command)
//TODO: Insert the handler content
EndProcedure

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:Configuration xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="428764af-216a-42c2-8ade-5dc9ca624b34">
<name>FormCommandsSingleEventHandlerCheck</name>
<synonym>
<key>en</key>
<value>Form commands single event handler check</value>
</synonym>
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="bd5ecbf3-5450-401c-882f-fa274729667b"/>
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="a250e3ef-ced6-41f7-97d0-4adf310cf226"/>
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="39b0df3c-94e4-46d3-8c24-f0b79faefdd4"/>
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="c336ccd5-e0d6-4867-a605-d9289a4b4028"/>
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="f3d2b558-6965-4b93-833a-ee6907c27b43"/>
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="0d3205cf-315f-499c-870c-9515e4d3cc0d"/>
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="ec3936dc-3d31-4c58-bebb-42fe9306258e"/>
<configurationExtensionCompatibilityMode>8.3.19</configurationExtensionCompatibilityMode>
<defaultRunMode>ManagedApplication</defaultRunMode>
<usePurposes>PersonalComputer</usePurposes>
<usedMobileApplicationFunctionalities>
<functionality>
<use>true</use>
</functionality>
<functionality>
<functionality>OSBackup</functionality>
<use>true</use>
</functionality>
</usedMobileApplicationFunctionalities>
<defaultLanguage>Language.English</defaultLanguage>
<dataLockControlMode>Managed</dataLockControlMode>
<objectAutonumerationMode>NotAutoFree</objectAutonumerationMode>
<modalityUseMode>DontUse</modalityUseMode>
<synchronousPlatformExtensionAndAddInCallUseMode>DontUse</synchronousPlatformExtensionAndAddInCallUseMode>
<compatibilityMode>8.3.19</compatibilityMode>
<languages uuid="1d6adc7e-b50c-4747-b3ab-dd2299be82fc">
<name>English</name>
<synonym>
<key>en</key>
<value>English</value>
</synonym>
<languageCode>en</languageCode>
</languages>
<catalogs>Catalog.Catalog</catalogs>
</mdclass:Configuration>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>