/** @generated */
 private String getSchema_1000Text(View view) {
   ESchema domainModelElement = (ESchema) view.getElement();
   if (domainModelElement != null) {
     return domainModelElement.getName();
   } else {
     DatamodelerDiagramEditorPlugin.getInstance()
         .logError("No domain element for view with visualID = " + 1000); // $NON-NLS-1$
     return ""; //$NON-NLS-1$
   }
 }
  @Override
  public void configureAction(ISelection selection) {
    if (!(selection instanceof IStructuredSelection)) {
      disable();
      return;
    } else {
      IStructuredSelection sSelection = (IStructuredSelection) selection;
      if (sSelection.size() > 0) disable();

      EObject eObject =
          (EObject) ((IAdaptable) sSelection.getFirstElement()).getAdapter(EObject.class);
      EProject eModelerProject = null;

      if (eObject instanceof ESQLObject)
        eModelerProject = (EProject) ((ESQLObject) eObject).getRootContainer();

      // Comprobamos que el elemento no sea externo
      if (eObject instanceof ESchema) {
        ESchema schema = (ESchema) eObject;
        if (eModelerProject != null
            && !(eModelerProject.getCapability().equals(schema.getCapability()))) {
          disable();
          return;
        }
      } else if (eObject instanceof ETable) {
        ETable table = (ETable) eObject;
        if (eModelerProject != null
            && !(eModelerProject.getCapability().equals(table.getSchema().getCapability()))) {
          disable();
          return;
        }
      }

      super.configureAction(new StructuredSelection(eObject));
    }
  }
  @Override
  public boolean performFinish() {
    _wizardPage.setPageComplete(false);
    TransactionalEditingDomain myEditingDomain = DataModelerUtils.getDataModelerEditingDomain();

    _schema = _wizardPage.getSchema();

    if (_schema.eIsProxy())
      _schema = (ESchema) EcoreUtil.resolve(_schema, myEditingDomain.getResourceSet());

    if (!_schema.eIsProxy()) _resource = _schema.eResource();

    if (_resource == null) return true;

    String path = _resource.getURI().toPlatformString(true);

    LinkedList<IFile> affectedFiles = new LinkedList<IFile>();

    IResource workspaceResource =
        ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));

    if (workspaceResource instanceof IFile) affectedFiles.add((IFile) workspaceResource);

    AbstractTransactionalCommand command =
        new AbstractTransactionalCommand(
            myEditingDomain,
            "Comando de creación de diagramas", //$NON-NLS-1$
            affectedFiles) {

          protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
              throws ExecutionException {

            _diagram =
                ViewService.createDiagram(
                    _schema,
                    SchemaEditPart.MODEL_ID,
                    DatamodelerDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
            _diagram.setName(_wizardPage.getDiagramName());
            _resource.getContents().add(_diagram);

            return CommandResult.newOKCommandResult();
          }
        };
    try {
      OperationHistoryFactory.getOperationHistory()
          .execute(command, new NullProgressMonitor(), null);

      _resource.save(DatamodelerDiagramEditorUtil.getSaveOptions());

      final URI diagramURI = EcoreUtil.getURI(_diagram);

      Display.getCurrent()
          .asyncExec(
              new Runnable() {

                @Override
                public void run() {
                  if (diagramURI.toPlatformString(true) != null)
                    try {
                      UtilsDataModelerUI.openDiagram(diagramURI, _diagram.getName());
                    } catch (PartInitException ex) {
                      DatamodelerDiagramEditorPlugin.getInstance()
                          .logError("Unable to open editor", ex); // $NON-NLS-1$
                    }
                }
              });

    } catch (ExecutionException e) {
      DatamodelerDiagramEditorPlugin.getInstance()
          .logError("Unable to create model and diagram", e); // $NON-NLS-1$
    } catch (IOException ex) {
      DatamodelerDiagramEditorPlugin.getInstance()
          .logError("Save operation failed for: " + _resource.getURI(), ex); // $NON-NLS-1$
    }

    return true;
  }