AnsweredAssumed Answered

Activiti editor - read only mode

Question asked by breakline on Feb 26, 2014
Latest reply on Mar 4, 2014 by breakline
Hi!

Is there a simple way to implement a read only editor? We implemented our own diagram behavior class based on DiagramBehavior.java The class DiagramBehavior has this function we figured we should override:


private void setConfigurationProvider(IConfigurationProviderInternal configurationProvider) {
      this.configurationProvider = configurationProvider;

      // initialize configuration-provider depending on this editor
      configurationProvider.setWorkbenchPart(parentPart);

      if (diagramContainer.getGraphicalViewer() != null) {
         initializeGraphicalViewer();
      }

      if (diagramContainer instanceof IEditorPart) {
         DefaultEditDomain editDomain = new DefaultEditDomain((IEditorPart) diagramContainer);
         diagramContainer.setEditDomain(editDomain);
      }

      CommandStack commandStack = new GFCommandStack(configurationProvider, getEditingDomain());
      getEditDomain().setCommandStack(commandStack);
   }


But since this function is private we cannot override it.  But this function sets the editing domain as well as the command stack. So we're stuck with this for now.

Is there any easy way to implement a read-only functionality? As far as I can tell we need to set our own EditDomain for that? Is there a way to set the Edit Domain later? Maybe overwrite it?

Outcomes