private void activeFields() { wlFields.setEnabled(wSelectFields.getSelection()); wFields.setEnabled(wSelectFields.getSelection()); wGet.setEnabled(wSelectFields.getSelection()); wlValueTypes.setEnabled(wSelectValuesType.getSelection()); wValueTypes.setEnabled(wSelectValuesType.getSelection()); wlReplaceByValue.setEnabled(!wSelectFields.getSelection() && !wSelectValuesType.getSelection()); wReplaceByValue.setEnabled(!wSelectFields.getSelection() && !wSelectValuesType.getSelection()); wlMask.setEnabled(!wSelectFields.getSelection() && !wSelectValuesType.getSelection()); wMask.setEnabled(!wSelectFields.getSelection() && !wSelectValuesType.getSelection()); }
private void activeSelectValuesType() { if (wSelectValuesType.getSelection()) { wSelectFields.setSelection(false); wFields.setEnabled(false); wlFields.setEnabled(false); } activeFields(); }
// Réinitialise la table des paramètres private void clearTables() { Table paramsTable = wParams.table; paramsTable.removeAll(); if (wInputFormat.getText() != null && !wInputFormat.getText().isEmpty()) { String inputFormatKey = getFormatKey(wInputFormat.getText()); int i = 0; for (GisInputFormatParameterDef parameterDef : input.getInputFormatDefs().get(inputFormatKey).getParameterDefs()) { TableItem tableItem = new TableItem(paramsTable, SWT.NONE); tableItem.setText(0, String.valueOf(i)); tableItem.setText(1, getParamLabel(parameterDef.getKey())); tableItem.setText( 2, BaseMessages.getString( PKG, "GisFileInput.Params.Required." + String.valueOf(parameterDef.isRequired()).toUpperCase() + ".Label")); String defaultValue = parameterDef.getDefaultValue(); if (defaultValue != null && !defaultValue.isEmpty()) { String value = getParamValueLabel(parameterDef.getDefaultValue()); tableItem.setText(3, value); } i++; } wParams.setRowNums(); if (wParams.nrNonEmpty() > 0) { wlParams.setEnabled(true); wParams.setEnabled(true); } else { wlParams.setEnabled(false); wParams.setEnabled(false); } } wStepname.selectAll(); }
private void setMethod() { boolean activateBody = RestMeta.isActiveBody(wMethod.getText()); boolean activateParams = RestMeta.isActiveParameters(wMethod.getText()); wlBody.setEnabled(activateBody); wBody.setEnabled(activateBody); wlParameters.setEnabled(activateParams); wParameters.setEnabled(activateParams); wGet.setEnabled(activateParams); }
private void setExecutedEachInputRow() { wlFields.setEnabled(wEachRow.getSelection()); wFields.setEnabled(wEachRow.getSelection()); wlSetParams.setEnabled(wEachRow.getSelection()); wSetParams.setEnabled(wEachRow.getSelection()); if (!wEachRow.getSelection()) { wSetParams.setSelection(wEachRow.getSelection()); } wlQuoteString.setEnabled(wEachRow.getSelection()); wQuoteString.setEnabled(wEachRow.getSelection()); if (!wEachRow.getSelection()) { wQuoteString.setSelection(wEachRow.getSelection()); } }
private void RefreshArgFromPrevious() { wlFields.setEnabled(!wPrevious.getSelection()); wFields.setEnabled(!wPrevious.getSelection()); wbdSourceFileFolder.setEnabled(!wPrevious.getSelection()); wbeSourceFileFolder.setEnabled(!wPrevious.getSelection()); wbSourceFileFolder.setEnabled(!wPrevious.getSelection()); wbaSourceFileFolder.setEnabled(!wPrevious.getSelection()); wlSourceFileFolder.setEnabled(!wPrevious.getSelection()); wSourceFileFolder.setEnabled(!wPrevious.getSelection()); wlWildcard.setEnabled(!wPrevious.getSelection()); wWildcard.setEnabled(!wPrevious.getSelection()); wbSourceDirectory.setEnabled(!wPrevious.getSelection()); }
private void activeAddFields() { boolean activate = wgetCloserValue.getSelection() || (FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText()) == FuzzyMatchMeta.OPERATION_TYPE_DOUBLE_METAPHONE) || (FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText()) == FuzzyMatchMeta.OPERATION_TYPE_SOUNDEX) || (FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText()) == FuzzyMatchMeta.OPERATION_TYPE_REFINED_SOUNDEX) || (FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText()) == FuzzyMatchMeta.OPERATION_TYPE_METAPHONE); wlReturn.setEnabled(activate); wReturn.setEnabled(activate); wGetLU.setEnabled(activate); }
private void ActiveFileField() { wlFilenameField.setEnabled(wFileField.getSelection()); wFilenameField.setEnabled(wFileField.getSelection()); wlFilename.setEnabled(!wFileField.getSelection()); wbbFilename.setEnabled(!wFileField.getSelection()); wbaFilename.setEnabled(!wFileField.getSelection()); wFilename.setEnabled(!wFileField.getSelection()); wlFilemask.setEnabled(!wFileField.getSelection()); wFilemask.setEnabled(!wFileField.getSelection()); wlExcludeFilemask.setEnabled(!wFileField.getSelection()); wExcludeFilemask.setEnabled(!wFileField.getSelection()); wlFilenameList.setEnabled(!wFileField.getSelection()); wbdFilename.setEnabled(!wFileField.getSelection()); wbeFilename.setEnabled(!wFileField.getSelection()); wbShowFiles.setEnabled(!wFileField.getSelection()); wlFilenameList.setEnabled(!wFileField.getSelection()); wFilenameList.setEnabled(!wFileField.getSelection()); wPreview.setEnabled(!wFileField.getSelection()); }
// Charge les données dans le formulaire public void loadData() { // Liste des formats List<String> formatsLabels = new ArrayList<String>(); for (Entry<String, GisInputFormatDef> formatsDefs : input.getInputFormatDefs().entrySet()) { formatsLabels.add(getFormatLabel(formatsDefs.getKey())); } Collections.sort(formatsLabels); wInputFormat.setItems(formatsLabels.toArray(new String[formatsLabels.size()])); if (input.getInputFormat() != null && !input.getInputFormat().isEmpty()) { String formatKey = input.getInputFormat(); wInputFormat.setText(getFormatLabel(formatKey)); // Tableau de valeur des paramètres Table paramsTable = wParams.table; paramsTable.removeAll(); if (!input.getInputFormatParameters().isEmpty()) { int i = 0; for (GisInputFormatParameter parameter : input.getInputFormatParameters()) { TableItem tableItem = new TableItem(paramsTable, SWT.NONE); tableItem.setText(0, String.valueOf(i)); tableItem.setText(1, getParamLabel(parameter.getKey())); GisInputFormatParameterDef parameterDef = input.getInputFormatDefs().get(formatKey).getParameterDef(parameter.getKey()); tableItem.setText( 2, BaseMessages.getString( PKG, "GisFileInput.Params.Required." + String.valueOf(parameterDef.isRequired()).toUpperCase() + ".Label")); if (parameter.getValue() != null) { tableItem.setText(3, getParamValueLabel(parameter.getValue().toString())); } i++; } wParams.setRowNums(); if (wParams.nrNonEmpty() > 0) { wlParams.setEnabled(true); wParams.setEnabled(true); } else { wlParams.setEnabled(false); wParams.setEnabled(false); } } else { clearTables(); } } if (input.getInputFileName() != null) { wFileName.setText(input.getInputFileName()); } if (input.getGeometryFieldName() != null) { wGeometryField.setText(input.getGeometryFieldName()); } else { wGeometryField.setText(BaseMessages.getString(PKG, "GisFileInput.GeometryFieldName.Default")); } if (input.getEncoding() != null) { wEncoding.setText(input.getEncoding()); } wRowLimit.setText(input.getRowLimit().toString()); wStepname.selectAll(); }