@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();
  }
Esempio n. 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);
  }