Class DtNewWizard<M extends org.eclipse.emf.ecore.EObject>
- java.lang.Object
-
- org.eclipse.jface.wizard.Wizard
-
- com._1c.g5.v8.dt.md.ui.wizards.base.DtNewWizard<M>
-
- All Implemented Interfaces:
IDtNewWizard<M>
,org.eclipse.core.runtime.IExecutableExtension
,org.eclipse.jface.window.IShellProvider
,org.eclipse.jface.wizard.IWizard
,org.eclipse.ui.INewWizard
,org.eclipse.ui.IWorkbenchWizard
- Direct Known Subclasses:
DtAefNewWizard
public class DtNewWizard<M extends org.eclipse.emf.ecore.EObject> extends org.eclipse.jface.wizard.Wizard implements IDtNewWizard<M>, org.eclipse.core.runtime.IExecutableExtension
Base class for all DT model-related wizards.
-
-
Field Summary
Fields Modifier and Type Field Description protected IConfigurationProvider
configurationProvider
protected IDerivedDataManagerProvider
derivedDataManagerProvider
protected IBmModelManager
modelManager
protected IResourceLookup
resourceLookup
protected IRuntimeVersionSupport
runtimeVersionSupport
protected IDtSelectionService
selectionService
protected ITopObjectFqnGenerator
topObjectFqnGenerator
protected IV8ProjectManager
v8projectManager
protected DtNewWizardExtensionsRegistry
wizardExtensionsRegistry
-
Constructor Summary
Constructors Constructor Description DtNewWizard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addExtensionPages()
Add extensions pages to the DT wizard.void
addPages()
boolean
canFinish()
void
createModel()
Creates a model from the information stored in the wizard context.void
createPageControls(org.eclipse.swt.widgets.Composite pageContainer)
void
detectModelClass()
Detects a model class from the information stored in the wizard context.void
detectParent(IStructuredSelection selection)
Detects a parent for a given selection and stores it in the wizard context.void
dispose()
protected void
doAddPages()
TheDtNewWizard
implementation of this wizard method does nothing.IDtNewWizardContext<M>
getContext()
org.eclipse.jface.wizard.IWizardPage
getPreviousPage(org.eclipse.jface.wizard.IWizardPage page)
ISelection
getSelection()
Returns the selection at the moment the wizard was created.void
init(org.eclipse.ui.IWorkbench workbench, IStructuredSelection selection)
void
integrateModel(org.eclipse.core.runtime.IProgressMonitor monitor)
Integrates the created model in the enclosing model.boolean
performFinish()
protected void
postProcessBmIntegration(IBmTransaction transaction, org.eclipse.core.runtime.IProgressMonitor monitor)
Descendants could add additional data postprocessing to the model being integrated.protected void
preProcessBmIntegration(IBmTransaction transaction, org.eclipse.core.runtime.IProgressMonitor monitor)
Descendants could add additional data preprocessing before integrated to the model.void
setContainer(org.eclipse.jface.wizard.IWizardContainer wizardContainer)
void
setInitializationData(org.eclipse.core.runtime.IConfigurationElement configurationElement, String propertyName, Object data)
protected void
setModelClassDetectionStrategy(IDtNewWizardModelClassDetectionStrategy strategy)
Sets model class detection strategy.protected void
setOpenEditorAfterCreation(boolean value)
Sets wizard editor behavior.protected void
setParentDetectionStrategy(IDtNewWizardParentDetectionStrategy strategy)
Sets parent detection strategy.protected void
setSelectAfterCreation(boolean value)
Sets wizard editor behavior.protected void
setShowParentSelectionPage(boolean value)
Sets wizard parent selection page behavior.-
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
-
-
-
-
Field Detail
-
configurationProvider
@Inject protected IConfigurationProvider configurationProvider
-
v8projectManager
@Inject protected IV8ProjectManager v8projectManager
-
topObjectFqnGenerator
@Inject protected ITopObjectFqnGenerator topObjectFqnGenerator
-
runtimeVersionSupport
@Inject protected IRuntimeVersionSupport runtimeVersionSupport
-
derivedDataManagerProvider
@Inject protected IDerivedDataManagerProvider derivedDataManagerProvider
-
resourceLookup
@Inject protected IResourceLookup resourceLookup
-
modelManager
@Inject protected IBmModelManager modelManager
-
wizardExtensionsRegistry
@Inject protected DtNewWizardExtensionsRegistry wizardExtensionsRegistry
-
selectionService
@Inject protected IDtSelectionService selectionService
-
-
Method Detail
-
init
public void init(org.eclipse.ui.IWorkbench workbench, IStructuredSelection selection)
- Specified by:
init
in interfaceorg.eclipse.ui.IWorkbenchWizard
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
dispose
in classorg.eclipse.jface.wizard.Wizard
-
addPages
public final void addPages()
Should not be referenced by clients. Sublass must override
doAddPages()
instead.- Specified by:
addPages
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
addPages
in classorg.eclipse.jface.wizard.Wizard
-
createPageControls
public void createPageControls(org.eclipse.swt.widgets.Composite pageContainer)
- Specified by:
createPageControls
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
createPageControls
in classorg.eclipse.jface.wizard.Wizard
-
performFinish
public boolean performFinish()
- Specified by:
performFinish
in interfaceorg.eclipse.jface.wizard.IWizard
- Specified by:
performFinish
in classorg.eclipse.jface.wizard.Wizard
-
getPreviousPage
public org.eclipse.jface.wizard.IWizardPage getPreviousPage(org.eclipse.jface.wizard.IWizardPage page)
- Specified by:
getPreviousPage
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
getPreviousPage
in classorg.eclipse.jface.wizard.Wizard
-
getContext
public IDtNewWizardContext<M> getContext()
- Specified by:
getContext
in interfaceIDtNewWizard<M extends org.eclipse.emf.ecore.EObject>
- Returns:
- associated wizard context.
- See Also:
IDtNewWizardContext
-
detectParent
public void detectParent(IStructuredSelection selection)
Detects a parent for a given selection and stores it in the wizard context.- Specified by:
detectParent
in interfaceIDtNewWizard<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
selection
- selection to detect model from.
-
detectModelClass
public void detectModelClass()
Detects a model class from the information stored in the wizard context. Stores the model class in the wizard context. Called afterIDtNewWizard.detectParent(IStructuredSelection)
.- Specified by:
detectModelClass
in interfaceIDtNewWizard<M extends org.eclipse.emf.ecore.EObject>
-
createModel
public void createModel()
Creates a model from the information stored in the wizard context. Stores the model in the wizard context. Called afterIDtNewWizard.detectModelClass()
.- Specified by:
createModel
in interfaceIDtNewWizard<M extends org.eclipse.emf.ecore.EObject>
-
integrateModel
public void integrateModel(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
Integrates the created model in the enclosing model. Called at wizard finish.- Specified by:
integrateModel
in interfaceIDtNewWizard<M extends org.eclipse.emf.ecore.EObject>
- Parameters:
monitor
- the progress monitor to report progress to ornull
if progress report is not needed- Throws:
org.eclipse.core.runtime.CoreException
- if model integrations fails with some reason
-
setInitializationData
public void setInitializationData(org.eclipse.core.runtime.IConfigurationElement configurationElement, String propertyName, Object data) throws org.eclipse.core.runtime.CoreException
- Specified by:
setInitializationData
in interfaceorg.eclipse.core.runtime.IExecutableExtension
- Throws:
org.eclipse.core.runtime.CoreException
-
getSelection
public ISelection getSelection()
Returns the selection at the moment the wizard was created.- Returns:
- Selection at the moment the wizard was created
-
addExtensionPages
protected void addExtensionPages()
Add extensions pages to the DT wizard.
-
doAddPages
protected void doAddPages()
TheDtNewWizard
implementation of this wizard method does nothing. Subclasses should extend if extra pages need to be added before the wizard opens. New pages should be added by callingaddPage
.
-
preProcessBmIntegration
protected void preProcessBmIntegration(IBmTransaction transaction, org.eclipse.core.runtime.IProgressMonitor monitor)
Descendants could add additional data preprocessing before integrated to the model.- Parameters:
transaction
- the transaction the task is being executed in, cannot benull
monitor
- the task progress monitor, cannot benull
-
postProcessBmIntegration
protected void postProcessBmIntegration(IBmTransaction transaction, org.eclipse.core.runtime.IProgressMonitor monitor)
Descendants could add additional data postprocessing to the model being integrated.- Parameters:
transaction
- The transaction the task is being executed in.monitor
- The task progress monitor.
-
setContainer
public void setContainer(org.eclipse.jface.wizard.IWizardContainer wizardContainer)
- Specified by:
setContainer
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
setContainer
in classorg.eclipse.jface.wizard.Wizard
-
canFinish
public boolean canFinish()
- Specified by:
canFinish
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
canFinish
in classorg.eclipse.jface.wizard.Wizard
-
setParentDetectionStrategy
protected void setParentDetectionStrategy(IDtNewWizardParentDetectionStrategy strategy)
Sets parent detection strategy.- Parameters:
strategy
- strategy to set.- See Also:
DtNewWizardParentDetectionStrategy.ByFeatures
,DtNewWizardParentDetectionStrategy.NoParent
-
setModelClassDetectionStrategy
protected void setModelClassDetectionStrategy(IDtNewWizardModelClassDetectionStrategy strategy)
Sets model class detection strategy.- Parameters:
strategy
- strategy to set.- See Also:
DtNewWizardModelClassDetectionStrategy.ByFeature
,DtNewWizardModelClassDetectionStrategy.FixedClass
-
setOpenEditorAfterCreation
protected void setOpenEditorAfterCreation(boolean value)
Sets wizard editor behavior.- Parameters:
value
-true
to open editor when wizard finishes,false
do not open.
-
setSelectAfterCreation
protected void setSelectAfterCreation(boolean value)
Sets wizard editor behavior.- Parameters:
value
-true
to select and reveal the object after it is created.
-
setShowParentSelectionPage
protected void setShowParentSelectionPage(boolean value)
Sets wizard parent selection page behavior.- Parameters:
value
-true
to show the parent selection page if parent can't be detected automatically,false
never show parent selection page.
-
-