docs: public int createSARLType(IProgressMonitor monitor) throws CoreException, InterruptedException {
  		try {
  			final SubMonitor mainmon = SubMonitor.convert(monitor, getTitle(), STEPS);
  			// Create the package if not existing
  			IPackageFragment packageFragment = getPackageFragment();
  			if (!packageFragment.exists()) {
  				packageFragment = getPackageFragmentRoot().createPackageFragment(
  						getPackageFragment().getElementName(),
  						true,
  						mainmon.newChild(1));
  			} else {
  				mainmon.worked(1);
  			}
  
  			// Create the file
  			final IFolder packageResource = (IFolder) packageFragment.getResource();
  			if (!packageResource.exists()) {
  				CoreUtility.createFolder(packageResource, true, true, mainmon.newChild(1));
  			} else {
  				mainmon.worked(1);
  			}
  			IFile sarlFile = packageResource.getFile(
  					getTypeName() + "." //$NON-NLS-1$
  					+ this.sarlFileExtension);
  			int index = 1;
  			while (sarlFile.exists()) {
  				sarlFile = packageResource.getFile(
  						getTypeName() + index + "." //$NON-NLS-1$
  						+ this.sarlFileExtension);
  				++index;
  			}
  
  			final URI sarlUri = this.storage2UriMapper.getUri(sarlFile);
  			final ResourceSet resourceSet = this.resourceSetFactory.get(packageFragment.getJavaProject().getProject());
  			final ICompilationUnit compilationUnit = getCompilationUnitStub();
  			final String lineSeparator = this.whitespaceInformationProvider
  					.getLineSeparatorInformation(sarlUri).getLineSeparator();
  			mainmon.worked(1);
  
  			// Create the type content
  			final SubMonitor mon1 = mainmon.newChild(1);
  			mon1.setTaskName(MessageFormat.format(Messages.AbstractNewSarlElementWizardPage_5, getTypeName()));
  			final String typeComment = getTypeComment(compilationUnit, lineSeparator);
  			final IJvmTypeProvider typeProvider = this.jdtTypeProviderFactory.findOrCreateTypeProvider(resourceSet);
  			final ImportManager imports = new ImportManager(true);
  			this.injector.injectMembers(imports);
  			final FakeTreeAppendable appender = new FakeTreeAppendable(imports);
  			this.injector.injectMembers(appender);
  			generateTypeContent(appender, typeProvider, typeComment, mon1);
  			mon1.done();
  
  			// Build the full file content
  			final SubMonitor mon2 = mainmon.newChild(1);
  			mon2.setTaskName(MessageFormat.format(Messages.AbstractNewSarlElementWizardPage_6, getTypeName()));
  			final String fileComment = getFileComment(compilationUnit, lineSeparator);
  			final StringBuilder realContent = new StringBuilder();
  			if (!Strings.isNullOrEmpty(fileComment)) {
  				realContent.append(fileComment);
  				realContent.append(lineSeparator);
  				realContent.append(lineSeparator);
  			}
  			realContent.append(appender.getContent());
  			realContent.append(lineSeparator);
  			mon2.done();
  
  			final SubMonitor mon3 = mainmon.newChild(1);
  			mon3.setTaskName(MessageFormat.format(Messages.AbstractNewSarlElementWizardPage_7, getTypeName()));
  			final String content = this.formatterFacade.format(realContent.toString());
  			mon3.done();
  
  			// Write the resource
  			final SubMonitor mon4 = mainmon.newChild(1);
  			mon4.setTaskName(MessageFormat.format(Messages.AbstractNewSarlElementWizardPage_8, getTypeName()));
  			try (ByteArrayInputStream stream = new ByteArrayInputStream(content.getBytes())) {
  				sarlFile.create(stream, true, mon4);
  			}
  			setResource(sarlFile);
  			saveSettings();
  			mon4.done();
  
  			return content.length();
  		} catch (OperationCanceledException e) {
  			throw new InterruptedException();
  		} catch (CoreException e) {
  			throw e;
  		} catch (Exception e) {
  			throw new CoreException(SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR, e));
  		}
  	}