Package org.springframework.richclient.application.event

Examples of org.springframework.richclient.application.event.LifecycleApplicationEvent


   * model accordingly.
   * @param e event to process
   */
  public void onApplicationEvent(ApplicationEvent e) {
    if (e instanceof LifecycleApplicationEvent) {
      LifecycleApplicationEvent le = (LifecycleApplicationEvent) e;
      if (shouldHandleEvent(e)) {
        if (le.getEventType() == LifecycleApplicationEvent.CREATED) {
          handleNewObject(le.getObject());
        }
        else if (le.getEventType() == LifecycleApplicationEvent.MODIFIED) {
          handleUpdatedObject(le.getObject());
        }
        else if (le.getEventType() == LifecycleApplicationEvent.DELETED) {
          handleDeletedObject(le.getObject());
        }
      }
    }
  }
View Full Code Here


    }
    else {
      eventType = LifecycleApplicationEvent.MODIFIED;
    }
    // And notify the rest of the application of the change
    getApplicationContext().publishEvent(new LifecycleApplicationEvent(eventType, getEditingContact()));
    return true;
  }
View Full Code Here

                        Contact contact = (Contact) selected;
                        // Delete the object from the persistent store.
                        getContactDataStore().delete(contact);
                        // And notify the rest of the application of the change
                        getApplicationContext().publishEvent(
                                new LifecycleApplicationEvent(LifecycleApplicationEvent.DELETED, contact));
                    }
                }
            };
            dlg.showDialog();
        }
View Full Code Here

        pageComponent.setContext(new DefaultViewContext(this, editorPane))
        WorkspaceView workspace = (WorkspaceView)workspaceComponent;
        workspace.addDocumentComponent(pageComponent, activateAfterOpen);
        // Fires lifecycle event so listeners can react to editor
        //  being opened.
        LifecycleApplicationEvent event = new LifecycleApplicationEvent(
            LifecycleApplicationEvent.CREATED, editor);
        Application.instance().getApplicationContext().publishEvent(event);
    }
    }
View Full Code Here

        return group.createPopupMenu();
    }

    public void onApplicationEvent(ApplicationEvent e) {
        if (e instanceof LifecycleApplicationEvent) {
            LifecycleApplicationEvent le = (LifecycleApplicationEvent)e;
            if (le.getEventType() == LifecycleApplicationEvent.CREATED && le.objectIs(Owner.class)) {
                if (ownersTree != null) {
                    DefaultMutableTreeNode root = (DefaultMutableTreeNode)ownersTreeModel.getRoot();
                    root.add(new DefaultMutableTreeNode(le.getObject()));
                    ownersTreeModel.nodeStructureChanged(root);
                }
            }
        }
    }
View Full Code Here

    protected boolean onFinish() {
        Owner newOwner = getNewOwner();
        clinic.storeOwner(newOwner);
        getApplicationContext()
                .publishEvent(new LifecycleApplicationEvent(LifecycleApplicationEvent.CREATED, newOwner));
        return true;
    }
View Full Code Here

          eventType = LifecycleApplicationEvent.MODIFIED;
        }
        backend.commit();

        // And notify the rest of the application of the change
        springSupport.publishEvent( new LifecycleApplicationEvent( eventType, getFormObject() ) );
      }
    } ).run();
  }
View Full Code Here

  public void onApplicationEvent( ApplicationEvent event ) {
    if ( !( event instanceof LifecycleApplicationEvent ) ) {
      return;
    }

    LifecycleApplicationEvent lifecycleApplicationEvent = ( LifecycleApplicationEvent ) event;
    if ( !shouldHandleEvent( lifecycleApplicationEvent ) ) {
      return;
    }

    if ( !type.isAssignableFrom( lifecycleApplicationEvent.getObject().getClass() ) ) {
      return;
    }

    T eventObject = ( T ) lifecycleApplicationEvent.getObject();


    if ( LifecycleApplicationEvent.CREATED.equals( lifecycleApplicationEvent.getEventType() ) ) {
      handleNewObject( eventObject );
    } else if ( LifecycleApplicationEvent.MODIFIED.equals( lifecycleApplicationEvent.getEventType() ) ) {
      handleUpdatedObject( eventObject );
    } else if ( LifecycleApplicationEvent.DELETED.equals( lifecycleApplicationEvent.getEventType() ) ) {
      handleDeletedObject( eventObject );
    }
  }
View Full Code Here

    this.addScrollPane = addScrollPane;
  }

  protected void commit() {
    formUi.commit();
    SpringSupport.INSTANCE.getApplicationContext().publishEvent( new LifecycleApplicationEvent( LifecycleApplicationEvent.MODIFIED, formUi.getFormObject() ) )//todo notifying necessary???
  }
View Full Code Here

  public void publishEvent( @NotNull ApplicationEvent event ) {
    getApplicationContext().publishEvent( event );
  }

  public void publishCreated( @NotNull Object object ) {
    publishEvent( new LifecycleApplicationEvent( LifecycleApplicationEvent.CREATED, object ) );
  }
View Full Code Here

TOP

Related Classes of org.springframework.richclient.application.event.LifecycleApplicationEvent

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.