/** @generated */
  public StateMachine_MAVONewDiagramFileWizard(
      URI domainModelURI, EObject diagramRoot, TransactionalEditingDomain editingDomain) {
    assert domainModelURI != null : "Domain model uri must be specified"; // $NON-NLS-1$
    assert diagramRoot != null : "Doagram root element must be specified"; // $NON-NLS-1$
    assert editingDomain != null : "Editing domain must be specified"; // $NON-NLS-1$

    myFileCreationPage =
        new WizardNewFileCreationPage(
            edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages
                .StateMachine_MAVONewDiagramFileWizard_CreationPageName,
            StructuredSelection.EMPTY);
    myFileCreationPage.setTitle(
        edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages
            .StateMachine_MAVONewDiagramFileWizard_CreationPageTitle);
    myFileCreationPage.setDescription(
        NLS.bind(
            edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages
                .StateMachine_MAVONewDiagramFileWizard_CreationPageDescription,
            edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.edit.parts.StateMachineEditPart
                .MODEL_ID));
    IPath filePath;
    String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
    if (domainModelURI.isPlatformResource()) {
      filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
    } else if (domainModelURI.isFile()) {
      filePath = new Path(domainModelURI.trimSegments(1).toFileString());
    } else {
      // TODO : use some default path
      throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); // $NON-NLS-1$
    }
    myFileCreationPage.setContainerFullPath(filePath);
    myFileCreationPage.setFileName(
        edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part
            .StateMachine_MAVODiagramEditorUtil.getUniqueFileName(
            filePath, fileName, "statemachinediag_mavo")); // $NON-NLS-1$

    diagramRootElementSelectionPage =
        new DiagramRootElementSelectionPage(
            edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages
                .StateMachine_MAVONewDiagramFileWizard_RootSelectionPageName);
    diagramRootElementSelectionPage.setTitle(
        edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages
            .StateMachine_MAVONewDiagramFileWizard_RootSelectionPageTitle);
    diagramRootElementSelectionPage.setDescription(
        edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages
            .StateMachine_MAVONewDiagramFileWizard_RootSelectionPageDescription);
    diagramRootElementSelectionPage.setModelElement(diagramRoot);

    myEditingDomain = editingDomain;
  }
Exemplo n.º 2
0
 @Override
 protected Document initDocFromFile(String string, String filename) throws Exception {
   Document doc = super.initDocFromFile(string, HTML_SRC + filename);
   URI uri = doc.eResource().getURI();
   URI appendSegment = uri.trimSegments(1).appendSegment(string + ".xdoc");
   doc.eResource().setURI(appendSegment);
   return doc;
 }