Package com._1c.g5.v8.dt.md.ui.wizards
Class AbstractProjectWizard<M extends MdObject,T extends AbstractProjectWizard.WizardModel<M>>
- java.lang.Object
-
- org.eclipse.jface.wizard.Wizard
-
- com._1c.g5.v8.dt.md.ui.wizards.base.DtNewWizard<M>
-
- com._1c.g5.v8.dt.md.ui.wizards.base.aef.DtAefNewWizard<M>
-
- com._1c.g5.v8.dt.md.ui.wizards.AbstractProjectWizard<M,T>
-
- 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:
AbstractDependentProjectWizard
,ConfigurationWizard
public class AbstractProjectWizard<M extends MdObject,T extends AbstractProjectWizard.WizardModel<M>> extends DtAefNewWizard<M>
Abstract wizard of dt projects or their root objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractProjectWizard.ObjectNameValidator
Validator for creating object name.static class
AbstractProjectWizard.WizardModel<M extends MdObject>
Dependent wizard model instance.
-
Field Summary
Fields Modifier and Type Field Description protected String
id
id for view modelNewWizardPageViewModel
.-
Fields inherited from class com._1c.g5.v8.dt.md.ui.wizards.base.DtNewWizard
configurationProvider, derivedDataManagerProvider, modelManager, resourceLookup, runtimeVersionSupport, selectionService, topObjectFqnGenerator, v8projectManager, wizardExtensionsRegistry
-
-
Constructor Summary
Constructors Constructor Description AbstractProjectWizard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected T
createWizardModel()
Create wizard model.void
dispose()
void
doAddPages()
TheDtNewWizard
implementation of this wizard method does nothing.protected String
getContextHelpId()
Returns help context id to bind help to.protected Collection<String>
getExistedNames()
Returns the existed names for generate init object name.protected String
getInitObjectName()
Returns the wizard new object default name.protected IModel
getModelForPageComponent(NewWizardPageComponent<?> component)
Returns AEF model for the given component.protected org.eclipse.core.databinding.validation.IValidator
getNameValidator()
Returns validator for creating object name.protected String
getObjectNamePrefix()
Returns the new object name prefix.protected T
getOrCreateWizardModel()
Get wizard model or create if it is not exists.String
getPageDescription()
String
getPageTitle()
protected String
getProjectName()
Returns selected project name in the wizard, notnull
.protected Path
getProjectPath()
Returns selected project path in the wizard, notnull
.void
init(org.eclipse.ui.IWorkbench workbench, IStructuredSelection selection)
protected boolean
needToCreateProject()
Returns whether the wizard needs to create new project during model integration.protected void
setNeedToCreateProject(boolean needToCreateProject)
Sets whether the wizard needs to create a new project during model integration.protected void
setObjectNamePrefix(String prefix)
Set the new object name prefix.protected void
setObjectTypeNameMessage(String objectTypeNameMsg)
Set the object type name for validation messages.void
setPageDescription(String pageDescription)
Set the wizard main page description.void
setPageTitle(String pageTitle)
Set the wizard main page title.-
Methods inherited from class com._1c.g5.v8.dt.md.ui.wizards.base.aef.DtAefNewWizard
addPage, getEngine, onParentChanged
-
Methods inherited from class com._1c.g5.v8.dt.md.ui.wizards.base.DtNewWizard
addExtensionPages, addPages, canFinish, createModel, createPageControls, detectModelClass, detectParent, getContext, getPreviousPage, getSelection, integrateModel, performFinish, postProcessBmIntegration, preProcessBmIntegration, setContainer, setInitializationData, setModelClassDetectionStrategy, setOpenEditorAfterCreation, setParentDetectionStrategy, setSelectAfterCreation, setShowParentSelectionPage
-
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
-
id
protected final String id
id for view modelNewWizardPageViewModel
.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(org.eclipse.ui.IWorkbench workbench, IStructuredSelection selection)
Description copied from class:DtNewWizard
- Specified by:
init
in interfaceorg.eclipse.ui.IWorkbenchWizard
- Overrides:
init
in classDtNewWizard<M extends MdObject>
-
doAddPages
public void doAddPages()
Description copied from class:DtNewWizard
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
.- Overrides:
doAddPages
in classDtNewWizard<M extends MdObject>
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
dispose
in classDtAefNewWizard<M extends MdObject>
-
getPageTitle
public String getPageTitle()
- Returns:
- the pageTitle
-
getPageDescription
public String getPageDescription()
- Returns:
- the pageDescription
-
setPageDescription
public void setPageDescription(String pageDescription)
Set the wizard main page description.- Parameters:
pageDescription
- the wizard main page description to set, cannot benull
-
setPageTitle
public void setPageTitle(String pageTitle)
Set the wizard main page title.- Parameters:
pageTitle
- the wizard main page title to set, cannot benull
-
getContextHelpId
protected String getContextHelpId()
Returns help context id to bind help to.- Returns:
- help context id or
null
if no help is needed
-
getModelForPageComponent
protected IModel getModelForPageComponent(NewWizardPageComponent<?> component)
Description copied from class:DtAefNewWizard
Returns AEF model for the given component. Override to support components that is added as pages withDtAefNewWizard.addPage(NewWizardPageComponent)
.- Overrides:
getModelForPageComponent
in classDtAefNewWizard<M extends MdObject>
- Parameters:
component
- the component- Returns:
- model for the given component or
null
.
-
createWizardModel
protected T createWizardModel()
Create wizard model.- Returns:
- a new wizard model, never
null
-
getOrCreateWizardModel
protected final T getOrCreateWizardModel()
Get wizard model or create if it is not exists.- Returns:
- a new wizard model, cannot be
null
-
needToCreateProject
protected boolean needToCreateProject()
Returns whether the wizard needs to create new project during model integration. Default value isfalse
, implementation may change it withsetNeedToCreateProject(boolean)
.- Returns:
- whether the wizard needs to create new project during model integration
-
setNeedToCreateProject
protected void setNeedToCreateProject(boolean needToCreateProject)
Sets whether the wizard needs to create a new project during model integration.- Parameters:
needToCreateProject
- the flag to set
-
getInitObjectName
protected String getInitObjectName()
Returns the wizard new object default name. Can be customized oversetObjectNamePrefix()
andgetExistedNames()
.- Returns:
- new object name
-
setObjectNamePrefix
protected void setObjectNamePrefix(String prefix)
Set the new object name prefix.- Parameters:
new
- object name prefix to set, cannot benull
-
getObjectNamePrefix
protected String getObjectNamePrefix()
Returns the new object name prefix.- Returns:
- object name prefix, cannot be
null
-
getExistedNames
protected Collection<String> getExistedNames()
Returns the existed names for generate init object name.- Returns:
- collection of already taken names, cannot be
null
-
setObjectTypeNameMessage
protected void setObjectTypeNameMessage(String objectTypeNameMsg)
Set the object type name for validation messages. For example "Configuration name".- Parameters:
object
- type name for validation messages to set, cannot benull
-
getProjectPath
protected Path getProjectPath()
Returns selected project path in the wizard, notnull
.- Returns:
- the selected project path in the wizard, not
null
.
-
getProjectName
protected String getProjectName()
Returns selected project name in the wizard, notnull
.- Returns:
- the selected project name in the wizard, not
null
.
-
getNameValidator
protected org.eclipse.core.databinding.validation.IValidator getNameValidator()
Returns validator for creating object name.- Returns:
- object name validator, cannot be
null
-
-