Class CmiModelUtil


  • public class CmiModelUtil
    extends Object
    Command interface utility class
    • Constructor Detail

      • CmiModelUtil

        public CmiModelUtil()
    • Method Detail

      • createCommandInterface

        public static CommandInterface createCommandInterface​(IBmTransaction transaction,
                                                              String fqn)
        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 command
        commandInterface - the interface
        Returns:
        the commands group
      • getCommandGroupCategory

        public static CommandGroupCategory getCommandGroupCategory​(org.eclipse.emf.ecore.EObject group)
        Gets command group category.
        Parameters:
        group - the group
        Returns:
        the group category
      • getCommandGroupName

        public static String getCommandGroupName​(CommandGroup group)
        Gets command group name.
        Parameters:
        group - the group
        Returns:
        tne group name
      • getCommandGroupRepresentation

        public static String getCommandGroupRepresentation​(CommandGroup group,
                                                           Configuration configuration)
        Gets command group representation.
        Parameters:
        group - the group
        configuration - the confuguration
        Returns:
        the command group name
      • getStandardCommandGroupRepresentation

        public static String getStandardCommandGroupRepresentation​(StandardCommandGroup group)
        Gets group representation for standard command group.
        Parameters:
        group - the standard group
        Returns:
        the group representation
      • getCommandGroupRepresentation

        public static String getCommandGroupRepresentation​(CommandGroup group,
                                                           Language language)
        Gets command group representation.
        Parameters:
        group - the group
        language - the language, may be null
        Returns:
        the command group name
      • getCommandName

        public static String getCommandName​(Command command)
        Gets command name.
        Parameters:
        command - the command
        Returns:
        the command name
      • getCommandRepresentation

        public static String getCommandRepresentation​(Command command,
                                                      Configuration configuration)
        Gets command representaton
        Parameters:
        command - the command
        configuration - the configuration
        Returns:
        the name
      • getCommandRepresentation

        public static String getCommandRepresentation​(Command command,
                                                      Language language)
        Gets command representaton
        Parameters:
        command - the command
        language - the language, may be null
        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 group
        commandInterface - 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 command
        commandInterface - the interface
        Returns:
        true is visible
      • getDefaultCommandGroup

        public static CommandGroup getDefaultCommandGroup​(org.eclipse.emf.ecore.EObject command)
        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

        public static AdjustableBoolean getDefaultCommandVisible​(org.eclipse.emf.ecore.EObject command)
        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

        public static String getProxyUuid​(org.eclipse.emf.ecore.EObject eObject)
        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-object
        eObject2 - 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 if object1 or object2 is null.
        • else if object1 and object2 are both proxy returns true if their proxy URI's are identical, returns false otherwise;
        • else if object1 and object2 are both non-null and instance of IBmObject returns true if their IBmObject.bmGetId()s are identical, returns false otherwise;
        • else returns true if object1 and object2 are both non-null and they are equal according to Object.equals(Object).
        • Returns false in all other situations.
        Parameters:
        object1 - the first instance.
        object2 - the second instance.
      • getCategoryRepresentation

        public static String getCategoryRepresentation​(CommandGroupCategory commandGroupCategory)
        Gets the text representation of command group category.
        Parameters:
        commandGroupCategory - the given command group category, can not be null
        Returns:
        the text representation of command group category, may be null