Examples of Diagram


Examples of org.eclipse.gmf.runtime.notation.Diagram

    /* Get selection */
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();

    // Get selection from the window
    final ISelection selection = window.getSelectionService().getSelection();
        Diagram diagramView = null;
       
        // get the editing domain
        if (selection instanceof IStructuredSelection) {

            IStructuredSelection structuredSelection = (IStructuredSelection) selection;

            // Walk selection
            for (Iterator i = structuredSelection.iterator(); i.hasNext();) {

                // Try to adapt the selection to a view
                Object selectedObject = i.next();
                if (selectedObject instanceof IAdaptable) {

                    // Try to get a View (new notation)
                    Object object = ((IAdaptable) selectedObject)
                        .getAdapter(View.class);
                   
                    diagramView = ((View)object).getDiagram();
                }
            }
        }
       
        if (diagramView != null) {
            final Diagram diag = diagramView;
           

           
            TransactionalEditingDomain ted = TransactionUtil.getEditingDomain(diagramView);
            AbstractEMFOperation operation = new AbstractEMFOperation(
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

  /**
   * @generated
   */
  public Diagram createDiagram(IAdaptable semanticAdapter,
      String diagramKind, PreferencesHint preferencesHint) {
    Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
    diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle());
    diagram.setType(DispelFunctionEditPart.MODEL_ID);
    diagram.setElement(getSemanticElement(semanticAdapter));
    diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL);
    return diagram;
  }
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

      throws CoreException {
    IDiagramDocument diagramDocument = (IDiagramDocument) document;
    TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
    if (element instanceof FileEditorInput) {
      IStorage storage = ((FileEditorInput) element).getStorage();
      Diagram diagram = DiagramIOUtil.load(domain, storage, true,
          getProgressMonitor());
      document.setContent(diagram);
    } else if (element instanceof URIEditorInput) {
      URI uri = ((URIEditorInput) element).getURI();
      Resource resource = null;
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

                "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
      }
      IDiagramDocument diagramDocument = (IDiagramDocument) document;
      final Resource newResource = diagramDocument.getEditingDomain()
          .getResourceSet().createResource(newResoruceURI);
      final Diagram diagramCopy = (Diagram) EcoreUtil
          .copy(diagramDocument.getDiagram());
      try {
        new AbstractTransactionalCommand(
            diagramDocument.getEditingDomain(),
            NLS.bind(
                Messages.DispelDocumentProvider_SaveAsOperation,
                diagramCopy.getName()), affectedFiles) {
          protected CommandResult doExecuteWithResult(
              IProgressMonitor monitor, IAdaptable info)
              throws ExecutionException {
            newResource.getContents().add(diagramCopy);
            return CommandResult.newOKCommandResult();
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

    protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
        IAdaptable info) throws ExecutionException {
      try {
       
//iFO       
        Diagram diagram = getDiagramToOpen();
        if (diagram == null) {
          diagram = intializeNewDiagram();
        }
        URI uri = EcoreUtil.getURI(diagram);
        String editorName = uri.lastSegment()
            + "#" + diagram.eResource().getContents().indexOf(diagram); //$NON-NLS-1$
        IEditorInput editorInput = new URIEditorInput(uri, editorName);
        IWorkbenchPage page = PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getActivePage();
        page.openEditor(editorInput, getEditorID());
        return CommandResult.newOKCommandResult();
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

     * @generated
     */
    protected Diagram intializeNewDiagram() throws ExecutionException {

//iFO     
      Diagram d = ViewService.createDiagram(getDiagramDomainElement(),
          getDiagramKind(), getPreferencesHint());
      if (d == null) {
        throw new ExecutionException("Can't create diagram of '"
            + getDiagramKind() + "' kind");
      }
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

     * @generated
     */
    protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
        IAdaptable info) throws ExecutionException {
      try {
        Diagram diagram = getDiagramToOpen();
        if (diagram == null) {
          diagram = intializeNewDiagram();
        }
        URI uri = EcoreUtil.getURI(diagram);
        String editorName = uri.lastSegment()
            + "#" + diagram.eResource().getContents().indexOf(diagram); //$NON-NLS-1$
        IEditorInput editorInput = new URIEditorInput(uri, editorName);
        IWorkbenchPage page = PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getActivePage();
        page.openEditor(editorInput, getEditorID());
        return CommandResult.newOKCommandResult();
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

    /**
     * @generated
     */
    protected Diagram intializeNewDiagram() throws ExecutionException {
      Diagram d = ViewService.createDiagram(getDiagramDomainElement(),
          getDiagramKind(), getPreferencesHint());
      if (d == null) {
        throw new ExecutionException("Can't create diagram of '"
            + getDiagramKind() + "' kind");
      }
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

     * @generated
     */
    protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
        IAdaptable info) throws ExecutionException {
      try {
        Diagram diagram = getDiagramToOpen();
        if (diagram == null) {
          diagram = intializeNewDiagram();
        }
        URI uri = EcoreUtil.getURI(diagram);
        String editorName = uri.lastSegment()
            + "#" + diagram.eResource().getContents().indexOf(diagram); //$NON-NLS-1$
        IEditorInput editorInput = new URIEditorInput(uri, editorName);
        IWorkbenchPage page = PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getActivePage();
        page.openEditor(editorInput, getEditorID());
        return CommandResult.newOKCommandResult();
View Full Code Here

Examples of org.eclipse.gmf.runtime.notation.Diagram

    /**
     * @generated
     */
    protected Diagram intializeNewDiagram() throws ExecutionException {
      Diagram d = ViewService.createDiagram(getDiagramDomainElement(),
          getDiagramKind(), getPreferencesHint());
      if (d == null) {
        throw new ExecutionException("Can't create diagram of '"
            + getDiagramKind() + "' kind");
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.