Class DtNewWizardParentDetectionStrategy.ByFeatures
- java.lang.Object
-
- com._1c.g5.v8.dt.md.ui.wizards.base.DtNewWizardParentDetectionStrategy.ByFeatures
-
- All Implemented Interfaces:
IDtNewWizardParentDetectionStrategy
- Direct Known Subclasses:
PredefinedItemWizard.ByFeatures
,SubsystemWizard.ByFeatures
- Enclosing class:
- DtNewWizardParentDetectionStrategy
public static class DtNewWizardParentDetectionStrategy.ByFeatures extends Object implements IDtNewWizardParentDetectionStrategy
Detects model parent by provided features.
-
-
Constructor Summary
Constructors Constructor Description ByFeatures(org.eclipse.emf.ecore.EStructuralFeature... features)
Instantiates a new by-features strategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areChildrenPotentialParents(Object element)
Checks whether the givenelement
has potential parents among its children.protected boolean
detectInSelection(IDtNewWizardContext<?> context, Object selection, boolean searchForFeatureInParent)
Detect parent by selected object.void
detectParent(IDtNewWizardContext<?> context, IStructuredSelection selection)
Detects the parent model for the givenselection
.void
dispose()
Disposes this strategy.protected IV8ProjectManager
getV8ProjectManager()
Returns the V8 project manager.boolean
isParentSelected(IDtNewWizardContext<?> context)
Checks whether a givencontext
is considered as having the parent selected according to this strategy.boolean
isPotentialParent(Object element)
Checks whether the givenelement
is a potential parent.protected org.eclipse.emf.ecore.EStructuralFeature
obtainFeatureHint(Object selection)
Obtaines feature hint.
-
-
-
Method Detail
-
detectParent
public void detectParent(IDtNewWizardContext<?> context, IStructuredSelection selection)
Detects the parent model for the givenselection
. Stores the result in the wizardcontext
.- Specified by:
detectParent
in interfaceIDtNewWizardParentDetectionStrategy
- Parameters:
context
- wizard context.selection
- selection to detect parent in.
-
isPotentialParent
public boolean isPotentialParent(Object element)
Checks whether the givenelement
is a potential parent.- Specified by:
isPotentialParent
in interfaceIDtNewWizardParentDetectionStrategy
- Parameters:
element
- element to check.- Returns:
true
if element is a potential parent,false
otherwise.
-
areChildrenPotentialParents
public boolean areChildrenPotentialParents(Object element)
Checks whether the givenelement
has potential parents among its children.- Specified by:
areChildrenPotentialParents
in interfaceIDtNewWizardParentDetectionStrategy
- Parameters:
element
- element to check.- Returns:
true
if element has potential parents in its children,false
otherwise.
-
isParentSelected
public boolean isParentSelected(IDtNewWizardContext<?> context)
Description copied from interface:IDtNewWizardParentDetectionStrategy
Checks whether a givencontext
is considered as having the parent selected according to this strategy.- Specified by:
isParentSelected
in interfaceIDtNewWizardParentDetectionStrategy
- Parameters:
context
- wizard context
-
dispose
public void dispose()
Description copied from interface:IDtNewWizardParentDetectionStrategy
Disposes this strategy.- Specified by:
dispose
in interfaceIDtNewWizardParentDetectionStrategy
-
getV8ProjectManager
protected IV8ProjectManager getV8ProjectManager()
Returns the V8 project manager.- Returns:
- the V8 project manager, never
null
.
-
detectInSelection
protected boolean detectInSelection(IDtNewWizardContext<?> context, Object selection, boolean searchForFeatureInParent)
Detect parent by selected object.- Parameters:
context
- the wizard context, cannot benull
selection
- the selected object, cannot benull
searchForFeatureInParent
- serch in parent flag- Returns:
true
if detected
-
obtainFeatureHint
protected org.eclipse.emf.ecore.EStructuralFeature obtainFeatureHint(Object selection)
Obtaines feature hint.- Parameters:
selection
- the selection, can not benull
- Returns:
- the obtained feature,
null
if not obtained
-
-