@OnStart
  public void onStart(final Path path, final PlaceRequest request) {
    this.path = path;
    this.isReadOnly = request.getParameter("readOnly", null) == null ? false : true;

    multiPage.addWidget(view, CommonConstants.INSTANCE.EditTabTitle());

    multiPage.addPage(
        new Page(viewSource, CommonConstants.INSTANCE.SourceTabTitle()) {
          @Override
          public void onFocus() {
            factModelService
                .call(
                    new RemoteCallback<String>() {
                      @Override
                      public void callback(final String response) {
                        viewSource.setContent(response);
                      }
                    })
                .toSource(view.getContent());
          }

          @Override
          public void onLostFocus() {
            viewSource.clear();
          }
        });

    multiPage.addWidget(importsWidget, CommonConstants.INSTANCE.ConfigTabTitle());

    multiPage.addWidget(metadataWidget, CommonConstants.INSTANCE.MetadataTabTitle());

    loadContent();
  }
Beispiel #2
0
  @OnStart
  public void onStart(final Path path, final PlaceRequest place) {
    this.path = path;
    this.place = place;
    this.isReadOnly = place.getParameter("readOnly", null) == null ? false : true;
    makeMenuBar();

    multiPage.addWidget(view, CommonConstants.INSTANCE.EditTabTitle());
    multiPage.addPage(
        new Page(viewSource, CommonConstants.INSTANCE.SourceTabTitle()) {
          @Override
          public void onFocus() {
            viewSource.setContent(view.getContent());
          }

          @Override
          public void onLostFocus() {
            viewSource.clear();
          }
        });

    multiPage.addPage(
        new Page(metadataWidget, MetadataConstants.INSTANCE.Metadata()) {
          @Override
          public void onFocus() {
            metadataService
                .call(
                    new RemoteCallback<Metadata>() {
                      @Override
                      public void callback(Metadata metadata) {
                        metadataWidget.setContent(metadata, isReadOnly);
                      }
                    })
                .getMetadata(path);
          }

          @Override
          public void onLostFocus() {
            // Nothing to do here
          }
        });

    enumService
        .call(
            new RemoteCallback<EnumModelContent>() {
              @Override
              public void callback(EnumModelContent response) {
                view.setContent(response.getModel().getDRL());
              }
            })
        .load(path);
  }
  @Override
  public void addBulkRunTestScenarioPanel(final Path path, final boolean isReadOnly) {
    multiPage.addPage(
        new Page(bulkRunTestScenarioEditor, TestScenarioConstants.INSTANCE.TestScenarios()) {
          @Override
          public void onFocus() {
            bulkRunTestScenarioEditor.init(path, isReadOnly);
          }

          @Override
          public void onLostFocus() {}
        });
  }
  @Inject
  public ScenarioEditorViewImpl(
      final @New ImportsWidgetPresenter importsWidget,
      final @New MultiPageEditor multiPage,
      final @New MetadataWidget metadataWidget,
      final @New BulkRunTestScenarioEditor bulkRunTestScenarioEditor,
      Caller<MetadataService> metadataService,
      final Event<NotificationEvent> notification,
      final BusyIndicatorView busyIndicatorView) {
    this.importsWidget = importsWidget;
    this.multiPage = multiPage;
    this.metadataWidget = metadataWidget;
    this.metadataService = metadataService;
    this.notification = notification;
    this.busyIndicatorView = busyIndicatorView;
    this.bulkRunTestScenarioEditor = bulkRunTestScenarioEditor;

    multiPage.addWidget(layout, "Test Scenario");

    layout.setWidth("100%");

    multiPage.addWidget(importsWidget, CommonConstants.INSTANCE.ConfigTabTitle());
  }
  @Override
  public void addMetaDataPage(final Path path, final boolean isReadOnly) {
    multiPage.addPage(
        new Page(metadataWidget, MetadataConstants.INSTANCE.Metadata()) {
          @Override
          public void onFocus() {
            metadataWidget.showBusyIndicator(CommonConstants.INSTANCE.Loading());
            metadataService
                .call(
                    new MetadataSuccessCallback(metadataWidget, isReadOnly),
                    new HasBusyIndicatorDefaultErrorCallback(metadataWidget))
                .getMetadata(path);
          }

          @Override
          public void onLostFocus() {
            // Nothing to do here.
          }
        });
  }
  @OnStartup
  public void onStartup(final ObservablePath path, final PlaceRequest place) {
    this.path = path;
    this.place = place;
    this.isReadOnly = place.getParameter("readOnly", null) == null ? false : true;
    this.version = place.getParameter("version", null);

    this.path.onRename(
        new Command() {
          @Override
          public void execute() {
            changeTitleNotification.fire(new ChangeTitleWidgetEvent(place, getTitle(), null));
          }
        });
    this.path.onConcurrentUpdate(
        new ParameterizedCommand<ObservablePath.OnConcurrentUpdateEvent>() {
          @Override
          public void execute(final ObservablePath.OnConcurrentUpdateEvent eventInfo) {
            concurrentUpdateSessionInfo = eventInfo;
          }
        });

    this.path.onConcurrentRename(
        new ParameterizedCommand<ObservablePath.OnConcurrentRenameEvent>() {
          @Override
          public void execute(final ObservablePath.OnConcurrentRenameEvent info) {
            newConcurrentRename(
                    info.getSource(),
                    info.getTarget(),
                    info.getIdentity(),
                    new Command() {
                      @Override
                      public void execute() {
                        disableMenus();
                      }
                    },
                    new Command() {
                      @Override
                      public void execute() {
                        reload();
                      }
                    })
                .show();
          }
        });

    this.path.onConcurrentDelete(
        new ParameterizedCommand<ObservablePath.OnConcurrentDelete>() {
          @Override
          public void execute(final ObservablePath.OnConcurrentDelete info) {
            newConcurrentDelete(
                    info.getPath(),
                    info.getIdentity(),
                    new Command() {
                      @Override
                      public void execute() {
                        disableMenus();
                      }
                    },
                    new Command() {
                      @Override
                      public void execute() {
                        placeManager.closePlace(place);
                      }
                    })
                .show();
          }
        });

    makeMenuBar();

    view.showBusyIndicator(CommonConstants.INSTANCE.Loading());

    multiPage.addWidget(view, DSLTextEditorConstants.INSTANCE.DSL());

    multiPage.addPage(
        new Page(metadataWidget, CommonConstants.INSTANCE.MetadataTabTitle()) {
          @Override
          public void onFocus() {
            metadataWidget.showBusyIndicator(CommonConstants.INSTANCE.Loading());
            metadataService
                .call(
                    new MetadataSuccessCallback(metadataWidget, isReadOnly),
                    new HasBusyIndicatorDefaultErrorCallback(metadataWidget))
                .getMetadata(path);
          }

          @Override
          public void onLostFocus() {
            // Nothing to do
          }
        });

    loadContent();
  }
 @Override
 public Widget asWidget() {
   return multiPage.asWidget();
 }