Package com._1c.g5.v8.dt.cmi.model.util
Class CmiModelUtil
java.lang.Object
com._1c.g5.v8.dt.cmi.model.util.CmiModelUtil
Command interface utility class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandInterface
createCommandInterface
(IBmTransaction transaction, String fqn) Creates command interface.static CommandInterface
createConfigurationCommandInterface
(Configuration configuration, IBmTransaction transaction) Creates configuration command interface.static CommandInterface
createMainSectionCommandInterface
(Configuration configuration, IBmTransaction transaction) Creates main section command interface.static String
getCategoryRepresentation
(CommandGroupCategory commandGroupCategory) Gets the text representation of command group category.static Object
getCommandGroup
(org.eclipse.emf.ecore.EObject command, CommandInterface commandInterface) Gets command command group.static CommandGroupCategory
getCommandGroupCategory
(org.eclipse.emf.ecore.EObject group) Gets command group category.static String
getCommandGroupName
(CommandGroup group) Gets command group name.static String
getCommandGroupRepresentation
(CommandGroup group, Configuration configuration) Gets command group representation.static String
getCommandGroupRepresentation
(CommandGroup group, Language language) Gets command group representation.static String
getCommandName
(Command command) Gets command name.static String
getCommandRepresentation
(Command command, Configuration configuration) Gets command representatonstatic String
getCommandRepresentation
(Command command, Language language) Gets command representatonstatic CommandsOrderFragment
getCommandsOrderFragmentForGroup
(org.eclipse.emf.ecore.EObject group, CommandInterface commandInterface) Gets commands order fragment fo group.static boolean
getCommandVisibility
(org.eclipse.emf.ecore.EObject command, CommandInterface commandInterface) Gets command visibility.static CommandGroup
getDefaultCommandGroup
(org.eclipse.emf.ecore.EObject command) Gets default command group.static boolean
getDefaultCommandVisibility
(org.eclipse.emf.ecore.EObject command) Get default command visibility.static AdjustableBoolean
getDefaultCommandVisible
(org.eclipse.emf.ecore.EObject command) Gets command visibility.static org.eclipse.emf.ecore.EObject
getEObjectByDiagnostic
(org.eclipse.emf.common.util.Diagnostic diagnostic) Gets diagnostic e-object.static String
getProxyUuid
(org.eclipse.emf.ecore.EObject eObject) Gets proxy object representationstatic String
Gets group representation for standard command group.static boolean
isEObjectEquals
(org.eclipse.emf.ecore.EObject eObject1, org.eclipse.emf.ecore.EObject eObject2) Check e-object equals (with proxy representation)static boolean
isSameBmObject
(org.eclipse.emf.ecore.EObject object1, org.eclipse.emf.ecore.EObject object2) Determines whether two possibly-null objects are same.
-
Constructor Details
-
CmiModelUtil
public CmiModelUtil()
-
-
Method Details
-
createCommandInterface
Creates command interface.- Parameters:
transaction
- The transaction the command interface should be attached to.fqn
- the command interface FQN.- Returns:
- the created command interface.
-
createConfigurationCommandInterface
public static CommandInterface createConfigurationCommandInterface(Configuration configuration, IBmTransaction transaction) Creates configuration command interface.- Parameters:
configuration
- the configuration.transaction
- The transaction the command interface should be attached to.- Returns:
- the created command interface.
-
createMainSectionCommandInterface
public static CommandInterface createMainSectionCommandInterface(Configuration configuration, IBmTransaction transaction) Creates main section command interface.- Parameters:
configuration
- the configuration.transaction
- The transaction the command interface should be attached to.- Returns:
- the created command interface.
-
getCommandGroup
public static Object getCommandGroup(org.eclipse.emf.ecore.EObject command, CommandInterface commandInterface) Gets command command group.- Parameters:
command
- the commandcommandInterface
- the interface- Returns:
- the commands group
-
getCommandGroupCategory
Gets command group category.- Parameters:
group
- the group- Returns:
- the group category
-
getCommandGroupName
Gets command group name.- Parameters:
group
- the group- Returns:
- tne group name
-
getCommandGroupRepresentation
Gets command group representation.- Parameters:
group
- the groupconfiguration
- the confuguration- Returns:
- the command group name
-
getStandardCommandGroupRepresentation
Gets group representation for standard command group.- Parameters:
group
- the standard group- Returns:
- the group representation
-
getCommandGroupRepresentation
Gets command group representation.- Parameters:
group
- the grouplanguage
- the language, may benull
- Returns:
- the command group name
-
getCommandName
Gets command name.- Parameters:
command
- the command- Returns:
- the command name
-
getCommandRepresentation
Gets command representaton- Parameters:
command
- the commandconfiguration
- the configuration- Returns:
- the name
-
getCommandRepresentation
Gets command representaton- Parameters:
command
- the commandlanguage
- the language, may benull
- Returns:
- the name
-
getCommandsOrderFragmentForGroup
public static CommandsOrderFragment getCommandsOrderFragmentForGroup(org.eclipse.emf.ecore.EObject group, CommandInterface commandInterface) Gets commands order fragment fo group.- Parameters:
group
- the groupcommandInterface
- the interface- Returns:
- the fragment, may be
null
-
getCommandVisibility
public static boolean getCommandVisibility(org.eclipse.emf.ecore.EObject command, CommandInterface commandInterface) Gets command visibility.- Parameters:
command
- the commandcommandInterface
- the interface- Returns:
- true is visible
-
getDefaultCommandGroup
Gets default command group.- Parameters:
command
- the command- Returns:
- the group
-
getDefaultCommandVisibility
public static boolean getDefaultCommandVisibility(org.eclipse.emf.ecore.EObject command) Get default command visibility.- Parameters:
command
- the command- Returns:
- true is visible
-
getDefaultCommandVisible
Gets command visibility.- Parameters:
command
- the command- Returns:
- the visibility
-
getEObjectByDiagnostic
public static org.eclipse.emf.ecore.EObject getEObjectByDiagnostic(org.eclipse.emf.common.util.Diagnostic diagnostic) Gets diagnostic e-object.- Parameters:
diagnostic
- the diagnostic- Returns:
- the e-object
-
getProxyUuid
Gets proxy object representation- Parameters:
eObject
- the e-object- Returns:
- the representstion
-
isEObjectEquals
public static boolean isEObjectEquals(org.eclipse.emf.ecore.EObject eObject1, org.eclipse.emf.ecore.EObject eObject2) Check e-object equals (with proxy representation)- Parameters:
eObject1
- the first e-objecteObject2
- the second e-object- Returns:
- true is equals
-
isSameBmObject
public static boolean isSameBmObject(org.eclipse.emf.ecore.EObject object1, org.eclipse.emf.ecore.EObject object2) Determines whether two possibly-null objects are same.- Returns
false
ifobject1
orobject2
is null. - else if
object1
andobject2
are both proxy returnstrue
if their proxy URI's are identical, returnsfalse
otherwise; - else if
object1
andobject2
are both non-null and instance ofIBmObject
returnstrue
if theirIBmObject.bmGetId()
s are identical, returnsfalse
otherwise; - else returns
true
ifobject1
andobject2
are both non-null and they are equal according toObject.equals(Object)
. - Returns
false
in all other situations.
- Parameters:
object1
- the first instance.object2
- the second instance.
- Returns
-
getCategoryRepresentation
Gets the text representation of command group category.- Parameters:
commandGroupCategory
- the given command group category, can not benull
- Returns:
- the text representation of command group category, may be
null
-