Class CmiCustomizationUtil
java.lang.Object
com._1c.g5.v8.dt.internal.cmi.tasks.CmiCustomizationUtil
Provides utility methods to be used by tasks responsible for
CMI customization.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CommandsPlacementFragment
findCurrentPlacementFragment
(CommandsPlacement commandsPlacement, Command command) Finds current placement fragment for the command.static CommandsOrderFragment
findOrderFragment
(CommandInterface commandInterface, CommandGroup group) Finds customization fragment by the group in the given command interface.static CommandsOrderFragment
findOrderFragment
(CommandsOrder commandsOrder, CommandGroup group) Find customization fragment by the group in the given "commands order".static CommandsPlacementFragment
findPlacementFragment
(CommandsPlacement commandsPlacement, CommandGroup group) Gets customization placement fragment.static CommandsVisibilityFragment
findVisibilityFragment
(CommandInterface commandInterface, Command command) Finds custom visibility fragment in CI.static CommandsPlacement
getOrCreatePlacement
(CommandInterface commandInterface) Gets or create a new customization placement.static CommandsPlacementFragment
getOrCreatePlacementFragment
(CommandsPlacement placement, CommandGroup group) Gets or creates placement fragment.static boolean
isAnySubsystemIncludedInCommandInterface
(Configuration configuration) Checks if at least one subsystem is included into the command interface.static boolean
removeCommand
(List<Command> commands, Command command) Removes the command from the list.static CommandGroup
resolveGroup
(Command command) Resolves group for the command.
-
Method Details
-
findCurrentPlacementFragment
public static CommandsPlacementFragment findCurrentPlacementFragment(CommandsPlacement commandsPlacement, Command command) Finds current placement fragment for the command.- Parameters:
commandsPlacement
- The fragment to search into.command
- The command to find in fragment.- Returns:
- The found fragment if any.
-
findOrderFragment
public static CommandsOrderFragment findOrderFragment(CommandInterface commandInterface, CommandGroup group) Finds customization fragment by the group in the given command interface.- Parameters:
commandInterface
- the command interface.group
- the group.- Returns:
- fragment if found,
null
otherwise.
-
findOrderFragment
public static CommandsOrderFragment findOrderFragment(CommandsOrder commandsOrder, CommandGroup group) Find customization fragment by the group in the given "commands order".- Parameters:
commandsOrder
- the commands order.group
- the group.
-
findPlacementFragment
public static CommandsPlacementFragment findPlacementFragment(CommandsPlacement commandsPlacement, CommandGroup group) Gets customization placement fragment.- Parameters:
commandInterface
- The target command interface.- Returns:
- The command placement fragment.
-
findVisibilityFragment
public static CommandsVisibilityFragment findVisibilityFragment(CommandInterface commandInterface, Command command) Finds custom visibility fragment in CI.- Parameters:
commandInterface
- The command interface to search within.command
- The command to search the fragment for.- Returns:
- The fragment of any.
-
getOrCreatePlacement
Gets or create a new customization placement.- Parameters:
commandInterface
- The target command interface.- Returns:
- The command placement.
-
getOrCreatePlacementFragment
public static CommandsPlacementFragment getOrCreatePlacementFragment(CommandsPlacement placement, CommandGroup group) Gets or creates placement fragment.- Parameters:
placement
- The target placement.group
- The target group.- Returns:
- The found or newly created fragment.
-
isAnySubsystemIncludedInCommandInterface
Checks if at least one subsystem is included into the command interface. For now at least one top subsystem should be included (we aren't support adding subordinates without parents into the CMI)- Parameters:
Configuration
-- Returns:
-
removeCommand
Removes the command from the list.- Parameters:
commands
- the command list to remove the command from.command
- the command to remove from the list.- Returns:
true
if the command was found in the list and removed,false
otherwise.
-
resolveGroup
Resolves group for the command.- Parameters:
command
- the command to resolve group for.- Returns:
- the command group if applicable,
null
otherwise.
-