Ejemplo n.º 1
0
  @Override
  public void handlePerspective(
      final Message<Event, Object> action, final PerspectiveLayout perspectiveLayout) {
    if (action.messageBodyEquals(MessageUtil.INIT)) {

      perspectiveLayout.registerRootComponent(createRoot());
      GridPane.setVgrow(perspectiveLayout.getRootComponent(), Priority.ALWAYS);
      GridPane.setHgrow(perspectiveLayout.getRootComponent(), Priority.ALWAYS);

      // register left panel
      perspectiveLayout.registerTargetLayoutComponent("content0", this.content1);
      perspectiveLayout.registerTargetLayoutComponent("content1", this.content2);
      perspectiveLayout.registerTargetLayoutComponent("content2", this.content3);
      ApplicationLauncherPerspectiveMessaginTest.latch.countDown();
    } else {
      if (counter.get() > 1) {
        counter.decrementAndGet();
        context.send("id10", "message");
      } else {
        System.out.println("Perspective id12: FINISH");
        if (wait.getCount() > 0) wait.countDown();
        if (PerspectiveMessagingTestP1.wait.getCount() > 0) context.send("id10", "message");
      }
    }
  }
  @OnAsyncMessage(String.class)
  public Object onStringMessage(final Message<Event, Object> action) {
    if (action.messageBodyEquals(FXUtil.MessageUtil.INIT)) {
      ApplicationLauncherCallbackComponentMessaginTest1.latch.countDown();
    } else {
      if (counter.get() > 1) {
        counter.decrementAndGet();

      } else {
        System.out.println("Component id010: FINISH");
        if (wait.getCount() > 0) wait.countDown();

        return MESSAGE;
      }
    }
    context.setReturnTarget(
        PerspectiveIds.PerspectiveCallbackComponentMessagingTest1.concat(".")
            .concat(ComponentIds.CallbackComponentMessagingTest1Component1));
    return MESSAGE;
  }
Ejemplo n.º 3
0
 public static void fireMessage() {
   context.send("id10", "message");
 }