Class AbstractMdObjectCollectionTask<P1 extends MdObject,​P2 extends MdObject>

    • Constructor Detail

      • AbstractMdObjectCollectionTask

        protected AbstractMdObjectCollectionTask​(P1 object,
                                                 Collection<P2> objects,
                                                 String template)
        Instantiates a new IBmTask successor. Builds name of the task using {@linkplain AbstractMdObjectCollectionTask# getName(MdObject, Collection, String) getName()} method and the given template.
        Parameters:
        object - is the object
        objects - is the collection of objects
        template - is the template message. It can include "{0}" and "{1}" symbols to insert object and objects string representation respectively
    • Method Detail

      • execute

        public org.eclipse.core.runtime.IStatus execute​(P1 object,
                                                        Collection<P2> objects,
                                                        org.eclipse.core.runtime.IProgressMonitor monitor)
        Encapsulates custom action declared in doExecute() with right way error handling.
        Specified by:
        execute in class BmBasicTask2Collection<P1 extends MdObject,​P2 extends MdObject>
        Parameters:
        object - is the object
        objects - is the collection of objects
        monitor - is the progress monitor
        Returns:
        the status of the task
      • doExecute

        protected abstract void doExecute​(P1 object,
                                          Collection<P2> objects)
        Performs custom action. E.g. addition to collection. Override in successors.
        Parameters:
        object - is the object
        objects - is the collection of objects
      • getName

        protected static String getName​(MdObject object,
                                        Collection<? extends MdObject> objects,
                                        String messageTemplate)
        Returns the name of the task. The name is generated by the given template and MdObjects.
        Parameters:
        object - is the object
        objects - is the collection of objects
        messageTemplate - is the template for name
        Returns:
        task name