Package com._1c.g5.v8.dt.cmi.model.util
Class CommandInterfaceUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.cmi.model.util.CommandInterfaceUtil
-
public class CommandInterfaceUtil extends Object
Command interface util.
-
-
Constructor Summary
Constructors Constructor Description CommandInterfaceUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends org.eclipse.emf.ecore.EObject>
booleancontainsBmObject(Collection<? extends T> collection, T object)
Checks if the collection contains the given BM object.static AdjustableBoolean
copyVisibility(AdjustableBoolean original)
Copies visibility.static CommandGroupCategory
getCommandGroupCategory(org.eclipse.emf.ecore.EObject eObject)
Gets command group category.static CommandGroupCategory
getCommandGroupCategoryByCommandProxyUri(Command command)
Gets command group category by command proxy URI.static String
getCommandGroupName(CommandGroup group, ScriptVariant scriptVariant)
Gets command name.static String
getCommandGroupRepresentationBasename(CommandGroup group, String languageCode, ScriptVariant scriptVariant)
Gets basename of a command group representation.static CommandInterface
getCommandInterface(org.eclipse.emf.ecore.EObject eObject)
Gets command interface.static String
getCommandName(Command command, ScriptVariant scriptVariant)
Gets command name.static String
getCommandRepresentation(Command command, String languageCode, ScriptVariant scriptVariant)
Gets command representation.static Configuration
getConfiguration(org.eclipse.emf.ecore.EObject source)
Gets configuration by resolve configuration uri on source editing support.static ConfigurationCommandInterfaceItem
getConfigurationCommandInterfaceItem(SubsystemCommandInterface subsystemCommandInterface)
Gets interface section item by subsystem interface.static CommandInterface
getContainerCommandInterface(org.eclipse.emf.ecore.EObject eObject)
Gets e-object container command interface.static org.eclipse.xtext.naming.QualifiedName
getFullyQualifiedName(MdObject mdObject)
Gets md-object fully qualified name.static MdObject
getMdObjectByInterfaceItem(org.eclipse.emf.ecore.EObject interfaceItem)
Gets md-object by command interface item.static String
getMdObjectRepresentation(MdObject mdObject, String languageCode, boolean isObject)
Gets md-object representation.static SubsystemCommandInterface
getParentSubsystemCommandInterface(SubsystemCommandInterface subsystemCommandInterface)
Gets parent subsystem interface.static Command
getRealCommand(Command command)
Gets cmi model command.static CommandGroup
getRealCommandGroup(CommandGroup commandGroup)
Gets cmi model command group.static Subsystem
getRealSectionSubsystem(Subsystem subsystem)
Gets cmi model subsystem.static Subsystem
getSubsystem(Object obj)
Gets subsystemstatic SubsystemCommandInterface
getSubsystemCommandInterface(ConfigurationCommandInterfaceItem configurationCommandInterfaceItem)
Gets subsystem interface by interface section item.static MdObject
getSubsystemOwner(MdObject mdObject, Subsystem subsystem)
Gets subsystem ownerstatic List<Subsystem>
getSubsystems(MdObject mdObject)
Gets subsystem container subsystems.static Set<Role>
getUsedRoles(CommandInterfaceRoot root)
Gets interface used roles.static boolean
hasInterfaceSubsystem(Configuration configuration)
Is configuration has someone interface subsystem.static boolean
isCorrectNewOwner(MdObject newOwner, Subsystem subsystem)
Is correct new owner for moved subsystem.static boolean
isNewSubsystemOwnerNotEqualsCurrent(MdObject newOwner, Subsystem subsystem)
Is new owner for moved subsystem not equal old owner.static boolean
isRealSection(Object obj)
Is object cmi model subsystem, non proxy or stub ds-objectstatic boolean
isSubsystemOwnerNotConsistsSubsystemWithSameName(MdObject newOwner, Subsystem subsystem)
Cheks if new subsystem owner do not consists subsystem with same name.static <T extends org.eclipse.emf.ecore.EObject>
voidremoveBmObjectFromList(Collection<? extends T> list, T object)
Removes the given BM object from the list.static void
setCommandVisibility(CommandInterface commandInterface, Command command, AdjustableBoolean visibility)
Sets command visibility and add changes to affected objects.static void
setSubsystemVisibility(CommandInterface commandInterface, Subsystem subsystem, AdjustableBoolean visibility)
Sets subsystem visibility and add changes to affected objects.
-
-
-
Method Detail
-
containsBmObject
public static <T extends org.eclipse.emf.ecore.EObject> boolean containsBmObject(Collection<? extends T> collection, T object)
Checks if the collection contains the given BM object.- Parameters:
collection
- the collection.object
- the BM object.- Returns:
true
if contains,false
otherwise.
-
copyVisibility
public static AdjustableBoolean copyVisibility(AdjustableBoolean original)
Copies visibility.- Parameters:
original
- the original visibility.- Returns:
- the copy
-
getCommandGroupCategory
public static CommandGroupCategory getCommandGroupCategory(org.eclipse.emf.ecore.EObject eObject)
Gets command group category.- Parameters:
eObject
- the interface object- Returns:
- the category, may be
null
-
getCommandGroupCategoryByCommandProxyUri
public static CommandGroupCategory getCommandGroupCategoryByCommandProxyUri(Command command)
Gets command group category by command proxy URI.- Parameters:
command
- the command- Returns:
- the category, may be
null
-
getCommandGroupName
public static String getCommandGroupName(CommandGroup group, ScriptVariant scriptVariant)
Gets command name.- Parameters:
group
- the groupscriptVariant
- the script variant- Returns:
- the name
-
getCommandGroupRepresentationBasename
public static String getCommandGroupRepresentationBasename(CommandGroup group, String languageCode, ScriptVariant scriptVariant)
Gets basename of a command group representation. The basename here is a group name without category prefix.- Parameters:
group
- the grouplanguageCode
- the language codescriptVariant
- the script variant- Returns:
- the basename of group representation
-
getCommandInterface
public static CommandInterface getCommandInterface(org.eclipse.emf.ecore.EObject eObject)
Gets command interface.- Parameters:
eObject
- the interface object- Returns:
- the command interface, may be
null
-
getCommandName
public static String getCommandName(Command command, ScriptVariant scriptVariant)
Gets command name.- Parameters:
command
- the commandscriptVariant
- the script variant- Returns:
- the name
-
getCommandRepresentation
public static String getCommandRepresentation(Command command, String languageCode, ScriptVariant scriptVariant)
Gets command representation.- Parameters:
command
- the commandlanguageCode
- the language codescriptVariant
- the script variant- Returns:
- the command representation
-
getConfiguration
public static Configuration getConfiguration(org.eclipse.emf.ecore.EObject source)
Gets configuration by resolve configuration uri on source editing support.- Parameters:
source
- the source- Returns:
- the configuration
-
getConfigurationCommandInterfaceItem
public static ConfigurationCommandInterfaceItem getConfigurationCommandInterfaceItem(SubsystemCommandInterface subsystemCommandInterface)
Gets interface section item by subsystem interface.- Parameters:
subsystemCommandInterface
- the subsystem interface- Returns:
- the interface section item, may be
null
-
getContainerCommandInterface
public static CommandInterface getContainerCommandInterface(org.eclipse.emf.ecore.EObject eObject)
Gets e-object container command interface.- Parameters:
eObject
- the inteface object- Returns:
- the command interface, may be
null
-
getFullyQualifiedName
public static org.eclipse.xtext.naming.QualifiedName getFullyQualifiedName(MdObject mdObject)
Gets md-object fully qualified name.- Parameters:
mdObject
- the md-object- Returns:
- the fqn
-
getMdObjectByInterfaceItem
public static MdObject getMdObjectByInterfaceItem(org.eclipse.emf.ecore.EObject interfaceItem)
Gets md-object by command interface item.- Parameters:
interfaceItem
- the command interface item- Returns:
- the md-object, may be
null
-
getMdObjectRepresentation
public static String getMdObjectRepresentation(MdObject mdObject, String languageCode, boolean isObject)
Gets md-object representation.- Parameters:
mdObject
- the md-objectlanguageCode
- the language codeisObject
- if true gets object representation, false - list- Returns:
- the representation
-
getParentSubsystemCommandInterface
public static SubsystemCommandInterface getParentSubsystemCommandInterface(SubsystemCommandInterface subsystemCommandInterface)
Gets parent subsystem interface.- Parameters:
subsystemCommandInterface
- the child subsystem interface- Returns:
- the parent, may be
null
-
getRealCommand
public static Command getRealCommand(Command command)
Gets cmi model command.- Parameters:
command
- the command, may be stub ds-object- Returns:
- the cmi model command
-
getRealCommandGroup
public static CommandGroup getRealCommandGroup(CommandGroup commandGroup)
Gets cmi model command group.- Parameters:
commandGroup
- the command group, may be stub ds-object- Returns:
- the cmi model command group
-
getRealSectionSubsystem
public static Subsystem getRealSectionSubsystem(Subsystem subsystem)
Gets cmi model subsystem.- Parameters:
subsystem
- the subsystem, may be stub ds-object- Returns:
- the cmi model subsystem
-
getSubsystem
public static Subsystem getSubsystem(Object obj)
Gets subsystem- Parameters:
obj
- the interface object- Returns:
- the subsystem, may be
null
-
getSubsystemCommandInterface
public static SubsystemCommandInterface getSubsystemCommandInterface(ConfigurationCommandInterfaceItem configurationCommandInterfaceItem)
Gets subsystem interface by interface section item.- Parameters:
configurationCommandInterfaceItem
- the interface section item- Returns:
- the subsystem interface, may be
null
-
getSubsystemOwner
public static MdObject getSubsystemOwner(MdObject mdObject, Subsystem subsystem)
Gets subsystem owner- Parameters:
mdObject
- the start subsystem containersubsystem
- the subsystem- Returns:
- the owner container, may be
null
-
getSubsystems
public static List<Subsystem> getSubsystems(MdObject mdObject)
Gets subsystem container subsystems.- Parameters:
mdObject
- the container- Returns:
- the subsystems
-
getUsedRoles
public static Set<Role> getUsedRoles(CommandInterfaceRoot root)
Gets interface used roles.- Parameters:
root
- the command interface- Returns:
- the used roles with none default visibility
-
hasInterfaceSubsystem
public static boolean hasInterfaceSubsystem(Configuration configuration)
Is configuration has someone interface subsystem.- Parameters:
configuration
- the configuration- Returns:
- is has
-
isCorrectNewOwner
public static boolean isCorrectNewOwner(MdObject newOwner, Subsystem subsystem)
Is correct new owner for moved subsystem.- Parameters:
newOwner
- the new ownersubsystem
- the moved subsystem- Returns:
- true if is
-
isNewSubsystemOwnerNotEqualsCurrent
public static boolean isNewSubsystemOwnerNotEqualsCurrent(MdObject newOwner, Subsystem subsystem)
Is new owner for moved subsystem not equal old owner.- Parameters:
newOwner
- the new ownersubsystem
- the moved subsystem- Returns:
- true if is
-
isRealSection
public static boolean isRealSection(Object obj)
Is object cmi model subsystem, non proxy or stub ds-object- Parameters:
obj
- the object- Returns:
- true if is
-
isSubsystemOwnerNotConsistsSubsystemWithSameName
public static boolean isSubsystemOwnerNotConsistsSubsystemWithSameName(MdObject newOwner, Subsystem subsystem)
Cheks if new subsystem owner do not consists subsystem with same name.- Parameters:
newOwner
- the new ownersubsystem
- the moved subsystem- Returns:
- true if is
-
removeBmObjectFromList
public static <T extends org.eclipse.emf.ecore.EObject> void removeBmObjectFromList(Collection<? extends T> list, T object)
Removes the given BM object from the list.- Parameters:
list
- the listobject
- the BM object.
-
setCommandVisibility
public static void setCommandVisibility(CommandInterface commandInterface, Command command, AdjustableBoolean visibility)
Sets command visibility and add changes to affected objects.- Parameters:
commandInterface
- the command interfacecommand
- the commandvisibility
- the visibilityaffectedObjects
- the affected objects
-
setSubsystemVisibility
public static void setSubsystemVisibility(CommandInterface commandInterface, Subsystem subsystem, AdjustableBoolean visibility)
Sets subsystem visibility and add changes to affected objects.- Parameters:
commandInterface
- the command interfacesubsystem
- the subsystemvisibility
- the visibilityaffectedObjects
- the affected objects
-
-