Package com._1c.g5.v8.dt.ui.aef.actions
Class DtActionHelper
- java.lang.Object
- 
- com._1c.g5.v8.dt.ui.aef.actions.DtActionHelper
 
- 
 public class DtActionHelper extends Object Various helpers useful for actions.
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidexecuteAsComplexTask(IBmEditingContext editingContext, Collection<?> items, Function<Object,IBmTask<?>> taskCreator)static voidexecuteWizard(org.eclipse.ui.wizards.IWizardDescriptor wizardDescriptor, ISelection selection)Executes the givenwizardDescriptorwith and provides it with givenselectionstatic IBmEditingContextgetEditingContext(ISelection selection, org.eclipse.emf.ecore.EObject model)ObtainsIBmEditingContextfor a givenselection.static org.eclipse.emf.ecore.EObjectgetEObject(ISelection selection)ObtainsEObjectfrom a given selection.static org.eclipse.emf.common.util.EList<?>getList(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature, ISelection selection)ObtainsEListfor a givenmodel,featureandselection.static org.eclipse.emf.common.util.EList<?>getListForElement(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject element)ObtainsEListcorresponding to a givenmodel,featureandelement.static <T> List<T>getSelectedObjectList(IStructuredSelection selection, Class<T> clazz)Returns list of target class selected objects fromIStructuredSelection.
 
- 
- 
- 
Method Detail- 
getEObjectpublic static org.eclipse.emf.ecore.EObject getEObject(ISelection selection) ObtainsEObjectfrom a given selection.- Parameters:
- selection- selection to obtain- EObjectfrom.
- Returns:
- obtained EObjectornullif no object could be obtained.
 
 - 
getListpublic static org.eclipse.emf.common.util.EList<?> getList(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature, ISelection selection)ObtainsEListfor a givenmodel,featureandselection.- Parameters:
- model- model to obtain- EListfrom.
- feature- feature to obtain- EListfrom.
- selection- selection to obtain- EListfrom.
- Returns:
- obtained EListornullif no list could be obtained.
 
 - 
getListForElementpublic static org.eclipse.emf.common.util.EList<?> getListForElement(org.eclipse.emf.ecore.EObject model, org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EObject element)ObtainsEListcorresponding to a givenmodel,featureandelement.- Parameters:
- model- model to obtain- EListfrom.
- feature- feature to obtain- EListfrom.
- element- element to obtain- EListfrom.
- Returns:
- obtained EListornullif no list could be obtained.
 
 - 
getEditingContextpublic static IBmEditingContext getEditingContext(ISelection selection, org.eclipse.emf.ecore.EObject model) ObtainsIBmEditingContextfor a givenselection.- Parameters:
- selection- selection to obtain- IBmEditingContextfrom.
- model- the model object.
- Returns:
- obtained IBmEditingContextornullif no executor could be obtained.
 
 - 
executeAsComplexTaskpublic static void executeAsComplexTask(IBmEditingContext editingContext, Collection<?> items, Function<Object,IBmTask<?>> taskCreator) Creates anIBmTaskfor each element initemsusingtaskCreator. Then executes aBmCompoundTaskcomprised of the created tasks usingIBmEditingSupportthat corresponds to themodelobject.Note: If for some item no task should be executed, taskCreatorshell return null.
 - 
executeWizardpublic static void executeWizard(org.eclipse.ui.wizards.IWizardDescriptor wizardDescriptor, ISelection selection)Executes the givenwizardDescriptorwith and provides it with givenselection
 - 
getSelectedObjectListpublic static <T> List<T> getSelectedObjectList(IStructuredSelection selection, Class<T> clazz) Returns list of target class selected objects fromIStructuredSelection.- Parameters:
- selection- the source- IStructuredSelection, cannot be- null
- clazz- the target selected objects class, cannot be- null
- Returns:
- the list of target class selected objects, never null
 
 
- 
 
-