コード例 #1
0
    @Override
    public void handleEvent(final MessageBoxEvent be) {
      final String newEntityName = be.getValue();
      if (!Utils.isEmptyString(newEntityName)) {
        final EntityName categoryName;
        try {
          categoryName =
              CommonFactoryLocator.getInstance().createName(newEntityName, EntityType.category);
        } catch (NimbitsException e) {
          FeedbackHelper.showError(e);
          return;
        }

        final EntityServiceAsync service = GWT.create(EntityService.class);
        Entity entity = EntityModelFactory.createEntity(categoryName, EntityType.category);

        service.addUpdateEntity(entity, new AddUpdateEntityAsyncCallback());
      }
    }
コード例 #2
0
    @Override
    public void handleEvent(MessageBoxEvent be) {
      newEntityName = be.getValue();
      if (!Utils.isEmptyString(newEntityName)) {
        final MessageBox box =
            MessageBox.wait(
                "Progress",
                "Creating your data point channel into the cloud",
                "Creating: " + newEntityName);
        box.show();
        EntityServiceAsync service = GWT.create(EntityService.class);

        try {
          Point p = EntityHelper.createPointWithName(newEntityName);

          service.addUpdateEntity(p, new NewPointEntityAsyncCallback(box));
        } catch (NimbitsException caught) {
          FeedbackHelper.showError(caught);
        }
      }
    }