Exemple #1
0
  private void addTableColumns() {

    // Variable name column
    table.addColumn(
        new TextColumn<EntityModalPresenter.VariableValueRow>() {
          @Override
          public String getValue(EntityModalPresenter.VariableValueRow object) {
            return object.getVariableName();
          }
        },
        translations.variableLabel());

    // Variable value column having each cell of different type (text, binary, repeatable)
    VariableValueRowClickableColumn valueColumn = new VariableValueRowClickableColumn();

    valueColumn.setFieldUpdater(
        new FieldUpdater<
            EntityModalPresenter.VariableValueRow, EntityModalPresenter.VariableValueRow>() {
          @Override
          public void update(
              int index,
              EntityModalPresenter.VariableValueRow variableValueRow,
              EntityModalPresenter.VariableValueRow value) {
            valueSelectionHandler.onValueSelection(variableValueRow);
          }
        });

    table.addColumn(valueColumn, translations.valueLabel());
  }
 @Override
 public void setMode(VocabularyEditModalPresenter.EDIT_MODE editionMode) {
   modal.setTitle(
       editionMode == VocabularyEditModalPresenter.EDIT_MODE.CREATE
           ? translations.addVocabulary()
           : translations.editVocabulary());
 }
  public ContinuousSummaryView(
      ContinuousSummaryDto continuous,
      ImmutableList<FrequencyDto> frequenciesNonMissing,
      ImmutableList<FrequencyDto> frequenciesMissing,
      double totalNonMissing,
      double totalMissing) {
    initWidget(uiBinder.createAndBindUi(this));

    initDescriptivestats(continuous);

    stats.drawHeader();
    double total = totalNonMissing + totalMissing;
    stats.drawValuesFrequencies(
        frequenciesNonMissing,
        translations.nonMissing(),
        translations.notEmpty(),
        totalNonMissing,
        total);
    stats.drawValuesFrequencies(
        frequenciesMissing,
        translations.missingLabel(),
        translations.naLabel(),
        totalMissing,
        total);
    stats.drawTotal(total);
  }
  public String getNoSelectionErrorMessage() {
    if (folderDetailsPresenter.isSingleSelectionModel()) {
      return translationMessages.mustSelectFileFolder(
          translations.fileFolderTypeMap().get(fileSelectionType.name()));
    }

    return translationMessages.mustSelectAtLeastFileFolder(
        translations.fileFolderTypeMap().get(fileSelectionType.name()));
  }
  private void initTable(Translations translations) {
    table.setVisibleRange(0, 10);
    table.addColumn(Columns.NAME, translations.nameLabel());
    table.addColumn(Columns.VALUE, translations.valueLabel());
    table.addColumn(Columns.ACTIONS, translations.actionsLabel());
    table.setEmptyTableWidget(new Label(translations.noOtionsLabel()));

    registerActionsHandlers();
    dataProvider.addDataDisplay(table);
    pager.setDisplay(table);
  }
 @Override
 public String getValue(DatabaseDto dto) {
   String value = dto.getName();
   if (dto.getDefaultStorage())
     value += " (" + translations.defaultStorage().toLowerCase() + ")";
   return value;
 }
 @Override
 public DefaultWizardStepController.Builder getScriptEvaluationStepBuilder(
     WizardStepController.StepInHandler handler) {
   return DefaultWizardStepController.Builder.create(scriptEvaluationStep) //
       .title(translations.derivedVariableEvaluation()) //
       .onStepIn(handler);
 }
    private String getName(ResourcePermissionType type, AclResourceTokenizer tokenizer) {
      String name = null;
      switch (type) {
        case PROJECT:
          name = tokenizer.getToken(AclResourceTokenizer.ResourceTokens.PROJECT);
          break;

        case DATASOURCE:
          name = translations.allTablesLabel();
          break;

        case TABLE:
          name = tokenizer.getToken(AclResourceTokenizer.ResourceTokens.TABLE);
          break;

        case VARIABLE:
          name =
              tokenizer.getToken(AclResourceTokenizer.ResourceTokens.TABLE)
                  + ":"
                  + tokenizer.getToken(AclResourceTokenizer.ResourceTokens.VARIABLE);
          break;

        case REPORT_TEMPLATE:
          name = tokenizer.getToken(AclResourceTokenizer.ResourceTokens.REPORTTEMPLATE);
          break;
      }

      assert name != null;
      return name;
    }
 @Override
 protected void onLoad() {
   super.onLoad();
   if (histogram != null) {
     histogramPanel.clear();
     histogramPanel.add(histogram.createChart(translations.histogram(), translations.density()));
   }
   if (qqPlot != null) {
     normalProbability.clear();
     normalProbability.add(
         qqPlot.createChart(
             translations.normalProbability(),
             translations.theoreticalQuantiles(),
             translations.sampleQuantiles()));
   }
 }
 @Override
 public String getValue(DatabaseDto dto) {
   if (dto.hasSqlSettings())
     return SqlDatabaseModalPresenter.SqlSchema.valueOf(
             dto.getSqlSettings().getSqlSchema().getName())
         .getLabel();
   return translations.opalMongoLabel();
 }
Exemple #11
0
 private void initializeFrequencyColumn() {
   if (allowFrequencyColumn) {
     if (frequencyColumn == null) {
       frequencyColumn = new ValueMapColumn(new StatCell());
     }
     table.insertColumn(1, frequencyColumn, translations.frequency());
   }
 }
 @Inject
 public IdentifiersMappingModalView(
     Binder uiBinder, EventBus eventBus, Translations translations) {
   super(eventBus);
   this.translations = translations;
   initWidget(uiBinder.createAndBindUi(this));
   dialog.setTitle(translations.editIdentifiersMapping());
   dialog.setResizable(true);
 }
 public DeriveOpenTextualVariableStepView() {
   value = new SuggestBox(valueOracle = new MultiWordSuggestOracleWithDisplay());
   widget = uiBinder.createAndBindUi(this);
   radioGroup = new RadioGroup<Method>();
   radioGroup.addButton(auto, Method.AUTOMATICALLY);
   radioGroup.addButton(manual, Method.MANUAL);
   auto.setValue(true);
   addButton.setText("Add");
   addPanel.setText(translations.addValueMapping());
 }
 private void redrawVocabularies(TaxonomyDto taxonomy, FlowPanel panelTaxonomy) {
   JsArrayString vocabularies = JsArrays.toSafeArray(taxonomy.getVocabulariesArray());
   if (vocabularies.length() > 0) {
     panelTaxonomy.add(new Heading(5, translations.vocabulariesLabel()));
     FlowPanel vocabulariesPanel = new FlowPanel();
     for (int i = 0; i < vocabularies.length(); i++) {
       vocabulariesPanel.add(getVocabularyLink(getUiHandlers(), taxonomy, vocabularies.get(i)));
     }
     panelTaxonomy.add(vocabulariesPanel);
   }
 }
  @Override
  public void renderProperties(VariableDto variable, boolean modifyName) {
    if (variable != null) {
      variableName.setText(variable.getName());
      description.setText(
          AttributeHelper.getAttributeValue(variable.getAttributesArray(), "description"));
    } else {
      dialog.setTitle(translations.addIdentifiersMapping());
    }

    variableName.setEnabled(modifyName);
  }
Exemple #16
0
 @Inject
 public EntityModalView(EventBus eventBus) {
   super(eventBus);
   widget = uiBinder.createAndBindUi(this);
   valueSelectionHandler = new ValueSelectionHandlerImpl();
   initializeTable();
   initializeDisplayOptions();
   dialog.setTitle(translations.entityDetailsModalTitle());
   dialog.setMinWidth(MIN_WIDTH);
   dialog.setMinHeight(MIN_HEIGHT);
   tableChooser.addStyleName("table-chooser-large");
 }
 @Override
 public BranchingWizardStepController.Builder getDeriveFromVariableStepController(
     final boolean skip) {
   return (BranchingWizardStepController.Builder)
       BranchingWizardStepController.Builder.create(
               deriveFromVariableStep,
               new Skippable() {
                 @Override
                 public boolean skip() {
                   return skip;
                 }
               })
           .title(translations.deriveFromVariableStepTitle());
 }
Exemple #18
0
  protected void initializeValueColumn() {

    ValueMapCell cell =
        new ValueMapCell() {

          @Override
          protected String getText(ValueMapEntry entry) {
            return entry.getValue();
          }
        };

    Column<ValueMapEntry, ValueMapEntry> valueColumn = new ValueMapColumn(cell);
    valueColumn.setCellStyleNames("original-value");
    table.addColumn(valueColumn, translations.originalValueLabel());
  }
Exemple #19
0
  private void initializeLabelColumn() {

    ValueMapCell cell =
        new ValueMapCell() {

          @Override
          protected String getText(ValueMapEntry entry) {
            return entry.getLabel();
          }
        };

    Column<ValueMapEntry, ValueMapEntry> labelColumn = new ValueMapColumn(cell);
    labelColumn.setCellStyleNames("original-label");
    table.addColumn(labelColumn, translations.originalLabelLabel());
  }
Exemple #20
0
  private void initializeMissingColumn() {
    // Missing
    Column<ValueMapEntry, Boolean> missingColumn =
        new Column<ValueMapEntry, Boolean>(new CheckboxCell()) {

          @Override
          public Boolean getValue(ValueMapEntry entry) {
            return entry.isMissing();
          }
        };
    missingColumn.setCellStyleNames("new-missing");
    table.addColumn(missingColumn, translations.missingLabel());
    missingColumn.setFieldUpdater(
        new FieldUpdater<ValueMapEntry, Boolean>() {
          @Override
          public void update(int index, ValueMapEntry entry, Boolean value) {
            entry.setMissing(value);
          }
        });
  }
Exemple #21
0
  private void initializeNewValueColumn() {

    // New Value
    Cell<String> cell = hasValueChoices() ? new SelectionCell(valueChoices) : new TextInputCell();
    Column<ValueMapEntry, String> newValueColumn =
        new Column<ValueMapEntry, String>(cell) {
          @Override
          public String getValue(ValueMapEntry entry) {
            return entry.getNewValue();
          }
        };
    newValueColumn.setCellStyleNames("new-value");
    table.addColumn(newValueColumn, translations.newValueLabel());
    table.setColumnWidth(newValueColumn, "10em");
    newValueColumn.setFieldUpdater(
        new FieldUpdater<ValueMapEntry, String>() {
          @Override
          public void update(int index, ValueMapEntry entry, String value) {
            entry.setNewValue(value);
          }
        });
  }
 @Override
 public String map(Acl acl) {
   ResourcePermissionType type = ResourcePermissionType.getTypeByPermission(acl.getActions(0));
   return TranslationsUtils.replaceArguments(
       translations.permissionResourceNodeTypeMap().get(type.name()));
 }
 @Override
 public DefaultWizardStepController.Builder getMapStepController() {
   return DefaultWizardStepController.Builder.create(mapStep)
       .title(translations.recodeBooleanStepTitle());
 }
 @Override
 public void setDialogMode(IndexConfigurationPresenter.Mode dialogMode) {
   dialog.setTitle(translations.esConfigurationLabel());
 }
  private void addTableColumns() {

    table.addColumn(
        new Column<TableDto, TableDto>(
            new PlaceRequestCell<TableDto>(placeManager) {

              @Override
              public PlaceRequest getPlaceRequest(TableDto value) {
                return ProjectPlacesHelper.getTablePlace(
                    value.getDatasourceName(), value.getName());
              }

              @Override
              public String getText(TableDto value) {
                String name = value.getName();
                return value.hasViewLink()
                    ? "<i class=\"icon-cog\"></i>&nbsp;" + name
                    : "<i class=\"icon-table\"></i>&nbsp;" + name;
              }
            }) {
          @Override
          public TableDto getValue(TableDto object) {
            return object;
          }
        },
        translations.nameLabel());

    table.addColumn(
        new TextColumn<TableDto>() {

          @Override
          public String getValue(TableDto object) {
            return object.getEntityType();
          }
        },
        translations.entityTypeColumnLabel());

    table.addColumn(
        new TextColumn<TableDto>() {

          @Override
          public String getValue(TableDto object) {
            return Integer.toString(object.getVariableCount());
          }
        },
        translations.variablesLabel());

    table.addColumn(
        new TextColumn<TableDto>() {

          @Override
          public String getValue(TableDto object) {
            return Integer.toString(object.getValueSetCount());
          }
        },
        translations.entitiesLabel());

    dataProvider.addDataDisplay(table);
    table.setSelectionModel(new SingleSelectionModel<TableDto>());
    table.setPageSize(Table.DEFAULT_PAGESIZE);
    table.setEmptyTableWidget(new InlineLabel(translations.noTablesLabel()));
    pager.setDisplay(table);
  }
Exemple #26
0
 public void setHeading(HeadingType type) {
   header.setText(translations.collapsibleMap().get(type.name()));
 }
Exemple #27
0
 public CollapsiblePanel(HeadingType headingType) {
   this(translations.collapsibleMap().get(headingType.name()));
 }
 @Override
 public String getValue(DatabaseDto dto) {
   if (dto.hasSqlSettings()) return translations.sqlLabel();
   return translations.mongoDbLabel();
 }
 @Override
 public DefaultWizardStepController.Builder getMethodStepController() {
   return DefaultWizardStepController.Builder.create(methodStep)
       .title(translations.recodeOpenTextualMethodStepTitle());
 }
  private void addDescriptiveStatistics(DescriptiveStatsDto descriptiveStats) {
    grid.clear();
    grid.setHeader(0, translations.descriptiveStatistics());
    grid.setHeader(1, translations.value());
    int row = 0;

    addGridStat(translations.NLabel(), Math.round(descriptiveStats.getN()), row++);
    addGridStat(translations.min(), descriptiveStats.getMin(), row++);
    addGridStat(translations.max(), descriptiveStats.getMax(), row++);
    addGridStat(translations.meanLabel(), descriptiveStats.getMean(), row++);
    addGridStat(translations.geometricMeanLabel(), descriptiveStats.getGeometricMean(), row++);
    addGridStat(translations.median(), descriptiveStats.getMedian(), row++);
    addGridStat(translations.standardDeviationLabel(), descriptiveStats.getStdDev(), row++);
    addGridStat(translations.variance(), descriptiveStats.getVariance(), row++);
    addGridStat(translations.skewness(), descriptiveStats.getSkewness(), row++);
    addGridStat(translations.kurtosis(), descriptiveStats.getKurtosis(), row++);
    addGridStat(translations.sum(), descriptiveStats.getSum(), row++);
    addGridStat(translations.sumOfSquares(), descriptiveStats.getSumsq(), row++);
  }