Package org.eclipse.emf.common.command

Examples of org.eclipse.emf.common.command.BasicCommandStack


    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());

    // Create the command stack that will notify this editor as commands are executed.
    //
    BasicCommandStack commandStack = new BasicCommandStack();

    // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
    //
    commandStack.addCommandStackListener
      (new CommandStackListener() {
         public void commandStackChanged(final EventObject event) {
           getContainer().getDisplay().asyncExec
             (new Runnable() {
                public void run() {
View Full Code Here


        if (bpmnModel.getLocationMap().size() == 0) {
          BpmnAutoLayout layout = new BpmnAutoLayout(bpmnModel);
          layout.execute();
        }

        BasicCommandStack basicCommandStack = (BasicCommandStack) getEditingDomain().getCommandStack();

        if (input instanceof DiagramEditorInput) {

          basicCommandStack.execute(new RecordingCommand(getEditingDomain()) {

            @Override
            protected void doExecute() {
              importDiagram(model);
            }
          });
        }
        basicCommandStack.saveIsDone();
        basicCommandStack.flush();
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

    adapterFactory.addAdapterFactory(new JexItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());

    // Create the command stack that will notify this editor as commands are executed.
    //
    BasicCommandStack commandStack = new BasicCommandStack();

    // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
    //
    commandStack.addCommandStackListener
      (new CommandStackListener() {
         public void commandStackChanged(final EventObject event) {
           getContainer().getDisplay().asyncExec
             (new Runnable() {
                public void run() {
View Full Code Here

    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ModelItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
     
    // Create the command stack that will notify this editor as commands are executed.
    commandStack = new BasicCommandStack();

    // Create the editing domain with a special command stack.
    editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap());

    // Load the resource through the editing domain.
View Full Code Here

    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ContactsItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
   
    contactsResource = new VCardContactsResource();
    BasicCommandStack commandStack = new BasicCommandStack();
    editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack);
    editingDomain.getResourceSet().getResources().add(contactsResource);
  }
View Full Code Here

    // adapterFactory.addAdapterFactory( new ParametersItemProviderAdapterFactory() );
    adapterFactory.addAdapterFactory( new ReflectiveItemProviderAdapterFactory() );

    // Create the command stack that will notify this editor as commands are executed.
    //
    BasicCommandStack commandStack = new BasicCommandStack();

    // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
    //
    commandStack.addCommandStackListener( new CommandStackListener() {
      public void commandStackChanged( final EventObject event ) {
        getContainer().getDisplay().asyncExec( new Runnable() {
          public void run() {
            firePropertyChange( IEditorPart.PROP_DIRTY );
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.command.BasicCommandStack

Copyright © 2018 www.massapicom. 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.