Class DtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- java.lang.Object
-
- com._1c.g5.v8.dt.md.ui.wizards.base.DtNewWizardContext<M>
-
- All Implemented Interfaces:
IDtNewWizardContext<M>
public class DtNewWizardContext<M extends org.eclipse.emf.ecore.EObject> extends Object implements IDtNewWizardContext<M>
Default implementation ofIDtNewWizardContext
.
-
-
Constructor Summary
Constructors Constructor Description DtNewWizardContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRelatedModel(org.eclipse.emf.ecore.EObject model)
Adds the model to the list of related models.<T> T
findRelatedModel(Class<T> class_)
Finds related model by its class.<T> T
get(Class<T> class_)
Gets additional context information by its class.IBmTransaction
getActiveTransaction()
IBmEditingContext
getEditingContext()
org.eclipse.emf.ecore.EStructuralFeature
getFeature()
String
getFqn()
Gets FQN.M
getModel()
org.eclipse.emf.ecore.EClass
getModelClass()
MdModelTypesExtension
getModelType()
Version
getModelVersion()
org.eclipse.emf.ecore.EObject
getParent()
Iterable<org.eclipse.emf.ecore.EObject>
getRelatedModels()
IV8Project
getV8project()
boolean
isDiscardableEditingSupport()
Checks if the editing support associated with this context should be discarded in the end.boolean
isNeedSave()
Checks if the wizard need to perform save of the wizard context at the end of processing.boolean
isParentChanged()
Checks whether the wizard context parent was changed after initial parent set.void
put(Object object)
Stores additional context information.void
resetParentChange()
Resets context parent change.void
setActiveTransaction(IBmTransaction transaction)
Sets active BM transaction.void
setDiscardableEditingSupport(boolean discardableEditingSupport)
Sets the discard editing support flag.void
setEditingContext(IBmEditingContext editingContext)
Sets editing context for the wizard context.void
setFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Sets parent's model feature to place newly created model to.void
setFqn(String fqn)
Sets FQN.void
setModel(M model)
Sets newly created model.void
setModelClass(org.eclipse.emf.ecore.EClass modelClass)
SetsEClass
of the model being created.void
setModelType(MdModelTypesExtension modelType)
Sets model type of the model being createdvoid
setModelVersion(Version version)
Sets model version.void
setNeedSave(boolean needSave)
Sets the save designator for the context.void
setParent(org.eclipse.emf.ecore.EObject parent)
Sets model parent.void
setV8project(IV8Project v8project)
Sets associated V8 project.
-
-
-
Method Detail
-
addRelatedModel
public void addRelatedModel(org.eclipse.emf.ecore.EObject model)
Adds the model to the list of related models.- Specified by:
addRelatedModel
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
model
- model to add.
-
findRelatedModel
public <T> T findRelatedModel(Class<T> class_)
Finds related model by its class.- Specified by:
findRelatedModel
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
class_
- model class.- Returns:
- found model or
null
, if no model found.
-
get
public <T> T get(Class<T> class_)
Gets additional context information by its class.- Specified by:
get
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
class_
- class to lookup by.- Returns:
- found additional context information or
null
, if there is no such information. - See Also:
IDtNewWizardContext.put(Object)
-
getV8project
public IV8Project getV8project()
- Specified by:
getV8project
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- associated V8 project, cannot be
null
.
-
getEditingContext
public IBmEditingContext getEditingContext()
- Specified by:
getEditingContext
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- associated editing context
-
getFeature
public org.eclipse.emf.ecore.EStructuralFeature getFeature()
- Specified by:
getFeature
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- parent's model feature to place newly created model to.
-
getFqn
public String getFqn()
Gets FQN.- Specified by:
getFqn
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- FQN, may be
null
.
-
getModel
public M getModel()
- Specified by:
getModel
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- newly created model.
-
getModelClass
public org.eclipse.emf.ecore.EClass getModelClass()
- Specified by:
getModelClass
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
EClass
of the model being created.
-
getModelType
public MdModelTypesExtension getModelType()
- Specified by:
getModelType
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- model type of the model being created or
null
, if there is no model type. - See Also:
MdModelTypesExtension
-
getModelVersion
public Version getModelVersion()
- Specified by:
getModelVersion
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- model version.
-
getParent
public org.eclipse.emf.ecore.EObject getParent()
- Specified by:
getParent
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- model parent.
-
getRelatedModels
public Iterable<org.eclipse.emf.ecore.EObject> getRelatedModels()
- Specified by:
getRelatedModels
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- related models created by the wizard.
-
isDiscardableEditingSupport
public boolean isDiscardableEditingSupport()
Checks if the editing support associated with this context should be discarded in the end.- Specified by:
isDiscardableEditingSupport
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- True if the editing support should be discarded; false otherwise.
-
isNeedSave
public boolean isNeedSave()
Checks if the wizard need to perform save of the wizard context at the end of processing.- Specified by:
isNeedSave
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- True if the data changed in wizard should be persisted.
-
put
public void put(Object object)
Stores additional context information.- Specified by:
put
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
object
- object to store.- See Also:
IDtNewWizardContext.get(Class)
-
setV8project
public void setV8project(IV8Project v8project)
Sets associated V8 project.- Specified by:
setV8project
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
v8project
- the V8 project to associate (notnull
).
-
setDiscardableEditingSupport
public void setDiscardableEditingSupport(boolean discardableEditingSupport)
Sets the discard editing support flag.- Specified by:
setDiscardableEditingSupport
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
discardableEditingSupport
- The flag to set.
-
setEditingContext
public void setEditingContext(IBmEditingContext editingContext)
Sets editing context for the wizard context.- Specified by:
setEditingContext
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
editingContext
- The editing context to set.
-
setFeature
public void setFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Sets parent's model feature to place newly created model to.- Specified by:
setFeature
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
feature
- parent's model feature to place newly created model to.
-
setFqn
public void setFqn(String fqn)
Sets FQN.- Specified by:
setFqn
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
fqn
- FQN, may benull
.
-
setModel
public void setModel(M model)
Sets newly created model.- Specified by:
setModel
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
model
- model to set.
-
setModelClass
public void setModelClass(org.eclipse.emf.ecore.EClass modelClass)
SetsEClass
of the model being created.- Specified by:
setModelClass
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
modelClass
-EClass
of the model being created..
-
setModelType
public void setModelType(MdModelTypesExtension modelType)
Sets model type of the model being created- Specified by:
setModelType
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- See Also:
MdModelTypesExtension
-
setModelVersion
public void setModelVersion(Version version)
Description copied from interface:IDtNewWizardContext
Sets model version.- Specified by:
setModelVersion
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
version
- version to set.
-
setNeedSave
public void setNeedSave(boolean needSave)
Sets the save designator for the context.- Specified by:
setNeedSave
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
needSave
- True if the context should be saved; false otherwise.
-
setParent
public void setParent(org.eclipse.emf.ecore.EObject parent)
Sets model parent.- Specified by:
setParent
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
parent
- model parent to set.
-
getActiveTransaction
public IBmTransaction getActiveTransaction()
- Specified by:
getActiveTransaction
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- active BM transaction
-
setActiveTransaction
public void setActiveTransaction(IBmTransaction transaction)
Description copied from interface:IDtNewWizardContext
Sets active BM transaction.- Specified by:
setActiveTransaction
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
transaction
- the transaction.
-
isParentChanged
public boolean isParentChanged()
Description copied from interface:IDtNewWizardContext
Checks whether the wizard context parent was changed after initial parent set.- Specified by:
isParentChanged
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
- Returns:
true
if the wizard context parent was changed.
-
resetParentChange
public void resetParentChange()
Description copied from interface:IDtNewWizardContext
Resets context parent change.- Specified by:
resetParentChange
in interfaceIDtNewWizardContext<M extends org.eclipse.emf.ecore.EObject>
-
-