@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);
  }
 public void onRestore(@Observes RestoreEvent restore) {
   if (path == null || restore == null || restore.getPath() == null) {
     return;
   }
   if (path.equals(restore.getPath())) {
     loadContent();
     notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemRestored()));
   }
 }
  @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 boolean confirmClose() {
   return Window.confirm(CommonConstants.INSTANCE.DiscardUnsavedData());
 }
 @Override
 public void showCanNotSaveReadOnly() {
   Window.alert(CommonConstants.INSTANCE.CantSaveReadOnly());
 }
 @Override
 public void showSaveSuccessful() {
   notification.fire(new NotificationEvent(CommonConstants.INSTANCE.ItemSavedSuccessfully()));
 }