Exemple #1
0
 @Override
 public void onResource(Response response, VariableDto crossWithVariable) {
   // check cross variable is valid
   VariableDtos.VariableNature nature = VariableDtos.nature(crossWithVariable);
   if (nature == VariableDtos.VariableNature.CATEGORICAL
       || nature == VariableDtos.VariableNature.CONTINUOUS) {
     ContingencyTablePresenter crossVariablePresenter = crossVariableProvider.get();
     crossVariablePresenter.initialize(table, variableDto, crossWithVariable);
     setInSlot(Display.Slots.ContingencyTable, crossVariablePresenter);
   } else {
     fireEvent(
         NotificationEvent.newBuilder()
             .error(
                 TranslationsUtils.replaceArguments(
                     translations.variableNotCategoricalNorContinuous(),
                     crossWithVariable.getName()))
             .build());
   }
 } //
Exemple #2
0
 @Override
 public void onResource(Response response, final VariableDto variableDto) {
   // check selected variable is valid
   if (VariableDtos.nature(variableDto) == VariableDtos.VariableNature.CATEGORICAL) {
     ResourceRequestBuilderFactory.<VariableDto>newBuilder() //
         .forResource(
             UriBuilders.DATASOURCE_TABLE_VARIABLE
                 .create()
                 .build(table.getDatasourceName(), table.getName(), crossWithVariableName)) //
         .get() //
         .withCallback(new CrossVariableCallback(variableDto))
         .withCallback(
             new VariableNotFoundCallback(crossWithVariableName), Response.SC_NOT_FOUND) //
         .send();
   } else {
     fireEvent(
         NotificationEvent.newBuilder()
             .error(
                 TranslationsUtils.replaceArguments(
                     translations.variableNotCategorical(), variableDto.getName()))
             .build());
   }
 } //