You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by ha...@apache.org on 2026/02/17 13:52:35 UTC
(hop) branch main updated: Add a default shell method for Transforms/Actions, fixes #6469 (#6579)
This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new afdd0d0871 Add a default shell method for Transforms/Actions, fixes #6469 (#6579)
afdd0d0871 is described below
commit afdd0d0871c3af17fddb5917774fbc295fb74732
Author: Hans Van Akelyen <ha...@gmail.com>
AuthorDate: Tue Feb 17 14:52:29 2026 +0100
Add a default shell method for Transforms/Actions, fixes #6469 (#6579)
---
assemblies/debug/pom.xml | 24 ++
.../workflow/actions/abort/ActionAbortDialog.java | 70 +---
.../ActionAddResultFilenamesDialog.java | 75 +---
.../as400command/ActionAs400CommandDialog.java | 78 +---
.../ActionCheckDbConnectionsDialog.java | 61 +--
.../ActionCheckFilesLockedDialog.java | 68 +---
.../columnsexist/ActionColumnsExistDialog.java | 64 +---
.../actions/copyfiles/ActionCopyFilesDialog.java | 77 +---
.../ActionCopyMoveResultFilenamesDialog.java | 90 ++---
.../actions/createfile/ActionCreateFileDialog.java | 66 +---
.../createfolder/ActionCreateFolderDialog.java | 64 +---
.../workflow/actions/delay/ActionDelayDialog.java | 70 +---
.../actions/deletefile/ActionDeleteFileDialog.java | 67 +---
.../deletefiles/ActionDeleteFilesDialog.java | 71 +---
.../deletefolders/ActionDeleteFoldersDialog.java | 69 +---
.../ActionDeleteResultFilenamesDialog.java | 66 +---
.../actions/dostounix/ActionDosToUnixDialog.java | 76 +---
.../workflow/actions/eval/ActionEvalDialog.java | 61 +--
.../ActionEvalFilesMetricsDialog.java | 76 +---
.../ActionEvalTableContentDialog.java | 88 ++---
.../filecompare/ActionFileCompareDialog.java | 84 +---
.../actions/fileexists/ActionFileExistsDialog.java | 66 +---
.../actions/filesexist/ActionFilesExistDialog.java | 63 +--
.../folderisempty/ActionFolderIsEmptyDialog.java | 68 +---
.../folderscompare/ActionFoldersCompareDialog.java | 120 +++---
.../hop/workflow/actions/ftp/ActionFtpDialog.java | 85 ++---
.../actions/ftpdelete/ActionFtpDeleteDialog.java | 78 +---
.../actions/ftpput/ActionFtpPutDialog.java | 85 ++---
.../workflow/actions/sftp/ActionSftpDialog.java | 89 ++---
.../actions/sftpput/ActionSftpPutDialog.java | 89 ++---
.../workflow/actions/http/ActionHttpDialog.java | 88 +----
.../workflow/actions/join/ActionJoinDialog.java | 66 +---
.../actions/movefiles/ActionMoveFilesDialog.java | 104 ++---
.../mssqlbulkload/ActionMssqlBulkLoadDialog.java | 76 +---
.../mysqlbulkfile/ActionMysqlBulkFileDialog.java | 64 +---
.../mysqlbulkload/ActionMysqlBulkLoadDialog.java | 71 +---
.../ActionPGPDecryptFilesDialog.java | 110 ++----
.../ActionPGPEncryptFilesDialog.java | 112 ++----
.../actions/pgpverify/ActionPGPVerifyDialog.java | 76 +---
.../workflow/actions/ping/ActionPingDialog.java | 65 +---
.../workflow/actions/repeat/EndRepeatDialog.java | 62 +--
.../hop/workflow/actions/repeat/RepeatDialog.java | 86 +----
.../ActionSendNagiosPassiveCheckDialog.java | 62 +--
.../setvariables/ActionSetVariablesDialog.java | 62 +--
.../workflow/actions/shell/ActionShellDialog.java | 80 +---
.../actions/simpleeval/ActionSimpleEvalDialog.java | 64 +---
.../actions/snmptrap/ActionSNMPTrapDialog.java | 61 +--
.../actions/snowflake/WarehouseManagerDialog.java | 158 +++-----
.../hop/workflow/actions/sql/ActionSqlDialog.java | 67 +---
.../actions/success/ActionSuccessDialog.java | 68 +---
.../tableexists/ActionTableExistsDialog.java | 66 +---
.../actions/telnet/ActionTelnetDialog.java | 65 +---
.../truncatetables/ActionTruncateTablesDialog.java | 71 +---
.../workflow/actions/unzip/ActionUnZipDialog.java | 90 ++---
.../waitforfile/ActionWaitForFileDialog.java | 117 +++---
.../actions/waitforsql/ActionWaitForSqlDialog.java | 85 ++---
.../ActionWebServiceAvailableDialog.java | 64 +---
.../actions/workflow/ActionWorkflowDialog.java | 8 +-
.../writetofile/ActionWriteToFileDialog.java | 65 +---
.../actions/writetolog/ActionWriteToLogDialog.java | 65 +---
.../xml/dtdvalidator/DtdValidatorDialog.java | 66 +---
.../xml/xmlwellformed/XmlWellFormedDialog.java | 70 +---
.../xml/xsdvalidator/XsdValidatorDialog.java | 68 +---
.../hop/workflow/actions/xml/xslt/XsltDialog.java | 88 ++---
.../actions/zipfile/ActionZipFileDialog.java | 88 ++---
.../accessoutput/AccessOutputDialog.java | 130 +++----
.../bigtable/BeamBigtableInputDialog.java | 112 +++---
.../bigtable/BeamBigtableOutputDialog.java | 113 +++---
.../hop/beam/transforms/bq/BeamBQInputDialog.java | 117 +++---
.../hop/beam/transforms/bq/BeamBQOutputDialog.java | 111 +++---
.../hivecatalog/BeamHiveCatalogInputDialog.java | 58 +--
.../hop/beam/transforms/io/BeamInputDialog.java | 100 ++---
.../hop/beam/transforms/io/BeamOutputDialog.java | 114 +++---
.../beam/transforms/kafka/BeamConsumeDialog.java | 158 ++++----
.../beam/transforms/kafka/BeamProduceDialog.java | 110 +++---
.../kinesis/BeamKinesisConsumeDialog.java | 182 ++++-----
.../kinesis/BeamKinesisProduceDialog.java | 121 +++---
.../beam/transforms/pubsub/BeamPublishDialog.java | 105 ++---
.../transforms/pubsub/BeamSubscribeDialog.java | 109 +++---
.../transforms/window/BeamTimestampDialog.java | 98 ++---
.../beam/transforms/window/BeamWindowDialog.java | 124 +++---
.../apache/hop/documentation/ActionDocDialog.java | 97 ++---
.../mail/pipeline/transforms/mail/MailDialog.java | 86 ++---
.../transforms/mailinput/MailInputDialog.java | 90 ++---
.../actions/getpop/ActionGetPOPDialog.java | 109 ++----
.../workflow/actions/mail/ActionMailDialog.java | 101 ++---
.../mailvalidator/ActionMailValidatorDialog.java | 82 +---
.../pipeline/transform/PipelineLoggingDialog.java | 56 +--
.../reflection/probe/meta/PipelineProbeEditor.java | 4 +-
.../probe/transform/PipelineDataProbeDialog.java | 73 +---
.../workflow/meta/WorkflowLogEditor.java | 12 +-
.../workflow/transform/WorkflowLoggingDialog.java | 55 +--
.../actions/runtests/RunPipelineTestsDialog.java | 86 +----
.../transforms/exectests/ExecuteTestsDialog.java | 118 +++---
.../transforms/avrodecode/AvroDecodeDialog.java | 62 +--
.../transforms/avroencode/AvroEncodeDialog.java | 62 +--
.../transforms/avroinput/AvroFileInputDialog.java | 56 +--
.../transforms/avrooutput/AvroOutputDialog.java | 78 +---
.../transforms/aws/sns/SnsNotifyDialog.java | 82 +---
.../transforms/aws/sqs/SqsReaderDialog.java | 81 +---
.../bulkloader/RedshiftBulkLoaderDialog.java | 69 +---
.../eventhubs/listen/AzureListenerDialog.java | 198 +++++-----
.../eventhubs/write/AzureWriterDialog.java | 116 +++---
.../listen/messages/messages_en_US.properties | 1 +
.../write/messages/messages_en_US.properties | 1 +
.../cassandrainput/CassandraInputDialog.java | 64 +---
.../cassandraoutput/CassandraOutputDialog.java | 88 +----
.../SSTableOutputDialog.java | 117 +++---
.../workflow/actions/execcql/ExecCqlDialog.java | 116 ++----
.../googleanalytics/GoogleAnalyticsDialog.java | 78 +---
.../googlesheets/GoogleSheetsInputDialog.java | 88 ++---
.../googlesheets/GoogleSheetsOutputDialog.java | 67 +---
.../messages/messages_en_US.properties | 6 +-
.../actions/check/CheckConnectionsDialog.java | 70 +---
.../actions/constraint/Neo4jConstraintDialog.java | 81 +---
.../actions/cypherscript/CypherScriptDialog.java | 117 ++----
.../hop/neo4j/actions/index/Neo4jIndexDialog.java | 81 +---
.../apache/hop/neo4j/model/GraphModelEditor.java | 30 +-
.../hop/neo4j/transforms/cypher/CypherDialog.java | 79 +---
.../cypherbuilder/CypherBuilderDialog.java | 62 +--
.../neo4j/transforms/gencsv/GenerateCsvDialog.java | 74 +---
.../neo4j/transforms/graph/GraphOutputDialog.java | 78 +---
.../neo4j/transforms/importer/ImporterDialog.java | 107 ++----
.../transforms/loginfo/GetLoggingInfoDialog.java | 65 +---
.../neo4j/transforms/output/Neo4JOutputDialog.java | 97 ++---
.../neo4j/transforms/split/SplitGraphDialog.java | 68 +---
.../transforms/input/ParquetInputDialog.java | 57 +--
.../transforms/output/ParquetOutputDialog.java | 57 +--
.../salesforcedelete/SalesforceDeleteDialog.java | 62 +--
.../salesforceinput/SalesforceInputDialog.java | 88 +----
.../salesforceinsert/SalesforceInsertDialog.java | 62 +--
.../salesforceupdate/SalesforceUpdateDialog.java | 62 +--
.../salesforceupsert/SalesforceUpsertDialog.java | 62 +--
.../hop/pipeline/transforms/abort/AbortDialog.java | 131 ++-----
.../transforms/addsequence/AddSequenceDialog.java | 99 ++---
.../addsnowflakeid/AddSnowflakeIdDialog.java | 63 +--
.../analyticquery/AnalyticQueryDialog.java | 54 +--
.../pipeline/transforms/append/AppendDialog.java | 59 +--
.../blockingtransform/BlockingTransformDialog.java | 116 +++---
.../BlockUntilTransformsFinishDialog.java | 63 +--
.../transforms/calculator/CalculatorDialog.java | 83 +---
.../ChangeFileEncodingDialog.java | 60 +--
.../transforms/checksum/CheckSumDialog.java | 70 +---
.../transforms/clonerow/CloneRowDialog.java | 62 +--
.../transforms/closure/ClosureGeneratorDialog.java | 104 ++---
.../transforms/coalesce/CoalesceDialog.java | 63 +--
.../columnexists/ColumnExistsDialog.java | 126 +++---
.../combinationlookup/CombinationLookupDialog.java | 66 +---
.../concatfields/ConcatFieldsDialog.java | 136 +++----
.../transforms/constant/ConstantDialog.java | 58 +--
.../cratedbbulkloader/CrateDBBulkLoaderDialog.java | 78 +---
.../CreditCardValidatorDialog.java | 110 +++---
.../transforms/cubeinput/CubeInputDialog.java | 61 +--
.../transforms/cubeoutput/CubeOutputDialog.java | 105 +++--
.../databasejoin/DatabaseJoinDialog.java | 63 +--
.../databaselookup/DatabaseLookupDialog.java | 73 +---
.../transforms/datagrid/DataGridDialog.java | 59 +--
.../pipeline/transforms/dbproc/DBProcDialog.java | 73 +---
.../hop/pipeline/transforms/delay/DelayDialog.java | 57 +--
.../pipeline/transforms/delete/DeleteDialog.java | 61 +--
.../denormaliser/DenormaliserDialog.java | 56 +--
.../detectemptystream/DetectEmptyStreamDialog.java | 63 +--
.../transforms/language/DetectLanguageDialog.java | 72 +---
.../detectlastrow/DetectLastRowDialog.java | 60 +--
.../dimensionlookup/DimensionLookupDialog.java | 90 ++---
.../dorisbulkloader/DorisBulkLoaderDialog.java | 74 +---
.../transforms/drools/RulesAccumulatorDialog.java | 59 +--
.../transforms/drools/RulesExecutorDialog.java | 59 +--
.../dynamicsqlrow/DynamicSqlRowDialog.java | 119 +++---
.../pipeline/transforms/edi2xml/Edi2XmlDialog.java | 62 +--
.../transforms/excelinput/ExcelInputDialog.java | 70 +---
.../excelwriter/ExcelWriterTransformDialog.java | 69 +---
.../transforms/execinfo/ExecInfoDialog.java | 99 +++--
.../transforms/execprocess/ExecProcessDialog.java | 59 +--
.../transforms/execsqlrow/ExecSqlRowDialog.java | 103 +++--
.../hop/pipeline/transforms/fake/FakeDialog.java | 60 +--
.../FieldsChangeSequenceDialog.java | 65 +---
.../fieldsplitter/FieldSplitterDialog.java | 64 +---
.../transforms/fileexists/FileExistsDialog.java | 64 +---
.../transforms/filelocked/FileLockedDialog.java | 65 +---
.../filemetadata/FileMetadataDialog.java | 63 +--
.../filesfromresult/FilesFromResultDialog.java | 63 +--
.../filestoresult/FilesToResultDialog.java | 61 +--
.../transforms/filterrows/FilterRowsDialog.java | 62 +--
.../transforms/flattener/FlattenerDialog.java | 59 +--
.../pipeline/transforms/formula/FormulaDialog.java | 81 +---
.../transforms/formula/editor/FormulaEditor.java | 11 -
.../transforms/fuzzymatch/FuzzyMatchDialog.java | 95 ++---
.../getfilenames/GetFileNamesDialog.java | 95 ++---
.../getfilesrowcount/GetFilesRowsCountDialog.java | 64 +---
.../getsubfolders/GetSubFoldersDialog.java | 73 +---
.../gettablenames/GetTableNamesDialog.java | 88 ++---
.../transforms/getvariable/GetVariableDialog.java | 71 +---
.../pipeline/transforms/groupby/GroupByDialog.java | 58 +--
.../transforms/html2text/Html2TextDialog.java | 130 +++----
.../hop/pipeline/transforms/http/HttpDialog.java | 96 +----
.../transforms/httppost/HttpPostDialog.java | 77 +---
.../pipeline/transforms/ifnull/IfNullDialog.java | 63 +--
.../insertupdate/InsertUpdateDialog.java | 66 +---
.../pipeline/transforms/janino/JaninoDialog.java | 63 +--
.../transforms/javafilter/JavaFilterDialog.java | 97 ++---
.../UserDefinedJavaClassDialog.java | 116 +++---
.../messages/messages_en_US.properties | 3 +
.../transforms/javascript/ScriptValuesDialog.java | 121 +++---
.../javascript/messages/messages_en_US.properties | 3 +
.../transform/jdbcmetadata/JdbcMetadataDialog.java | 58 +--
.../transforms/joinrows/JoinRowsDialog.java | 70 +---
.../transforms/jsoninput/JsonInputDialog.java | 79 +---
.../transforms/jsonoutput/JsonOutputDialog.java | 66 +---
.../jsonoutputenhanced/JsonOutputDialog.java | 76 +---
.../kafka/consumer/KafkaConsumerInputDialog.java | 60 +--
.../kafka/producer/KafkaProducerOutputDialog.java | 72 +---
.../internals/ui/TransformNameComposite.java | 25 +-
.../transforms/ldapinput/LdapInputDialog.java | 89 +----
.../transforms/ldapoutput/LdapOutputDialog.java | 66 +---
.../loadfileinput/LoadFileInputDialog.java | 69 +---
.../transforms/input/MappingInputDialog.java | 57 +--
.../transforms/mapping/SimpleMappingDialog.java | 90 +----
.../transforms/output/MappingOutputDialog.java | 68 +---
.../transforms/memgroupby/MemoryGroupByDialog.java | 57 +--
.../transforms/mergejoin/MergeJoinDialog.java | 64 +---
.../transforms/mergerows/MergeRowsDialog.java | 58 +--
.../transforms/metainput/MetadataInputDialog.java | 75 +---
.../transforms/metainject/MetaInjectDialog.java | 96 +----
.../TransformMetaStructureDialog.java | 174 ++++-----
.../monetdbbulkloader/MonetDbBulkLoaderDialog.java | 159 +++-----
.../messages/messages_en_US.properties | 7 +-
.../mongodbdelete/MongoDbDeleteDialog.java | 77 +---
.../mongodbinput/MongoDbInputDialog.java | 73 +---
.../mongodboutput/MongoDbOutputDialog.java | 85 +----
.../multimerge/MultiMergeJoinDialog.java | 109 +++---
.../mysqlbulkloader/MySqlBulkLoaderDialog.java | 252 ++++++------
.../messages/messages_en_US.properties | 3 +-
.../messages/messages_pt_BR.properties | 1 -
.../transforms/normaliser/NormaliserDialog.java | 60 +--
.../pipeline/transforms/nullif/NullIfDialog.java | 66 +---
.../transforms/numberrange/NumberRangeDialog.java | 34 +-
.../orabulkloader/OraBulkLoaderDialog.java | 103 +++--
.../pgbulkloader/PGBulkLoaderDialog.java | 62 +--
.../pgpdecryptstream/PGPDecryptStreamDialog.java | 107 +++---
.../pgpencryptstream/PGPEncryptStreamDialog.java | 107 +++---
.../pipelineexecutor/PipelineExecutorDialog.java | 92 +----
.../processfiles/ProcessFilesDialog.java | 99 ++---
.../propertyinput/PropertyInputDialog.java | 63 +--
.../propertyoutput/PropertyOutputDialog.java | 61 +--
.../transforms/randomvalue/RandomValueDialog.java | 60 +--
.../transforms/regexeval/RegexEvalDialog.java | 68 +---
.../regexeval/RegexEvalHelperDialog.java | 12 +-
.../repeatfields/RepeatFieldsDialog.java | 56 +--
.../replacestring/ReplaceStringDialog.java | 59 +--
.../reservoirsampling/ReservoirSamplingDialog.java | 61 +--
.../hop/pipeline/transforms/rest/RestDialog.java | 109 ++----
.../rowgenerator/RowGeneratorDialog.java | 60 +--
.../rowsfromresult/RowsFromResultDialog.java | 60 +--
.../rowstoresult/RowsToResultDialog.java | 63 +--
.../transforms/samplerows/SampleRowsDialog.java | 58 +--
.../transforms/sasinput/SasInputDialog.java | 62 +--
.../schemamapping/SchemaMappingDialog.java | 51 +--
.../pipeline/transforms/script/ScriptDialog.java | 78 +---
.../selectvalues/SelectValuesDialog.java | 114 ++----
.../serverstatus/GetServerStatusDialog.java | 150 ++++----
.../setvalueconstant/SetValueConstantDialog.java | 58 +--
.../setvaluefield/SetValueFieldDialog.java | 68 +---
.../transforms/setvariable/SetVariableDialog.java | 70 +---
.../bulkloader/SnowflakeBulkLoaderDialog.java | 110 ++----
.../pipeline/transforms/sort/SortRowsDialog.java | 75 +---
.../transforms/sortedmerge/SortedMergeDialog.java | 61 +--
.../splitfieldtorows/SplitFieldToRowsDialog.java | 57 +--
.../transforms/splunkinput/SplunkInputDialog.java | 65 +---
.../splunkinput/messages/messages_en_US.properties | 1 +
.../hop/pipeline/transforms/sql/ExecSqlDialog.java | 65 +---
.../sqlfileoutput/SQLFileOutputDialog.java | 67 +---
.../hop/pipeline/transforms/ssh/SshDialog.java | 79 +---
.../StandardizePhoneNumberDialog.java | 58 +--
.../nlp/simple/StanfordSimpleNlpDialog.java | 74 +---
.../streamlookup/StreamLookupDialog.java | 75 +---
.../streamschemamerge/StreamSchemaDialog.java | 69 +---
.../transforms/stringcut/StringCutDialog.java | 59 +--
.../stringoperations/StringOperationsDialog.java | 62 +--
.../transforms/switchcase/SwitchCaseDialog.java | 63 +--
.../SynchronizeAfterMergeDialog.java | 70 +---
.../transforms/systemdata/SystemDataDialog.java | 67 +---
.../tablecompare/TableCompareDialog.java | 58 +--
.../transforms/tableexists/TableExistsDialog.java | 104 +++--
.../transforms/tableinput/TableInputDialog.java | 70 +---
.../transforms/tableoutput/TableOutputDialog.java | 142 ++++---
.../transforms/terafast/TeraFastDialog.java | 77 ++--
.../pipeline/transforms/terafast/TeraFastMeta.java | 25 +-
.../transforms/csvinput/CsvInputDialog.java | 74 +---
.../transforms/fileinput/TextFileInputDialog.java | 76 +---
.../fileinput/text/TextFileInputDialog.java | 78 +---
.../textfileoutput/TextFileOutputDialog.java | 62 +--
.../hop/pipeline/transforms/tika/TikaDialog.java | 76 +---
.../tokenreplacement/TokenReplacementDialog.java | 79 +---
.../transforms/uniquerows/UniqueRowsDialog.java | 64 +---
.../UniqueRowsByHashSetDialog.java | 62 +--
.../pipeline/transforms/update/UpdateDialog.java | 64 +---
.../transforms/validator/ValidatorDialog.java | 86 ++---
.../transforms/valuemapper/ValueMapperDialog.java | 67 +---
.../bulkloader/VerticaBulkLoaderDialog.java | 84 +---
.../WebServiceAvailableDialog.java | 105 ++---
.../transforms/webservices/WebServiceDialog.java | 125 +++---
.../workflowexecutor/WorkflowExecutorDialog.java | 90 +----
.../transforms/writetolog/WriteToLogDialog.java | 62 +--
.../transforms/xml/addxml/AddXmlDialog.java | 54 +--
.../xml/getxmldata/GetXmlDataDialog.java | 73 +---
.../xml/xmlinputstream/XmlInputStreamDialog.java | 260 ++++++-------
.../transforms/xml/xmljoin/XmlJoinDialog.java | 98 ++---
.../transforms/xml/xmloutput/XmlOutputDialog.java | 64 +---
.../xml/xsdvalidator/XsdValidatorDialog.java | 69 +---
.../pipeline/transforms/xml/xslt/XsltDialog.java | 73 +---
.../transforms/yamlinput/YamlInputDialog.java | 63 +--
.../pipeline/transforms/zipfile/ZipFileDialog.java | 115 +++---
.../main/java/org/apache/hop/ui/core/PropsUi.java | 114 +++++-
.../org/apache/hop/ui/core/dialog/BaseDialog.java | 60 +++
.../apache/hop/ui/core/dialog/ShowHelpDialog.java | 2 +-
.../org/apache/hop/ui/core/gui/WindowProperty.java | 64 +++-
.../hop/ui/core/widget/MetaSelectionLine.java | 2 +-
.../org/apache/hop/ui/core/widget/TableView.java | 18 +
.../main/java/org/apache/hop/ui/hopgui/HopGui.java | 8 +-
.../apache/hop/ui/hopgui/dialog/NotePadDialog.java | 4 +-
.../tabs/ConfigGeneralOptionsTab.java | 72 +++-
.../ui/pipeline/transform/BaseTransformDialog.java | 421 +++++++++++++++++++--
.../transform/TransformErrorMetaDialog.java | 4 +-
.../ui/pipeline/transforms/dummy/DummyDialog.java | 67 +---
.../transforms/injector/InjectorDialog.java | 10 +-
.../hop/ui/workflow/action/ActionDialog.java | 274 +++++++++++++-
.../hop/ui/workflow/actions/ActionBaseDialog.java | 40 ++
.../workflow/actions/dummy/ActionDummyDialog.java | 67 +---
.../workflow/actions/start/ActionStartDialog.java | 59 +--
.../hop/ui/workflow/dialog/WorkflowDialog.java | 14 +-
.../core/dialog/messages/messages_en_US.properties | 7 +
332 files changed, 6845 insertions(+), 18614 deletions(-)
diff --git a/assemblies/debug/pom.xml b/assemblies/debug/pom.xml
index 857efa8161..7ab7d7e21e 100644
--- a/assemblies/debug/pom.xml
+++ b/assemblies/debug/pom.xml
@@ -421,6 +421,12 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.hop</groupId>
+ <artifactId>hop-transform-abort</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-transform-addsequence</artifactId>
@@ -445,6 +451,12 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.hop</groupId>
+ <artifactId>hop-transform-concatfields</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-transform-datagrid</artifactId>
@@ -529,12 +541,24 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.hop</groupId>
+ <artifactId>hop-transform-tableinput</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-transform-textfile</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.hop</groupId>
+ <artifactId>hop-transform-validator</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-transform-writetolog</artifactId>
diff --git a/plugins/actions/abort/src/main/java/org/apache/hop/workflow/actions/abort/ActionAbortDialog.java b/plugins/actions/abort/src/main/java/org/apache/hop/workflow/actions/abort/ActionAbortDialog.java
index 6f196ee1b8..b81291255d 100644
--- a/plugins/actions/abort/src/main/java/org/apache/hop/workflow/actions/abort/ActionAbortDialog.java
+++ b/plugins/actions/abort/src/main/java/org/apache/hop/workflow/actions/abort/ActionAbortDialog.java
@@ -24,25 +24,18 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit a Action Abort object. */
public class ActionAbortDialog extends ActionDialog {
@@ -52,8 +45,6 @@ public class ActionAbortDialog extends ActionDialog {
private boolean changed;
- private Text wName;
-
private TextVar wMessageAbort;
private Button wAlwaysLogRows;
@@ -69,45 +60,11 @@ public class ActionAbortDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionAbortDialog.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 200);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = (ModifyEvent e) -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
- formLayout.spacing = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionAbortDialog.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
// Message line
Label wlMessageAbort = new Label(shell, SWT.RIGHT);
wlMessageAbort.setText(BaseMessages.getString(PKG, "ActionAbortDialog.MessageAbort.Label"));
@@ -115,17 +72,17 @@ public class ActionAbortDialog extends ActionDialog {
FormData fdlMessageAbort = new FormData();
fdlMessageAbort.left = new FormAttachment(0, 0);
fdlMessageAbort.right = new FormAttachment(middle, -margin);
- fdlMessageAbort.top = new FormAttachment(wName, margin);
+ fdlMessageAbort.top = new FormAttachment(wSpacer, margin);
wlMessageAbort.setLayoutData(fdlMessageAbort);
wMessageAbort = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wMessageAbort);
wMessageAbort.setToolTipText(
BaseMessages.getString(PKG, "ActionAbortDialog.MessageAbort.Tooltip"));
- wMessageAbort.addModifyListener(lsMod);
+ wMessageAbort.addModifyListener(e -> action.setChanged());
FormData fdMessageAbort = new FormData();
fdMessageAbort.left = new FormAttachment(middle, 0);
- fdMessageAbort.top = new FormAttachment(wName, margin);
+ fdMessageAbort.top = new FormAttachment(wlMessageAbort, 0, SWT.CENTER);
fdMessageAbort.right = new FormAttachment(100, 0);
wMessageAbort.setLayoutData(fdMessageAbort);
@@ -150,21 +107,19 @@ public class ActionAbortDialog extends ActionDialog {
fdAlwaysLogRows.right = new FormAttachment(100, 0);
wAlwaysLogRows.setLayoutData(fdAlwaysLogRows);
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, (Event e) -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, (Event e) -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, 0, null);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
}
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
+ }
+
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
if (action.getName() != null) {
@@ -174,9 +129,6 @@ public class ActionAbortDialog extends ActionDialog {
wMessageAbort.setText(action.getMessageAbort());
}
wAlwaysLogRows.setSelection(action.isAlwaysLogRows());
-
- wName.selectAll();
- wName.setFocus();
}
private void cancel() {
diff --git a/plugins/actions/addresultfilenames/src/main/java/org/apache/hop/workflow/actions/addresultfilenames/ActionAddResultFilenamesDialog.java b/plugins/actions/addresultfilenames/src/main/java/org/apache/hop/workflow/actions/addresultfilenames/ActionAddResultFilenamesDialog.java
index e5a98c25a8..21c82cca44 100644
--- a/plugins/actions/addresultfilenames/src/main/java/org/apache/hop/workflow/actions/addresultfilenames/ActionAddResultFilenamesDialog.java
+++ b/plugins/actions/addresultfilenames/src/main/java/org/apache/hop/workflow/actions/addresultfilenames/ActionAddResultFilenamesDialog.java
@@ -28,9 +28,7 @@ import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -45,7 +43,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Delete Files action settings. */
public class ActionAddResultFilenamesDialog extends ActionDialog {
@@ -54,8 +51,6 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
private static final String[] FILETYPES =
new String[] {BaseMessages.getString(PKG, "ActionAddResultFilenames.Filetype.All")};
- private Text wName;
-
private Label wlFilename;
private Button wbFilename;
private Button wbDirectory;
@@ -96,51 +91,12 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
@Override
public IAction open() {
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionAddResultFilenames.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionAddResultFilenames.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons at the bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionAddResultFilenames.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
// SETTINGS grouping?
// ////////////////////////
// START OF SETTINGS GROUP
@@ -161,7 +117,7 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlIncludeSubfolders);
FormData fdlIncludeSubfolders = new FormData();
fdlIncludeSubfolders.left = new FormAttachment(0, 0);
- fdlIncludeSubfolders.top = new FormAttachment(0, 2 * margin);
+ fdlIncludeSubfolders.top = new FormAttachment(0, margin);
fdlIncludeSubfolders.right = new FormAttachment(middle, -margin);
wlIncludeSubfolders.setLayoutData(fdlIncludeSubfolders);
wIncludeSubfolders = new Button(wgSettings, SWT.CHECK);
@@ -186,7 +142,7 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlPrevious);
FormData fdlPrevious = new FormData();
fdlPrevious.left = new FormAttachment(0, 0);
- fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, 2 * margin);
+ fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, margin);
fdlPrevious.right = new FormAttachment(middle, -margin);
wlPrevious.setLayoutData(fdlPrevious);
wPrevious = new Button(wgSettings, SWT.CHECK);
@@ -215,7 +171,7 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlDeleteAllBefore);
FormData fdlDeleteAllBefore = new FormData();
fdlDeleteAllBefore.left = new FormAttachment(0, 0);
- fdlDeleteAllBefore.top = new FormAttachment(wlPrevious, 2 * margin);
+ fdlDeleteAllBefore.top = new FormAttachment(wlPrevious, margin);
fdlDeleteAllBefore.right = new FormAttachment(middle, -margin);
wlDeleteAllBefore.setLayoutData(fdlDeleteAllBefore);
wDeleteAllBefore = new Button(wgSettings, SWT.CHECK);
@@ -237,7 +193,7 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(wSpacer, margin);
fdSettings.right = new FormAttachment(100, -margin);
wgSettings.setLayoutData(fdSettings);
@@ -251,7 +207,7 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlFilename);
FormData fdlFilename = new FormData();
fdlFilename.left = new FormAttachment(0, 0);
- fdlFilename.top = new FormAttachment(wgSettings, 2 * margin);
+ fdlFilename.top = new FormAttachment(wgSettings, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
@@ -290,8 +246,8 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
wFilename.addModifyListener(lsMod);
FormData fdFilename = new FormData();
fdFilename.left = new FormAttachment(middle, 0);
- fdFilename.top = new FormAttachment(wgSettings, 2 * margin);
- fdFilename.right = new FormAttachment(wbaFilename, -2 * margin);
+ fdFilename.top = new FormAttachment(wgSettings, margin);
+ fdFilename.right = new FormAttachment(wbaFilename, -margin);
wFilename.setLayoutData(fdFilename);
// Whenever something changes, set the tooltip to the expanded version:
@@ -324,7 +280,7 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
FormData fdFilemask = new FormData();
fdFilemask.left = new FormAttachment(middle, 0);
fdFilemask.top = new FormAttachment(wFilename, margin);
- fdFilemask.right = new FormAttachment(wbaFilename, -2 * margin);
+ fdFilemask.right = new FormAttachment(wbaFilename, -margin);
wFilemask.setLayoutData(fdFilemask);
wlFields = new Label(shell, SWT.NONE);
@@ -390,8 +346,8 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
FormData fdFields = new FormData();
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
- fdFields.right = new FormAttachment(wbdFilename, -2 * margin);
- fdFields.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFields.right = new FormAttachment(wbdFilename, -margin);
+ fdFields.bottom = new FormAttachment(wOk, -margin);
wFields.setLayoutData(fdFields);
wlFields.setEnabled(!action.isArgFromPrevious());
@@ -444,6 +400,7 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
getData();
setPrevious();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -485,9 +442,11 @@ public class ActionAddResultFilenamesDialog extends ActionDialog {
wPrevious.setSelection(action.isArgFromPrevious());
wIncludeSubfolders.setSelection(action.isIncludeSubFolders());
wDeleteAllBefore.setSelection(action.isDeleteAllBefore());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/as400command/src/main/java/org/apache/hop/workflow/actions/as400command/ActionAs400CommandDialog.java b/plugins/actions/as400command/src/main/java/org/apache/hop/workflow/actions/as400command/ActionAs400CommandDialog.java
index f04f30cb74..716c3e2730 100644
--- a/plugins/actions/as400command/src/main/java/org/apache/hop/workflow/actions/as400command/ActionAs400CommandDialog.java
+++ b/plugins/actions/as400command/src/main/java/org/apache/hop/workflow/actions/as400command/ActionAs400CommandDialog.java
@@ -26,24 +26,18 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.LabelTextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit a Action As400Command metadata. */
public class ActionAs400CommandDialog extends ActionDialog {
@@ -53,8 +47,6 @@ public class ActionAs400CommandDialog extends ActionDialog {
private boolean changed;
- private Text wName;
-
private LabelTextVar wServerName;
private LabelTextVar wUserName;
@@ -78,56 +70,12 @@ public class ActionAs400CommandDialog extends ActionDialog {
@Override
public IAction open() {
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
+ createShell(BaseMessages.getString(PKG, "ActionAs400CommandDialog.Shell.Title"), action);
shell.setMinimumSize(new Point(600, 400));
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
ModifyListener lsMod = (ModifyEvent e) -> action.setChanged();
changed = action.hasChanged();
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = 15;
- formLayout.marginHeight = 15;
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionAs400CommandDialog.Shell.Title"));
-
- Label wicon = new Label(shell, SWT.RIGHT);
- wicon.setImage(shell.getImage());
- FormData fdlicon = new FormData();
- fdlicon.top = new FormAttachment(0, 0);
- fdlicon.right = new FormAttachment(100, 0);
- wicon.setLayoutData(fdlicon);
- PropsUi.setLook(wicon);
-
- Label wlName = new Label(shell, SWT.RIGHT);
- PropsUi.setLook(wlName);
- wlName.setText(BaseMessages.getString(PKG, "ActionAs400CommandDialog.Name.Label"));
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.top = new FormAttachment(wicon, 0, SWT.CENTER);
- fdlName.right = new FormAttachment(middle, -margin);
- wlName.setLayoutData(fdlName);
-
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- FormData fdName = new FormData();
- fdName.right = new FormAttachment(wicon, -margin);
- fdName.top = new FormAttachment(wlName, 0, SWT.CENTER);
- fdName.left = new FormAttachment(wlName, margin);
- wName.setLayoutData(fdName);
-
- Label spacer = new Label(shell, SWT.HORIZONTAL | SWT.SEPARATOR);
- FormData fdSpacer = new FormData();
- fdSpacer.left = new FormAttachment(0, 0);
- fdSpacer.top = new FormAttachment(wicon, 0);
- fdSpacer.right = new FormAttachment(100, 0);
- spacer.setLayoutData(fdSpacer);
-
Group systemGroup = new Group(shell, SWT.SHADOW_NONE);
systemGroup.setText(BaseMessages.getString(PKG, "ActionAs400CommandDialog.System.Group.Label"));
FormLayout systemGroupLayout = new FormLayout();
@@ -135,7 +83,7 @@ public class ActionAs400CommandDialog extends ActionDialog {
systemGroupLayout.marginHeight = PropsUi.getFormMargin();
systemGroup.setLayout(systemGroupLayout);
systemGroup.setLayoutData(
- new FormDataBuilder().top(spacer, PropsUi.getFormMargin()).fullWidth().result());
+ new FormDataBuilder().top(wSpacer, PropsUi.getFormMargin()).fullWidth().result());
PropsUi.setLook(systemGroup);
// Widget ServerName
@@ -227,20 +175,14 @@ public class ActionAs400CommandDialog extends ActionDialog {
PropsUi.setLook(wCommand);
// at the bottom
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, (Event e) -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, (Event e) -> cancel());
Button wTest = new Button(shell, SWT.PUSH);
wTest.setText(BaseMessages.getString(PKG, "ActionAs400CommandDialog.TestConnection.Label"));
wTest.addListener(SWT.Selection, (Event e) -> onTest());
- BaseTransformDialog.positionBottomButtons(
- shell, new Button[] {wTest, wOk, wCancel}, PropsUi.getMargin(), null);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build(commandGroup);
+ setButtonPositions(new Button[] {wTest, wOk, wCancel}, margin, commandGroup);
getData();
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -248,18 +190,18 @@ public class ActionAs400CommandDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- if (action.getName() != null) {
- wName.setText(action.getName());
- }
+ wName.setText(Const.NVL(action.getName(), ""));
wServerName.setText(Const.NVL(action.getServer(), ""));
wUserName.setText(Const.NVL(action.getUser(), ""));
wPassword.setText(Const.NVL(action.getPassword(), ""));
wCommand.setText(Const.NVL(action.getCommand(), ""));
wProxyHost.setText(Const.NVL(action.getProxyHost(), ""));
wProxyPort.setText(Const.NVL(action.getProxyPort(), ""));
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/checkdbconnection/src/main/java/org/apache/hop/workflow/actions/checkdbconnection/ActionCheckDbConnectionsDialog.java b/plugins/actions/checkdbconnection/src/main/java/org/apache/hop/workflow/actions/checkdbconnection/ActionCheckDbConnectionsDialog.java
index 7bd142afc0..5f48d59f6b 100644
--- a/plugins/actions/checkdbconnection/src/main/java/org/apache/hop/workflow/actions/checkdbconnection/ActionCheckDbConnectionsDialog.java
+++ b/plugins/actions/checkdbconnection/src/main/java/org/apache/hop/workflow/actions/checkdbconnection/ActionCheckDbConnectionsDialog.java
@@ -30,9 +30,7 @@ import org.apache.hop.ui.core.dialog.ErrorDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -40,20 +38,15 @@ import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the check database connection action settings. */
public class ActionCheckDbConnectionsDialog extends ActionDialog {
private static final Class<?> PKG = ActionCheckDbConnectionsDialog.class;
- private Text wName;
-
private ActionCheckDbConnections action;
private boolean changed;
@@ -74,57 +67,18 @@ public class ActionCheckDbConnectionsDialog extends ActionDialog {
@Override
public IAction open() {
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionCheckDbConnections.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = (ModifyEvent e) -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionCheckDbConnections.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons at the bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, (Event e) -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, (Event e) -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Action name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
Label wlFields = new Label(shell, SWT.NONE);
wlFields.setText(BaseMessages.getString(PKG, "ActionCheckDbConnections.Fields.Label"));
PropsUi.setLook(wlFields);
FormData fdlFields = new FormData();
fdlFields.left = new FormAttachment(0, 0);
- fdlFields.top = new FormAttachment(wName, 2 * margin);
+ fdlFields.top = new FormAttachment(wSpacer, margin);
wlFields.setLayoutData(fdlFields);
// Buttons to the right of the screen...
@@ -190,7 +144,7 @@ public class ActionCheckDbConnectionsDialog extends ActionDialog {
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
fdFields.right = new FormAttachment(wbGetConnections, -margin);
- fdFields.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFields.bottom = new FormAttachment(wCancel, -margin);
wFields.setLayoutData(fdFields);
// Delete files from the list of files...
@@ -207,6 +161,7 @@ public class ActionCheckDbConnectionsDialog extends ActionDialog {
wbGetConnections.addListener(SWT.Selection, e -> getDatabases());
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -239,9 +194,11 @@ public class ActionCheckDbConnectionsDialog extends ActionDialog {
ti.setText(3, connection.getWaitTimeUnit().getDescription());
}
wFields.optimizeTableView();
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/checkfilelocked/src/main/java/org/apache/hop/workflow/actions/checkfilelocked/ActionCheckFilesLockedDialog.java b/plugins/actions/checkfilelocked/src/main/java/org/apache/hop/workflow/actions/checkfilelocked/ActionCheckFilesLockedDialog.java
index ee9f1cb1a4..1d7e3abb60 100644
--- a/plugins/actions/checkfilelocked/src/main/java/org/apache/hop/workflow/actions/checkfilelocked/ActionCheckFilesLockedDialog.java
+++ b/plugins/actions/checkfilelocked/src/main/java/org/apache/hop/workflow/actions/checkfilelocked/ActionCheckFilesLockedDialog.java
@@ -30,9 +30,7 @@ import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -47,7 +45,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Delete Files action settings. */
public class ActionCheckFilesLockedDialog extends ActionDialog {
@@ -56,8 +53,6 @@ public class ActionCheckFilesLockedDialog extends ActionDialog {
private static final String[] FILETYPES =
new String[] {BaseMessages.getString(PKG, "System.FileType.AllFiles")};
- private Text wName;
-
private Button wIncludeSubfolders;
private ActionCheckFilesLocked action;
@@ -84,56 +79,12 @@ public class ActionCheckFilesLockedDialog extends ActionDialog {
@Override
public IAction open() {
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionCheckFilesLocked.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionCheckFilesLocked.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons at the bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionCheckFilesLocked.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // SETTINGS grouping?
- // ////////////////////////
- // START OF SETTINGS GROUP
- //
-
Group wSettings = new Group(shell, SWT.SHADOW_NONE);
PropsUi.setLook(wSettings);
wSettings.setText(BaseMessages.getString(PKG, "ActionCheckFilesLocked.Settings.Label"));
@@ -149,7 +100,7 @@ public class ActionCheckFilesLockedDialog extends ActionDialog {
PropsUi.setLook(wlIncludeSubfolders);
FormData fdlIncludeSubfolders = new FormData();
fdlIncludeSubfolders.left = new FormAttachment(0, 0);
- fdlIncludeSubfolders.top = new FormAttachment(wName, margin);
+ fdlIncludeSubfolders.top = new FormAttachment(0, margin);
fdlIncludeSubfolders.right = new FormAttachment(middle, -margin);
wlIncludeSubfolders.setLayoutData(fdlIncludeSubfolders);
wIncludeSubfolders = new Button(wSettings, SWT.CHECK);
@@ -168,7 +119,7 @@ public class ActionCheckFilesLockedDialog extends ActionDialog {
PropsUi.setLook(wlPrevious);
FormData fdlPrevious = new FormData();
fdlPrevious.left = new FormAttachment(0, 0);
- fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, 2 * margin);
+ fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, margin);
fdlPrevious.right = new FormAttachment(middle, -margin);
wlPrevious.setLayoutData(fdlPrevious);
wPrevious = new Button(wSettings, SWT.CHECK);
@@ -188,7 +139,7 @@ public class ActionCheckFilesLockedDialog extends ActionDialog {
});
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(wSpacer, margin);
fdSettings.right = new FormAttachment(100, -margin);
wSettings.setLayoutData(fdSettings);
@@ -237,7 +188,7 @@ public class ActionCheckFilesLockedDialog extends ActionDialog {
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
fdFields.right = new FormAttachment(100, 0);
- fdFields.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFields.bottom = new FormAttachment(wCancel, -margin);
wFields.setLayoutData(fdFields);
wlFields.setEnabled(!action.isArgFromPrevious());
@@ -246,6 +197,7 @@ public class ActionCheckFilesLockedDialog extends ActionDialog {
// Add listeners
getData();
setPrevious();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -295,9 +247,11 @@ public class ActionCheckFilesLockedDialog extends ActionDialog {
wFields.optWidth(true);
wPrevious.setSelection(action.isArgFromPrevious());
wIncludeSubfolders.setSelection(action.isIncludeSubfolders());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/columnsexist/src/main/java/org/apache/hop/workflow/actions/columnsexist/ActionColumnsExistDialog.java b/plugins/actions/columnsexist/src/main/java/org/apache/hop/workflow/actions/columnsexist/ActionColumnsExistDialog.java
index 42c4e06675..9dc0f0ffa5 100644
--- a/plugins/actions/columnsexist/src/main/java/org/apache/hop/workflow/actions/columnsexist/ActionColumnsExistDialog.java
+++ b/plugins/actions/columnsexist/src/main/java/org/apache/hop/workflow/actions/columnsexist/ActionColumnsExistDialog.java
@@ -37,9 +37,7 @@ import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.MetaSelectionLine;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.actions.columnsexist.ActionColumnsExist.ColumnExist;
@@ -50,13 +48,10 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/**
* This dialog allows you to edit the Column Exists action settings. (select the connection and the
@@ -66,7 +61,6 @@ public class ActionColumnsExistDialog extends ActionDialog {
private static final Class<?> PKG = ActionColumnsExist.class;
private static final String CONST_ERROR_TITLE = "System.Dialog.Error.Title";
- private Text wName;
private MetaSelectionLine<DatabaseMeta> wConnection;
private TextVar wTablename;
private ActionColumnsExist action;
@@ -85,51 +79,14 @@ public class ActionColumnsExistDialog extends ActionDialog {
@Override
public IAction open() {
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionColumnsExist.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = (ModifyEvent e) -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionColumnsExist.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, (Event e) -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, (Event e) -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Action name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionColumnsExist.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
// Connection line
- wConnection = addConnectionLine(shell, wName, action.getDatabaseMeta(), lsMod);
+ wConnection = addConnectionLine(shell, wSpacer, action.getDatabaseMeta(), lsMod);
// Schema name line
// Schema name
@@ -139,14 +96,14 @@ public class ActionColumnsExistDialog extends ActionDialog {
FormData fdlSchemaname = new FormData();
fdlSchemaname.left = new FormAttachment(0, 0);
fdlSchemaname.right = new FormAttachment(middle, -margin);
- fdlSchemaname.top = new FormAttachment(wConnection, 2 * margin);
+ fdlSchemaname.top = new FormAttachment(wConnection, margin);
wlSchemaname.setLayoutData(fdlSchemaname);
Button wbSchema = new Button(shell, SWT.PUSH | SWT.CENTER);
PropsUi.setLook(wbSchema);
wbSchema.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbSchema = new FormData();
- fdbSchema.top = new FormAttachment(wConnection, 2 * margin);
+ fdbSchema.top = new FormAttachment(wConnection, margin);
fdbSchema.right = new FormAttachment(100, 0);
wbSchema.setLayoutData(fdbSchema);
wbSchema.addSelectionListener(
@@ -164,7 +121,7 @@ public class ActionColumnsExistDialog extends ActionDialog {
wSchemaname.addModifyListener(lsMod);
FormData fdSchemaname = new FormData();
fdSchemaname.left = new FormAttachment(middle, 0);
- fdSchemaname.top = new FormAttachment(wConnection, 2 * margin);
+ fdSchemaname.top = new FormAttachment(wConnection, margin);
fdSchemaname.right = new FormAttachment(wbSchema, -margin);
wSchemaname.setLayoutData(fdSchemaname);
@@ -252,13 +209,14 @@ public class ActionColumnsExistDialog extends ActionDialog {
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
fdFields.right = new FormAttachment(wbGetColumns, -margin);
- fdFields.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFields.bottom = new FormAttachment(wCancel, -margin);
wFields.setLayoutData(fdFields);
// Get list of columns name from the table...
wbGetColumns.addListener(SWT.Selection, e -> getListColumns());
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -314,9 +272,11 @@ public class ActionColumnsExistDialog extends ActionDialog {
wFields.setRowNums();
wFields.optWidth(true);
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/copyfiles/src/main/java/org/apache/hop/workflow/actions/copyfiles/ActionCopyFilesDialog.java b/plugins/actions/copyfiles/src/main/java/org/apache/hop/workflow/actions/copyfiles/ActionCopyFilesDialog.java
index a2bd78d627..c735d03975 100644
--- a/plugins/actions/copyfiles/src/main/java/org/apache/hop/workflow/actions/copyfiles/ActionCopyFilesDialog.java
+++ b/plugins/actions/copyfiles/src/main/java/org/apache/hop/workflow/actions/copyfiles/ActionCopyFilesDialog.java
@@ -19,6 +19,7 @@ package org.apache.hop.workflow.actions.copyfiles;
import java.util.HashMap;
import java.util.Map;
+import org.apache.hop.core.Const;
import org.apache.hop.core.Props;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
@@ -30,9 +31,7 @@ import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.ITextVarButtonRenderCallback;
import org.apache.hop.ui.core.widget.TableView;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -50,7 +49,6 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Copy Files action settings. */
public class ActionCopyFilesDialog extends ActionDialog {
@@ -62,8 +60,6 @@ public class ActionCopyFilesDialog extends ActionDialog {
public static final String LOCAL_ENVIRONMENT = "Local";
public static final String STATIC_ENVIRONMENT = "<Static>";
- protected Text wName;
-
protected Button wPrevious;
protected Button wCopyEmptyFolders;
protected Button wOverwriteFiles;
@@ -77,6 +73,8 @@ public class ActionCopyFilesDialog extends ActionDialog {
protected boolean changed;
+ protected CTabFolder wTabFolder;
+
private Label wlFields;
protected TableView wFields;
@@ -92,59 +90,23 @@ public class ActionCopyFilesDialog extends ActionDialog {
}
protected void initUi() {
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionCopyFiles.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionCopyFiles.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons at the bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionCopyFiles.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(wlName, margin);
- fdName.top = new FormAttachment(wlName, 0, SWT.CENTER);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
+ int middle = this.middle;
+ int margin = this.margin;
+
+ wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin * 3);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
// ///////////////////////////////////////////////////////////
@@ -362,15 +324,14 @@ public class ActionCopyFilesDialog extends ActionDialog {
wFields.setLayoutData(fdFields);
refreshArgFromPrevious();
-
- getData();
- wTabFolder.setSelection(0);
}
@Override
public IAction open() {
initUi();
-
+ getData();
+ wTabFolder.setSelection(0);
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -414,9 +375,7 @@ public class ActionCopyFilesDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- if (action.getName() != null) {
- wName.setText(action.getName());
- }
+ wName.setText(Const.NVL(action.getName(), ""));
wCopyEmptyFolders.setSelection(action.copyEmptyFolders);
if (action.sourceFileFolder != null) {
@@ -488,9 +447,11 @@ public class ActionCopyFilesDialog extends ActionDialog {
wCreateDestinationFolder.setSelection(action.createDestinationFolder);
wAddFileToResult.setSelection(action.addResultFilenames);
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/copymoveresultfilenames/src/main/java/org/apache/hop/workflow/actions/copymoveresultfilenames/ActionCopyMoveResultFilenamesDialog.java b/plugins/actions/copymoveresultfilenames/src/main/java/org/apache/hop/workflow/actions/copymoveresultfilenames/ActionCopyMoveResultFilenamesDialog.java
index 8a3e2b7573..e539bd6c8a 100644
--- a/plugins/actions/copymoveresultfilenames/src/main/java/org/apache/hop/workflow/actions/copymoveresultfilenames/ActionCopyMoveResultFilenamesDialog.java
+++ b/plugins/actions/copymoveresultfilenames/src/main/java/org/apache/hop/workflow/actions/copymoveresultfilenames/ActionCopyMoveResultFilenamesDialog.java
@@ -25,9 +25,7 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -42,14 +40,11 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Copy/Move result filenames action settings. */
public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
private static final Class<?> PKG = ActionCopyMoveResultFilenames.class;
- private Text wName;
-
private Button wSpecifyWildcard;
private Label wlWildcard;
@@ -115,42 +110,13 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
@Override
public IAction open() {
- Shell parent = getParent();
-
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionCopyMoveResultFilenames.Title"), action);
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionCopyMoveResultFilenames.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionCopyMoveResultFilenames.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ int middle = this.middle;
+ int margin = this.margin;
// Copy or Move
Label wlAction = new Label(shell, SWT.RIGHT);
@@ -159,7 +125,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
FormData fdlAction = new FormData();
fdlAction.left = new FormAttachment(0, 0);
fdlAction.right = new FormAttachment(middle, -margin);
- fdlAction.top = new FormAttachment(wName, 2 * margin);
+ fdlAction.top = new FormAttachment(wSpacer, margin);
wlAction.setLayoutData(fdlAction);
wAction = new CCombo(shell, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wAction.add(BaseMessages.getString(PKG, "ActionCopyMoveResultFilenames.Copy.Label"));
@@ -170,7 +136,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wAction);
FormData fdAction = new FormData();
fdAction.left = new FormAttachment(middle, 0);
- fdAction.top = new FormAttachment(wName, 2 * margin);
+ fdAction.top = new FormAttachment(wSpacer, margin);
fdAction.right = new FormAttachment(100, 0);
wAction.setLayoutData(fdAction);
wAction.addSelectionListener(
@@ -252,7 +218,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlOverwriteFile);
FormData fdlOverwriteFile = new FormData();
fdlOverwriteFile.left = new FormAttachment(0, 0);
- fdlOverwriteFile.top = new FormAttachment(wlCreateDestinationFolder, 2 * margin);
+ fdlOverwriteFile.top = new FormAttachment(wlCreateDestinationFolder, margin);
fdlOverwriteFile.right = new FormAttachment(middle, -margin);
wlOverwriteFile.setLayoutData(fdlOverwriteFile);
wOverwriteFile = new Button(shell, SWT.CHECK);
@@ -279,7 +245,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlRemovedSourceFilename);
FormData fdlRemovedSourceFilename = new FormData();
fdlRemovedSourceFilename.left = new FormAttachment(0, 0);
- fdlRemovedSourceFilename.top = new FormAttachment(wlOverwriteFile, 2 * margin);
+ fdlRemovedSourceFilename.top = new FormAttachment(wlOverwriteFile, margin);
fdlRemovedSourceFilename.right = new FormAttachment(middle, -margin);
wlRemovedSourceFilename.setLayoutData(fdlRemovedSourceFilename);
wRemovedSourceFilename = new Button(shell, SWT.CHECK);
@@ -306,7 +272,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlAddDestinationFilename);
FormData fdlAddDestinationFilename = new FormData();
fdlAddDestinationFilename.left = new FormAttachment(0, 0);
- fdlAddDestinationFilename.top = new FormAttachment(wlRemovedSourceFilename, 2 * margin);
+ fdlAddDestinationFilename.top = new FormAttachment(wlRemovedSourceFilename, margin);
fdlAddDestinationFilename.right = new FormAttachment(middle, -margin);
wlAddDestinationFilename.setLayoutData(fdlAddDestinationFilename);
wAddDestinationFilename = new Button(shell, SWT.CHECK);
@@ -333,7 +299,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlAddDate);
FormData fdlAddDate = new FormData();
fdlAddDate.left = new FormAttachment(0, 0);
- fdlAddDate.top = new FormAttachment(wlAddDestinationFilename, 2 * margin);
+ fdlAddDate.top = new FormAttachment(wlAddDestinationFilename, margin);
fdlAddDate.right = new FormAttachment(middle, -margin);
wlAddDate.setLayoutData(fdlAddDate);
wAddDate = new Button(shell, SWT.CHECK);
@@ -359,7 +325,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlAddTime);
FormData fdlAddTime = new FormData();
fdlAddTime.left = new FormAttachment(0, 0);
- fdlAddTime.top = new FormAttachment(wlAddDate, 2 * margin);
+ fdlAddTime.top = new FormAttachment(wlAddDate, margin);
fdlAddTime.right = new FormAttachment(middle, -margin);
wlAddTime.setLayoutData(fdlAddTime);
wAddTime = new Button(shell, SWT.CHECK);
@@ -387,7 +353,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyFormat);
FormData fdlSpecifyFormat = new FormData();
fdlSpecifyFormat.left = new FormAttachment(0, 0);
- fdlSpecifyFormat.top = new FormAttachment(wlAddTime, 2 * margin);
+ fdlSpecifyFormat.top = new FormAttachment(wlAddTime, margin);
fdlSpecifyFormat.right = new FormAttachment(middle, -margin);
wlSpecifyFormat.setLayoutData(fdlSpecifyFormat);
wSpecifyFormat = new Button(shell, SWT.CHECK);
@@ -419,7 +385,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlDateTimeFormat);
FormData fdlDateTimeFormat = new FormData();
fdlDateTimeFormat.left = new FormAttachment(0, 0);
- fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdlDateTimeFormat.right = new FormAttachment(middle, -margin);
wlDateTimeFormat.setLayoutData(fdlDateTimeFormat);
wDateTimeFormat = new CCombo(shell, SWT.BORDER | SWT.READ_ONLY);
@@ -428,7 +394,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
wDateTimeFormat.addModifyListener(lsMod);
FormData fdDateTimeFormat = new FormData();
fdDateTimeFormat.left = new FormAttachment(middle, 0);
- fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdDateTimeFormat.right = new FormAttachment(100, 0);
wDateTimeFormat.setLayoutData(fdDateTimeFormat);
for (String dat : dats) {
@@ -513,7 +479,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlWildcard);
FormData fdlWildcard = new FormData();
fdlWildcard.left = new FormAttachment(0, 0);
- fdlWildcard.top = new FormAttachment(wlSpecifyWildcard, 2 * margin);
+ fdlWildcard.top = new FormAttachment(wlSpecifyWildcard, margin);
fdlWildcard.right = new FormAttachment(middle, -margin);
wlWildcard.setLayoutData(fdlWildcard);
wWildcard = new TextVar(variables, wLimitTo, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -523,7 +489,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
wWildcard.addModifyListener(lsMod);
FormData fdWildcard = new FormData();
fdWildcard.left = new FormAttachment(middle, 0);
- fdWildcard.top = new FormAttachment(wlSpecifyWildcard, 2 * margin);
+ fdWildcard.top = new FormAttachment(wlSpecifyWildcard, margin);
fdWildcard.right = new FormAttachment(100, -margin);
wWildcard.setLayoutData(fdWildcard);
@@ -589,7 +555,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
FormData fdlSuccessCondition = new FormData();
fdlSuccessCondition.left = new FormAttachment(0, 0);
fdlSuccessCondition.right = new FormAttachment(middle, 0);
- fdlSuccessCondition.top = new FormAttachment(wLimitTo, 2 * margin);
+ fdlSuccessCondition.top = new FormAttachment(wLimitTo, margin);
wlSuccessCondition.setLayoutData(fdlSuccessCondition);
wSuccessCondition = new CCombo(wSuccessOn, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wSuccessCondition.add(
@@ -604,7 +570,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wSuccessCondition);
FormData fdSuccessCondition = new FormData();
fdSuccessCondition.left = new FormAttachment(middle, 0);
- fdSuccessCondition.top = new FormAttachment(wLimitTo, 2 * margin);
+ fdSuccessCondition.top = new FormAttachment(wLimitTo, margin);
fdSuccessCondition.right = new FormAttachment(100, 0);
wSuccessCondition.setLayoutData(fdSuccessCondition);
wSuccessCondition.addSelectionListener(
@@ -649,15 +615,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
// / END OF Success ON GROUP
// ///////////////////////////////////////////////////////////
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
-
- BaseTransformDialog.positionBottomButtons(
- shell, new Button[] {wOk, wCancel}, margin, wSuccessOn);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build(wSuccessOn);
getData();
checkLimit();
@@ -665,7 +623,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
activeSuccessCondition();
setAddDateBeforeExtension();
enableAction();
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -709,9 +667,7 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- if (action.getName() != null) {
- wName.setText(action.getName());
- }
+ wName.setText(Const.NVL(action.getName(), ""));
wSpecifyWildcard.setSelection(action.isSpecifyWildcard());
if (action.getWildcard() != null) {
wWildcard.setText(action.getWildcard());
@@ -770,9 +726,11 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
wCreateDestinationFolder.setSelection(action.isCreateDestinationFolder());
wRemovedSourceFilename.setSelection(action.isRemovedSourceFilename());
wAddDestinationFilename.setSelection(action.isAddDestinationFilename());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/createfile/src/main/java/org/apache/hop/workflow/actions/createfile/ActionCreateFileDialog.java b/plugins/actions/createfile/src/main/java/org/apache/hop/workflow/actions/createfile/ActionCreateFileDialog.java
index 4c80c08d70..9f1c469dd1 100644
--- a/plugins/actions/createfile/src/main/java/org/apache/hop/workflow/actions/createfile/ActionCreateFileDialog.java
+++ b/plugins/actions/createfile/src/main/java/org/apache/hop/workflow/actions/createfile/ActionCreateFileDialog.java
@@ -24,20 +24,16 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Create File action settings. */
public class ActionCreateFileDialog extends ActionDialog {
@@ -46,8 +42,6 @@ public class ActionCreateFileDialog extends ActionDialog {
private static final String[] FILETYPES =
new String[] {BaseMessages.getString(PKG, "ActionCreateFile.Filetype.All")};
- private Text wName;
-
private TextVar wFilename;
private Button wAbortExists;
@@ -69,42 +63,12 @@ public class ActionCreateFileDialog extends ActionDialog {
@Override
public IAction open() {
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 210);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionCreateFile.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- Listener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionCreateFile.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addListener(SWT.Modify, lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ Listener lsMod = e -> action.setChanged();
// Filename line
Label wlFilename = new Label(shell, SWT.RIGHT);
@@ -112,7 +76,7 @@ public class ActionCreateFileDialog extends ActionDialog {
PropsUi.setLook(wlFilename);
FormData fdlFilename = new FormData();
fdlFilename.left = new FormAttachment(0, 0);
- fdlFilename.top = new FormAttachment(wName, margin);
+ fdlFilename.top = new FormAttachment(wSpacer, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
@@ -121,7 +85,7 @@ public class ActionCreateFileDialog extends ActionDialog {
wbFilename.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbFilename = new FormData();
fdbFilename.right = new FormAttachment(100, 0);
- fdbFilename.top = new FormAttachment(wName, 0);
+ fdbFilename.top = new FormAttachment(wlFilename, 0, SWT.CENTER);
wbFilename.setLayoutData(fdbFilename);
wFilename = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -129,7 +93,7 @@ public class ActionCreateFileDialog extends ActionDialog {
wFilename.addListener(SWT.Modify, lsMod);
FormData fdFilename = new FormData();
fdFilename.left = new FormAttachment(middle, 0);
- fdFilename.top = new FormAttachment(wName, margin);
+ fdFilename.top = new FormAttachment(wlFilename, 0, SWT.CENTER);
fdFilename.right = new FormAttachment(wbFilename, -margin);
wFilename.setLayoutData(fdFilename);
@@ -169,7 +133,7 @@ public class ActionCreateFileDialog extends ActionDialog {
PropsUi.setLook(wlAddFilenameToResult);
FormData fdlAddFilenameToResult = new FormData();
fdlAddFilenameToResult.left = new FormAttachment(0, 0);
- fdlAddFilenameToResult.top = new FormAttachment(wlAbortExists, 2 * margin);
+ fdlAddFilenameToResult.top = new FormAttachment(wlAbortExists, margin);
fdlAddFilenameToResult.right = new FormAttachment(middle, -margin);
wlAddFilenameToResult.setLayoutData(fdlAddFilenameToResult);
wAddFilenameToResult = new Button(shell, SWT.CHECK);
@@ -182,16 +146,8 @@ public class ActionCreateFileDialog extends ActionDialog {
fdAddFilenameToResult.right = new FormAttachment(100, 0);
wAddFilenameToResult.setLayoutData(fdAddFilenameToResult);
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
-
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -208,9 +164,11 @@ public class ActionCreateFileDialog extends ActionDialog {
}
wAbortExists.setSelection(action.isFailIfFileExists());
wAddFilenameToResult.setSelection(action.isAddFilenameToResult());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/createfolder/src/main/java/org/apache/hop/workflow/actions/createfolder/ActionCreateFolderDialog.java b/plugins/actions/createfolder/src/main/java/org/apache/hop/workflow/actions/createfolder/ActionCreateFolderDialog.java
index 250de8389b..94b23e06f1 100644
--- a/plugins/actions/createfolder/src/main/java/org/apache/hop/workflow/actions/createfolder/ActionCreateFolderDialog.java
+++ b/plugins/actions/createfolder/src/main/java/org/apache/hop/workflow/actions/createfolder/ActionCreateFolderDialog.java
@@ -24,9 +24,7 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -35,18 +33,14 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Create Folder action settings. */
public class ActionCreateFolderDialog extends ActionDialog {
private static final Class<?> PKG = ActionCreateFolder.class;
- private Text wName;
-
private TextVar wFoldername;
private Button wAbortExists;
@@ -66,43 +60,12 @@ public class ActionCreateFolderDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionCreateFolder.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 180);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionCreateFolder.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Foldername line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ ModifyListener lsMod = e -> action.setChanged();
// Foldername line
Label wlFoldername = new Label(shell, SWT.RIGHT);
@@ -110,7 +73,7 @@ public class ActionCreateFolderDialog extends ActionDialog {
PropsUi.setLook(wlFoldername);
FormData fdlFoldername = new FormData();
fdlFoldername.left = new FormAttachment(0, 0);
- fdlFoldername.top = new FormAttachment(wName, margin);
+ fdlFoldername.top = new FormAttachment(wSpacer, margin);
fdlFoldername.right = new FormAttachment(middle, -margin);
wlFoldername.setLayoutData(fdlFoldername);
@@ -119,7 +82,7 @@ public class ActionCreateFolderDialog extends ActionDialog {
wbFoldername.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbFoldername = new FormData();
fdbFoldername.right = new FormAttachment(100, 0);
- fdbFoldername.top = new FormAttachment(wName, 0);
+ fdbFoldername.top = new FormAttachment(wlFoldername, 0, SWT.CENTER);
wbFoldername.setLayoutData(fdbFoldername);
wFoldername = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -127,7 +90,7 @@ public class ActionCreateFolderDialog extends ActionDialog {
wFoldername.addModifyListener(lsMod);
FormData fdFoldername = new FormData();
fdFoldername.left = new FormAttachment(middle, 0);
- fdFoldername.top = new FormAttachment(wName, margin);
+ fdFoldername.top = new FormAttachment(wlFoldername, 0, SWT.CENTER);
fdFoldername.right = new FormAttachment(wbFoldername, -margin);
wFoldername.setLayoutData(fdFoldername);
@@ -163,15 +126,8 @@ public class ActionCreateFolderDialog extends ActionDialog {
}
});
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -187,9 +143,11 @@ public class ActionCreateFolderDialog extends ActionDialog {
wFoldername.setText(action.getFolderName());
}
wAbortExists.setSelection(action.isFailIfFolderExists());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/delay/src/main/java/org/apache/hop/workflow/actions/delay/ActionDelayDialog.java b/plugins/actions/delay/src/main/java/org/apache/hop/workflow/actions/delay/ActionDelayDialog.java
index b071aca86b..643acb751e 100644
--- a/plugins/actions/delay/src/main/java/org/apache/hop/workflow/actions/delay/ActionDelayDialog.java
+++ b/plugins/actions/delay/src/main/java/org/apache/hop/workflow/actions/delay/ActionDelayDialog.java
@@ -24,28 +24,19 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.LabelTextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the delay action settings. */
public class ActionDelayDialog extends ActionDialog {
private static final Class<?> PKG = ActionDelay.class;
- private Text wName;
-
private CCombo wScaleTime;
private LabelTextVar wMaximumTimeout;
@@ -65,45 +56,11 @@ public class ActionDelayDialog extends ActionDialog {
@Override
public IAction open() {
- Shell parent = getParent();
-
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 190);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionDelay.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionDelay.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
// MaximumTimeout line
wMaximumTimeout =
new LabelTextVar(
@@ -112,10 +69,10 @@ public class ActionDelayDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionDelay.MaximumTimeout.Label"),
BaseMessages.getString(PKG, "ActionDelay.MaximumTimeout.Tooltip"));
PropsUi.setLook(wMaximumTimeout);
- wMaximumTimeout.addModifyListener(lsMod);
+ wMaximumTimeout.addModifyListener(e -> action.setChanged());
FormData fdMaximumTimeout = new FormData();
fdMaximumTimeout.left = new FormAttachment(0, 0);
- fdMaximumTimeout.top = new FormAttachment(wName, margin);
+ fdMaximumTimeout.top = new FormAttachment(wSpacer, margin);
fdMaximumTimeout.right = new FormAttachment(100, 0);
wMaximumTimeout.setLayoutData(fdMaximumTimeout);
@@ -124,7 +81,6 @@ public class ActionDelayDialog extends ActionDialog {
e -> wMaximumTimeout.setToolTipText(variables.resolve(wMaximumTimeout.getText())));
// Scale time
-
wScaleTime = new CCombo(shell, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wScaleTime.add(BaseMessages.getString(PKG, "ActionDelay.SScaleTime.Label"));
wScaleTime.add(BaseMessages.getString(PKG, "ActionDelay.MnScaleTime.Label"));
@@ -138,22 +94,19 @@ public class ActionDelayDialog extends ActionDialog {
fdScaleTime.right = new FormAttachment(100, 0);
wScaleTime.setLayoutData(fdScaleTime);
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
-
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
}
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
+ }
+
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
if (action.getName() != null) {
@@ -164,9 +117,6 @@ public class ActionDelayDialog extends ActionDialog {
}
wScaleTime.select(action.scaleTime);
-
- wName.selectAll();
- wName.setFocus();
}
private void cancel() {
diff --git a/plugins/actions/deletefile/src/main/java/org/apache/hop/workflow/actions/deletefile/ActionDeleteFileDialog.java b/plugins/actions/deletefile/src/main/java/org/apache/hop/workflow/actions/deletefile/ActionDeleteFileDialog.java
index 543f1f542b..66921743db 100644
--- a/plugins/actions/deletefile/src/main/java/org/apache/hop/workflow/actions/deletefile/ActionDeleteFileDialog.java
+++ b/plugins/actions/deletefile/src/main/java/org/apache/hop/workflow/actions/deletefile/ActionDeleteFileDialog.java
@@ -24,9 +24,7 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -35,11 +33,9 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Delete File action settings. */
public class ActionDeleteFileDialog extends ActionDialog {
@@ -48,8 +44,6 @@ public class ActionDeleteFileDialog extends ActionDialog {
private static final String[] FILETYPES =
new String[] {BaseMessages.getString(PKG, "ActionDeleteFile.Filetype.All")};
- private Text wName;
-
private TextVar wFilename;
private Button wAbortExists;
@@ -70,43 +64,12 @@ public class ActionDeleteFileDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionDeleteFile.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 180);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionDeleteFile.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ ModifyListener lsMod = e -> action.setChanged();
// Filename line
Label wlFilename = new Label(shell, SWT.RIGHT);
@@ -114,7 +77,7 @@ public class ActionDeleteFileDialog extends ActionDialog {
PropsUi.setLook(wlFilename);
FormData fdlFilename = new FormData();
fdlFilename.left = new FormAttachment(0, 0);
- fdlFilename.top = new FormAttachment(wName, margin);
+ fdlFilename.top = new FormAttachment(wSpacer, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
@@ -123,7 +86,7 @@ public class ActionDeleteFileDialog extends ActionDialog {
wbFilename.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbFilename = new FormData();
fdbFilename.right = new FormAttachment(100, 0);
- fdbFilename.top = new FormAttachment(wName, 0);
+ fdbFilename.top = new FormAttachment(wlFilename, 0, SWT.CENTER);
wbFilename.setLayoutData(fdbFilename);
wFilename = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -131,7 +94,7 @@ public class ActionDeleteFileDialog extends ActionDialog {
wFilename.addModifyListener(lsMod);
FormData fdFilename = new FormData();
fdFilename.left = new FormAttachment(middle, 0);
- fdFilename.top = new FormAttachment(wName, margin);
+ fdFilename.top = new FormAttachment(wlFilename, 0, SWT.CENTER);
fdFilename.right = new FormAttachment(wbFilename, -margin);
wFilename.setLayoutData(fdFilename);
@@ -170,18 +133,8 @@ public class ActionDeleteFileDialog extends ActionDialog {
}
});
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
-
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Add listeners
- wCancel.addListener(SWT.Selection, e -> cancel());
- wOk.addListener(SWT.Selection, e -> ok());
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -197,9 +150,11 @@ public class ActionDeleteFileDialog extends ActionDialog {
wFilename.setText(action.getFilename());
}
wAbortExists.setSelection(action.isFailIfFileNotExists());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/deletefiles/src/main/java/org/apache/hop/workflow/actions/deletefiles/ActionDeleteFilesDialog.java b/plugins/actions/deletefiles/src/main/java/org/apache/hop/workflow/actions/deletefiles/ActionDeleteFilesDialog.java
index 0a9f85278a..66d83afd48 100644
--- a/plugins/actions/deletefiles/src/main/java/org/apache/hop/workflow/actions/deletefiles/ActionDeleteFilesDialog.java
+++ b/plugins/actions/deletefiles/src/main/java/org/apache/hop/workflow/actions/deletefiles/ActionDeleteFilesDialog.java
@@ -31,9 +31,7 @@ import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -45,12 +43,10 @@ import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Delete Files action settings. */
public class ActionDeleteFilesDialog extends ActionDialog {
@@ -59,8 +55,6 @@ public class ActionDeleteFilesDialog extends ActionDialog {
private static final String[] FILETYPES =
new String[] {BaseMessages.getString(PKG, "System.FileType.AllFiles")};
- private Text wName;
-
private Button wIncludeSubfolders;
private ActionDeleteFiles action;
@@ -84,58 +78,12 @@ public class ActionDeleteFilesDialog extends ActionDialog {
@Override
public IAction open() {
- Shell parent = getParent();
-
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionDeleteFiles.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = (ModifyEvent e) -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionDeleteFiles.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, (Event e) -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, (Event e) -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionDeleteFiles.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addListener(SWT.Modify, event -> action.setChanged());
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // SETTINGS grouping?
- // ////////////////////////
- // START OF SETTINGS GROUP
- //
-
Group wSettings = new Group(shell, SWT.SHADOW_NONE);
PropsUi.setLook(wSettings);
wSettings.setText(BaseMessages.getString(PKG, "ActionDeleteFiles.Settings.Label"));
@@ -151,7 +99,7 @@ public class ActionDeleteFilesDialog extends ActionDialog {
PropsUi.setLook(wlIncludeSubfolders);
FormData fdlIncludeSubfolders = new FormData();
fdlIncludeSubfolders.left = new FormAttachment(0, 0);
- fdlIncludeSubfolders.top = new FormAttachment(wName, margin);
+ fdlIncludeSubfolders.top = new FormAttachment(0, margin);
fdlIncludeSubfolders.right = new FormAttachment(middle, -margin);
wlIncludeSubfolders.setLayoutData(fdlIncludeSubfolders);
wIncludeSubfolders = new Button(wSettings, SWT.CHECK);
@@ -170,7 +118,7 @@ public class ActionDeleteFilesDialog extends ActionDialog {
PropsUi.setLook(wlPrevious);
FormData fdlPrevious = new FormData();
fdlPrevious.left = new FormAttachment(0, 0);
- fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, 2 * margin);
+ fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, margin);
fdlPrevious.right = new FormAttachment(middle, -margin);
wlPrevious.setLayoutData(fdlPrevious);
wPrevious = new Button(wSettings, SWT.CHECK);
@@ -190,7 +138,7 @@ public class ActionDeleteFilesDialog extends ActionDialog {
});
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(wSpacer, margin);
fdSettings.right = new FormAttachment(100, -margin);
wSettings.setLayoutData(fdSettings);
@@ -241,7 +189,7 @@ public class ActionDeleteFilesDialog extends ActionDialog {
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
fdFields.right = new FormAttachment(100, 0);
- fdFields.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFields.bottom = new FormAttachment(wCancel, -margin);
wFields.setLayoutData(fdFields);
wlFields.setEnabled(!action.isArgFromPrevious());
@@ -249,6 +197,7 @@ public class ActionDeleteFilesDialog extends ActionDialog {
getData();
setPrevious();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -302,9 +251,11 @@ public class ActionDeleteFilesDialog extends ActionDialog {
wPrevious.setSelection(action.isArgFromPrevious());
wIncludeSubfolders.setSelection(action.isIncludeSubfolders());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/deletefolders/src/main/java/org/apache/hop/workflow/actions/deletefolders/ActionDeleteFoldersDialog.java b/plugins/actions/deletefolders/src/main/java/org/apache/hop/workflow/actions/deletefolders/ActionDeleteFoldersDialog.java
index 9be97d3b54..5db7b08a9f 100644
--- a/plugins/actions/deletefolders/src/main/java/org/apache/hop/workflow/actions/deletefolders/ActionDeleteFoldersDialog.java
+++ b/plugins/actions/deletefolders/src/main/java/org/apache/hop/workflow/actions/deletefolders/ActionDeleteFoldersDialog.java
@@ -28,9 +28,7 @@ import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.ColumnsResizer;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -43,19 +41,15 @@ import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Delete Folders action settings. */
public class ActionDeleteFoldersDialog extends ActionDialog {
private static final Class<?> PKG = ActionDeleteFolders.class;
- private Text wName;
-
private ActionDeleteFolders action;
private boolean changed;
@@ -82,58 +76,12 @@ public class ActionDeleteFoldersDialog extends ActionDialog {
@Override
public IAction open() {
- Shell parent = getParent();
-
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionDeleteFolders.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = (ModifyEvent e) -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionDeleteFolders.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, (Event e) -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, (Event e) -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionDeleteFolders.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // SETTINGS grouping?
- // ////////////////////////
- // START OF SETTINGS GROUP
- //
-
Group wSettings = new Group(shell, SWT.SHADOW_NONE);
PropsUi.setLook(wSettings);
wSettings.setText(BaseMessages.getString(PKG, "ActionDeleteFolders.Settings.Label"));
@@ -148,7 +96,7 @@ public class ActionDeleteFoldersDialog extends ActionDialog {
PropsUi.setLook(wlPrevious);
FormData fdlPrevious = new FormData();
fdlPrevious.left = new FormAttachment(0, 0);
- fdlPrevious.top = new FormAttachment(wName, margin);
+ fdlPrevious.top = new FormAttachment(0, margin);
fdlPrevious.right = new FormAttachment(middle, -margin);
wlPrevious.setLayoutData(fdlPrevious);
wPrevious = new Button(wSettings, SWT.CHECK);
@@ -168,7 +116,7 @@ public class ActionDeleteFoldersDialog extends ActionDialog {
});
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(wSpacer, margin);
fdSettings.right = new FormAttachment(100, -margin);
wSettings.setLayoutData(fdSettings);
@@ -293,7 +241,7 @@ public class ActionDeleteFoldersDialog extends ActionDialog {
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
fdFields.right = new FormAttachment(100, 0);
- fdFields.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFields.bottom = new FormAttachment(wCancel, -margin);
wFields.setLayoutData(fdFields);
wFields.getTable().addListener(SWT.Resize, new ColumnsResizer(8, 92));
@@ -303,6 +251,7 @@ public class ActionDeleteFoldersDialog extends ActionDialog {
getData();
setPrevious();
activeSuccessCondition();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -349,9 +298,11 @@ public class ActionDeleteFoldersDialog extends ActionDialog {
} else {
wSuccessCondition.select(0);
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesDialog.java b/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesDialog.java
index ce0b081ea6..f278fcea65 100644
--- a/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesDialog.java
+++ b/plugins/actions/deleteresultfilenames/src/main/java/org/apache/hop/workflow/actions/deleteresultfilenames/ActionDeleteResultFilenamesDialog.java
@@ -24,9 +24,7 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -35,18 +33,14 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Create Folder action settings. */
public class ActionDeleteResultFilenamesDialog extends ActionDialog {
private static final Class<?> PKG = ActionDeleteResultFilenames.class;
- private Text wName;
-
private Button wSpecifyWildcard;
private Label wlWildcard;
@@ -74,45 +68,12 @@ public class ActionDeleteResultFilenamesDialog extends ActionDialog {
@Override
public IAction open() {
- Shell parent = getParent();
-
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 220);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionDeleteResultFilenames.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionDeleteResultFilenames.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Folder name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
// Specify wildcard?
Label wlSpecifyWildcard = new Label(shell, SWT.RIGHT);
wlSpecifyWildcard.setText(
@@ -120,7 +81,7 @@ public class ActionDeleteResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyWildcard);
FormData fdlSpecifyWildcard = new FormData();
fdlSpecifyWildcard.left = new FormAttachment(0, 0);
- fdlSpecifyWildcard.top = new FormAttachment(wName, margin);
+ fdlSpecifyWildcard.top = new FormAttachment(wSpacer, margin);
fdlSpecifyWildcard.right = new FormAttachment(middle, -margin);
wlSpecifyWildcard.setLayoutData(fdlSpecifyWildcard);
wSpecifyWildcard = new Button(shell, SWT.CHECK);
@@ -147,7 +108,7 @@ public class ActionDeleteResultFilenamesDialog extends ActionDialog {
PropsUi.setLook(wlWildcard);
FormData fdlWildcard = new FormData();
fdlWildcard.left = new FormAttachment(0, 0);
- fdlWildcard.top = new FormAttachment(wlSpecifyWildcard, 2 * margin);
+ fdlWildcard.top = new FormAttachment(wlSpecifyWildcard, margin);
fdlWildcard.right = new FormAttachment(middle, -margin);
wlWildcard.setLayoutData(fdlWildcard);
wWildcard = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -157,7 +118,7 @@ public class ActionDeleteResultFilenamesDialog extends ActionDialog {
wWildcard.addModifyListener(lsMod);
FormData fdWildcard = new FormData();
fdWildcard.left = new FormAttachment(middle, 0);
- fdWildcard.top = new FormAttachment(wlSpecifyWildcard, 2 * margin);
+ fdWildcard.top = new FormAttachment(wlSpecifyWildcard, margin);
fdWildcard.right = new FormAttachment(100, -margin);
wWildcard.setLayoutData(fdWildcard);
@@ -189,18 +150,9 @@ public class ActionDeleteResultFilenamesDialog extends ActionDialog {
wWildcardExclude.addModifyListener(
e -> wWildcardExclude.setToolTipText(variables.resolve(wWildcardExclude.getText())));
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
getData();
CheckLimit();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -226,9 +178,11 @@ public class ActionDeleteResultFilenamesDialog extends ActionDialog {
if (action.getWildcardExclude() != null) {
wWildcardExclude.setText(action.getWildcardExclude());
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/dostounix/src/main/java/org/apache/hop/workflow/actions/dostounix/ActionDosToUnixDialog.java b/plugins/actions/dostounix/src/main/java/org/apache/hop/workflow/actions/dostounix/ActionDosToUnixDialog.java
index e804a9d74d..13f9338925 100644
--- a/plugins/actions/dostounix/src/main/java/org/apache/hop/workflow/actions/dostounix/ActionDosToUnixDialog.java
+++ b/plugins/actions/dostounix/src/main/java/org/apache/hop/workflow/actions/dostounix/ActionDosToUnixDialog.java
@@ -19,6 +19,7 @@ package org.apache.hop.workflow.actions.dostounix;
import java.util.ArrayList;
import java.util.List;
+import org.apache.hop.core.Const;
import org.apache.hop.core.Props;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
@@ -30,9 +31,7 @@ import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -51,7 +50,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the XML valid action settings. */
public class ActionDosToUnixDialog extends ActionDialog {
@@ -63,8 +61,6 @@ public class ActionDosToUnixDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionDosToUnix.Filetype.All")
};
- private Text wName;
-
private Label wlSourceFileFolder;
private Button wbSourceFileFolder;
private Button wbSourceDirectory;
@@ -110,53 +106,12 @@ public class ActionDosToUnixDialog extends ActionDialog {
@Override
public IAction open() {
- Shell parent = getParent();
-
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionDosToUnix.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionDosToUnix.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionDosToUnix.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -196,7 +151,7 @@ public class ActionDosToUnixDialog extends ActionDialog {
PropsUi.setLook(wlIncludeSubfolders);
FormData fdlIncludeSubfolders = new FormData();
fdlIncludeSubfolders.left = new FormAttachment(0, 0);
- fdlIncludeSubfolders.top = new FormAttachment(wName, margin);
+ fdlIncludeSubfolders.top = new FormAttachment(0, margin);
fdlIncludeSubfolders.right = new FormAttachment(middle, -margin);
wlIncludeSubfolders.setLayoutData(fdlIncludeSubfolders);
wIncludeSubfolders = new Button(wSettings, SWT.CHECK);
@@ -222,7 +177,7 @@ public class ActionDosToUnixDialog extends ActionDialog {
PropsUi.setLook(wlPrevious);
FormData fdlPrevious = new FormData();
fdlPrevious.left = new FormAttachment(0, 0);
- fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, 2 * margin);
+ fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, margin);
fdlPrevious.right = new FormAttachment(middle, -margin);
wlPrevious.setLayoutData(fdlPrevious);
wPrevious = new Button(wSettings, SWT.CHECK);
@@ -244,7 +199,7 @@ public class ActionDosToUnixDialog extends ActionDialog {
});
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(0, margin);
fdSettings.right = new FormAttachment(100, -margin);
wSettings.setLayoutData(fdSettings);
@@ -259,7 +214,7 @@ public class ActionDosToUnixDialog extends ActionDialog {
PropsUi.setLook(wlSourceFileFolder);
FormData fdlSourceFileFolder = new FormData();
fdlSourceFileFolder.left = new FormAttachment(0, 0);
- fdlSourceFileFolder.top = new FormAttachment(wSettings, 2 * margin);
+ fdlSourceFileFolder.top = new FormAttachment(wSettings, margin);
fdlSourceFileFolder.right = new FormAttachment(middle, -margin);
wlSourceFileFolder.setLayoutData(fdlSourceFileFolder);
@@ -301,7 +256,7 @@ public class ActionDosToUnixDialog extends ActionDialog {
wSourceFileFolder.addModifyListener(lsMod);
FormData fdSourceFileFolder = new FormData();
fdSourceFileFolder.left = new FormAttachment(middle, 0);
- fdSourceFileFolder.top = new FormAttachment(wSettings, 2 * margin);
+ fdSourceFileFolder.top = new FormAttachment(wSettings, margin);
fdSourceFileFolder.right = new FormAttachment(wbaSourceFileFolder, -margin);
wSourceFileFolder.setLayoutData(fdSourceFileFolder);
@@ -648,12 +603,13 @@ public class ActionDosToUnixDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
+ focusActionName();
activeSuccessCondition();
wTabFolder.setSelection(0);
@@ -686,9 +642,7 @@ public class ActionDosToUnixDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- if (action.getName() != null) {
- wName.setText(action.getName());
- }
+ wName.setText(Const.NVL(action.getName(), ""));
if (action.getFields() != null) {
for (int i = 0; i < action.getFields().size(); i++) {
@@ -743,9 +697,11 @@ public class ActionDosToUnixDialog extends ActionDialog {
} else {
wAddFilenameToResult.select(0);
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/eval/src/main/java/org/apache/hop/workflow/actions/eval/ActionEvalDialog.java b/plugins/actions/eval/src/main/java/org/apache/hop/workflow/actions/eval/ActionEvalDialog.java
index 61bd3c3621..15a89d9e37 100644
--- a/plugins/actions/eval/src/main/java/org/apache/hop/workflow/actions/eval/ActionEvalDialog.java
+++ b/plugins/actions/eval/src/main/java/org/apache/hop/workflow/actions/eval/ActionEvalDialog.java
@@ -27,10 +27,8 @@ import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.JavaScriptStyledTextComp;
import org.apache.hop.ui.core.widget.StyledTextComp;
import org.apache.hop.ui.core.widget.TextComposite;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.util.EnvironmentUtils;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -43,18 +41,13 @@ import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit a ActionEval object. */
public class ActionEvalDialog extends ActionDialog {
private static final Class<?> PKG = ActionEval.class;
- private Text wName;
-
private TextComposite wScript;
private Label wlPosition;
@@ -74,51 +67,12 @@ public class ActionEvalDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionEval.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionEval.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionEval.ActionName.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ ModifyListener lsMod = e -> action.setChanged();
wlPosition = new Label(shell, SWT.NONE);
wlPosition.setText(BaseMessages.getString(PKG, "ActionEval.LineNr.Label", "0"));
@@ -134,7 +88,7 @@ public class ActionEvalDialog extends ActionDialog {
PropsUi.setLook(wlScript);
FormData fdlScript = new FormData();
fdlScript.left = new FormAttachment(0, 0);
- fdlScript.top = new FormAttachment(wName, margin);
+ fdlScript.top = new FormAttachment(wSpacer, margin);
wlScript.setLayoutData(fdlScript);
if (EnvironmentUtils.getInstance().isWeb()) {
@@ -208,6 +162,7 @@ public class ActionEvalDialog extends ActionDialog {
wScript.addModifyListener(lsMod);
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -230,9 +185,11 @@ public class ActionEvalDialog extends ActionDialog {
if (action.getScript() != null) {
wScript.setText(action.getScript());
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/evalfilesmetrics/src/main/java/org/apache/hop/workflow/actions/evalfilesmetrics/ActionEvalFilesMetricsDialog.java b/plugins/actions/evalfilesmetrics/src/main/java/org/apache/hop/workflow/actions/evalfilesmetrics/ActionEvalFilesMetricsDialog.java
index f75d76835e..c5c18663ff 100644
--- a/plugins/actions/evalfilesmetrics/src/main/java/org/apache/hop/workflow/actions/evalfilesmetrics/ActionEvalFilesMetricsDialog.java
+++ b/plugins/actions/evalfilesmetrics/src/main/java/org/apache/hop/workflow/actions/evalfilesmetrics/ActionEvalFilesMetricsDialog.java
@@ -17,6 +17,7 @@
package org.apache.hop.workflow.actions.evalfilesmetrics;
+import org.apache.hop.core.Const;
import org.apache.hop.core.Props;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
@@ -28,9 +29,7 @@ import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -49,7 +48,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the eval files metrics action settings. */
public class ActionEvalFilesMetricsDialog extends ActionDialog {
@@ -58,8 +56,6 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
private static final String[] FILETYPES =
new String[] {BaseMessages.getString(PKG, "ActionEvalFilesMetrics.Filetype.All")};
- private Text wName;
-
private Label wlSourceFileFolder;
private Button wbSourceFileFolder;
private Button wbSourceDirectory;
@@ -125,52 +121,12 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionEvalFilesMetrics.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionEvalFilesMetrics.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionEvalFilesMetrics.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -212,7 +168,7 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
FormData fdlSourceFiles = new FormData();
fdlSourceFiles.left = new FormAttachment(0, 0);
fdlSourceFiles.right = new FormAttachment(middle, -margin);
- fdlSourceFiles.top = new FormAttachment(wName, margin);
+ fdlSourceFiles.top = new FormAttachment(0, margin);
wlSourceFiles.setLayoutData(fdlSourceFiles);
wSourceFiles = new CCombo(wSettings, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
@@ -222,7 +178,7 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
PropsUi.setLook(wSourceFiles);
FormData fdSourceFiles = new FormData();
fdSourceFiles.left = new FormAttachment(middle, 0);
- fdSourceFiles.top = new FormAttachment(wName, margin);
+ fdSourceFiles.top = new FormAttachment(0, margin);
fdSourceFiles.right = new FormAttachment(100, 0);
wSourceFiles.setLayoutData(fdSourceFiles);
wSourceFiles.addSelectionListener(
@@ -358,7 +314,7 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(0, margin);
fdSettings.right = new FormAttachment(100, -margin);
wSettings.setLayoutData(fdSettings);
@@ -373,7 +329,7 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
PropsUi.setLook(wlSourceFileFolder);
FormData fdlSourceFileFolder = new FormData();
fdlSourceFileFolder.left = new FormAttachment(0, 0);
- fdlSourceFileFolder.top = new FormAttachment(wSettings, 2 * margin);
+ fdlSourceFileFolder.top = new FormAttachment(wSettings, margin);
fdlSourceFileFolder.right = new FormAttachment(middle, -margin);
wlSourceFileFolder.setLayoutData(fdlSourceFileFolder);
@@ -418,7 +374,7 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
wSourceFileFolder.addModifyListener(lsMod);
FormData fdSourceFileFolder = new FormData();
fdSourceFileFolder.left = new FormAttachment(middle, 0);
- fdSourceFileFolder.top = new FormAttachment(wSettings, 2 * margin);
+ fdSourceFileFolder.top = new FormAttachment(wSettings, margin);
fdSourceFileFolder.right = new FormAttachment(wbaSourceFileFolder, -margin);
wSourceFileFolder.setLayoutData(fdSourceFileFolder);
@@ -777,9 +733,9 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
@@ -787,7 +743,7 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
refreshSize();
refreshSourceFiles();
wTabFolder.setSelection(0);
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -837,9 +793,7 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- if (action.getName() != null) {
- wName.setText(action.getName());
- }
+ wName.setText(Const.NVL(action.getName(), ""));
if (action.getSourceFileFolder() != null) {
for (int i = 0; i < action.getSourceFileFolder().length; i++) {
@@ -888,9 +842,11 @@ public class ActionEvalFilesMetricsDialog extends ActionDialog {
if (action.getMaxValue() != null) {
wMaxValue.setText(action.getMaxValue());
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/evaluatetablecontent/src/main/java/org/apache/hop/workflow/actions/evaluatetablecontent/ActionEvalTableContentDialog.java b/plugins/actions/evaluatetablecontent/src/main/java/org/apache/hop/workflow/actions/evaluatetablecontent/ActionEvalTableContentDialog.java
index 46059022bf..6f6ffc1063 100644
--- a/plugins/actions/evaluatetablecontent/src/main/java/org/apache/hop/workflow/actions/evaluatetablecontent/ActionEvalTableContentDialog.java
+++ b/plugins/actions/evaluatetablecontent/src/main/java/org/apache/hop/workflow/actions/evaluatetablecontent/ActionEvalTableContentDialog.java
@@ -35,9 +35,7 @@ import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.MetaSelectionLine;
import org.apache.hop.ui.core.widget.StyledTextComp;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -58,7 +56,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/**
* This dialog allows you to edit the Table content evaluation action settings. (select the
@@ -70,8 +67,6 @@ public class ActionEvalTableContentDialog extends ActionDialog {
private Button wbTable;
private Button wbSqlTable;
- private Text wName;
-
private MetaSelectionLine<DatabaseMeta> wConnection;
private ActionEvalTableContent action;
@@ -123,54 +118,14 @@ public class ActionEvalTableContentDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionEvalTableContent.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionEvalTableContent.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionEvalTableContent.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
// Connection line
- wConnection = addConnectionLine(shell, wName, action.getDatabase(), lsMod);
+ wConnection = addConnectionLine(shell, wSpacer, action.getDatabase(), lsMod);
// Schema name line
wlSchemaName = new Label(shell, SWT.RIGHT);
@@ -208,7 +163,7 @@ public class ActionEvalTableContentDialog extends ActionDialog {
wbTable.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbTable = new FormData();
fdbTable.right = new FormAttachment(100, 0);
- fdbTable.top = new FormAttachment(wSchemaName, margin / 2);
+ fdbTable.top = new FormAttachment(wSchemaName, margin);
wbTable.setLayoutData(fdbTable);
wbTable.addSelectionListener(
new SelectionAdapter() {
@@ -249,7 +204,7 @@ public class ActionEvalTableContentDialog extends ActionDialog {
PropsUi.setLook(wlSuccessCondition);
FormData fdlSuccessCondition = new FormData();
fdlSuccessCondition.left = new FormAttachment(0, -margin);
- fdlSuccessCondition.right = new FormAttachment(middle, -2 * margin);
+ fdlSuccessCondition.right = new FormAttachment(middle, -margin);
fdlSuccessCondition.top = new FormAttachment(0, margin);
wlSuccessCondition.setLayoutData(fdlSuccessCondition);
wSuccessCondition = new CCombo(wSuccessGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
@@ -277,7 +232,7 @@ public class ActionEvalTableContentDialog extends ActionDialog {
FormData fdlLimit = new FormData();
fdlLimit.left = new FormAttachment(0, -margin);
fdlLimit.top = new FormAttachment(wSuccessCondition, margin);
- fdlLimit.right = new FormAttachment(middle, -2 * margin);
+ fdlLimit.right = new FormAttachment(middle, -margin);
wlLimit.setLayoutData(fdlLimit);
wLimit =
@@ -323,7 +278,7 @@ public class ActionEvalTableContentDialog extends ActionDialog {
FormData fdlCustomSql = new FormData();
fdlCustomSql.left = new FormAttachment(0, -margin);
fdlCustomSql.top = new FormAttachment(0, margin);
- fdlCustomSql.right = new FormAttachment(middle, -2 * margin);
+ fdlCustomSql.right = new FormAttachment(middle, -margin);
wlCustomSql.setLayoutData(fdlCustomSql);
wCustomSql = new Button(wCustomGroup, SWT.CHECK);
PropsUi.setLook(wCustomSql);
@@ -349,8 +304,8 @@ public class ActionEvalTableContentDialog extends ActionDialog {
PropsUi.setLook(wlUseSubs);
FormData fdlUseSubs = new FormData();
fdlUseSubs.left = new FormAttachment(0, -margin);
- fdlUseSubs.top = new FormAttachment(wlCustomSql, 2 * margin);
- fdlUseSubs.right = new FormAttachment(middle, -2 * margin);
+ fdlUseSubs.top = new FormAttachment(wlCustomSql, margin);
+ fdlUseSubs.right = new FormAttachment(middle, -margin);
wlUseSubs.setLayoutData(fdlUseSubs);
wUseSubs = new Button(wCustomGroup, SWT.CHECK);
PropsUi.setLook(wUseSubs);
@@ -376,8 +331,8 @@ public class ActionEvalTableContentDialog extends ActionDialog {
PropsUi.setLook(wlClearResultList);
FormData fdlClearResultList = new FormData();
fdlClearResultList.left = new FormAttachment(0, -margin);
- fdlClearResultList.top = new FormAttachment(wlUseSubs, 2 * margin);
- fdlClearResultList.right = new FormAttachment(middle, -2 * margin);
+ fdlClearResultList.top = new FormAttachment(wlUseSubs, margin);
+ fdlClearResultList.right = new FormAttachment(middle, -margin);
wlClearResultList.setLayoutData(fdlClearResultList);
wClearResultList = new Button(wCustomGroup, SWT.CHECK);
PropsUi.setLook(wClearResultList);
@@ -403,8 +358,8 @@ public class ActionEvalTableContentDialog extends ActionDialog {
PropsUi.setLook(wlAddRowsToResult);
FormData fdlAddRowsToResult = new FormData();
fdlAddRowsToResult.left = new FormAttachment(0, -margin);
- fdlAddRowsToResult.top = new FormAttachment(wlClearResultList, 2 * margin);
- fdlAddRowsToResult.right = new FormAttachment(middle, -2 * margin);
+ fdlAddRowsToResult.top = new FormAttachment(wlClearResultList, margin);
+ fdlAddRowsToResult.right = new FormAttachment(middle, -margin);
wlAddRowsToResult.setLayoutData(fdlAddRowsToResult);
wAddRowsToResult = new Button(wCustomGroup, SWT.CHECK);
PropsUi.setLook(wAddRowsToResult);
@@ -437,7 +392,7 @@ public class ActionEvalTableContentDialog extends ActionDialog {
PropsUi.setLook(wlSql);
FormData fdlSql = new FormData();
fdlSql.left = new FormAttachment(0, 0);
- fdlSql.top = new FormAttachment(wlAddRowsToResult, 2 * margin);
+ fdlSql.top = new FormAttachment(wlAddRowsToResult, margin);
wlSql.setLayoutData(fdlSql);
wbSqlTable = new Button(wCustomGroup, SWT.PUSH | SWT.CENTER);
@@ -460,6 +415,7 @@ public class ActionEvalTableContentDialog extends ActionDialog {
fdSql.top = new FormAttachment(wbSqlTable, margin);
fdSql.right = new FormAttachment(100, -10);
fdSql.bottom = new FormAttachment(wlPosition, -margin);
+ fdSql.height = 200;
wSql.setLayoutData(fdSql);
wSql.addModifyListener(arg0 -> setPosition());
@@ -511,7 +467,7 @@ public class ActionEvalTableContentDialog extends ActionDialog {
fdCustomGroup.left = new FormAttachment(0, margin);
fdCustomGroup.top = new FormAttachment(wSuccessGroup, margin);
fdCustomGroup.right = new FormAttachment(100, -margin);
- fdCustomGroup.bottom = new FormAttachment(wOk, -margin);
+ fdCustomGroup.bottom = new FormAttachment(wCancel, -margin);
wCustomGroup.setLayoutData(fdCustomGroup);
// ///////////////////////////////////////////////////////////
// / END OF CustomGroup GROUP
@@ -519,7 +475,7 @@ public class ActionEvalTableContentDialog extends ActionDialog {
getData();
setCustomSql();
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -636,9 +592,7 @@ public class ActionEvalTableContentDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- if (action.getName() != null) {
- wName.setText(action.getName());
- }
+ wName.setText(Const.NVL(action.getName(), ""));
if (action.getDatabase() != null) {
wConnection.setText(action.getDatabase().getName());
@@ -667,9 +621,11 @@ public class ActionEvalTableContentDialog extends ActionDialog {
if (action.getCustomSql() != null) {
wSql.setText(action.getCustomSql());
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/filecompare/src/main/java/org/apache/hop/workflow/actions/filecompare/ActionFileCompareDialog.java b/plugins/actions/filecompare/src/main/java/org/apache/hop/workflow/actions/filecompare/ActionFileCompareDialog.java
index e753dc32a0..b14e66ee54 100644
--- a/plugins/actions/filecompare/src/main/java/org/apache/hop/workflow/actions/filecompare/ActionFileCompareDialog.java
+++ b/plugins/actions/filecompare/src/main/java/org/apache/hop/workflow/actions/filecompare/ActionFileCompareDialog.java
@@ -24,9 +24,7 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -35,11 +33,9 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the File compare action settings. */
public class ActionFileCompareDialog extends ActionDialog {
@@ -48,8 +44,6 @@ public class ActionFileCompareDialog extends ActionDialog {
private static final String[] FILETYPES =
new String[] {BaseMessages.getString(PKG, "ActionFileCompare.Filetype.All")};
- private Text wName;
-
private TextVar wFilename1;
private TextVar wFilename2;
@@ -70,66 +64,35 @@ public class ActionFileCompareDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionFileCompare.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 230);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionFileCompare.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ ModifyListener lsMod = e -> action.setChanged();
// Filename 1 line
Label wlFilename1 = new Label(shell, SWT.RIGHT);
wlFilename1.setText(BaseMessages.getString(PKG, "ActionFileCompare.Filename1.Label"));
PropsUi.setLook(wlFilename1);
FormData fdlFilename1 = new FormData();
- fdlFilename1.left = new FormAttachment(0, 0);
- fdlFilename1.top = new FormAttachment(wName, margin);
+ fdlFilename1.left = new FormAttachment(0, margin);
+ fdlFilename1.top = new FormAttachment(wSpacer, margin);
fdlFilename1.right = new FormAttachment(middle, -margin);
wlFilename1.setLayoutData(fdlFilename1);
Button wbFilename1 = new Button(shell, SWT.PUSH | SWT.CENTER);
PropsUi.setLook(wbFilename1);
wbFilename1.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbFilename1 = new FormData();
- fdbFilename1.right = new FormAttachment(100, 0);
- fdbFilename1.top = new FormAttachment(wName, 0);
+ fdbFilename1.right = new FormAttachment(100, -margin);
+ fdbFilename1.top = new FormAttachment(wlFilename1, 0, SWT.CENTER);
wbFilename1.setLayoutData(fdbFilename1);
wFilename1 = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wFilename1);
wFilename1.addModifyListener(lsMod);
FormData fdFilename1 = new FormData();
fdFilename1.left = new FormAttachment(middle, 0);
- fdFilename1.top = new FormAttachment(wName, margin);
+ fdFilename1.top = new FormAttachment(wlFilename1, 0, SWT.CENTER);
fdFilename1.right = new FormAttachment(wbFilename1, -margin);
wFilename1.setLayoutData(fdFilename1);
@@ -148,7 +111,7 @@ public class ActionFileCompareDialog extends ActionDialog {
wlFilename2.setText(BaseMessages.getString(PKG, "ActionFileCompare.Filename2.Label"));
PropsUi.setLook(wlFilename2);
FormData fdlFilename2 = new FormData();
- fdlFilename2.left = new FormAttachment(0, 0);
+ fdlFilename2.left = new FormAttachment(0, margin);
fdlFilename2.top = new FormAttachment(wFilename1, margin);
fdlFilename2.right = new FormAttachment(middle, -margin);
wlFilename2.setLayoutData(fdlFilename2);
@@ -156,15 +119,15 @@ public class ActionFileCompareDialog extends ActionDialog {
PropsUi.setLook(wbFilename2);
wbFilename2.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbFilename2 = new FormData();
- fdbFilename2.right = new FormAttachment(100, 0);
- fdbFilename2.top = new FormAttachment(wFilename1, 0);
+ fdbFilename2.right = new FormAttachment(100, -margin);
+ fdbFilename2.top = new FormAttachment(wlFilename2, 0, SWT.CENTER);
wbFilename2.setLayoutData(fdbFilename2);
wFilename2 = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wFilename2);
wFilename2.addModifyListener(lsMod);
FormData fdFilename2 = new FormData();
fdFilename2.left = new FormAttachment(middle, 0);
- fdFilename2.top = new FormAttachment(wFilename1, margin);
+ fdFilename2.top = new FormAttachment(wlFilename2, 0, SWT.CENTER);
fdFilename2.right = new FormAttachment(wbFilename2, -margin);
wFilename2.setLayoutData(fdFilename2);
@@ -184,8 +147,8 @@ public class ActionFileCompareDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionFileCompare.AddFilenameResult.Label"));
PropsUi.setLook(wlAddFilenameResult);
FormData fdlAddFilenameResult = new FormData();
- fdlAddFilenameResult.left = new FormAttachment(0, 0);
- fdlAddFilenameResult.top = new FormAttachment(wbFilename2, 2 * margin);
+ fdlAddFilenameResult.left = new FormAttachment(0, margin);
+ fdlAddFilenameResult.top = new FormAttachment(wbFilename2, margin);
fdlAddFilenameResult.right = new FormAttachment(middle, -margin);
wlAddFilenameResult.setLayoutData(fdlAddFilenameResult);
wAddFilenameResult = new Button(shell, SWT.CHECK);
@@ -195,7 +158,7 @@ public class ActionFileCompareDialog extends ActionDialog {
FormData fdAddFilenameResult = new FormData();
fdAddFilenameResult.left = new FormAttachment(middle, 0);
fdAddFilenameResult.top = new FormAttachment(wlAddFilenameResult, 0, SWT.CENTER);
- fdAddFilenameResult.right = new FormAttachment(100, 0);
+ fdAddFilenameResult.right = new FormAttachment(100, -margin);
wAddFilenameResult.setLayoutData(fdAddFilenameResult);
wAddFilenameResult.addSelectionListener(
new SelectionAdapter() {
@@ -205,17 +168,8 @@ public class ActionFileCompareDialog extends ActionDialog {
}
});
- // Buttons at the bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -234,9 +188,11 @@ public class ActionFileCompareDialog extends ActionDialog {
wFilename2.setText(action.getFilename2());
}
wAddFilenameResult.setSelection(action.isAddFilenameToResult());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/fileexists/src/main/java/org/apache/hop/workflow/actions/fileexists/ActionFileExistsDialog.java b/plugins/actions/fileexists/src/main/java/org/apache/hop/workflow/actions/fileexists/ActionFileExistsDialog.java
index 18483b1fa3..6deb7667e0 100644
--- a/plugins/actions/fileexists/src/main/java/org/apache/hop/workflow/actions/fileexists/ActionFileExistsDialog.java
+++ b/plugins/actions/fileexists/src/main/java/org/apache/hop/workflow/actions/fileexists/ActionFileExistsDialog.java
@@ -24,20 +24,16 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/**
* This dialog allows you to edit the SQL action settings. (select the connection and the sql script
@@ -55,8 +51,6 @@ public class ActionFileExistsDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionFileExists.Filetype.All")
};
- private Text wName;
-
private TextVar wFilename;
private ActionFileExists action;
@@ -74,43 +68,12 @@ public class ActionFileExistsDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionFileExists.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 160);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionFileExists.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ ModifyListener lsMod = e -> action.setChanged();
// Filename line
Label wlFilename = new Label(shell, SWT.RIGHT);
@@ -118,7 +81,7 @@ public class ActionFileExistsDialog extends ActionDialog {
PropsUi.setLook(wlFilename);
FormData fdlFilename = new FormData();
fdlFilename.left = new FormAttachment(0, 0);
- fdlFilename.top = new FormAttachment(wName, margin);
+ fdlFilename.top = new FormAttachment(wSpacer, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
@@ -127,7 +90,7 @@ public class ActionFileExistsDialog extends ActionDialog {
wbFilename.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbFilename = new FormData();
fdbFilename.right = new FormAttachment(100, 0);
- fdbFilename.top = new FormAttachment(wName, 0);
+ fdbFilename.top = new FormAttachment(wlFilename, 0, SWT.CENTER);
wbFilename.setLayoutData(fdbFilename);
wFilename = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -135,7 +98,7 @@ public class ActionFileExistsDialog extends ActionDialog {
wFilename.addModifyListener(lsMod);
FormData fdFilename = new FormData();
fdFilename.left = new FormAttachment(middle, 0);
- fdFilename.top = new FormAttachment(wName, margin);
+ fdFilename.top = new FormAttachment(wlFilename, 0, SWT.CENTER);
fdFilename.right = new FormAttachment(wbFilename, -margin);
wFilename.setLayoutData(fdFilename);
@@ -148,17 +111,8 @@ public class ActionFileExistsDialog extends ActionDialog {
BaseDialog.presentFileDialog(
shell, wFilename, variables, EXTENSIONS, FILETYPES, false));
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -173,9 +127,11 @@ public class ActionFileExistsDialog extends ActionDialog {
if (action.getFilename() != null) {
wFilename.setText(action.getFilename());
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/filesexist/src/main/java/org/apache/hop/workflow/actions/filesexist/ActionFilesExistDialog.java b/plugins/actions/filesexist/src/main/java/org/apache/hop/workflow/actions/filesexist/ActionFilesExistDialog.java
index ee264a1af8..375c05121f 100644
--- a/plugins/actions/filesexist/src/main/java/org/apache/hop/workflow/actions/filesexist/ActionFilesExistDialog.java
+++ b/plugins/actions/filesexist/src/main/java/org/apache/hop/workflow/actions/filesexist/ActionFilesExistDialog.java
@@ -28,9 +28,7 @@ import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.ColumnsResizer;
import org.apache.hop.ui.core.widget.TableView;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -39,19 +37,14 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Files exist action settings. */
public class ActionFilesExistDialog extends ActionDialog {
private static final Class<?> PKG = ActionFilesExist.class;
- private Text wName;
-
private ActionFilesExist action;
private boolean changed;
@@ -69,60 +62,19 @@ public class ActionFilesExistDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionFilesExist.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionFilesExist.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Action name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
Label wlFields = new Label(shell, SWT.NONE);
wlFields.setText(BaseMessages.getString(PKG, "ActionFilesExist.Fields.Label"));
PropsUi.setLook(wlFields);
FormData fdlFields = new FormData();
fdlFields.left = new FormAttachment(0, 0);
fdlFields.right = new FormAttachment(middle, -margin);
- fdlFields.top = new FormAttachment(wName, margin);
+ fdlFields.top = new FormAttachment(wSpacer, margin);
wlFields.setLayoutData(fdlFields);
ColumnInfo[] columns =
@@ -160,11 +112,12 @@ public class ActionFilesExistDialog extends ActionDialog {
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
fdFields.right = new FormAttachment(100, 0);
- fdFields.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFields.bottom = new FormAttachment(wCancel, -margin);
wFields.setLayoutData(fdFields);
wFields.getTable().addListener(SWT.Resize, new ColumnsResizer(8, 92));
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -186,9 +139,11 @@ public class ActionFilesExistDialog extends ActionDialog {
}
wFields.setRowNums();
// wFields.optWidth(true);
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/folderisempty/src/main/java/org/apache/hop/workflow/actions/folderisempty/ActionFolderIsEmptyDialog.java b/plugins/actions/folderisempty/src/main/java/org/apache/hop/workflow/actions/folderisempty/ActionFolderIsEmptyDialog.java
index b5561c72d3..f82f2d24aa 100644
--- a/plugins/actions/folderisempty/src/main/java/org/apache/hop/workflow/actions/folderisempty/ActionFolderIsEmptyDialog.java
+++ b/plugins/actions/folderisempty/src/main/java/org/apache/hop/workflow/actions/folderisempty/ActionFolderIsEmptyDialog.java
@@ -24,9 +24,7 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -35,18 +33,14 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Create Folder action settings. */
public class ActionFolderIsEmptyDialog extends ActionDialog {
private static final Class<?> PKG = ActionFolderIsEmpty.class;
- private Text wName;
-
private TextVar wFoldername;
private Button wIncludeSubFolders;
@@ -71,43 +65,12 @@ public class ActionFolderIsEmptyDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionFolderIsEmpty.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 244);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionFolderIsEmpty.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Foldername line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ ModifyListener lsMod = e -> action.setChanged();
// Foldername line
Label wlFoldername = new Label(shell, SWT.RIGHT);
@@ -115,7 +78,7 @@ public class ActionFolderIsEmptyDialog extends ActionDialog {
PropsUi.setLook(wlFoldername);
FormData fdlFoldername = new FormData();
fdlFoldername.left = new FormAttachment(0, 0);
- fdlFoldername.top = new FormAttachment(wName, margin);
+ fdlFoldername.top = new FormAttachment(wSpacer, margin);
fdlFoldername.right = new FormAttachment(middle, -margin);
wlFoldername.setLayoutData(fdlFoldername);
@@ -124,7 +87,7 @@ public class ActionFolderIsEmptyDialog extends ActionDialog {
wbFoldername.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbFoldername = new FormData();
fdbFoldername.right = new FormAttachment(100, 0);
- fdbFoldername.top = new FormAttachment(wName, 0);
+ fdbFoldername.top = new FormAttachment(wlFoldername, 0, SWT.CENTER);
wbFoldername.setLayoutData(fdbFoldername);
wFoldername = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -132,7 +95,7 @@ public class ActionFolderIsEmptyDialog extends ActionDialog {
wFoldername.addModifyListener(lsMod);
FormData fdFoldername = new FormData();
fdFoldername.left = new FormAttachment(middle, 0);
- fdFoldername.top = new FormAttachment(wName, margin);
+ fdFoldername.top = new FormAttachment(wlFoldername, 0, SWT.CENTER);
fdFoldername.right = new FormAttachment(wbFoldername, -margin);
wFoldername.setLayoutData(fdFoldername);
@@ -170,7 +133,7 @@ public class ActionFolderIsEmptyDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyWildcard);
FormData fdlSpecifyWildcard = new FormData();
fdlSpecifyWildcard.left = new FormAttachment(0, 0);
- fdlSpecifyWildcard.top = new FormAttachment(wlIncludeSubFolders, 2 * margin);
+ fdlSpecifyWildcard.top = new FormAttachment(wlIncludeSubFolders, margin);
fdlSpecifyWildcard.right = new FormAttachment(middle, -margin);
wlSpecifyWildcard.setLayoutData(fdlSpecifyWildcard);
wSpecifyWildcard = new Button(shell, SWT.CHECK);
@@ -219,18 +182,9 @@ public class ActionFolderIsEmptyDialog extends ActionDialog {
wbFoldername.addListener(
SWT.Selection, e -> BaseDialog.presentDirectoryDialog(shell, wFoldername, variables));
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
getData();
checkLimitSearch();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -255,9 +209,11 @@ public class ActionFolderIsEmptyDialog extends ActionDialog {
if (action.getWildcard() != null) {
wWildcard.setText(action.getWildcard());
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/folderscompare/src/main/java/org/apache/hop/workflow/actions/folderscompare/ActionFoldersCompareDialog.java b/plugins/actions/folderscompare/src/main/java/org/apache/hop/workflow/actions/folderscompare/ActionFoldersCompareDialog.java
index 4c46e8edda..50c156d81c 100644
--- a/plugins/actions/folderscompare/src/main/java/org/apache/hop/workflow/actions/folderscompare/ActionFoldersCompareDialog.java
+++ b/plugins/actions/folderscompare/src/main/java/org/apache/hop/workflow/actions/folderscompare/ActionFoldersCompareDialog.java
@@ -24,24 +24,24 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Folders compare action settings. */
public class ActionFoldersCompareDialog extends ActionDialog {
@@ -50,8 +50,6 @@ public class ActionFoldersCompareDialog extends ActionDialog {
private static final String[] FILETYPES =
new String[] {BaseMessages.getString(PKG, "ActionFoldersCompare.Filetype.All")};
- private Text wName;
-
private TextVar wFilename1;
private TextVar wFilename2;
@@ -84,48 +82,32 @@ public class ActionFoldersCompareDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionFoldersCompare.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
+
+ ScrolledComposite sc = new ScrolledComposite(shell, SWT.V_SCROLL | SWT.H_SCROLL);
+ PropsUi.setLook(sc);
+ FormData fdSc = new FormData();
+ fdSc.left = new FormAttachment(0, margin);
+ fdSc.top = new FormAttachment(wSpacer, margin);
+ fdSc.right = new FormAttachment(100, -margin);
+ fdSc.bottom = new FormAttachment(wCancel, -margin);
+ sc.setLayoutData(fdSc);
+ sc.setLayout(new FillLayout());
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+
+ Composite wContent = new Composite(sc, SWT.NONE);
+ PropsUi.setLook(wContent);
+ FormLayout contentLayout = new FormLayout();
+ contentLayout.marginWidth = PropsUi.getFormMargin();
+ contentLayout.marginHeight = PropsUi.getFormMargin();
+ wContent.setLayout(contentLayout);
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionFoldersCompare.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionFoldersCompare.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // SETTINGS grouping?
- // ////////////////////////
- // START OF SETTINGS GROUP
- //
-
- Group wSettings = new Group(shell, SWT.SHADOW_NONE);
+ Group wSettings = new Group(wContent, SWT.SHADOW_NONE);
PropsUi.setLook(wSettings);
wSettings.setText(BaseMessages.getString(PKG, "ActionFoldersCompare.Settings.Label"));
@@ -167,7 +149,7 @@ public class ActionFoldersCompareDialog extends ActionDialog {
FormData fdlCompareOnly = new FormData();
fdlCompareOnly.left = new FormAttachment(0, 0);
fdlCompareOnly.right = new FormAttachment(middle, -margin);
- fdlCompareOnly.top = new FormAttachment(wlIncludeSubfolders, 2 * margin);
+ fdlCompareOnly.top = new FormAttachment(wlIncludeSubfolders, margin);
wlCompareOnly.setLayoutData(fdlCompareOnly);
wCompareOnly = new CCombo(wSettings, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wCompareOnly.add(BaseMessages.getString(PKG, "ActionFoldersCompare.All_CompareOnly.Label"));
@@ -244,7 +226,7 @@ public class ActionFoldersCompareDialog extends ActionDialog {
PropsUi.setLook(wlCompareFileContent);
FormData fdlCompareFileContent = new FormData();
fdlCompareFileContent.left = new FormAttachment(0, 0);
- fdlCompareFileContent.top = new FormAttachment(wlCompareFileSize, 2 * margin);
+ fdlCompareFileContent.top = new FormAttachment(wlCompareFileSize, margin);
fdlCompareFileContent.right = new FormAttachment(middle, -margin);
wlCompareFileContent.setLayoutData(fdlCompareFileContent);
wCompareFileContent = new Button(wSettings, SWT.CHECK);
@@ -266,7 +248,7 @@ public class ActionFoldersCompareDialog extends ActionDialog {
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(0, margin);
fdSettings.right = new FormAttachment(100, -margin);
wSettings.setLayoutData(fdSettings);
@@ -275,22 +257,22 @@ public class ActionFoldersCompareDialog extends ActionDialog {
// ///////////////////////////////////////////////////////////
// Filename 1 line
- Label wlFilename1 = new Label(shell, SWT.RIGHT);
+ Label wlFilename1 = new Label(wContent, SWT.RIGHT);
wlFilename1.setText(BaseMessages.getString(PKG, "ActionFoldersCompare.Filename1.Label"));
PropsUi.setLook(wlFilename1);
FormData fdlFilename1 = new FormData();
fdlFilename1.left = new FormAttachment(0, 0);
- fdlFilename1.top = new FormAttachment(wSettings, 2 * margin);
+ fdlFilename1.top = new FormAttachment(wSettings, margin);
fdlFilename1.right = new FormAttachment(middle, -margin);
wlFilename1.setLayoutData(fdlFilename1);
// Browse folders button ...
- Button wbDirectory1 = new Button(shell, SWT.PUSH | SWT.CENTER);
+ Button wbDirectory1 = new Button(wContent, SWT.PUSH | SWT.CENTER);
PropsUi.setLook(wbDirectory1);
wbDirectory1.setText(BaseMessages.getString(PKG, "ActionFoldersCompare.FolderBrowse.Label"));
FormData fdbDirectory1 = new FormData();
fdbDirectory1.right = new FormAttachment(100, -margin);
- fdbDirectory1.top = new FormAttachment(wSettings, 2 * margin);
+ fdbDirectory1.top = new FormAttachment(wSettings, margin);
wbDirectory1.setLayoutData(fdbDirectory1);
wbDirectory1.addSelectionListener(
@@ -302,20 +284,20 @@ public class ActionFoldersCompareDialog extends ActionDialog {
});
// Browse files ..
- Button wbFilename1 = new Button(shell, SWT.PUSH | SWT.CENTER);
+ Button wbFilename1 = new Button(wContent, SWT.PUSH | SWT.CENTER);
PropsUi.setLook(wbFilename1);
wbFilename1.setText(BaseMessages.getString(PKG, "ActionFoldersCompare.FileBrowse.Label"));
FormData fdbFilename1 = new FormData();
fdbFilename1.right = new FormAttachment(wbDirectory1, -margin);
- fdbFilename1.top = new FormAttachment(wSettings, 2 * margin);
+ fdbFilename1.top = new FormAttachment(wSettings, margin);
wbFilename1.setLayoutData(fdbFilename1);
- wFilename1 = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ wFilename1 = new TextVar(variables, wContent, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wFilename1);
wFilename1.addModifyListener(lsMod);
FormData fdFilename1 = new FormData();
fdFilename1.left = new FormAttachment(middle, 0);
- fdFilename1.top = new FormAttachment(wSettings, 2 * margin);
+ fdFilename1.top = new FormAttachment(wSettings, margin);
fdFilename1.right = new FormAttachment(wbFilename1, -margin);
wFilename1.setLayoutData(fdFilename1);
@@ -330,7 +312,7 @@ public class ActionFoldersCompareDialog extends ActionDialog {
shell, wFilename1, variables, new String[] {"*"}, FILETYPES, false));
// Filename 2 line
- Label wlFilename2 = new Label(shell, SWT.RIGHT);
+ Label wlFilename2 = new Label(wContent, SWT.RIGHT);
wlFilename2.setText(BaseMessages.getString(PKG, "ActionFoldersCompare.Filename2.Label"));
PropsUi.setLook(wlFilename2);
FormData fdlFilename2 = new FormData();
@@ -340,7 +322,7 @@ public class ActionFoldersCompareDialog extends ActionDialog {
wlFilename2.setLayoutData(fdlFilename2);
// Browse folders button ...
- Button wbDirectory2 = new Button(shell, SWT.PUSH | SWT.CENTER);
+ Button wbDirectory2 = new Button(wContent, SWT.PUSH | SWT.CENTER);
PropsUi.setLook(wbDirectory2);
wbDirectory2.setText(BaseMessages.getString(PKG, "ActionFoldersCompare.FolderBrowse.Label"));
FormData fdbDirectory2 = new FormData();
@@ -351,8 +333,12 @@ public class ActionFoldersCompareDialog extends ActionDialog {
wbDirectory2.addListener(
SWT.Selection, e -> BaseDialog.presentDirectoryDialog(shell, wFilename2, variables));
+ sc.setContent(wContent);
+ wContent.pack();
+ sc.setMinSize(wContent.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
// Browse files...
- Button wbFilename2 = new Button(shell, SWT.PUSH | SWT.CENTER);
+ Button wbFilename2 = new Button(wContent, SWT.PUSH | SWT.CENTER);
PropsUi.setLook(wbFilename2);
wbFilename2.setText(BaseMessages.getString(PKG, "ActionFoldersCompare.FileBrowse.Label"));
FormData fdbFilename2 = new FormData();
@@ -360,7 +346,7 @@ public class ActionFoldersCompareDialog extends ActionDialog {
fdbFilename2.top = new FormAttachment(wFilename1, margin);
wbFilename2.setLayoutData(fdbFilename2);
- wFilename2 = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ wFilename2 = new TextVar(variables, wContent, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wFilename2);
wFilename2.addModifyListener(lsMod);
FormData fdFilename2 = new FormData();
@@ -379,19 +365,9 @@ public class ActionFoldersCompareDialog extends ActionDialog {
BaseDialog.presentFileDialog(
shell, wFilename2, variables, new String[] {"*"}, FILETYPES, false));
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(
- shell, new Button[] {wOk, wCancel}, margin, wFilename2);
-
getData();
specifyCompareOnlyActivate();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -438,9 +414,11 @@ public class ActionFoldersCompareDialog extends ActionDialog {
wIncludeSubfolders.setSelection(action.isIncludeSubfolders());
wCompareFileContent.setSelection(action.isCompareFileContent());
wCompareFileSize.setSelection(action.isCompareFileSize());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp/ActionFtpDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp/ActionFtpDialog.java
index c0b06f3617..15beff7a52 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp/ActionFtpDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftp/ActionFtpDialog.java
@@ -28,12 +28,9 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.gui.GuiResource;
-import org.apache.hop.ui.core.widget.LabelText;
import org.apache.hop.ui.core.widget.LabelTextVar;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.actions.util.FtpClientUtil;
@@ -58,8 +55,6 @@ import org.eclipse.swt.widgets.Shell;
public class ActionFtpDialog extends ActionDialog {
private static final Class<?> PKG = ActionFtp.class;
- private LabelText wName;
-
private LabelTextVar wServerName;
private LabelTextVar wSocksProxyHost;
@@ -157,10 +152,8 @@ public class ActionFtpDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionFtp.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod =
e -> {
@@ -169,41 +162,6 @@ public class ActionFtpDialog extends ActionDialog {
};
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionFtp.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Action name line
- wName =
- new LabelText(
- shell,
- BaseMessages.getString(PKG, "ActionFtp.Name.Label"),
- BaseMessages.getString(PKG, "ActionFtp.Name.Tooltip"));
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.top = new FormAttachment(0, 0);
- fdName.left = new FormAttachment(0, 0);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // The buttons at the bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // The tab folder between the name and the buttons
- //
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -250,7 +208,7 @@ public class ActionFtpDialog extends ActionDialog {
wServerName.addModifyListener(lsMod);
FormData fdServerName = new FormData();
fdServerName.left = new FormAttachment(0, 0);
- fdServerName.top = new FormAttachment(wName, margin);
+ fdServerName.top = new FormAttachment(0, margin);
fdServerName.right = new FormAttachment(100, 0);
wServerName.setLayoutData(fdServerName);
@@ -322,7 +280,7 @@ public class ActionFtpDialog extends ActionDialog {
wProxyHost.addModifyListener(lsMod);
FormData fdProxyHost = new FormData();
fdProxyHost.left = new FormAttachment(0, 0);
- fdProxyHost.top = new FormAttachment(wPassword, 2 * margin);
+ fdProxyHost.top = new FormAttachment(wPassword, margin);
fdProxyHost.right = new FormAttachment(100, 0);
wProxyHost.setLayoutData(fdProxyHost);
@@ -392,7 +350,7 @@ public class ActionFtpDialog extends ActionDialog {
FormData fdServerSettings = new FormData();
fdServerSettings.left = new FormAttachment(0, margin);
- fdServerSettings.top = new FormAttachment(wName, margin);
+ fdServerSettings.top = new FormAttachment(0, margin);
fdServerSettings.right = new FormAttachment(100, -margin);
wgServerSettings.setLayoutData(fdServerSettings);
// ///////////////////////////////////////////////////////////
@@ -475,7 +433,7 @@ public class ActionFtpDialog extends ActionDialog {
PropsUi.setLook(wlControlEncoding);
FormData fdlControlEncoding = new FormData();
fdlControlEncoding.left = new FormAttachment(0, 0);
- fdlControlEncoding.top = new FormAttachment(wlActive, 2 * margin);
+ fdlControlEncoding.top = new FormAttachment(wlActive, margin);
fdlControlEncoding.right = new FormAttachment(middle, -margin);
wlControlEncoding.setLayoutData(fdlControlEncoding);
wControlEncoding = new Combo(wAdvancedSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -706,7 +664,7 @@ public class ActionFtpDialog extends ActionDialog {
FormData fdRemoteSettings = new FormData();
fdRemoteSettings.left = new FormAttachment(0, margin);
- fdRemoteSettings.top = new FormAttachment(0, 2 * margin);
+ fdRemoteSettings.top = new FormAttachment(0, margin);
fdRemoteSettings.right = new FormAttachment(100, -margin);
wgRemoteSettings.setLayoutData(fdRemoteSettings);
// ///////////////////////////////////////////////////////////
@@ -792,7 +750,7 @@ public class ActionFtpDialog extends ActionDialog {
PropsUi.setLook(wlAddTime);
FormData fdlAddTime = new FormData();
fdlAddTime.left = new FormAttachment(0, 0);
- fdlAddTime.top = new FormAttachment(wlAddDate, 2 * margin);
+ fdlAddTime.top = new FormAttachment(wlAddDate, margin);
fdlAddTime.right = new FormAttachment(middle, -margin);
wlAddTime.setLayoutData(fdlAddTime);
wAddTime = new Button(wgLocalSettings, SWT.CHECK);
@@ -817,7 +775,7 @@ public class ActionFtpDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyFormat);
FormData fdlSpecifyFormat = new FormData();
fdlSpecifyFormat.left = new FormAttachment(0, 0);
- fdlSpecifyFormat.top = new FormAttachment(wlAddTime, 2 * margin);
+ fdlSpecifyFormat.top = new FormAttachment(wlAddTime, margin);
fdlSpecifyFormat.right = new FormAttachment(middle, -margin);
wlSpecifyFormat.setLayoutData(fdlSpecifyFormat);
wSpecifyFormat = new Button(wgLocalSettings, SWT.CHECK);
@@ -847,7 +805,7 @@ public class ActionFtpDialog extends ActionDialog {
PropsUi.setLook(wlDateTimeFormat);
FormData fdlDateTimeFormat = new FormData();
fdlDateTimeFormat.left = new FormAttachment(0, 0);
- fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdlDateTimeFormat.right = new FormAttachment(middle, -margin);
wlDateTimeFormat.setLayoutData(fdlDateTimeFormat);
wDateTimeFormat = new CCombo(wgLocalSettings, SWT.BORDER | SWT.READ_ONLY);
@@ -856,7 +814,7 @@ public class ActionFtpDialog extends ActionDialog {
wDateTimeFormat.addModifyListener(lsMod);
FormData fdDateTimeFormat = new FormData();
fdDateTimeFormat.left = new FormAttachment(middle, 0);
- fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdDateTimeFormat.right = new FormAttachment(100, 0);
wDateTimeFormat.setLayoutData(fdDateTimeFormat);
for (String dat : dats) {
@@ -923,7 +881,7 @@ public class ActionFtpDialog extends ActionDialog {
FormData fdlIfFileExists = new FormData();
fdlIfFileExists.left = new FormAttachment(0, 0);
fdlIfFileExists.right = new FormAttachment(middle, -margin);
- fdlIfFileExists.top = new FormAttachment(wlOnlyNew, 2 * margin);
+ fdlIfFileExists.top = new FormAttachment(wlOnlyNew, margin);
wlIfFileExists.setLayoutData(fdlIfFileExists);
wIfFileExists = new CCombo(wgLocalSettings, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wIfFileExists.add(BaseMessages.getString(PKG, "ActionFtp.Skip.Label"));
@@ -954,7 +912,7 @@ public class ActionFtpDialog extends ActionDialog {
PropsUi.setLook(wlAddFilenameToResult);
FormData fdlAddFilenameToResult = new FormData();
fdlAddFilenameToResult.left = new FormAttachment(0, 0);
- fdlAddFilenameToResult.top = new FormAttachment(wIfFileExists, 2 * margin);
+ fdlAddFilenameToResult.top = new FormAttachment(wIfFileExists, margin);
fdlAddFilenameToResult.right = new FormAttachment(middle, -margin);
wlAddFilenameToResult.setLayoutData(fdlAddFilenameToResult);
wAddFilenameToResult = new Button(wgLocalSettings, SWT.CHECK);
@@ -1141,7 +1099,7 @@ public class ActionFtpDialog extends ActionDialog {
wSocksProxyHost.addModifyListener(lsMod);
FormData fdSocksProxyHost = new FormData();
fdSocksProxyHost.left = new FormAttachment(0, 0);
- fdSocksProxyHost.top = new FormAttachment(wName, margin);
+ fdSocksProxyHost.top = new FormAttachment(0, margin);
fdSocksProxyHost.right = new FormAttachment(100, margin);
wSocksProxyHost.setLayoutData(fdSocksProxyHost);
@@ -1219,9 +1177,9 @@ public class ActionFtpDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
// Add listeners
@@ -1239,7 +1197,7 @@ public class ActionFtpDialog extends ActionDialog {
activeIfExists();
wTabFolder.setSelection(0);
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -1364,7 +1322,7 @@ public class ActionFtpDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
wServerName.setText(Const.NVL(action.getServerName(), ""));
wPort.setText(Const.NVL(action.getServerPort(), "21"));
wUserName.setText(Const.NVL(action.getUserName(), ""));
@@ -1418,9 +1376,12 @@ public class ActionFtpDialog extends ActionDialog {
} else {
wSuccessCondition.select(0);
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ ftpclient = null;
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpdelete/ActionFtpDeleteDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpdelete/ActionFtpDeleteDialog.java
index a3a3883926..784f197ce6 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpdelete/ActionFtpDeleteDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpdelete/ActionFtpDeleteDialog.java
@@ -29,12 +29,9 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.gui.GuiResource;
-import org.apache.hop.ui.core.widget.LabelText;
import org.apache.hop.ui.core.widget.LabelTextVar;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.actions.sftp.SftpClient;
@@ -60,8 +57,6 @@ import org.eclipse.swt.widgets.Shell;
public class ActionFtpDeleteDialog extends ActionDialog {
private static final Class<?> PKG = ActionFtpDelete.class;
- private LabelText wName;
-
private LabelTextVar wServerName;
private LabelTextVar wUserName;
@@ -143,10 +138,8 @@ public class ActionFtpDeleteDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionFtpDelete.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod =
e -> {
@@ -157,42 +150,6 @@ public class ActionFtpDeleteDialog extends ActionDialog {
};
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionFtpDelete.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Action name line
- wName =
- new LabelText(
- shell,
- BaseMessages.getString(PKG, "ActionFtpDelete.Name.Label"),
- BaseMessages.getString(PKG, "ActionFtpDelete.Name.Tooltip"));
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.top = new FormAttachment(0, 0);
- fdName.left = new FormAttachment(0, 0);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
- PropsUi.setLook(wName);
-
- // The buttons at the bottom...
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // The tab folder between the name and the buttons
- //
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -232,7 +189,7 @@ public class ActionFtpDeleteDialog extends ActionDialog {
PropsUi.setLook(wlProtocol);
FormData fdlProtocol = new FormData();
fdlProtocol.left = new FormAttachment(0, 0);
- fdlProtocol.top = new FormAttachment(wName, margin);
+ fdlProtocol.top = new FormAttachment(0, margin);
fdlProtocol.right = new FormAttachment(middle, -margin);
wlProtocol.setLayoutData(fdlProtocol);
wProtocol = new Combo(wServerSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -242,7 +199,7 @@ public class ActionFtpDeleteDialog extends ActionDialog {
PropsUi.setLook(wProtocol);
FormData fdProtocol = new FormData();
fdProtocol.left = new FormAttachment(middle, 0);
- fdProtocol.top = new FormAttachment(wName, margin);
+ fdProtocol.top = new FormAttachment(0, margin);
fdProtocol.right = new FormAttachment(100, 0);
wProtocol.setLayoutData(fdProtocol);
wProtocol.addSelectionListener(
@@ -366,7 +323,7 @@ public class ActionFtpDeleteDialog extends ActionDialog {
wProxyHost.addModifyListener(lsMod);
FormData fdProxyHost = new FormData();
fdProxyHost.left = new FormAttachment(0, 0);
- fdProxyHost.top = new FormAttachment(wlUseProxy, 2 * margin);
+ fdProxyHost.top = new FormAttachment(wlUseProxy, margin);
fdProxyHost.right = new FormAttachment(100, 0);
wProxyHost.setLayoutData(fdProxyHost);
@@ -457,7 +414,7 @@ public class ActionFtpDeleteDialog extends ActionDialog {
PropsUi.setLook(wlKeyFilename);
FormData fdlKeyFilename = new FormData();
fdlKeyFilename.left = new FormAttachment(0, 0);
- fdlKeyFilename.top = new FormAttachment(wlUsePublicKey, 2 * margin);
+ fdlKeyFilename.top = new FormAttachment(wlUsePublicKey, margin);
fdlKeyFilename.right = new FormAttachment(middle, -margin);
wlKeyFilename.setLayoutData(fdlKeyFilename);
@@ -518,7 +475,7 @@ public class ActionFtpDeleteDialog extends ActionDialog {
FormData fdServerSettings = new FormData();
fdServerSettings.left = new FormAttachment(0, margin);
- fdServerSettings.top = new FormAttachment(wName, margin);
+ fdServerSettings.top = new FormAttachment(0, margin);
fdServerSettings.right = new FormAttachment(100, -margin);
wServerSettings.setLayoutData(fdServerSettings);
// ///////////////////////////////////////////////////////////
@@ -661,7 +618,7 @@ public class ActionFtpDeleteDialog extends ActionDialog {
PropsUi.setLook(wlFtpDirectory);
FormData fdlFtpDirectory = new FormData();
fdlFtpDirectory.left = new FormAttachment(0, 0);
- fdlFtpDirectory.top = new FormAttachment(wlGetPrevious, 2 * margin);
+ fdlFtpDirectory.top = new FormAttachment(wlGetPrevious, margin);
fdlFtpDirectory.right = new FormAttachment(middle, -margin);
wlFtpDirectory.setLayoutData(fdlFtpDirectory);
@@ -853,7 +810,7 @@ public class ActionFtpDeleteDialog extends ActionDialog {
wSocksProxyHost.addModifyListener(lsMod);
FormData fdSocksProxyHost = new FormData();
fdSocksProxyHost.left = new FormAttachment(0, 0);
- fdSocksProxyHost.top = new FormAttachment(wName, margin);
+ fdSocksProxyHost.top = new FormAttachment(0, margin);
fdSocksProxyHost.right = new FormAttachment(100, margin);
wSocksProxyHost.setLayoutData(fdSocksProxyHost);
@@ -931,9 +888,9 @@ public class ActionFtpDeleteDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
@@ -944,7 +901,7 @@ public class ActionFtpDeleteDialog extends ActionDialog {
activeCopyFromPrevious();
wTabFolder.setSelection(0);
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -1129,7 +1086,7 @@ public class ActionFtpDeleteDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
wProtocol.setText(Const.NVL(action.getProtocol(), "FTP"));
wPort.setText(Const.NVL(action.getServerPort(), ""));
@@ -1172,9 +1129,14 @@ public class ActionFtpDeleteDialog extends ActionDialog {
wKeyFilePass.setText(Const.nullToEmpty(action.getKeyFilePass()));
wGetPrevious.setSelection(action.isCopyPrevious());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ pwdFolder = null;
+ ftpclient = null;
+ sftpclient = null;
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpput/ActionFtpPutDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpput/ActionFtpPutDialog.java
index 6d07895487..a21f18ce9e 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpput/ActionFtpPutDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/ftpput/ActionFtpPutDialog.java
@@ -32,9 +32,7 @@ import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.LabelTextVar;
import org.apache.hop.ui.core.widget.PasswordTextVar;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.actions.util.FtpClientUtil;
@@ -51,13 +49,11 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the FTP Put action settings */
public class ActionFtpPutDialog extends ActionDialog {
private static final Class<?> PKG = ActionFtpPut.class;
- private Text wName;
private TextVar wServerName;
private TextVar wServerPort;
private TextVar wUserName;
@@ -102,10 +98,8 @@ public class ActionFtpPutDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionFtpPut.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod =
e -> {
@@ -115,43 +109,6 @@ public class ActionFtpPutDialog extends ActionDialog {
};
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionFtpPut.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Action name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionFtpPut.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- wName.setLayoutData(
- FormDataBuilder.builder().left(middle, 0).top(0, margin).right(100, 0).build());
-
- // The buttons at the bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // The tab folder between the name and the buttons
- //
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -190,7 +147,7 @@ public class ActionFtpPutDialog extends ActionDialog {
PropsUi.setLook(wlServerName);
FormData fdlServerName = new FormData();
fdlServerName.left = new FormAttachment(0, 0);
- fdlServerName.top = new FormAttachment(wName, margin);
+ fdlServerName.top = new FormAttachment(0, margin);
fdlServerName.right = new FormAttachment(middle, -margin);
wlServerName.setLayoutData(fdlServerName);
wServerName = new TextVar(variables, wServerSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -198,7 +155,7 @@ public class ActionFtpPutDialog extends ActionDialog {
wServerName.addModifyListener(lsMod);
FormData fdServerName = new FormData();
fdServerName.left = new FormAttachment(middle, 0);
- fdServerName.top = new FormAttachment(wName, margin);
+ fdServerName.top = new FormAttachment(0, margin);
fdServerName.right = new FormAttachment(100, 0);
wServerName.setLayoutData(fdServerName);
@@ -271,7 +228,7 @@ public class ActionFtpPutDialog extends ActionDialog {
wProxyHost.addModifyListener(lsMod);
FormData fdProxyHost = new FormData();
fdProxyHost.left = new FormAttachment(0, 0);
- fdProxyHost.top = new FormAttachment(wPassword, 2 * margin);
+ fdProxyHost.top = new FormAttachment(wPassword, margin);
fdProxyHost.right = new FormAttachment(100, 0);
wProxyHost.setLayoutData(fdProxyHost);
@@ -342,7 +299,7 @@ public class ActionFtpPutDialog extends ActionDialog {
FormData fdServerSettings = new FormData();
fdServerSettings.left = new FormAttachment(0, margin);
- fdServerSettings.top = new FormAttachment(wName, margin);
+ fdServerSettings.top = new FormAttachment(0, margin);
fdServerSettings.right = new FormAttachment(100, -margin);
wServerSettings.setLayoutData(fdServerSettings);
// ///////////////////////////////////////////////////////////
@@ -385,7 +342,7 @@ public class ActionFtpPutDialog extends ActionDialog {
PropsUi.setLook(wlTimeout);
FormData fdlTimeout = new FormData();
fdlTimeout.left = new FormAttachment(0, 0);
- fdlTimeout.top = new FormAttachment(wlBinaryMode, 2 * margin);
+ fdlTimeout.top = new FormAttachment(wlBinaryMode, margin);
fdlTimeout.right = new FormAttachment(middle, -margin);
wlTimeout.setLayoutData(fdlTimeout);
wTimeout =
@@ -430,7 +387,7 @@ public class ActionFtpPutDialog extends ActionDialog {
PropsUi.setLook(wlControlEncoding);
FormData fdlControlEncoding = new FormData();
fdlControlEncoding.left = new FormAttachment(0, 0);
- fdlControlEncoding.top = new FormAttachment(wlActive, 2 * margin);
+ fdlControlEncoding.top = new FormAttachment(wlActive, margin);
fdlControlEncoding.right = new FormAttachment(middle, -margin);
wlControlEncoding.setLayoutData(fdlControlEncoding);
wControlEncoding = new Combo(wAdvancedSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -559,7 +516,7 @@ public class ActionFtpPutDialog extends ActionDialog {
PropsUi.setLook(wlRemove);
FormData fdlRemove = new FormData();
fdlRemove.left = new FormAttachment(0, 0);
- fdlRemove.top = new FormAttachment(wWildcard, 2 * margin);
+ fdlRemove.top = new FormAttachment(wWildcard, margin);
fdlRemove.right = new FormAttachment(middle, -margin);
wlRemove.setLayoutData(fdlRemove);
wRemove = new Button(wSourceSettings, SWT.CHECK);
@@ -577,7 +534,7 @@ public class ActionFtpPutDialog extends ActionDialog {
PropsUi.setLook(wlOnlyNew);
FormData fdlOnlyNew = new FormData();
fdlOnlyNew.left = new FormAttachment(0, 0);
- fdlOnlyNew.top = new FormAttachment(wlRemove, 2 * margin);
+ fdlOnlyNew.top = new FormAttachment(wlRemove, margin);
fdlOnlyNew.right = new FormAttachment(middle, -margin);
wlOnlyNew.setLayoutData(fdlOnlyNew);
wOnlyNew = new Button(wSourceSettings, SWT.CHECK);
@@ -591,7 +548,7 @@ public class ActionFtpPutDialog extends ActionDialog {
FormData fdSourceSettings = new FormData();
fdSourceSettings.left = new FormAttachment(0, margin);
- fdSourceSettings.top = new FormAttachment(0, 2 * margin);
+ fdSourceSettings.top = new FormAttachment(0, margin);
fdSourceSettings.right = new FormAttachment(100, -margin);
wSourceSettings.setLayoutData(fdSourceSettings);
// ///////////////////////////////////////////////////////////
@@ -710,7 +667,7 @@ public class ActionFtpPutDialog extends ActionDialog {
wSocksProxyHost.addModifyListener(lsMod);
FormData fdSocksProxyHost = new FormData();
fdSocksProxyHost.left = new FormAttachment(0, 0);
- fdSocksProxyHost.top = new FormAttachment(wName, margin);
+ fdSocksProxyHost.top = new FormAttachment(0, margin);
fdSocksProxyHost.right = new FormAttachment(100, margin);
wSocksProxyHost.setLayoutData(fdSocksProxyHost);
@@ -788,14 +745,14 @@ public class ActionFtpPutDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
wTabFolder.setSelection(0);
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -895,9 +852,7 @@ public class ActionFtpPutDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- if (action.getName() != null) {
- wName.setText(action.getName());
- }
+ wName.setText(Const.NVL(action.getName(), ""));
wServerName.setText(Const.NVL(action.getServerName(), ""));
wServerPort.setText(Const.NVL(action.getServerPort(), ""));
@@ -921,9 +876,13 @@ public class ActionFtpPutDialog extends ActionDialog {
wSocksProxyPort.setText(Const.NVL(action.getSocksProxyPort(), "1080"));
wSocksProxyUsername.setText(Const.NVL(action.getSocksProxyUsername(), ""));
wSocksProxyPassword.setText(Const.NVL(action.getSocksProxyPassword(), ""));
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ ftpclient = null;
+ pwdFolder = null;
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftp/ActionSftpDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftp/ActionSftpDialog.java
index f892f6b347..bae25d8450 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftp/ActionSftpDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftp/ActionSftpDialog.java
@@ -31,9 +31,7 @@ import org.apache.hop.ui.core.widget.CheckBoxVar;
import org.apache.hop.ui.core.widget.LabelTextVar;
import org.apache.hop.ui.core.widget.PasswordTextVar;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -51,7 +49,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the SFTP action settings. */
public class ActionSftpDialog extends ActionDialog {
@@ -62,7 +59,6 @@ public class ActionSftpDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionSftp.Filetype.All")
};
- private Text wName;
private TextVar wServerName;
private TextVar wServerPort;
private TextVar wUserName;
@@ -102,10 +98,8 @@ public class ActionSftpDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionSftp.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod =
e -> {
@@ -114,46 +108,6 @@ public class ActionSftpDialog extends ActionDialog {
};
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionSftp.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionSftp.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // The buttons at the bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // The tab folder between the name and the buttons
- //
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -166,9 +120,9 @@ public class ActionSftpDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
@@ -176,7 +130,7 @@ public class ActionSftpDialog extends ActionDialog {
activeUseKey();
wTabFolder.setSelection(0);
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -212,7 +166,7 @@ public class ActionSftpDialog extends ActionDialog {
PropsUi.setLook(wlGetPrevious);
FormData fdlGetPrevious = new FormData();
fdlGetPrevious.left = new FormAttachment(0, 0);
- fdlGetPrevious.top = new FormAttachment(wSourceFiles, 2 * margin);
+ fdlGetPrevious.top = new FormAttachment(wSourceFiles, margin);
fdlGetPrevious.right = new FormAttachment(middle, -margin);
wlGetPrevious.setLayoutData(fdlGetPrevious);
wGetPrevious = new Button(wSourceFiles, SWT.CHECK);
@@ -238,7 +192,7 @@ public class ActionSftpDialog extends ActionDialog {
PropsUi.setLook(wlScpDirectory);
FormData fdlScpDirectory = new FormData();
fdlScpDirectory.left = new FormAttachment(0, 0);
- fdlScpDirectory.top = new FormAttachment(wlGetPrevious, 2 * margin);
+ fdlScpDirectory.top = new FormAttachment(wlGetPrevious, margin);
fdlScpDirectory.right = new FormAttachment(middle, -margin);
wlScpDirectory.setLayoutData(fdlScpDirectory);
@@ -249,7 +203,7 @@ public class ActionSftpDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionSftp.TestFolderExists.Label"));
FormData fdbTestChangeFolderExists = new FormData();
fdbTestChangeFolderExists.right = new FormAttachment(100, 0);
- fdbTestChangeFolderExists.top = new FormAttachment(wGetPrevious, 2 * margin);
+ fdbTestChangeFolderExists.top = new FormAttachment(wGetPrevious, margin);
wbTestChangeFolderExists.setLayoutData(fdbTestChangeFolderExists);
wbTestChangeFolderExists.addListener(SWT.Selection, e -> checkRemoteFolder());
@@ -263,7 +217,7 @@ public class ActionSftpDialog extends ActionDialog {
wSftpDirectory.addModifyListener(lsMod);
FormData fdScpDirectory = new FormData();
fdScpDirectory.left = new FormAttachment(middle, 0);
- fdScpDirectory.top = new FormAttachment(wGetPrevious, 2 * margin);
+ fdScpDirectory.top = new FormAttachment(wGetPrevious, margin);
fdScpDirectory.right = new FormAttachment(wbTestChangeFolderExists, -margin);
wSftpDirectory.setLayoutData(fdScpDirectory);
@@ -310,7 +264,7 @@ public class ActionSftpDialog extends ActionDialog {
FormData fdSourceFiles = new FormData();
fdSourceFiles.left = new FormAttachment(0, margin);
- fdSourceFiles.top = new FormAttachment(0, 2 * margin);
+ fdSourceFiles.top = new FormAttachment(0, margin);
fdSourceFiles.right = new FormAttachment(100, -margin);
wSourceFiles.setLayoutData(fdSourceFiles);
// ///////////////////////////////////////////////////////////
@@ -390,7 +344,7 @@ public class ActionSftpDialog extends ActionDialog {
FormData fdlPreserveTimestamp = new FormData();
fdlPreserveTimestamp.left = new FormAttachment(0, 0);
fdlPreserveTimestamp.right = new FormAttachment(middle, -margin);
- fdlPreserveTimestamp.top = new FormAttachment(wCreateTargetFolder, margin * 2);
+ fdlPreserveTimestamp.top = new FormAttachment(wCreateTargetFolder, margin);
wlPreserveTimestamp.setLayoutData(fdlPreserveTimestamp);
wPreserveTimestamp = new CheckBoxVar(variables, wTargetFiles, SWT.CHECK, "");
wPreserveTimestamp.setToolTipText(
@@ -481,7 +435,7 @@ public class ActionSftpDialog extends ActionDialog {
PropsUi.setLook(wlServerName);
FormData fdlServerName = new FormData();
fdlServerName.left = new FormAttachment(0, 0);
- fdlServerName.top = new FormAttachment(wName, margin);
+ fdlServerName.top = new FormAttachment(0, margin);
fdlServerName.right = new FormAttachment(middle, -margin);
wlServerName.setLayoutData(fdlServerName);
wServerName = new TextVar(variables, wServerSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -489,7 +443,7 @@ public class ActionSftpDialog extends ActionDialog {
wServerName.addModifyListener(lsMod);
FormData fdServerName = new FormData();
fdServerName.left = new FormAttachment(middle, 0);
- fdServerName.top = new FormAttachment(wName, margin);
+ fdServerName.top = new FormAttachment(0, margin);
fdServerName.right = new FormAttachment(100, 0);
wServerName.setLayoutData(fdServerName);
@@ -580,7 +534,7 @@ public class ActionSftpDialog extends ActionDialog {
PropsUi.setLook(wlKeyFilename);
FormData fdlKeyFilename = new FormData();
fdlKeyFilename.left = new FormAttachment(0, 0);
- fdlKeyFilename.top = new FormAttachment(wlUsePublicKey, 2 * margin);
+ fdlKeyFilename.top = new FormAttachment(wlUsePublicKey, margin);
fdlKeyFilename.right = new FormAttachment(middle, -margin);
wlKeyFilename.setLayoutData(fdlKeyFilename);
@@ -632,7 +586,7 @@ public class ActionSftpDialog extends ActionDialog {
FormData fdlProxyType = new FormData();
fdlProxyType.left = new FormAttachment(0, 0);
fdlProxyType.right = new FormAttachment(middle, -margin);
- fdlProxyType.top = new FormAttachment(wKeyfilePass, 2 * margin);
+ fdlProxyType.top = new FormAttachment(wKeyfilePass, margin);
wlProxyType.setLayoutData(fdlProxyType);
wProxyType = new CCombo(wServerSettings, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
@@ -642,7 +596,7 @@ public class ActionSftpDialog extends ActionDialog {
PropsUi.setLook(wProxyType);
FormData fdProxyType = new FormData();
fdProxyType.left = new FormAttachment(middle, 0);
- fdProxyType.top = new FormAttachment(wKeyfilePass, 2 * margin);
+ fdProxyType.top = new FormAttachment(wKeyfilePass, margin);
fdProxyType.right = new FormAttachment(100, 0);
wProxyType.setLayoutData(fdProxyType);
wProxyType.addSelectionListener(
@@ -738,7 +692,7 @@ public class ActionSftpDialog extends ActionDialog {
FormData fdServerSettings = new FormData();
fdServerSettings.left = new FormAttachment(0, margin);
- fdServerSettings.top = new FormAttachment(wName, margin);
+ fdServerSettings.top = new FormAttachment(0, margin);
fdServerSettings.right = new FormAttachment(100, -margin);
wServerSettings.setLayoutData(fdServerSettings);
@@ -879,7 +833,7 @@ public class ActionSftpDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
wServerName.setText(Const.NVL(action.getServerName(), ""));
wServerPort.setText(action.getServerPort());
@@ -903,9 +857,12 @@ public class ActionSftpDialog extends ActionDialog {
wProxyPort.setText(Const.NVL(action.getProxyPort(), ""));
wProxyUsername.setText(Const.NVL(action.getProxyUsername(), ""));
wProxyPassword.setText(Const.NVL(action.getProxyPassword(), ""));
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ sftpclient = null;
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftpput/ActionSftpPutDialog.java b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftpput/ActionSftpPutDialog.java
index efa56c9af4..ac9acc5e90 100644
--- a/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftpput/ActionSftpPutDialog.java
+++ b/plugins/actions/ftp/src/main/java/org/apache/hop/workflow/actions/sftpput/ActionSftpPutDialog.java
@@ -31,9 +31,7 @@ import org.apache.hop.ui.core.widget.CheckBoxVar;
import org.apache.hop.ui.core.widget.LabelTextVar;
import org.apache.hop.ui.core.widget.PasswordTextVar;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.actions.sftp.SftpClient;
@@ -52,7 +50,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the FTP Put action settings. */
public class ActionSftpPutDialog extends ActionDialog {
@@ -63,7 +60,6 @@ public class ActionSftpPutDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionSftpPut.Filetype.All")
};
- private Text wName;
private TextVar wServerName;
private TextVar wServerPort;
private TextVar wUserName;
@@ -114,10 +110,8 @@ public class ActionSftpPutDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionSftpPut.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod =
e -> {
@@ -126,46 +120,6 @@ public class ActionSftpPutDialog extends ActionDialog {
};
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionSftpPut.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionSftpPut.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // The buttons at the bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // The tab folder between the name and the buttons
- //
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -203,7 +157,7 @@ public class ActionSftpPutDialog extends ActionDialog {
PropsUi.setLook(wlServerName);
FormData fdlServerName = new FormData();
fdlServerName.left = new FormAttachment(0, 0);
- fdlServerName.top = new FormAttachment(wName, margin);
+ fdlServerName.top = new FormAttachment(0, margin);
fdlServerName.right = new FormAttachment(middle, -margin);
wlServerName.setLayoutData(fdlServerName);
wServerName = new TextVar(variables, wServerSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -211,7 +165,7 @@ public class ActionSftpPutDialog extends ActionDialog {
wServerName.addModifyListener(lsMod);
FormData fdServerName = new FormData();
fdServerName.left = new FormAttachment(middle, 0);
- fdServerName.top = new FormAttachment(wName, margin);
+ fdServerName.top = new FormAttachment(0, margin);
fdServerName.right = new FormAttachment(100, 0);
wServerName.setLayoutData(fdServerName);
@@ -303,7 +257,7 @@ public class ActionSftpPutDialog extends ActionDialog {
PropsUi.setLook(wlKeyFilename);
FormData fdlKeyFilename = new FormData();
fdlKeyFilename.left = new FormAttachment(0, 0);
- fdlKeyFilename.top = new FormAttachment(wlUsePublicKey, 2 * margin);
+ fdlKeyFilename.top = new FormAttachment(wlUsePublicKey, margin);
fdlKeyFilename.right = new FormAttachment(middle, -margin);
wlKeyFilename.setLayoutData(fdlKeyFilename);
@@ -355,7 +309,7 @@ public class ActionSftpPutDialog extends ActionDialog {
FormData fdlProxyType = new FormData();
fdlProxyType.left = new FormAttachment(0, 0);
fdlProxyType.right = new FormAttachment(middle, -margin);
- fdlProxyType.top = new FormAttachment(wKeyFilePass, 2 * margin);
+ fdlProxyType.top = new FormAttachment(wKeyFilePass, margin);
wlProxyType.setLayoutData(fdlProxyType);
wProxyType = new CCombo(wServerSettings, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
@@ -365,7 +319,7 @@ public class ActionSftpPutDialog extends ActionDialog {
PropsUi.setLook(wProxyType);
FormData fdProxyType = new FormData();
fdProxyType.left = new FormAttachment(middle, 0);
- fdProxyType.top = new FormAttachment(wKeyFilePass, 2 * margin);
+ fdProxyType.top = new FormAttachment(wKeyFilePass, margin);
fdProxyType.right = new FormAttachment(100, 0);
wProxyType.setLayoutData(fdProxyType);
wProxyType.addSelectionListener(
@@ -566,7 +520,7 @@ public class ActionSftpPutDialog extends ActionDialog {
PropsUi.setLook(wlGetPreviousFiles);
FormData fdlGetPreviousFiles = new FormData();
fdlGetPreviousFiles.left = new FormAttachment(0, 0);
- fdlGetPreviousFiles.top = new FormAttachment(wlGetPrevious, 2 * margin);
+ fdlGetPreviousFiles.top = new FormAttachment(wlGetPrevious, margin);
fdlGetPreviousFiles.right = new FormAttachment(middle, -margin);
wlGetPreviousFiles.setLayoutData(fdlGetPreviousFiles);
wGetPreviousFiles = new Button(wgSourceFiles, SWT.CHECK);
@@ -596,7 +550,7 @@ public class ActionSftpPutDialog extends ActionDialog {
PropsUi.setLook(wlLocalDirectory);
FormData fdlLocalDirectory = new FormData();
fdlLocalDirectory.left = new FormAttachment(0, 0);
- fdlLocalDirectory.top = new FormAttachment(wlGetPreviousFiles, 2 * margin);
+ fdlLocalDirectory.top = new FormAttachment(wlGetPreviousFiles, margin);
fdlLocalDirectory.right = new FormAttachment(middle, -margin);
wlLocalDirectory.setLayoutData(fdlLocalDirectory);
@@ -674,7 +628,7 @@ public class ActionSftpPutDialog extends ActionDialog {
FormData fdlAfterFtpPut = new FormData();
fdlAfterFtpPut.left = new FormAttachment(0, 0);
fdlAfterFtpPut.right = new FormAttachment(middle, -margin);
- fdlAfterFtpPut.top = new FormAttachment(wlSuccessWhenNoFile, 2 * margin);
+ fdlAfterFtpPut.top = new FormAttachment(wlSuccessWhenNoFile, margin);
wlAfterFtpPut.setLayoutData(fdlAfterFtpPut);
wAfterFtpPut = new CCombo(wgSourceFiles, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wAfterFtpPut.add(BaseMessages.getString(PKG, "ActionSftpPut.AfterSFTP.DoNothing.Label"));
@@ -684,7 +638,7 @@ public class ActionSftpPutDialog extends ActionDialog {
PropsUi.setLook(wAfterFtpPut);
FormData fdAfterFtpPut = new FormData();
fdAfterFtpPut.left = new FormAttachment(middle, 0);
- fdAfterFtpPut.top = new FormAttachment(wSuccessWhenNoFile, 2 * margin);
+ fdAfterFtpPut.top = new FormAttachment(wSuccessWhenNoFile, margin);
fdAfterFtpPut.right = new FormAttachment(100, -margin);
wAfterFtpPut.setLayoutData(fdAfterFtpPut);
wAfterFtpPut.addSelectionListener(
@@ -764,7 +718,7 @@ public class ActionSftpPutDialog extends ActionDialog {
PropsUi.setLook(wlAddFilenameToResult);
FormData fdlAddFilenameToResult = new FormData();
fdlAddFilenameToResult.left = new FormAttachment(0, 0);
- fdlAddFilenameToResult.top = new FormAttachment(wlCreateDestinationFolder, 2 * margin);
+ fdlAddFilenameToResult.top = new FormAttachment(wlCreateDestinationFolder, margin);
fdlAddFilenameToResult.right = new FormAttachment(middle, -margin);
wlAddFilenameToResult.setLayoutData(fdlAddFilenameToResult);
wAddFilenameToResult = new Button(wgSourceFiles, SWT.CHECK);
@@ -779,7 +733,7 @@ public class ActionSftpPutDialog extends ActionDialog {
FormData fdSourceFiles = new FormData();
fdSourceFiles.left = new FormAttachment(0, margin);
- fdSourceFiles.top = new FormAttachment(wServerSettings, 2 * margin);
+ fdSourceFiles.top = new FormAttachment(wServerSettings, margin);
fdSourceFiles.right = new FormAttachment(100, -margin);
wgSourceFiles.setLayoutData(fdSourceFiles);
// ///////////////////////////////////////////////////////////
@@ -864,7 +818,7 @@ public class ActionSftpPutDialog extends ActionDialog {
FormData fdlPreserveTimestamp = new FormData();
fdlPreserveTimestamp.left = new FormAttachment(0, 0);
fdlPreserveTimestamp.right = new FormAttachment(middle, -margin);
- fdlPreserveTimestamp.top = new FormAttachment(wCreateRemoteFolder, margin * 2);
+ fdlPreserveTimestamp.top = new FormAttachment(wCreateRemoteFolder, margin);
wlPreserveTimestamp.setLayoutData(fdlPreserveTimestamp);
wPreserveTimestamp = new CheckBoxVar(variables, wTargetFiles, SWT.CHECK, "");
wPreserveTimestamp.setToolTipText(
@@ -909,9 +863,9 @@ public class ActionSftpPutDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
wTabFolder.setSelection(0);
@@ -920,7 +874,7 @@ public class ActionSftpPutDialog extends ActionDialog {
activeCopyFromPrevious();
activeUseKey();
afterFtpPutActivate();
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -1045,7 +999,7 @@ public class ActionSftpPutDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
wServerName.setText(Const.NVL(action.getServerName(), ""));
wServerPort.setText(action.getServerPort());
wUserName.setText(Const.NVL(action.getUserName(), ""));
@@ -1073,9 +1027,12 @@ public class ActionSftpPutDialog extends ActionDialog {
wCreateDestinationFolder.setSelection(action.isCreateDestinationFolder());
wPreserveTimestamp.setSelection(action.isPreserveTargetFileTimestamp());
wSuccessWhenNoFile.setSelection(action.isSuccessWhenNoFile());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ sftpClient = null;
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/http/src/main/java/org/apache/hop/workflow/actions/http/ActionHttpDialog.java b/plugins/actions/http/src/main/java/org/apache/hop/workflow/actions/http/ActionHttpDialog.java
index 7babaf29a4..92e4de3096 100644
--- a/plugins/actions/http/src/main/java/org/apache/hop/workflow/actions/http/ActionHttpDialog.java
+++ b/plugins/actions/http/src/main/java/org/apache/hop/workflow/actions/http/ActionHttpDialog.java
@@ -33,9 +33,7 @@ import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.PasswordTextVar;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -53,7 +51,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/**
* This dialog allows you to edit the SQL action settings. (select the connection and the sql script
@@ -65,8 +62,6 @@ public class ActionHttpDialog extends ActionDialog {
private static final String[] FILETYPES =
new String[] {BaseMessages.getString(PKG, "ActionHTTP.Filetype.All")};
- private Text wName;
-
private Label wlURL;
private TextVar wURL;
@@ -140,26 +135,14 @@ public class ActionHttpDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionHTTP.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionHTTP.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- Button wOk = setupButtons(margin);
- setupActionName(lsMod, middle, margin);
+ int middle = this.middle;
+ int margin = this.margin;
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -243,7 +226,7 @@ public class ActionHttpDialog extends ActionDialog {
FormData fdGeneralComp = new FormData();
fdGeneralComp.left = new FormAttachment(0, 0);
- fdGeneralComp.top = new FormAttachment(wName, 0);
+ fdGeneralComp.top = new FormAttachment(0, margin);
fdGeneralComp.right = new FormAttachment(100, 0);
fdGeneralComp.bottom = new FormAttachment(100, 0);
wGeneralComp.setLayoutData(fdGeneralComp);
@@ -276,15 +259,15 @@ public class ActionHttpDialog extends ActionDialog {
// ///////////////////////////////////////////////////////////
FormData fdTabFolder = new FormData();
- fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
- fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.left = new FormAttachment(0, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
+ fdTabFolder.right = new FormAttachment(100, -margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
wTabFolder.setSelection(0);
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -324,7 +307,7 @@ public class ActionHttpDialog extends ActionDialog {
FormData fdHeaders = new FormData();
fdHeaders.left = new FormAttachment(0, margin);
- fdHeaders.top = new FormAttachment(wName, margin);
+ fdHeaders.top = new FormAttachment(0, margin);
fdHeaders.right = new FormAttachment(100, -margin);
fdHeaders.bottom = new FormAttachment(100, -margin);
wHeaders.setLayoutData(fdHeaders);
@@ -370,7 +353,7 @@ public class ActionHttpDialog extends ActionDialog {
PropsUi.setLook(wlTargetExt);
FormData fdlTargetExt = new FormData();
fdlTargetExt.left = new FormAttachment(0, 0);
- fdlTargetExt.top = new FormAttachment(wlDateTimeAdded, 2 * margin);
+ fdlTargetExt.top = new FormAttachment(wlDateTimeAdded, margin);
fdlTargetExt.right = new FormAttachment(middle, -margin);
wlTargetExt.setLayoutData(fdlTargetExt);
wTargetExt = new TextVar(variables, wTargetFileGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -391,7 +374,7 @@ public class ActionHttpDialog extends ActionDialog {
PropsUi.setLook(wlDateTimeAdded);
FormData fdlDateTimeAdded = new FormData();
fdlDateTimeAdded.left = new FormAttachment(0, 0);
- fdlDateTimeAdded.top = new FormAttachment(wlAppend, 2 * margin);
+ fdlDateTimeAdded.top = new FormAttachment(wlAppend, margin);
fdlDateTimeAdded.right = new FormAttachment(middle, -margin);
wlDateTimeAdded.setLayoutData(fdlDateTimeAdded);
wDateTimeAdded = new Button(wTargetFileGroup, SWT.CHECK);
@@ -709,7 +692,7 @@ public class ActionHttpDialog extends ActionDialog {
PropsUi.setLook(wlFieldURL);
FormData fdlFieldURL = new FormData();
fdlFieldURL.left = new FormAttachment(0, 0);
- fdlFieldURL.top = new FormAttachment(wRunEveryRow, 2 * margin);
+ fdlFieldURL.top = new FormAttachment(wRunEveryRow, margin);
fdlFieldURL.right = new FormAttachment(middle, -margin);
wlFieldURL.setLayoutData(fdlFieldURL);
wFieldURL = new TextVar(variables, wGeneralComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -718,7 +701,7 @@ public class ActionHttpDialog extends ActionDialog {
wFieldURL.addModifyListener(lsMod);
FormData fdFieldURL = new FormData();
fdFieldURL.left = new FormAttachment(middle, 0);
- fdFieldURL.top = new FormAttachment(wRunEveryRow, 2 * margin);
+ fdFieldURL.top = new FormAttachment(wRunEveryRow, margin);
fdFieldURL.right = new FormAttachment(100, 0);
wFieldURL.setLayoutData(fdFieldURL);
}
@@ -786,7 +769,7 @@ public class ActionHttpDialog extends ActionDialog {
PropsUi.setLook(wlURL);
FormData fdlURL = new FormData();
fdlURL.left = new FormAttachment(0, 0);
- fdlURL.top = new FormAttachment(wName, 2 * margin);
+ fdlURL.top = new FormAttachment(0, margin);
fdlURL.right = new FormAttachment(middle, -margin);
wlURL.setLayoutData(fdlURL);
wURL =
@@ -799,42 +782,14 @@ public class ActionHttpDialog extends ActionDialog {
wURL.addModifyListener(lsMod);
FormData fdURL = new FormData();
fdURL.left = new FormAttachment(middle, 0);
- fdURL.top = new FormAttachment(wName, 2 * margin);
+ fdURL.top = new FormAttachment(0, margin);
fdURL.right = new FormAttachment(100, 0);
wURL.setLayoutData(fdURL);
}
- private void setupActionName(ModifyListener lsMod, int middle, int margin) {
- // Action name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionHTTP.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
- }
-
- private Button setupButtons(int margin) {
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
- return wOk;
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void setFlags() {
@@ -913,9 +868,6 @@ public class ActionHttpDialog extends ActionDialog {
wAddFilenameToResult.setSelection(action.isAddFilenameToResult());
setFlags();
-
- wName.selectAll();
- wName.setFocus();
}
private void cancel() {
diff --git a/plugins/actions/join/src/main/java/org/apache/hop/workflow/actions/join/ActionJoinDialog.java b/plugins/actions/join/src/main/java/org/apache/hop/workflow/actions/join/ActionJoinDialog.java
index 836d326dc5..0cad09311f 100644
--- a/plugins/actions/join/src/main/java/org/apache/hop/workflow/actions/join/ActionJoinDialog.java
+++ b/plugins/actions/join/src/main/java/org/apache/hop/workflow/actions/join/ActionJoinDialog.java
@@ -20,31 +20,20 @@ package org.apache.hop.workflow.actions.join;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.i18n.BaseMessages;
-import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-/** This dialog allows you to edit a Action Abort object. */
+/** This dialog allows you to edit a Action Join object. */
public class ActionJoinDialog extends ActionDialog {
private static final Class<?> PKG = ActionJoinDialog.class;
private ActionJoin action;
private boolean changed;
- private Text wName;
public ActionJoinDialog(
Shell parent, ActionJoin action, WorkflowMeta workflowMeta, IVariables variables) {
@@ -57,66 +46,29 @@ public class ActionJoinDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 160);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionJoinDialog.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
- formLayout.spacing = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionJoinDialog.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addListener(SWT.Modify, e -> action.setChanged());
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, (Event e) -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, (Event e) -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, 0, null);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
}
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
+ }
+
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
if (action.getName() != null) {
wName.setText(action.getName());
}
- wName.selectAll();
- wName.setFocus();
}
private void cancel() {
diff --git a/plugins/actions/movefiles/src/main/java/org/apache/hop/workflow/actions/movefiles/ActionMoveFilesDialog.java b/plugins/actions/movefiles/src/main/java/org/apache/hop/workflow/actions/movefiles/ActionMoveFilesDialog.java
index 0b2fd9152f..8f87b356ee 100644
--- a/plugins/actions/movefiles/src/main/java/org/apache/hop/workflow/actions/movefiles/ActionMoveFilesDialog.java
+++ b/plugins/actions/movefiles/src/main/java/org/apache/hop/workflow/actions/movefiles/ActionMoveFilesDialog.java
@@ -33,9 +33,7 @@ import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -54,7 +52,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Move Files action settings. */
public class ActionMoveFilesDialog extends ActionDialog {
@@ -65,8 +62,6 @@ public class ActionMoveFilesDialog extends ActionDialog {
public static final String CONST_OVERWRITE_FILE = "overwrite_file";
public static final String CONST_UNIQUE_NAME = "unique_name";
- private Text wName;
-
private Label wlMoveEmptyFolders;
private Button wMoveEmptyFolders;
@@ -152,52 +147,12 @@ public class ActionMoveFilesDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionMoveFiles.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionMoveFiles.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, event -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, event -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionMoveFiles.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -237,7 +192,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlIncludeSubfolders);
FormData fdlIncludeSubfolders = new FormData();
fdlIncludeSubfolders.left = new FormAttachment(0, 0);
- fdlIncludeSubfolders.top = new FormAttachment(wName, margin);
+ fdlIncludeSubfolders.top = new FormAttachment(0, margin);
fdlIncludeSubfolders.right = new FormAttachment(middle, -margin);
wlIncludeSubfolders.setLayoutData(fdlIncludeSubfolders);
wIncludeSubfolders = new Button(wSettings, SWT.CHECK);
@@ -265,7 +220,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlMoveEmptyFolders);
FormData fdlMoveEmptyFolders = new FormData();
fdlMoveEmptyFolders.left = new FormAttachment(0, 0);
- fdlMoveEmptyFolders.top = new FormAttachment(wlIncludeSubfolders, 2 * margin);
+ fdlMoveEmptyFolders.top = new FormAttachment(wlIncludeSubfolders, margin);
fdlMoveEmptyFolders.right = new FormAttachment(middle, -margin);
wlMoveEmptyFolders.setLayoutData(fdlMoveEmptyFolders);
wMoveEmptyFolders = new Button(wSettings, SWT.CHECK);
@@ -285,7 +240,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlSimulate);
FormData fdlSimulate = new FormData();
fdlSimulate.left = new FormAttachment(0, 0);
- fdlSimulate.top = new FormAttachment(wlMoveEmptyFolders, 2 * margin);
+ fdlSimulate.top = new FormAttachment(wlMoveEmptyFolders, margin);
fdlSimulate.right = new FormAttachment(middle, -margin);
wlSimulate.setLayoutData(fdlSimulate);
wSimulate = new Button(wSettings, SWT.CHECK);
@@ -304,7 +259,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlPrevious);
FormData fdlPrevious = new FormData();
fdlPrevious.left = new FormAttachment(0, 0);
- fdlPrevious.top = new FormAttachment(wlSimulate, 2 * margin);
+ fdlPrevious.top = new FormAttachment(wlSimulate, margin);
fdlPrevious.right = new FormAttachment(middle, -margin);
wlPrevious.setLayoutData(fdlPrevious);
wPrevious = new Button(wSettings, SWT.CHECK);
@@ -319,7 +274,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
wPrevious.addListener(SWT.Selection, event -> refreshArgFromPrevious());
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(0, margin);
fdSettings.right = new FormAttachment(100, -margin);
wSettings.setLayoutData(fdSettings);
@@ -462,7 +417,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlDestinationIsAFile);
FormData fdlDestinationIsAFile = new FormData();
fdlDestinationIsAFile.left = new FormAttachment(0, 0);
- fdlDestinationIsAFile.top = new FormAttachment(wlCreateDestinationFolder, 2 * margin);
+ fdlDestinationIsAFile.top = new FormAttachment(wlCreateDestinationFolder, margin);
fdlDestinationIsAFile.right = new FormAttachment(middle, -margin);
wlDestinationIsAFile.setLayoutData(fdlDestinationIsAFile);
wDestinationIsAFile = new Button(wDestinationFile, SWT.CHECK);
@@ -483,7 +438,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlDoNotKeepFolderStructure);
FormData fdlDoNotKeepFolderStructure = new FormData();
fdlDoNotKeepFolderStructure.left = new FormAttachment(0, 0);
- fdlDoNotKeepFolderStructure.top = new FormAttachment(wlDestinationIsAFile, 2 * margin);
+ fdlDoNotKeepFolderStructure.top = new FormAttachment(wlDestinationIsAFile, margin);
fdlDoNotKeepFolderStructure.right = new FormAttachment(middle, -margin);
wlDoNotKeepFolderStructure.setLayoutData(fdlDoNotKeepFolderStructure);
wDoNotKeepFolderStructure = new Button(wDestinationFile, SWT.CHECK);
@@ -503,7 +458,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddDate);
FormData fdlAddDate = new FormData();
fdlAddDate.left = new FormAttachment(0, 0);
- fdlAddDate.top = new FormAttachment(wlDoNotKeepFolderStructure, 2 * margin);
+ fdlAddDate.top = new FormAttachment(wlDoNotKeepFolderStructure, margin);
fdlAddDate.right = new FormAttachment(middle, -margin);
wlAddDate.setLayoutData(fdlAddDate);
wAddDate = new Button(wDestinationFile, SWT.CHECK);
@@ -528,7 +483,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddTime);
FormData fdlAddTime = new FormData();
fdlAddTime.left = new FormAttachment(0, 0);
- fdlAddTime.top = new FormAttachment(wlAddDate, 2 * margin);
+ fdlAddTime.top = new FormAttachment(wlAddDate, margin);
fdlAddTime.right = new FormAttachment(middle, -margin);
wlAddTime.setLayoutData(fdlAddTime);
wAddTime = new Button(wDestinationFile, SWT.CHECK);
@@ -554,7 +509,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyFormat);
FormData fdlSpecifyFormat = new FormData();
fdlSpecifyFormat.left = new FormAttachment(0, 0);
- fdlSpecifyFormat.top = new FormAttachment(wlAddTime, 2 * margin);
+ fdlSpecifyFormat.top = new FormAttachment(wlAddTime, margin);
fdlSpecifyFormat.right = new FormAttachment(middle, -margin);
wlSpecifyFormat.setLayoutData(fdlSpecifyFormat);
wSpecifyFormat = new Button(wDestinationFile, SWT.CHECK);
@@ -582,7 +537,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlDateTimeFormat);
FormData fdlDateTimeFormat = new FormData();
fdlDateTimeFormat.left = new FormAttachment(0, 0);
- fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdlDateTimeFormat.right = new FormAttachment(middle, -margin);
wlDateTimeFormat.setLayoutData(fdlDateTimeFormat);
wDateTimeFormat = new CCombo(wDestinationFile, SWT.BORDER | SWT.READ_ONLY);
@@ -591,7 +546,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
wDateTimeFormat.addModifyListener(lsMod);
FormData fdDateTimeFormat = new FormData();
fdDateTimeFormat.left = new FormAttachment(middle, 0);
- fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdDateTimeFormat.right = new FormAttachment(100, 0);
wDateTimeFormat.setLayoutData(fdDateTimeFormat);
// Prepare a list of possible DateTimeFormats...
@@ -628,7 +583,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
FormData fdlIfFileExists = new FormData();
fdlIfFileExists.left = new FormAttachment(0, 0);
fdlIfFileExists.right = new FormAttachment(middle, -margin);
- fdlIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, 2 * margin);
+ fdlIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, margin);
wlIfFileExists.setLayoutData(fdlIfFileExists);
wIfFileExists = new CCombo(wDestinationFile, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
@@ -646,7 +601,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wIfFileExists);
FormData fdIfFileExists = new FormData();
fdIfFileExists.left = new FormAttachment(middle, 0);
- fdIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, 2 * margin);
+ fdIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, margin);
fdIfFileExists.right = new FormAttachment(100, 0);
wIfFileExists.setLayoutData(fdIfFileExists);
wIfFileExists.addSelectionListener(
@@ -662,7 +617,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
FormData fdDestinationFile = new FormData();
fdDestinationFile.left = new FormAttachment(0, margin);
- fdDestinationFile.top = new FormAttachment(wName, margin);
+ fdDestinationFile.top = new FormAttachment(0, margin);
fdDestinationFile.right = new FormAttachment(100, -margin);
wDestinationFile.setLayoutData(fdDestinationFile);
@@ -746,7 +701,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddMovedDate);
FormData fdlAddMovedDate = new FormData();
fdlAddMovedDate.left = new FormAttachment(0, 0);
- fdlAddMovedDate.top = new FormAttachment(wlCreateMoveToFolder, 2 * margin);
+ fdlAddMovedDate.top = new FormAttachment(wlCreateMoveToFolder, margin);
fdlAddMovedDate.right = new FormAttachment(middle, -margin);
wlAddMovedDate.setLayoutData(fdlAddMovedDate);
wAddMovedDate = new Button(wMoveToGroup, SWT.CHECK);
@@ -772,7 +727,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddMovedTime);
FormData fdlAddMovedTime = new FormData();
fdlAddMovedTime.left = new FormAttachment(0, 0);
- fdlAddMovedTime.top = new FormAttachment(wlAddMovedDate, 2 * margin);
+ fdlAddMovedTime.top = new FormAttachment(wlAddMovedDate, margin);
fdlAddMovedTime.right = new FormAttachment(middle, -margin);
wlAddMovedTime.setLayoutData(fdlAddMovedTime);
wAddMovedTime = new Button(wMoveToGroup, SWT.CHECK);
@@ -800,7 +755,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyMoveFormat);
FormData fdlSpecifyMoveFormat = new FormData();
fdlSpecifyMoveFormat.left = new FormAttachment(0, 0);
- fdlSpecifyMoveFormat.top = new FormAttachment(wlAddMovedTime, 2 * margin);
+ fdlSpecifyMoveFormat.top = new FormAttachment(wlAddMovedTime, margin);
fdlSpecifyMoveFormat.right = new FormAttachment(middle, -margin);
wlSpecifyMoveFormat.setLayoutData(fdlSpecifyMoveFormat);
wSpecifyMoveFormat = new Button(wMoveToGroup, SWT.CHECK);
@@ -829,7 +784,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wlMovedDateTimeFormat);
FormData fdlMovedDateTimeFormat = new FormData();
fdlMovedDateTimeFormat.left = new FormAttachment(0, 0);
- fdlMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, 2 * margin);
+ fdlMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, margin);
fdlMovedDateTimeFormat.right = new FormAttachment(middle, -margin);
wlMovedDateTimeFormat.setLayoutData(fdlMovedDateTimeFormat);
wMovedDateTimeFormat = new CCombo(wMoveToGroup, SWT.BORDER | SWT.READ_ONLY);
@@ -838,7 +793,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
wMovedDateTimeFormat.addModifyListener(lsMod);
FormData fdMovedDateTimeFormat = new FormData();
fdMovedDateTimeFormat.left = new FormAttachment(middle, 0);
- fdMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, 2 * margin);
+ fdMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, margin);
fdMovedDateTimeFormat.right = new FormAttachment(100, 0);
wMovedDateTimeFormat.setLayoutData(fdMovedDateTimeFormat);
@@ -876,7 +831,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
FormData fdlIfMovedFileExists = new FormData();
fdlIfMovedFileExists.left = new FormAttachment(0, 0);
fdlIfMovedFileExists.right = new FormAttachment(middle, -margin);
- fdlIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, 2 * margin);
+ fdlIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, margin);
wlIfMovedFileExists.setLayoutData(fdlIfMovedFileExists);
wIfMovedFileExists = new CCombo(wMoveToGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wIfMovedFileExists.add(
@@ -891,7 +846,7 @@ public class ActionMoveFilesDialog extends ActionDialog {
PropsUi.setLook(wIfMovedFileExists);
FormData fdIfMovedFileExists = new FormData();
fdIfMovedFileExists.left = new FormAttachment(middle, 0);
- fdIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, 2 * margin);
+ fdIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, margin);
fdIfMovedFileExists.right = new FormAttachment(100, 0);
wIfMovedFileExists.setLayoutData(fdIfMovedFileExists);
@@ -1075,12 +1030,13 @@ public class ActionMoveFilesDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
+ focusActionName();
checkIncludeSubFolders();
activeSuccessCondition();
setDateTimeFormat();
@@ -1306,9 +1262,11 @@ public class ActionMoveFilesDialog extends ActionDialog {
wMovedDateTimeFormat.setText(action.getMovedDateTimeFormat());
}
wAddMovedDateBeforeExtension.setSelection(action.isAddMovedDateBeforeExtension());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/mssqlbulkload/src/main/java/org/apache/hop/workflow/actions/mssqlbulkload/ActionMssqlBulkLoadDialog.java b/plugins/actions/mssqlbulkload/src/main/java/org/apache/hop/workflow/actions/mssqlbulkload/ActionMssqlBulkLoadDialog.java
index b779fc3305..0e8c7edd10 100644
--- a/plugins/actions/mssqlbulkload/src/main/java/org/apache/hop/workflow/actions/mssqlbulkload/ActionMssqlBulkLoadDialog.java
+++ b/plugins/actions/mssqlbulkload/src/main/java/org/apache/hop/workflow/actions/mssqlbulkload/ActionMssqlBulkLoadDialog.java
@@ -36,9 +36,7 @@ import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.MetaSelectionLine;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -56,7 +54,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** Dialog class for the MSSqlBulkLoader. */
public class ActionMssqlBulkLoadDialog extends ActionDialog {
@@ -70,8 +67,6 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
};
public static final String CONST_SYSTEM_BUTTON_BROWSE = "System.Button.Browse";
- private Text wName;
-
private MetaSelectionLine<DatabaseMeta> wConnection;
private TextVar wSchemaname;
@@ -145,52 +140,14 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionMssqlBulkLoad.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
-
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionMssqlBulkLoad.Title"));
-
int middle = props.getMiddlePct();
int margin = PropsUi.getMargin();
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionMssqlBulkLoad.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -312,7 +269,7 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
FormData fdConnectionGroup = new FormData();
fdConnectionGroup.left = new FormAttachment(0, margin);
- fdConnectionGroup.top = new FormAttachment(wName, margin);
+ fdConnectionGroup.top = new FormAttachment(0, margin);
fdConnectionGroup.right = new FormAttachment(100, -margin);
wConnectionGroup.setLayoutData(fdConnectionGroup);
// ///////////////////////////////////////////////////////////
@@ -623,7 +580,7 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
PropsUi.setLook(wlCheckConstraints);
FormData fdlCheckConstraints = new FormData();
fdlCheckConstraints.left = new FormAttachment(0, 0);
- fdlCheckConstraints.top = new FormAttachment(wlFireTriggers, 2 * margin);
+ fdlCheckConstraints.top = new FormAttachment(wlFireTriggers, margin);
fdlCheckConstraints.right = new FormAttachment(middle, -margin);
wlCheckConstraints.setLayoutData(fdlCheckConstraints);
wCheckConstraints = new Button(wAdvancedComp, SWT.CHECK);
@@ -650,7 +607,7 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
PropsUi.setLook(wlKeepNulls);
FormData fdlKeepNulls = new FormData();
fdlKeepNulls.left = new FormAttachment(0, 0);
- fdlKeepNulls.top = new FormAttachment(wlCheckConstraints, 2 * margin);
+ fdlKeepNulls.top = new FormAttachment(wlCheckConstraints, margin);
fdlKeepNulls.right = new FormAttachment(middle, -margin);
wlKeepNulls.setLayoutData(fdlKeepNulls);
wKeepNulls = new Button(wAdvancedComp, SWT.CHECK);
@@ -676,7 +633,7 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
PropsUi.setLook(wlKeepIdentity);
FormData fdlKeepIdentity = new FormData();
fdlKeepIdentity.left = new FormAttachment(0, 0);
- fdlKeepIdentity.top = new FormAttachment(wlKeepNulls, 2 * margin);
+ fdlKeepIdentity.top = new FormAttachment(wlKeepNulls, margin);
fdlKeepIdentity.right = new FormAttachment(middle, -margin);
wlKeepIdentity.setLayoutData(fdlKeepIdentity);
wKeepIdentity = new Button(wAdvancedComp, SWT.CHECK);
@@ -703,7 +660,7 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
PropsUi.setLook(wlTablock);
FormData fdlTablock = new FormData();
fdlTablock.left = new FormAttachment(0, 0);
- fdlTablock.top = new FormAttachment(wlKeepIdentity, 2 * margin);
+ fdlTablock.top = new FormAttachment(wlKeepIdentity, margin);
fdlTablock.right = new FormAttachment(middle, -margin);
wlTablock.setLayoutData(fdlTablock);
wTablock = new Button(wAdvancedComp, SWT.CHECK);
@@ -730,7 +687,7 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
FormData fdlStartFile = new FormData();
fdlStartFile.left = new FormAttachment(0, 0);
fdlStartFile.right = new FormAttachment(middle, 0);
- fdlStartFile.top = new FormAttachment(wlTablock, 2 * margin);
+ fdlStartFile.top = new FormAttachment(wlTablock, margin);
wlStartFile.setLayoutData(fdlStartFile);
wStartFile = new TextVar(variables, wAdvancedComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -739,7 +696,7 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
wStartFile.addModifyListener(lsMod);
FormData fdStartFile = new FormData();
fdStartFile.left = new FormAttachment(middle, 0);
- fdStartFile.top = new FormAttachment(wlTablock, 2 * margin);
+ fdStartFile.top = new FormAttachment(wlTablock, margin);
fdStartFile.right = new FormAttachment(100, 0);
wStartFile.setLayoutData(fdStartFile);
@@ -894,7 +851,7 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
FormData fdlMaxErrors = new FormData();
fdlMaxErrors.left = new FormAttachment(0, 0);
fdlMaxErrors.right = new FormAttachment(middle, -margin);
- fdlMaxErrors.top = new FormAttachment(wlAddDateTime, 2 * margin);
+ fdlMaxErrors.top = new FormAttachment(wlAddDateTime, margin);
wlMaxErrors.setLayoutData(fdlMaxErrors);
wMaxErrors = new TextVar(variables, wAdvancedComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -904,7 +861,7 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
wMaxErrors.addModifyListener(lsMod);
FormData fdMaxErrors = new FormData();
fdMaxErrors.left = new FormAttachment(middle, 0);
- fdMaxErrors.top = new FormAttachment(wlAddDateTime, 2 * margin);
+ fdMaxErrors.top = new FormAttachment(wlAddDateTime, margin);
fdMaxErrors.right = new FormAttachment(100, 0);
wMaxErrors.setLayoutData(fdMaxErrors);
@@ -1019,12 +976,13 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
+ focusActionName();
setDataType();
setCodeType();
@@ -1126,9 +1084,11 @@ public class ActionMssqlBulkLoadDialog extends ActionDialog {
wAddFileToResult.setSelection(action.isAddFileToResult());
wTruncate.setSelection(action.isTruncate());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/mysqlbulkfile/src/main/java/org/apache/hop/workflow/actions/mysqlbulkfile/ActionMysqlBulkFileDialog.java b/plugins/actions/mysqlbulkfile/src/main/java/org/apache/hop/workflow/actions/mysqlbulkfile/ActionMysqlBulkFileDialog.java
index d2118abdc2..772ae6496c 100644
--- a/plugins/actions/mysqlbulkfile/src/main/java/org/apache/hop/workflow/actions/mysqlbulkfile/ActionMysqlBulkFileDialog.java
+++ b/plugins/actions/mysqlbulkfile/src/main/java/org/apache/hop/workflow/actions/mysqlbulkfile/ActionMysqlBulkFileDialog.java
@@ -34,9 +34,7 @@ import org.apache.hop.ui.core.dialog.ErrorDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.MetaSelectionLine;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -50,7 +48,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/**
* This dialog allows you to edit the MYSQL Bulk Load To a file action settings. (select the
@@ -65,8 +62,6 @@ public class ActionMysqlBulkFileDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionMysqlBulkFile.Filetype.All")
};
- private Text wName;
-
private MetaSelectionLine<DatabaseMeta> wConnection;
private TextVar wTableName;
@@ -112,51 +107,12 @@ public class ActionMysqlBulkFileDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionMysqlBulkFile.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons at the bottom of the dialog
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Action name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionMysqlBulkFile.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(wlName, 0, SWT.CENTER);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ createShell(BaseMessages.getString(PKG, "ActionMysqlBulkFile.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
// Connection line
DatabaseMeta databaseMeta = workflowMeta.findDatabase(action.getConnection(), variables);
- wConnection = addConnectionLine(shell, wName, databaseMeta, null);
+ wConnection = addConnectionLine(shell, wSpacer, databaseMeta, e -> action.setChanged());
// Schema name line
// Schema name
@@ -283,7 +239,7 @@ public class ActionMysqlBulkFileDialog extends ActionDialog {
FormData fdlOutDumpValue = new FormData();
fdlOutDumpValue.left = new FormAttachment(0, 0);
fdlOutDumpValue.right = new FormAttachment(middle, -margin);
- fdlOutDumpValue.top = new FormAttachment(wlHighPriority, 2 * margin);
+ fdlOutDumpValue.top = new FormAttachment(wlHighPriority, margin);
wlOutDumpValue.setLayoutData(fdlOutDumpValue);
wOutDumpValue = new CCombo(shell, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wOutDumpValue.add(BaseMessages.getString(PKG, "ActionMysqlBulkFile.OutFileValue.Label"));
@@ -363,7 +319,7 @@ public class ActionMysqlBulkFileDialog extends ActionDialog {
FormData fdlLineTerminated = new FormData();
fdlLineTerminated.left = new FormAttachment(0, 0);
fdlLineTerminated.right = new FormAttachment(middle, -margin);
- fdlLineTerminated.top = new FormAttachment(wlOptionEnclosed, 2 * margin);
+ fdlLineTerminated.top = new FormAttachment(wlOptionEnclosed, margin);
wlLineTerminated.setLayoutData(fdlLineTerminated);
wLineTerminated = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
PropsUi.setLook(wLineTerminated);
@@ -491,7 +447,7 @@ public class ActionMysqlBulkFileDialog extends ActionDialog {
fdFileResult.left = new FormAttachment(0, 0);
fdFileResult.top = new FormAttachment(wIfFileExists, margin);
fdFileResult.right = new FormAttachment(100, -margin);
- fdFileResult.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFileResult.bottom = new FormAttachment(wCancel, -margin);
wFileResult.setLayoutData(fdFileResult);
// ///////////////////////////////////////////////////////////
@@ -499,7 +455,7 @@ public class ActionMysqlBulkFileDialog extends ActionDialog {
// ///////////////////////////////////////////////////////////
getData();
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, n -> ok(), n -> cancel());
return action;
@@ -574,9 +530,11 @@ public class ActionMysqlBulkFileDialog extends ActionDialog {
}
wAddFileToResult.setSelection(action.isAddFileToResult());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/mysqlbulkload/src/main/java/org/apache/hop/workflow/actions/mysqlbulkload/ActionMysqlBulkLoadDialog.java b/plugins/actions/mysqlbulkload/src/main/java/org/apache/hop/workflow/actions/mysqlbulkload/ActionMysqlBulkLoadDialog.java
index 8878cb9be4..35efd73d3b 100644
--- a/plugins/actions/mysqlbulkload/src/main/java/org/apache/hop/workflow/actions/mysqlbulkload/ActionMysqlBulkLoadDialog.java
+++ b/plugins/actions/mysqlbulkload/src/main/java/org/apache/hop/workflow/actions/mysqlbulkload/ActionMysqlBulkLoadDialog.java
@@ -34,9 +34,7 @@ import org.apache.hop.ui.core.dialog.ErrorDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.MetaSelectionLine;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -51,7 +49,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** Dialog class for the MySqlBulkLoader. */
public class ActionMysqlBulkLoadDialog extends ActionDialog {
@@ -63,8 +60,6 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionMysqlBulkLoad.Filetype.All")
};
- private Text wName;
-
private MetaSelectionLine<DatabaseMeta> wConnection;
private TextVar wSchemaname;
@@ -112,55 +107,15 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionMysqlBulkLoad.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionMysqlBulkLoad.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionMysqlBulkLoad.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
// Connection line
DatabaseMeta databaseMeta = workflowMeta.findDatabase(action.getConnection(), variables);
- wConnection = addConnectionLine(shell, wName, databaseMeta, lsMod);
+ wConnection = addConnectionLine(shell, wSpacer, databaseMeta, lsMod);
// Schema name line
// Schema name
@@ -296,7 +251,7 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
FormData fdlPriorityValue = new FormData();
fdlPriorityValue.left = new FormAttachment(0, 0);
fdlPriorityValue.right = new FormAttachment(middle, -margin);
- fdlPriorityValue.top = new FormAttachment(wlLocalInfile, 2 * margin);
+ fdlPriorityValue.top = new FormAttachment(wlLocalInfile, margin);
wlPriorityValue.setLayoutData(fdlPriorityValue);
wPriorityValue = new CCombo(shell, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wPriorityValue.add(BaseMessages.getString(PKG, "ActionMysqlBulkLoad.NorProrityValue.Label"));
@@ -306,7 +261,7 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
PropsUi.setLook(wPriorityValue);
FormData fdPriorityValue = new FormData();
fdPriorityValue.left = new FormAttachment(middle, 0);
- fdPriorityValue.top = new FormAttachment(wlLocalInfile, 2 * margin);
+ fdPriorityValue.top = new FormAttachment(wlLocalInfile, margin);
fdPriorityValue.right = new FormAttachment(100, 0);
wPriorityValue.setLayoutData(fdPriorityValue);
@@ -484,7 +439,7 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
FormData fdlIgnorelines = new FormData();
fdlIgnorelines.left = new FormAttachment(0, 0);
fdlIgnorelines.right = new FormAttachment(middle, -margin);
- fdlIgnorelines.top = new FormAttachment(wlReplaceData, 2 * margin);
+ fdlIgnorelines.top = new FormAttachment(wlReplaceData, margin);
wlIgnorelines.setLayoutData(fdlIgnorelines);
wIgnorelines = new TextVar(variables, shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -492,7 +447,7 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
wIgnorelines.addModifyListener(lsMod);
FormData fdIgnorelines = new FormData();
fdIgnorelines.left = new FormAttachment(middle, 0);
- fdIgnorelines.top = new FormAttachment(wlReplaceData, 2 * margin);
+ fdIgnorelines.top = new FormAttachment(wlReplaceData, margin);
fdIgnorelines.right = new FormAttachment(100, 0);
wIgnorelines.setLayoutData(fdIgnorelines);
@@ -541,7 +496,7 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
fdFileResult.left = new FormAttachment(0, margin);
fdFileResult.top = new FormAttachment(wIgnorelines, margin);
fdFileResult.right = new FormAttachment(100, -margin);
- fdFileResult.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFileResult.bottom = new FormAttachment(wCancel, -margin);
wFileResult.setLayoutData(fdFileResult);
// ///////////////////////////////////////////////////////////
@@ -549,7 +504,7 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
// ///////////////////////////////////////////////////////////
getData();
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -557,7 +512,7 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
if (action.getSchemaName() != null) {
wSchemaname.setText(action.getSchemaName());
}
@@ -611,9 +566,11 @@ public class ActionMysqlBulkLoadDialog extends ActionDialog {
}
wAddFileToResult.setSelection(action.isAddFileToResult());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpdecryptfiles/ActionPGPDecryptFilesDialog.java b/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpdecryptfiles/ActionPGPDecryptFilesDialog.java
index a298467da6..c2bf9b00c6 100644
--- a/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpdecryptfiles/ActionPGPDecryptFilesDialog.java
+++ b/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpdecryptfiles/ActionPGPDecryptFilesDialog.java
@@ -29,9 +29,7 @@ import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -50,7 +48,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Move Files action settings. */
public class ActionPGPDecryptFilesDialog extends ActionDialog {
@@ -63,8 +60,6 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
public static final String CONST_OVERWRITE_FILE = "overwrite_file";
public static final String CONST_UNIQUE_NAME = "unique_name";
- private Text wName;
-
private Label wlSourceFileFolder;
private Button wbSourceFileFolder;
private Button wbDestinationFileFolder;
@@ -166,52 +161,12 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionPGPDecryptFiles.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionPGPDecryptFiles.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionPGPDecryptFiles.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -251,7 +206,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlGpgExe);
FormData fdlGpgExe = new FormData();
fdlGpgExe.left = new FormAttachment(0, 0);
- fdlGpgExe.top = new FormAttachment(wName, margin);
+ fdlGpgExe.top = new FormAttachment(0, margin);
fdlGpgExe.right = new FormAttachment(middle, -margin);
wlGpgExe.setLayoutData(fdlGpgExe);
@@ -262,7 +217,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
BaseMessages.getString(PKG, CONST_ACTION_PGPDECRYPT_FILES_BROWSE_FILES_LABEL));
FormData fdbbGpgExe = new FormData();
fdbbGpgExe.right = new FormAttachment(100, -margin);
- fdbbGpgExe.top = new FormAttachment(wName, margin);
+ fdbbGpgExe.top = new FormAttachment(0, margin);
wbbGpgExe.setLayoutData(fdbbGpgExe);
wbbGpgExe.addListener(
@@ -277,7 +232,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
wGpgExe.addModifyListener(lsMod);
FormData fdGpgExe = new FormData();
fdGpgExe.left = new FormAttachment(middle, 0);
- fdGpgExe.top = new FormAttachment(wName, margin);
+ fdGpgExe.top = new FormAttachment(0, margin);
fdGpgExe.right = new FormAttachment(wbbGpgExe, -margin);
wGpgExe.setLayoutData(fdGpgExe);
@@ -314,7 +269,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlPrevious);
FormData fdlPrevious = new FormData();
fdlPrevious.left = new FormAttachment(0, 0);
- fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, 2 * margin);
+ fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, margin);
fdlPrevious.right = new FormAttachment(middle, -margin);
wlPrevious.setLayoutData(fdlPrevious);
wPrevious = new Button(wSettings, SWT.CHECK);
@@ -336,7 +291,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
});
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(0, margin);
fdSettings.right = new FormAttachment(100, -margin);
wSettings.setLayoutData(fdSettings);
@@ -351,7 +306,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlSourceFileFolder);
FormData fdlSourceFileFolder = new FormData();
fdlSourceFileFolder.left = new FormAttachment(0, 0);
- fdlSourceFileFolder.top = new FormAttachment(wSettings, 2 * margin);
+ fdlSourceFileFolder.top = new FormAttachment(wSettings, margin);
fdlSourceFileFolder.right = new FormAttachment(middle, -margin);
wlSourceFileFolder.setLayoutData(fdlSourceFileFolder);
@@ -395,7 +350,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
wSourceFileFolder.addModifyListener(lsMod);
FormData fdSourceFileFolder = new FormData();
fdSourceFileFolder.left = new FormAttachment(middle, 0);
- fdSourceFileFolder.top = new FormAttachment(wSettings, 2 * margin);
+ fdSourceFileFolder.top = new FormAttachment(wSettings, margin);
fdSourceFileFolder.right = new FormAttachment(wbaSourceFileFolder, -margin);
wSourceFileFolder.setLayoutData(fdSourceFileFolder);
@@ -710,7 +665,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlDestinationIsAFile);
FormData fdlDestinationIsAFile = new FormData();
fdlDestinationIsAFile.left = new FormAttachment(0, 0);
- fdlDestinationIsAFile.top = new FormAttachment(wlCreateDestinationFolder, 2 * margin);
+ fdlDestinationIsAFile.top = new FormAttachment(wlCreateDestinationFolder, margin);
fdlDestinationIsAFile.right = new FormAttachment(middle, -margin);
wlDestinationIsAFile.setLayoutData(fdlDestinationIsAFile);
wDestinationIsAFile = new Button(wDestinationFile, SWT.CHECK);
@@ -738,7 +693,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlDoNotKeepFolderStructure);
FormData fdlDoNotKeepFolderStructure = new FormData();
fdlDoNotKeepFolderStructure.left = new FormAttachment(0, 0);
- fdlDoNotKeepFolderStructure.top = new FormAttachment(wlDestinationIsAFile, 2 * margin);
+ fdlDoNotKeepFolderStructure.top = new FormAttachment(wlDestinationIsAFile, margin);
fdlDoNotKeepFolderStructure.right = new FormAttachment(middle, -margin);
wlDoNotKeepFolderStructure.setLayoutData(fdlDoNotKeepFolderStructure);
wDoNotKeepFolderStructure = new Button(wDestinationFile, SWT.CHECK);
@@ -764,7 +719,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddDate);
FormData fdlAddDate = new FormData();
fdlAddDate.left = new FormAttachment(0, 0);
- fdlAddDate.top = new FormAttachment(wlDoNotKeepFolderStructure, 2 * margin);
+ fdlAddDate.top = new FormAttachment(wlDoNotKeepFolderStructure, margin);
fdlAddDate.right = new FormAttachment(middle, -margin);
wlAddDate.setLayoutData(fdlAddDate);
wAddDate = new Button(wDestinationFile, SWT.CHECK);
@@ -789,7 +744,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddTime);
FormData fdlAddTime = new FormData();
fdlAddTime.left = new FormAttachment(0, 0);
- fdlAddTime.top = new FormAttachment(wlAddDate, 2 * margin);
+ fdlAddTime.top = new FormAttachment(wlAddDate, margin);
fdlAddTime.right = new FormAttachment(middle, -margin);
wlAddTime.setLayoutData(fdlAddTime);
wAddTime = new Button(wDestinationFile, SWT.CHECK);
@@ -816,7 +771,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyFormat);
FormData fdlSpecifyFormat = new FormData();
fdlSpecifyFormat.left = new FormAttachment(0, 0);
- fdlSpecifyFormat.top = new FormAttachment(wlAddTime, 2 * margin);
+ fdlSpecifyFormat.top = new FormAttachment(wlAddTime, margin);
fdlSpecifyFormat.right = new FormAttachment(middle, -margin);
wlSpecifyFormat.setLayoutData(fdlSpecifyFormat);
wSpecifyFormat = new Button(wDestinationFile, SWT.CHECK);
@@ -845,7 +800,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlDateTimeFormat);
FormData fdlDateTimeFormat = new FormData();
fdlDateTimeFormat.left = new FormAttachment(0, 0);
- fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdlDateTimeFormat.right = new FormAttachment(middle, -margin);
wlDateTimeFormat.setLayoutData(fdlDateTimeFormat);
wDateTimeFormat = new CCombo(wDestinationFile, SWT.BORDER | SWT.READ_ONLY);
@@ -854,7 +809,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
wDateTimeFormat.addModifyListener(lsMod);
FormData fdDateTimeFormat = new FormData();
fdDateTimeFormat.left = new FormAttachment(middle, 0);
- fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdDateTimeFormat.right = new FormAttachment(100, 0);
wDateTimeFormat.setLayoutData(fdDateTimeFormat);
// Prepare a list of possible DateTimeFormats...
@@ -897,7 +852,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
FormData fdlIfFileExists = new FormData();
fdlIfFileExists.left = new FormAttachment(0, 0);
fdlIfFileExists.right = new FormAttachment(middle, 0);
- fdlIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, 2 * margin);
+ fdlIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, margin);
wlIfFileExists.setLayoutData(fdlIfFileExists);
wIfFileExists = new CCombo(wDestinationFile, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wIfFileExists.add(
@@ -916,7 +871,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wIfFileExists);
FormData fdIfFileExists = new FormData();
fdIfFileExists.left = new FormAttachment(middle, 0);
- fdIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, 2 * margin);
+ fdIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, margin);
fdIfFileExists.right = new FormAttachment(100, 0);
wIfFileExists.setLayoutData(fdIfFileExists);
@@ -933,7 +888,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
FormData fdDestinationFile = new FormData();
fdDestinationFile.left = new FormAttachment(0, margin);
- fdDestinationFile.top = new FormAttachment(wName, margin);
+ fdDestinationFile.top = new FormAttachment(0, margin);
fdDestinationFile.right = new FormAttachment(100, -margin);
wDestinationFile.setLayoutData(fdDestinationFile);
@@ -1025,7 +980,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddMovedDate);
FormData fdlAddMovedDate = new FormData();
fdlAddMovedDate.left = new FormAttachment(0, 0);
- fdlAddMovedDate.top = new FormAttachment(wlCreateMoveToFolder, 2 * margin);
+ fdlAddMovedDate.top = new FormAttachment(wlCreateMoveToFolder, margin);
fdlAddMovedDate.right = new FormAttachment(middle, -margin);
wlAddMovedDate.setLayoutData(fdlAddMovedDate);
wAddMovedDate = new Button(wMoveToGroup, SWT.CHECK);
@@ -1051,7 +1006,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddMovedTime);
FormData fdlAddMovedTime = new FormData();
fdlAddMovedTime.left = new FormAttachment(0, 0);
- fdlAddMovedTime.top = new FormAttachment(wlAddMovedDate, 2 * margin);
+ fdlAddMovedTime.top = new FormAttachment(wlAddMovedDate, margin);
fdlAddMovedTime.right = new FormAttachment(middle, -margin);
wlAddMovedTime.setLayoutData(fdlAddMovedTime);
wAddMovedTime = new Button(wMoveToGroup, SWT.CHECK);
@@ -1079,7 +1034,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyMoveFormat);
FormData fdlSpecifyMoveFormat = new FormData();
fdlSpecifyMoveFormat.left = new FormAttachment(0, 0);
- fdlSpecifyMoveFormat.top = new FormAttachment(wlAddMovedTime, 2 * margin);
+ fdlSpecifyMoveFormat.top = new FormAttachment(wlAddMovedTime, margin);
fdlSpecifyMoveFormat.right = new FormAttachment(middle, -margin);
wlSpecifyMoveFormat.setLayoutData(fdlSpecifyMoveFormat);
wSpecifyMoveFormat = new Button(wMoveToGroup, SWT.CHECK);
@@ -1108,7 +1063,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlMovedDateTimeFormat);
FormData fdlMovedDateTimeFormat = new FormData();
fdlMovedDateTimeFormat.left = new FormAttachment(0, 0);
- fdlMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, 2 * margin);
+ fdlMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, margin);
fdlMovedDateTimeFormat.right = new FormAttachment(middle, -margin);
wlMovedDateTimeFormat.setLayoutData(fdlMovedDateTimeFormat);
wMovedDateTimeFormat = new CCombo(wMoveToGroup, SWT.BORDER | SWT.READ_ONLY);
@@ -1117,7 +1072,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
wMovedDateTimeFormat.addModifyListener(lsMod);
FormData fdMovedDateTimeFormat = new FormData();
fdMovedDateTimeFormat.left = new FormAttachment(middle, 0);
- fdMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, 2 * margin);
+ fdMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, margin);
fdMovedDateTimeFormat.right = new FormAttachment(100, 0);
wMovedDateTimeFormat.setLayoutData(fdMovedDateTimeFormat);
@@ -1161,7 +1116,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
FormData fdlIfMovedFileExists = new FormData();
fdlIfMovedFileExists.left = new FormAttachment(0, 0);
fdlIfMovedFileExists.right = new FormAttachment(middle, 0);
- fdlIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, 2 * margin);
+ fdlIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, margin);
wlIfMovedFileExists.setLayoutData(fdlIfMovedFileExists);
wIfMovedFileExists = new CCombo(wMoveToGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wIfMovedFileExists.add(
@@ -1177,7 +1132,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
PropsUi.setLook(wIfMovedFileExists);
FormData fdIfMovedFileExists = new FormData();
fdIfMovedFileExists.left = new FormAttachment(middle, 0);
- fdIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, 2 * margin);
+ fdIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, margin);
fdIfMovedFileExists.right = new FormAttachment(100, 0);
wIfMovedFileExists.setLayoutData(fdIfMovedFileExists);
@@ -1370,12 +1325,13 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
+ focusActionName();
checkIncludeSubFolders();
activeSuccessCondition();
setDateTimeFormat();
@@ -1498,7 +1454,7 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
if (action.sourceFileFolder != null) {
for (int i = 0; i < action.sourceFileFolder.length; i++) {
@@ -1597,9 +1553,11 @@ public class ActionPGPDecryptFilesDialog extends ActionDialog {
wMovedDateTimeFormat.setText(action.getMovedDateTimeFormat());
}
wAddMovedDateBeforeExtension.setSelection(action.isAddMovedDateBeforeExtension());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpencryptfiles/ActionPGPEncryptFilesDialog.java b/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpencryptfiles/ActionPGPEncryptFilesDialog.java
index 4aff20a9ff..f70a4562b6 100644
--- a/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpencryptfiles/ActionPGPEncryptFilesDialog.java
+++ b/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpencryptfiles/ActionPGPEncryptFilesDialog.java
@@ -29,9 +29,7 @@ import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -50,7 +48,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Move Files action settings. */
public class ActionPGPEncryptFilesDialog extends ActionDialog {
@@ -63,8 +60,6 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
public static final String CONST_OVERWRITE_FILE = "overwrite_file";
public static final String CONST_UNIQUE_NAME = "unique_name";
- private Text wName;
-
private Label wlSourceFileFolder;
private Button wbSourceFileFolder;
private Button wbDestinationFileFolder;
@@ -168,52 +163,12 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionPGPEncryptFiles.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionPGPEncryptFiles.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionPGPEncryptFiles.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -253,7 +208,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlGpgExe);
FormData fdlGpgExe = new FormData();
fdlGpgExe.left = new FormAttachment(0, 0);
- fdlGpgExe.top = new FormAttachment(wName, margin);
+ fdlGpgExe.top = new FormAttachment(0, margin);
fdlGpgExe.right = new FormAttachment(middle, -margin);
wlGpgExe.setLayoutData(fdlGpgExe);
@@ -264,7 +219,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
BaseMessages.getString(PKG, CONST_ACTION_PGPENCRYPT_FILES_BROWSE_FILES_LABEL));
FormData fdbbGpgExe = new FormData();
fdbbGpgExe.right = new FormAttachment(100, -margin);
- fdbbGpgExe.top = new FormAttachment(wName, margin);
+ fdbbGpgExe.top = new FormAttachment(0, margin);
wbbGpgExe.setLayoutData(fdbbGpgExe);
wbbGpgExe.addListener(
@@ -279,7 +234,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
wGpgExe.addModifyListener(lsMod);
FormData fdGpgExe = new FormData();
fdGpgExe.left = new FormAttachment(middle, 0);
- fdGpgExe.top = new FormAttachment(wName, margin);
+ fdGpgExe.top = new FormAttachment(0, margin);
fdGpgExe.right = new FormAttachment(wbbGpgExe, -margin);
wGpgExe.setLayoutData(fdGpgExe);
@@ -314,7 +269,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlIncludeSubfolders);
FormData fdlIncludeSubfolders = new FormData();
fdlIncludeSubfolders.left = new FormAttachment(0, 0);
- fdlIncludeSubfolders.top = new FormAttachment(wlAsciiMode, 2 * margin);
+ fdlIncludeSubfolders.top = new FormAttachment(wlAsciiMode, margin);
fdlIncludeSubfolders.right = new FormAttachment(middle, -margin);
wlIncludeSubfolders.setLayoutData(fdlIncludeSubfolders);
wIncludeSubfolders = new Button(wSettings, SWT.CHECK);
@@ -341,7 +296,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlPrevious);
FormData fdlPrevious = new FormData();
fdlPrevious.left = new FormAttachment(0, 0);
- fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, 2 * margin);
+ fdlPrevious.top = new FormAttachment(wlIncludeSubfolders, margin);
fdlPrevious.right = new FormAttachment(middle, -margin);
wlPrevious.setLayoutData(fdlPrevious);
wPrevious = new Button(wSettings, SWT.CHECK);
@@ -363,7 +318,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
});
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(0, margin);
fdSettings.right = new FormAttachment(100, -margin);
wSettings.setLayoutData(fdSettings);
@@ -378,7 +333,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlSourceFileFolder);
FormData fdlSourceFileFolder = new FormData();
fdlSourceFileFolder.left = new FormAttachment(0, 0);
- fdlSourceFileFolder.top = new FormAttachment(wSettings, 2 * margin);
+ fdlSourceFileFolder.top = new FormAttachment(wSettings, margin);
fdlSourceFileFolder.right = new FormAttachment(middle, -margin);
wlSourceFileFolder.setLayoutData(fdlSourceFileFolder);
@@ -422,7 +377,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
wSourceFileFolder.addModifyListener(lsMod);
FormData fdSourceFileFolder = new FormData();
fdSourceFileFolder.left = new FormAttachment(middle, 0);
- fdSourceFileFolder.top = new FormAttachment(wSettings, 2 * margin);
+ fdSourceFileFolder.top = new FormAttachment(wSettings, margin);
fdSourceFileFolder.right = new FormAttachment(wbaSourceFileFolder, -margin);
wSourceFileFolder.setLayoutData(fdSourceFileFolder);
@@ -740,7 +695,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlDestinationIsAFile);
FormData fdlDestinationIsAFile = new FormData();
fdlDestinationIsAFile.left = new FormAttachment(0, 0);
- fdlDestinationIsAFile.top = new FormAttachment(wlCreateDestinationFolder, 2 * margin);
+ fdlDestinationIsAFile.top = new FormAttachment(wlCreateDestinationFolder, margin);
fdlDestinationIsAFile.right = new FormAttachment(middle, -margin);
wlDestinationIsAFile.setLayoutData(fdlDestinationIsAFile);
wDestinationIsAFile = new Button(wDestinationFile, SWT.CHECK);
@@ -768,7 +723,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlDoNotKeepFolderStructure);
FormData fdlDoNotKeepFolderStructure = new FormData();
fdlDoNotKeepFolderStructure.left = new FormAttachment(0, 0);
- fdlDoNotKeepFolderStructure.top = new FormAttachment(wlDestinationIsAFile, 2 * margin);
+ fdlDoNotKeepFolderStructure.top = new FormAttachment(wlDestinationIsAFile, margin);
fdlDoNotKeepFolderStructure.right = new FormAttachment(middle, -margin);
wlDoNotKeepFolderStructure.setLayoutData(fdlDoNotKeepFolderStructure);
wDoNotKeepFolderStructure = new Button(wDestinationFile, SWT.CHECK);
@@ -794,7 +749,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddDate);
FormData fdlAddDate = new FormData();
fdlAddDate.left = new FormAttachment(0, 0);
- fdlAddDate.top = new FormAttachment(wlDoNotKeepFolderStructure, 2 * margin);
+ fdlAddDate.top = new FormAttachment(wlDoNotKeepFolderStructure, margin);
fdlAddDate.right = new FormAttachment(middle, -margin);
wlAddDate.setLayoutData(fdlAddDate);
wAddDate = new Button(wDestinationFile, SWT.CHECK);
@@ -819,7 +774,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddTime);
FormData fdlAddTime = new FormData();
fdlAddTime.left = new FormAttachment(0, 0);
- fdlAddTime.top = new FormAttachment(wlAddDate, 2 * margin);
+ fdlAddTime.top = new FormAttachment(wlAddDate, margin);
fdlAddTime.right = new FormAttachment(middle, -margin);
wlAddTime.setLayoutData(fdlAddTime);
wAddTime = new Button(wDestinationFile, SWT.CHECK);
@@ -846,7 +801,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyFormat);
FormData fdlSpecifyFormat = new FormData();
fdlSpecifyFormat.left = new FormAttachment(0, 0);
- fdlSpecifyFormat.top = new FormAttachment(wlAddTime, 2 * margin);
+ fdlSpecifyFormat.top = new FormAttachment(wlAddTime, margin);
fdlSpecifyFormat.right = new FormAttachment(middle, -margin);
wlSpecifyFormat.setLayoutData(fdlSpecifyFormat);
wSpecifyFormat = new Button(wDestinationFile, SWT.CHECK);
@@ -875,7 +830,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlDateTimeFormat);
FormData fdlDateTimeFormat = new FormData();
fdlDateTimeFormat.left = new FormAttachment(0, 0);
- fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdlDateTimeFormat.right = new FormAttachment(middle, -margin);
wlDateTimeFormat.setLayoutData(fdlDateTimeFormat);
wDateTimeFormat = new CCombo(wDestinationFile, SWT.BORDER | SWT.READ_ONLY);
@@ -884,7 +839,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
wDateTimeFormat.addModifyListener(lsMod);
FormData fdDateTimeFormat = new FormData();
fdDateTimeFormat.left = new FormAttachment(middle, 0);
- fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdDateTimeFormat.right = new FormAttachment(100, 0);
wDateTimeFormat.setLayoutData(fdDateTimeFormat);
// Prepare a list of possible DateTimeFormats...
@@ -927,7 +882,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
FormData fdlIfFileExists = new FormData();
fdlIfFileExists.left = new FormAttachment(0, 0);
fdlIfFileExists.right = new FormAttachment(middle, 0);
- fdlIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, 2 * margin);
+ fdlIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, margin);
wlIfFileExists.setLayoutData(fdlIfFileExists);
wIfFileExists = new CCombo(wDestinationFile, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wIfFileExists.add(
@@ -945,7 +900,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wIfFileExists);
FormData fdIfFileExists = new FormData();
fdIfFileExists.left = new FormAttachment(middle, 0);
- fdIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, 2 * margin);
+ fdIfFileExists.top = new FormAttachment(wlAddDateBeforeExtension, margin);
fdIfFileExists.right = new FormAttachment(100, 0);
wIfFileExists.setLayoutData(fdIfFileExists);
@@ -962,7 +917,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
FormData fdDestinationFile = new FormData();
fdDestinationFile.left = new FormAttachment(0, margin);
- fdDestinationFile.top = new FormAttachment(wName, margin);
+ fdDestinationFile.top = new FormAttachment(0, margin);
fdDestinationFile.right = new FormAttachment(100, -margin);
wDestinationFile.setLayoutData(fdDestinationFile);
@@ -1053,7 +1008,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddMovedDate);
FormData fdlAddMovedDate = new FormData();
fdlAddMovedDate.left = new FormAttachment(0, 0);
- fdlAddMovedDate.top = new FormAttachment(wlCreateMoveToFolder, 2 * margin);
+ fdlAddMovedDate.top = new FormAttachment(wlCreateMoveToFolder, margin);
fdlAddMovedDate.right = new FormAttachment(middle, -margin);
wlAddMovedDate.setLayoutData(fdlAddMovedDate);
wAddMovedDate = new Button(wMoveToGroup, SWT.CHECK);
@@ -1079,7 +1034,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlAddMovedTime);
FormData fdlAddMovedTime = new FormData();
fdlAddMovedTime.left = new FormAttachment(0, 0);
- fdlAddMovedTime.top = new FormAttachment(wlAddMovedDate, 2 * margin);
+ fdlAddMovedTime.top = new FormAttachment(wlAddMovedDate, margin);
fdlAddMovedTime.right = new FormAttachment(middle, -margin);
wlAddMovedTime.setLayoutData(fdlAddMovedTime);
wAddMovedTime = new Button(wMoveToGroup, SWT.CHECK);
@@ -1107,7 +1062,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyMoveFormat);
FormData fdlSpecifyMoveFormat = new FormData();
fdlSpecifyMoveFormat.left = new FormAttachment(0, 0);
- fdlSpecifyMoveFormat.top = new FormAttachment(wlAddMovedTime, 2 * margin);
+ fdlSpecifyMoveFormat.top = new FormAttachment(wlAddMovedTime, margin);
fdlSpecifyMoveFormat.right = new FormAttachment(middle, -margin);
wlSpecifyMoveFormat.setLayoutData(fdlSpecifyMoveFormat);
wSpecifyMoveFormat = new Button(wMoveToGroup, SWT.CHECK);
@@ -1136,7 +1091,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wlMovedDateTimeFormat);
FormData fdlMovedDateTimeFormat = new FormData();
fdlMovedDateTimeFormat.left = new FormAttachment(0, 0);
- fdlMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, 2 * margin);
+ fdlMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, margin);
fdlMovedDateTimeFormat.right = new FormAttachment(middle, -margin);
wlMovedDateTimeFormat.setLayoutData(fdlMovedDateTimeFormat);
wMovedDateTimeFormat = new CCombo(wMoveToGroup, SWT.BORDER | SWT.READ_ONLY);
@@ -1145,7 +1100,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
wMovedDateTimeFormat.addModifyListener(lsMod);
FormData fdMovedDateTimeFormat = new FormData();
fdMovedDateTimeFormat.left = new FormAttachment(middle, 0);
- fdMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, 2 * margin);
+ fdMovedDateTimeFormat.top = new FormAttachment(wlSpecifyMoveFormat, margin);
fdMovedDateTimeFormat.right = new FormAttachment(100, 0);
wMovedDateTimeFormat.setLayoutData(fdMovedDateTimeFormat);
@@ -1189,7 +1144,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
FormData fdlIfMovedFileExists = new FormData();
fdlIfMovedFileExists.left = new FormAttachment(0, 0);
fdlIfMovedFileExists.right = new FormAttachment(middle, 0);
- fdlIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, 2 * margin);
+ fdlIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, margin);
wlIfMovedFileExists.setLayoutData(fdlIfMovedFileExists);
wIfMovedFileExists = new CCombo(wMoveToGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wIfMovedFileExists.add(
@@ -1205,7 +1160,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
PropsUi.setLook(wIfMovedFileExists);
FormData fdIfMovedFileExists = new FormData();
fdIfMovedFileExists.left = new FormAttachment(middle, 0);
- fdIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, 2 * margin);
+ fdIfMovedFileExists.top = new FormAttachment(wlAddMovedDateBeforeExtension, margin);
fdIfMovedFileExists.right = new FormAttachment(100, 0);
wIfMovedFileExists.setLayoutData(fdIfMovedFileExists);
@@ -1398,12 +1353,13 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
+ focusActionName();
checkIncludeSubFolders();
activeSuccessCondition();
setDateTimeFormat();
@@ -1526,7 +1482,7 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
if (action.sourceFileFolder != null) {
for (int i = 0; i < action.sourceFileFolder.length; i++) {
TableItem ti = wFields.table.getItem(i);
@@ -1626,9 +1582,11 @@ public class ActionPGPEncryptFilesDialog extends ActionDialog {
wMovedDateTimeFormat.setText(action.getMovedDateTimeFormat());
}
wAddMovedDateBeforeExtension.setSelection(action.isAddMovedDateBeforeExtension());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpverify/ActionPGPVerifyDialog.java b/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpverify/ActionPGPVerifyDialog.java
index 341336369c..02a74618aa 100644
--- a/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpverify/ActionPGPVerifyDialog.java
+++ b/plugins/actions/pgpfiles/src/main/java/org/apache/hop/workflow/actions/pgpverify/ActionPGPVerifyDialog.java
@@ -25,9 +25,7 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -41,7 +39,6 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This defines a PGP verify action. */
public class ActionPGPVerifyDialog extends ActionDialog {
@@ -53,8 +50,6 @@ public class ActionPGPVerifyDialog extends ActionDialog {
new String[] {BaseMessages.getString(PKG, "ActionPGPVerify.Filetype.All")};
public static final String CONST_SYSTEM_BUTTON_BROWSE = "System.Button.Browse";
- private Text wName;
-
private TextVar wGPGLocation;
private TextVar wFilename;
@@ -82,54 +77,12 @@ public class ActionPGPVerifyDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionPGPVerify.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionPGPVerify.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // GPGLocation line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionPGPVerify.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // ////////////////////////
- // START OF SERVER SETTINGS GROUP///
- // /
Group wSettings = new Group(shell, SWT.SHADOW_NONE);
PropsUi.setLook(wSettings);
wSettings.setText(BaseMessages.getString(PKG, "ActionPGPVerify.Settings.Group.Label"));
@@ -146,7 +99,7 @@ public class ActionPGPVerifyDialog extends ActionDialog {
PropsUi.setLook(wlGPGLocation);
FormData fdlGPGLocation = new FormData();
fdlGPGLocation.left = new FormAttachment(0, 0);
- fdlGPGLocation.top = new FormAttachment(wName, margin);
+ fdlGPGLocation.top = new FormAttachment(0, margin);
fdlGPGLocation.right = new FormAttachment(middle, -margin);
wlGPGLocation.setLayoutData(fdlGPGLocation);
@@ -155,7 +108,7 @@ public class ActionPGPVerifyDialog extends ActionDialog {
wbGPGLocation.setText(BaseMessages.getString(PKG, CONST_SYSTEM_BUTTON_BROWSE));
FormData fdbGPGLocation = new FormData();
fdbGPGLocation.right = new FormAttachment(100, 0);
- fdbGPGLocation.top = new FormAttachment(wName, 0);
+ fdbGPGLocation.top = new FormAttachment(0, margin);
wbGPGLocation.setLayoutData(fdbGPGLocation);
wGPGLocation = new TextVar(variables, wSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -163,7 +116,7 @@ public class ActionPGPVerifyDialog extends ActionDialog {
wGPGLocation.addModifyListener(lsMod);
FormData fdGPGLocation = new FormData();
fdGPGLocation.left = new FormAttachment(middle, 0);
- fdGPGLocation.top = new FormAttachment(wName, margin);
+ fdGPGLocation.top = new FormAttachment(0, margin);
fdGPGLocation.right = new FormAttachment(wbGPGLocation, -margin);
wGPGLocation.setLayoutData(fdGPGLocation);
@@ -182,7 +135,7 @@ public class ActionPGPVerifyDialog extends ActionDialog {
wbFilename.setText(BaseMessages.getString(PKG, CONST_SYSTEM_BUTTON_BROWSE));
FormData fdbFilename = new FormData();
fdbFilename.right = new FormAttachment(100, 0);
- fdbFilename.top = new FormAttachment(wGPGLocation, 0);
+ fdbFilename.top = new FormAttachment(wGPGLocation, margin);
wbFilename.setLayoutData(fdbFilename);
wFilename = new TextVar(variables, wSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -209,7 +162,7 @@ public class ActionPGPVerifyDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionPGPVerify.useDetachedSignature.Tooltip"));
FormData fdUseDetachedSignature = new FormData();
fdUseDetachedSignature.left = new FormAttachment(middle, 0);
- fdUseDetachedSignature.top = new FormAttachment(wlUseDetachedSignature, 0, SWT.CENTER);
+ fdUseDetachedSignature.top = new FormAttachment(wFilename, margin);
fdUseDetachedSignature.right = new FormAttachment(100, -margin);
wUseDetachedSignature.setLayoutData(fdUseDetachedSignature);
wUseDetachedSignature.addSelectionListener(
@@ -228,7 +181,7 @@ public class ActionPGPVerifyDialog extends ActionDialog {
PropsUi.setLook(wlDetachedFilename);
FormData fdlDetachedFilename = new FormData();
fdlDetachedFilename.left = new FormAttachment(0, 0);
- fdlDetachedFilename.top = new FormAttachment(wlUseDetachedSignature, 2 * margin);
+ fdlDetachedFilename.top = new FormAttachment(wlUseDetachedSignature, margin);
fdlDetachedFilename.right = new FormAttachment(middle, -margin);
wlDetachedFilename.setLayoutData(fdlDetachedFilename);
@@ -279,15 +232,16 @@ public class ActionPGPVerifyDialog extends ActionDialog {
FormData fdSettings = new FormData();
fdSettings.left = new FormAttachment(0, margin);
- fdSettings.top = new FormAttachment(wName, margin);
+ fdSettings.top = new FormAttachment(wSpacer, margin);
fdSettings.right = new FormAttachment(100, -margin);
- fdSettings.bottom = new FormAttachment(wOk, -2 * margin);
+ fdSettings.bottom = new FormAttachment(wCancel, -margin);
wSettings.setLayoutData(fdSettings);
// ///////////////////////////////////////////////////////////
// / END OF Advanced SETTINGS GROUP
// ///////////////////////////////////////////////////////////
getData();
+ focusActionName();
enableDetachedSignature();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -297,7 +251,7 @@ public class ActionPGPVerifyDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
if (action.getGPGLocation() != null) {
wGPGLocation.setText(action.getGPGLocation());
}
@@ -308,9 +262,11 @@ public class ActionPGPVerifyDialog extends ActionDialog {
wDetachedFilename.setText(action.getDetachedfilename());
}
wUseDetachedSignature.setSelection(action.useDetachedfilename());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/ping/src/main/java/org/apache/hop/workflow/actions/ping/ActionPingDialog.java b/plugins/actions/ping/src/main/java/org/apache/hop/workflow/actions/ping/ActionPingDialog.java
index 86efbb2582..021f1837d5 100644
--- a/plugins/actions/ping/src/main/java/org/apache/hop/workflow/actions/ping/ActionPingDialog.java
+++ b/plugins/actions/ping/src/main/java/org/apache/hop/workflow/actions/ping/ActionPingDialog.java
@@ -25,9 +25,7 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -37,18 +35,13 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the ping action settings. */
public class ActionPingDialog extends ActionDialog {
private static final Class<?> PKG = ActionPing.class;
- private Text wName;
-
private TextVar wHostname;
private Label wlTimeOut;
@@ -74,43 +67,12 @@ public class ActionPingDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionPing.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 250);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionPing.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ ModifyListener lsMod = e -> action.setChanged();
// hostname line
Label wlHostname = new Label(shell, SWT.RIGHT);
@@ -118,7 +80,7 @@ public class ActionPingDialog extends ActionDialog {
PropsUi.setLook(wlHostname);
FormData fdlHostname = new FormData();
fdlHostname.left = new FormAttachment(0, 0);
- fdlHostname.top = new FormAttachment(wName, margin);
+ fdlHostname.top = new FormAttachment(wSpacer, margin);
fdlHostname.right = new FormAttachment(middle, -margin);
wlHostname.setLayoutData(fdlHostname);
@@ -127,7 +89,7 @@ public class ActionPingDialog extends ActionDialog {
wHostname.addModifyListener(lsMod);
FormData fdHostname = new FormData();
fdHostname.left = new FormAttachment(middle, 0);
- fdHostname.top = new FormAttachment(wName, margin);
+ fdHostname.top = new FormAttachment(wlHostname, 0, SWT.CENTER);
fdHostname.right = new FormAttachment(100, 0);
wHostname.setLayoutData(fdHostname);
@@ -202,18 +164,9 @@ public class ActionPingDialog extends ActionDialog {
fdNbrPackets.right = new FormAttachment(100, 0);
wNbrPackets.setLayoutData(fdNbrPackets);
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
getData();
setPingType();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -254,9 +207,11 @@ public class ActionPingDialog extends ActionDialog {
}
wPingType.select(action.ipingtype);
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/repeat/src/main/java/org/apache/hop/workflow/actions/repeat/EndRepeatDialog.java b/plugins/actions/repeat/src/main/java/org/apache/hop/workflow/actions/repeat/EndRepeatDialog.java
index ed698acd3a..94f940d3b0 100644
--- a/plugins/actions/repeat/src/main/java/org/apache/hop/workflow/actions/repeat/EndRepeatDialog.java
+++ b/plugins/actions/repeat/src/main/java/org/apache/hop/workflow/actions/repeat/EndRepeatDialog.java
@@ -21,22 +21,13 @@ import org.apache.hop.core.Const;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.i18n.BaseMessages;
-import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
public class EndRepeatDialog extends ActionDialog {
@@ -44,8 +35,6 @@ public class EndRepeatDialog extends ActionDialog {
private EndRepeat action;
- private Text wName;
-
public EndRepeatDialog(
Shell parent, EndRepeat action, WorkflowMeta workflowMeta, IVariables variables) {
super(parent, workflowMeta, variables);
@@ -58,51 +47,12 @@ public class EndRepeatDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
+ createShell(BaseMessages.getString(PKG, "EndRepeat.Name"), action);
shell.setMinimumSize(400, 130);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "EndRepeat.Name"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
getData();
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -115,9 +65,11 @@ public class EndRepeatDialog extends ActionDialog {
private void getData() {
wName.setText(Const.NVL(action.getName(), ""));
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
public void ok() {
diff --git a/plugins/actions/repeat/src/main/java/org/apache/hop/workflow/actions/repeat/RepeatDialog.java b/plugins/actions/repeat/src/main/java/org/apache/hop/workflow/actions/repeat/RepeatDialog.java
index b6f73b815e..00e1b8f0df 100644
--- a/plugins/actions/repeat/src/main/java/org/apache/hop/workflow/actions/repeat/RepeatDialog.java
+++ b/plugins/actions/repeat/src/main/java/org/apache/hop/workflow/actions/repeat/RepeatDialog.java
@@ -36,9 +36,7 @@ import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
import org.apache.hop.ui.hopgui.file.pipeline.HopPipelineFileType;
import org.apache.hop.ui.hopgui.file.workflow.HopWorkflowFileType;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.config.WorkflowRunConfiguration;
@@ -52,7 +50,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
public class RepeatDialog extends ActionDialog {
@@ -62,7 +59,6 @@ public class RepeatDialog extends ActionDialog {
private Repeat action;
- private Text wName;
private TextVar wFilename;
private TextVar wVariableName;
private TextVar wVariableValue;
@@ -99,43 +95,16 @@ public class RepeatDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "Repeat.Name"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "Repeat.Name"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText("Action name");
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
- Control lastControl = wName;
+ Control lastControl = wSpacer;
Label wlFilename = new Label(shell, SWT.RIGHT);
wlFilename.setText(BaseMessages.getString(PKG, "Repeat.FileToRepeat.Label"));
PropsUi.setLook(wlFilename);
FormData fdlFilename = new FormData();
- fdlFilename.left = new FormAttachment(0, 0);
+ fdlFilename.left = new FormAttachment(0, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
fdlFilename.top = new FormAttachment(lastControl, margin);
wlFilename.setLayoutData(fdlFilename);
@@ -168,7 +137,7 @@ public class RepeatDialog extends ActionDialog {
PropsUi.setLook(wlRunConfiguration);
FormData fdlRunConfiguration = new FormData();
fdlRunConfiguration.left = new FormAttachment(0, 0);
- fdlRunConfiguration.top = new FormAttachment(lastControl, Const.isOSX() ? 0 : 5);
+ fdlRunConfiguration.top = new FormAttachment(lastControl, margin);
fdlRunConfiguration.right = new FormAttachment(middle, -margin);
wlRunConfiguration.setLayoutData(fdlRunConfiguration);
@@ -399,9 +368,9 @@ public class RepeatDialog extends ActionDialog {
wLogFileUpdateInterval.setLayoutData(fdLogFileUpdateInterval);
FormData fdLogFileGroup = new FormData();
- fdLogFileGroup.left = new FormAttachment(0, 0);
- fdLogFileGroup.right = new FormAttachment(100, 0);
- fdLogFileGroup.top = new FormAttachment(lastControl, 2 * margin);
+ fdLogFileGroup.left = new FormAttachment(0, margin);
+ fdLogFileGroup.right = new FormAttachment(100, -margin);
+ fdLogFileGroup.top = new FormAttachment(lastControl, margin);
wLogFileGroup.setLayoutData(fdLogFileGroup);
wLogFileGroup.pack();
lastControl = wLogFileGroup;
@@ -412,31 +381,12 @@ public class RepeatDialog extends ActionDialog {
wlParameters.setText(BaseMessages.getString(PKG, "Repeat.ParmsVarGroup.Label"));
PropsUi.setLook(wlParameters);
FormData fdlParameters = new FormData();
- fdlParameters.left = new FormAttachment(0, 0);
- fdlParameters.top = new FormAttachment(lastControl, 2 * margin);
+ fdlParameters.left = new FormAttachment(0, margin);
+ fdlParameters.top = new FormAttachment(lastControl, margin);
fdlParameters.right = new FormAttachment(100, 0);
wlParameters.setLayoutData(fdlParameters);
lastControl = wlParameters;
- // Add buttons first, then the script field can use dynamic sizing
- //
- Button wOK = new Button(shell, SWT.PUSH);
- wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOK.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
-
- // Put these buttons at the bottom
- //
- BaseTransformDialog.positionBottomButtons(
- shell,
- new Button[] {
- wOK, wCancel,
- },
- margin,
- null);
-
ColumnInfo[] columnInfos =
new ColumnInfo[] {
new ColumnInfo(
@@ -457,14 +407,14 @@ public class RepeatDialog extends ActionDialog {
variables, shell, SWT.BORDER, columnInfos, action.getParameters().size(), null, props);
PropsUi.setLook(wParameters);
FormData fdParameters = new FormData();
- fdParameters.left = new FormAttachment(0, 0);
- fdParameters.right = new FormAttachment(100, 0);
+ fdParameters.left = new FormAttachment(0, margin);
+ fdParameters.right = new FormAttachment(100, -margin);
fdParameters.top = new FormAttachment(lastControl, margin);
- fdParameters.bottom = new FormAttachment(wOK, -margin * 2);
+ fdParameters.bottom = new FormAttachment(wCancel, -margin);
wParameters.setLayoutData(fdParameters);
getData();
-
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
@@ -584,12 +534,14 @@ public class RepeatDialog extends ActionDialog {
}
}
- wName.selectAll();
- wName.setFocus();
-
enableControls();
}
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
+ }
+
private void ok() {
if (Utils.isEmpty(wName.getText())) {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
diff --git a/plugins/actions/sendnagiospassivecheck/src/main/java/org/apache/hop/workflow/actions/sendnagiospassivecheck/ActionSendNagiosPassiveCheckDialog.java b/plugins/actions/sendnagiospassivecheck/src/main/java/org/apache/hop/workflow/actions/sendnagiospassivecheck/ActionSendNagiosPassiveCheckDialog.java
index 0f4a25654f..8f30594015 100644
--- a/plugins/actions/sendnagiospassivecheck/src/main/java/org/apache/hop/workflow/actions/sendnagiospassivecheck/ActionSendNagiosPassiveCheckDialog.java
+++ b/plugins/actions/sendnagiospassivecheck/src/main/java/org/apache/hop/workflow/actions/sendnagiospassivecheck/ActionSendNagiosPassiveCheckDialog.java
@@ -27,12 +27,9 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.gui.GuiResource;
-import org.apache.hop.ui.core.widget.LabelText;
import org.apache.hop.ui.core.widget.LabelTextVar;
import org.apache.hop.ui.core.widget.StyledTextComp;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -55,8 +52,6 @@ import org.eclipse.swt.widgets.Shell;
public class ActionSendNagiosPassiveCheckDialog extends ActionDialog {
private static final Class<?> PKG = ActionSendNagiosPassiveCheck.class;
- private LabelText wName;
-
private LabelTextVar wServerName;
private LabelTextVar wResponseTimeOut;
@@ -95,48 +90,12 @@ public class ActionSendNagiosPassiveCheckDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionSendNagiosPassiveCheck.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionSendNagiosPassiveCheck.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Action name line
- wName =
- new LabelText(
- shell,
- BaseMessages.getString(PKG, "ActionSendNagiosPassiveCheck.Name.Label"),
- BaseMessages.getString(PKG, "ActionSendNagiosPassiveCheck.Name.Tooltip"));
- wName.addModifyListener(lsMod);
- PropsUi.setLook(wName);
- FormData fdName = new FormData();
- fdName.top = new FormAttachment(0, 0);
- fdName.left = new FormAttachment(0, 0);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -182,7 +141,7 @@ public class ActionSendNagiosPassiveCheckDialog extends ActionDialog {
wServerName.addModifyListener(lsMod);
FormData fdServerName = new FormData();
fdServerName.left = new FormAttachment(0, 0);
- fdServerName.top = new FormAttachment(wName, margin);
+ fdServerName.top = new FormAttachment(0, margin);
fdServerName.right = new FormAttachment(100, 0);
wServerName.setLayoutData(fdServerName);
@@ -261,7 +220,7 @@ public class ActionSendNagiosPassiveCheckDialog extends ActionDialog {
FormData fdServerSettings = new FormData();
fdServerSettings.left = new FormAttachment(0, margin);
- fdServerSettings.top = new FormAttachment(wName, margin);
+ fdServerSettings.top = new FormAttachment(0, margin);
fdServerSettings.right = new FormAttachment(100, -margin);
wServerSettings.setLayoutData(fdServerSettings);
// ///////////////////////////////////////////////////////////
@@ -436,12 +395,13 @@ public class ActionSendNagiosPassiveCheckDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
+ focusActionName();
wTabFolder.setSelection(0);
@@ -487,7 +447,7 @@ public class ActionSendNagiosPassiveCheckDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
wServerName.setText(Const.NVL(action.getServerName(), ""));
wPort.setText(Const.nullToEmpty(action.getPort()));
@@ -501,9 +461,11 @@ public class ActionSendNagiosPassiveCheckDialog extends ActionDialog {
ActionSendNagiosPassiveCheck.getEncryptionModeDesc(
action.getEncryptionMode().getOriginalCode()));
wLevelMode.setText(ActionSendNagiosPassiveCheck.getLevelDesc(action.getLevel()));
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/setvariables/src/main/java/org/apache/hop/workflow/actions/setvariables/ActionSetVariablesDialog.java b/plugins/actions/setvariables/src/main/java/org/apache/hop/workflow/actions/setvariables/ActionSetVariablesDialog.java
index 2dcaad5cbf..c0fd48400a 100644
--- a/plugins/actions/setvariables/src/main/java/org/apache/hop/workflow/actions/setvariables/ActionSetVariablesDialog.java
+++ b/plugins/actions/setvariables/src/main/java/org/apache/hop/workflow/actions/setvariables/ActionSetVariablesDialog.java
@@ -29,9 +29,7 @@ import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.actions.setvariables.ActionSetVariables.VariableDefinition;
@@ -47,14 +45,11 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Set variables action settings. */
public class ActionSetVariablesDialog extends ActionDialog {
private static final Class<?> PKG = ActionSetVariables.class;
- private Text wName;
-
private Button wVarSubs;
private ActionSetVariables action;
@@ -79,52 +74,12 @@ public class ActionSetVariablesDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionSetVariables.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionSetVariables.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionSetVariables.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
Group gFilename = new Group(shell, SWT.SHADOW_NONE);
PropsUi.setLook(gFilename);
gFilename.setText(BaseMessages.getString(PKG, "ActionSetVariables.FilenameGroup.Label"));
@@ -174,7 +129,7 @@ public class ActionSetVariablesDialog extends ActionDialog {
FormData fdgFilename = new FormData();
fdgFilename.left = new FormAttachment(0, margin);
- fdgFilename.top = new FormAttachment(wName, margin);
+ fdgFilename.top = new FormAttachment(wSpacer, margin);
fdgFilename.right = new FormAttachment(100, -margin);
gFilename.setLayoutData(fdgFilename);
@@ -195,7 +150,7 @@ public class ActionSetVariablesDialog extends ActionDialog {
PropsUi.setLook(wlVarSubs);
FormData fdlVarSubs = new FormData();
fdlVarSubs.left = new FormAttachment(0, 0);
- fdlVarSubs.top = new FormAttachment(wName, margin);
+ fdlVarSubs.top = new FormAttachment(0, margin);
fdlVarSubs.right = new FormAttachment(middle, -margin);
wlVarSubs.setLayoutData(fdlVarSubs);
wVarSubs = new Button(gSettings, SWT.CHECK);
@@ -261,10 +216,11 @@ public class ActionSetVariablesDialog extends ActionDialog {
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
fdFields.right = new FormAttachment(100, 0);
- fdFields.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFields.bottom = new FormAttachment(wCancel, -margin);
wFields.setLayoutData(fdFields);
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -291,9 +247,11 @@ public class ActionSetVariablesDialog extends ActionDialog {
wFields.setRowNums();
wFields.optWidth(true);
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/shell/src/main/java/org/apache/hop/workflow/actions/shell/ActionShellDialog.java b/plugins/actions/shell/src/main/java/org/apache/hop/workflow/actions/shell/ActionShellDialog.java
index 81c56f720e..ba16246c4d 100644
--- a/plugins/actions/shell/src/main/java/org/apache/hop/workflow/actions/shell/ActionShellDialog.java
+++ b/plugins/actions/shell/src/main/java/org/apache/hop/workflow/actions/shell/ActionShellDialog.java
@@ -31,9 +31,7 @@ import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -65,8 +63,6 @@ public class ActionShellDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionShell.Fileformat.All")
};
- private Text wName;
-
private Label wlFilename;
private Button wbFilename;
@@ -135,12 +131,10 @@ public class ActionShellDialog extends ActionDialog {
@Override
public IAction open() {
-
display = getParent().getDisplay();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionShell.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
backupChanged = action.hasChanged();
@@ -148,45 +142,6 @@ public class ActionShellDialog extends ActionDialog {
backupDate = action.addDate;
backupTime = action.addTime;
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionShell.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionShell.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.top = new FormAttachment(0, margin);
- fdlName.right = new FormAttachment(middle, -margin);
- wlName.setLayoutData(fdlName);
-
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.top = new FormAttachment(0, 0);
- fdName.left = new FormAttachment(middle, 0);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -240,7 +195,7 @@ public class ActionShellDialog extends ActionDialog {
PropsUi.setLook(wlFilename);
FormData fdlFilename = new FormData();
fdlFilename.left = new FormAttachment(0, 0);
- fdlFilename.top = new FormAttachment(wInsertScript, 2 * margin);
+ fdlFilename.top = new FormAttachment(wInsertScript, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
@@ -279,7 +234,7 @@ public class ActionShellDialog extends ActionDialog {
PropsUi.setLook(wlWorkDirectory);
FormData fdlWorkDirectory = new FormData();
fdlWorkDirectory.left = new FormAttachment(0, 0);
- fdlWorkDirectory.top = new FormAttachment(wFilename, 2 * margin);
+ fdlWorkDirectory.top = new FormAttachment(wFilename, margin);
fdlWorkDirectory.right = new FormAttachment(middle, -margin);
wlWorkDirectory.setLayoutData(fdlWorkDirectory);
@@ -336,7 +291,7 @@ public class ActionShellDialog extends ActionDialog {
PropsUi.setLook(wlAppendLogfile);
FormData fdlAppendLogfile = new FormData();
fdlAppendLogfile.left = new FormAttachment(0, 0);
- fdlAppendLogfile.top = new FormAttachment(wSetLogfile, 2 * margin);
+ fdlAppendLogfile.top = new FormAttachment(wSetLogfile, margin);
fdlAppendLogfile.right = new FormAttachment(middle, -margin);
wlAppendLogfile.setLayoutData(fdlAppendLogfile);
wAppendLogfile = new Button(wLogging, SWT.CHECK);
@@ -362,7 +317,7 @@ public class ActionShellDialog extends ActionDialog {
PropsUi.setLook(wlLogfile);
FormData fdlLogfile = new FormData();
fdlLogfile.left = new FormAttachment(0, 0);
- fdlLogfile.top = new FormAttachment(wAppendLogfile, 2 * margin);
+ fdlLogfile.top = new FormAttachment(wAppendLogfile, margin);
fdlLogfile.right = new FormAttachment(middle, -margin);
wlLogfile.setLayoutData(fdlLogfile);
wLogfile = new TextVar(variables, wLogging, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -380,7 +335,7 @@ public class ActionShellDialog extends ActionDialog {
PropsUi.setLook(wlLogExt);
FormData fdlLogExt = new FormData();
fdlLogExt.left = new FormAttachment(0, 0);
- fdlLogExt.top = new FormAttachment(wLogfile, 2 * margin);
+ fdlLogExt.top = new FormAttachment(wLogfile, margin);
fdlLogExt.right = new FormAttachment(middle, -margin);
wlLogExt.setLayoutData(fdlLogExt);
wLogExt = new TextVar(variables, wLogging, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -398,7 +353,7 @@ public class ActionShellDialog extends ActionDialog {
PropsUi.setLook(wlAddDate);
FormData fdlAddDate = new FormData();
fdlAddDate.left = new FormAttachment(0, 0);
- fdlAddDate.top = new FormAttachment(wLogExt, 2 * margin);
+ fdlAddDate.top = new FormAttachment(wLogExt, margin);
fdlAddDate.right = new FormAttachment(middle, -margin);
wlAddDate.setLayoutData(fdlAddDate);
wAddDate = new Button(wLogging, SWT.CHECK);
@@ -423,7 +378,7 @@ public class ActionShellDialog extends ActionDialog {
PropsUi.setLook(wlAddTime);
FormData fdlAddTime = new FormData();
fdlAddTime.left = new FormAttachment(0, 0);
- fdlAddTime.top = new FormAttachment(wAddDate, 2 * margin);
+ fdlAddTime.top = new FormAttachment(wAddDate, margin);
fdlAddTime.right = new FormAttachment(middle, -margin);
wlAddTime.setLayoutData(fdlAddTime);
wAddTime = new Button(wLogging, SWT.CHECK);
@@ -448,7 +403,7 @@ public class ActionShellDialog extends ActionDialog {
FormData fdlLoglevel = new FormData();
fdlLoglevel.left = new FormAttachment(0, 0);
fdlLoglevel.right = new FormAttachment(middle, -margin);
- fdlLoglevel.top = new FormAttachment(wAddTime, 2 * margin);
+ fdlLoglevel.top = new FormAttachment(wAddTime, margin);
wlLoglevel.setLayoutData(fdlLoglevel);
wLoglevel = new CCombo(wLogging, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wLoglevel.setItems(LogLevel.getLogLevelDescriptions());
@@ -502,7 +457,7 @@ public class ActionShellDialog extends ActionDialog {
PropsUi.setLook(wlEveryRow);
FormData fdlEveryRow = new FormData();
fdlEveryRow.left = new FormAttachment(0, 0);
- fdlEveryRow.top = new FormAttachment(wPrevious, 2 * margin);
+ fdlEveryRow.top = new FormAttachment(wPrevious, margin);
fdlEveryRow.right = new FormAttachment(middle, -margin);
wlEveryRow.setLayoutData(fdlEveryRow);
wEveryRow = new Button(wGeneralComp, SWT.CHECK);
@@ -529,7 +484,7 @@ public class ActionShellDialog extends ActionDialog {
PropsUi.setLook(wlFields);
FormData fdlFields = new FormData();
fdlFields.left = new FormAttachment(0, 0);
- fdlFields.top = new FormAttachment(wlEveryRow, 2 * margin);
+ fdlFields.top = new FormAttachment(wlEveryRow, margin);
wlFields.setLayoutData(fdlFields);
final int nrFieldsCols = 1;
@@ -624,15 +579,16 @@ public class ActionShellDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
enableFields();
activeInsertScript();
wTabFolder.setSelection(0);
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -720,9 +676,11 @@ public class ActionShellDialog extends ActionDialog {
wInsertScript.setSelection(action.insertScript);
wScript.setText(Const.nullToEmpty(action.getScript()));
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/simpleeval/src/main/java/org/apache/hop/workflow/actions/simpleeval/ActionSimpleEvalDialog.java b/plugins/actions/simpleeval/src/main/java/org/apache/hop/workflow/actions/simpleeval/ActionSimpleEvalDialog.java
index 41c04b229f..2136607433 100644
--- a/plugins/actions/simpleeval/src/main/java/org/apache/hop/workflow/actions/simpleeval/ActionSimpleEvalDialog.java
+++ b/plugins/actions/simpleeval/src/main/java/org/apache/hop/workflow/actions/simpleeval/ActionSimpleEvalDialog.java
@@ -28,9 +28,7 @@ import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.ComboVar;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.actions.simpleeval.ActionSimpleEval.FieldType;
@@ -50,14 +48,11 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Simple Eval action settings. */
public class ActionSimpleEvalDialog extends ActionDialog {
private static final Class<?> PKG = ActionSimpleEval.class;
- private Text wName;
-
private ActionSimpleEval action;
private boolean changed;
@@ -102,51 +97,11 @@ public class ActionSimpleEvalDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionSimpleEval.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionSimpleEval.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionSimpleEval.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
- wName.addListener(SWT.Modify, e -> action.setChanged());
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -521,15 +476,16 @@ public class ActionSimpleEvalDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
refresh();
wTabFolder.setSelection(0);
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -538,7 +494,9 @@ public class ActionSimpleEvalDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ if (action.getName() != null) {
+ wName.setText(action.getName());
+ }
wValueType.setText(action.getValueType().getDescription());
wFieldName.setText(Const.nullToEmpty(action.getFieldName()));
wVariableName.setText(Const.nullToEmpty(action.getVariableName()));
@@ -551,9 +509,11 @@ public class ActionSimpleEvalDialog extends ActionDialog {
wSuccessStringCondition.setText(action.getSuccessStringCondition().getDescription());
wSuccessNumberCondition.setText(action.getSuccessNumberCondition().getDescription());
wSuccessBooleanCondition.setText(action.getSuccessBooleanCondition().getDescription());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void refresh() {
diff --git a/plugins/actions/snmptrap/src/main/java/org/apache/hop/workflow/actions/snmptrap/ActionSNMPTrapDialog.java b/plugins/actions/snmptrap/src/main/java/org/apache/hop/workflow/actions/snmptrap/ActionSNMPTrapDialog.java
index 582ba617bd..b70cbde3be 100644
--- a/plugins/actions/snmptrap/src/main/java/org/apache/hop/workflow/actions/snmptrap/ActionSNMPTrapDialog.java
+++ b/plugins/actions/snmptrap/src/main/java/org/apache/hop/workflow/actions/snmptrap/ActionSNMPTrapDialog.java
@@ -27,12 +27,9 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.gui.GuiResource;
-import org.apache.hop.ui.core.widget.LabelText;
import org.apache.hop.ui.core.widget.LabelTextVar;
import org.apache.hop.ui.core.widget.StyledTextComp;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -57,8 +54,6 @@ import org.snmp4j.smi.UdpAddress;
public class ActionSNMPTrapDialog extends ActionDialog {
private static final Class<?> PKG = ActionSNMPTrap.class;
- private LabelText wName;
-
private LabelTextVar wServerName;
private LabelTextVar wTimeout;
@@ -96,47 +91,12 @@ public class ActionSNMPTrapDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionSNMPTrap.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionSNMPTrap.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Action name line
- wName =
- new LabelText(
- shell,
- BaseMessages.getString(PKG, "ActionSNMPTrap.Name.Label"),
- BaseMessages.getString(PKG, "ActionSNMPTrap.Name.Tooltip"));
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.top = new FormAttachment(0, 0);
- fdName.left = new FormAttachment(0, 0);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -181,7 +141,7 @@ public class ActionSNMPTrapDialog extends ActionDialog {
wServerName.addModifyListener(lsMod);
FormData fdServerName = new FormData();
fdServerName.left = new FormAttachment(0, 0);
- fdServerName.top = new FormAttachment(wName, margin);
+ fdServerName.top = new FormAttachment(0, margin);
fdServerName.right = new FormAttachment(100, 0);
wServerName.setLayoutData(fdServerName);
@@ -228,7 +188,7 @@ public class ActionSNMPTrapDialog extends ActionDialog {
FormData fdServerSettings = new FormData();
fdServerSettings.left = new FormAttachment(0, margin);
- fdServerSettings.top = new FormAttachment(wName, margin);
+ fdServerSettings.top = new FormAttachment(0, margin);
fdServerSettings.right = new FormAttachment(100, -margin);
wServerSettings.setLayoutData(fdServerSettings);
// ///////////////////////////////////////////////////////////
@@ -433,12 +393,13 @@ public class ActionSNMPTrapDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
+ focusActionName();
checkUseUserTarget();
wTabFolder.setSelection(0);
@@ -494,7 +455,7 @@ public class ActionSNMPTrapDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
+ wName.setText(Const.NVL(action.getName(), ""));
wServerName.setText(Const.NVL(action.getServerName(), ""));
wPort.setText(action.getPort());
wOID.setText(Const.NVL(action.getOid(), ""));
@@ -506,9 +467,11 @@ public class ActionSNMPTrapDialog extends ActionDialog {
wUser.setText(Const.NVL(action.getUser(), ""));
wPassphrase.setText(Const.NVL(action.getPassphrase(), ""));
wEngineID.setText(Const.NVL(action.getEngineid(), ""));
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/snowflake/src/main/java/org/apache/hop/workflow/actions/snowflake/WarehouseManagerDialog.java b/plugins/actions/snowflake/src/main/java/org/apache/hop/workflow/actions/snowflake/WarehouseManagerDialog.java
index 082f32b603..3434971929 100644
--- a/plugins/actions/snowflake/src/main/java/org/apache/hop/workflow/actions/snowflake/WarehouseManagerDialog.java
+++ b/plugins/actions/snowflake/src/main/java/org/apache/hop/workflow/actions/snowflake/WarehouseManagerDialog.java
@@ -27,13 +27,13 @@ import org.apache.hop.core.util.StringUtil;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.i18n.BaseMessages;
import org.apache.hop.ui.core.PropsUi;
+import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.gui.WindowProperty;
import org.apache.hop.ui.core.widget.ComboVar;
import org.apache.hop.ui.core.widget.MetaSelectionLine;
import org.apache.hop.ui.core.widget.TextVar;
import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
@@ -44,19 +44,14 @@ import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
public class WarehouseManagerDialog extends ActionDialog implements IActionDialog {
@@ -91,8 +86,6 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
private WarehouseManager warehouseManager;
- private Text wName;
-
private MetaSelectionLine<DatabaseMeta> wConnection;
private ComboVar wWarehouseName;
@@ -157,8 +150,6 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
private boolean backupChanged;
- private Shell shell;
-
public WarehouseManagerDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
super(parent, workflowMeta, variables);
@@ -166,49 +157,17 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
}
public IAction open() {
- Shell parent = getParent();
- Display display = parent.getDisplay();
-
- shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, warehouseManager);
-
+ createShell(
+ BaseMessages.getString(PKG, "SnowflakeWarehouseManager.Dialog.Title"), warehouseManager);
ModifyListener lsMod = e -> warehouseManager.setChanged();
backupChanged = warehouseManager.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "SnowflakeWarehouseManager.Dialog.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "SnowflakeWarehouseManager.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.top = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- wlName.setLayoutData(fdlName);
-
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- FormData fdName = new FormData();
- fdName.top = new FormAttachment(0, 0);
- fdName.left = new FormAttachment(middle, 0);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // Connection line
- // Connection line
+ int middle = this.middle;
+ int margin = this.margin;
+
DatabaseMeta databaseMeta =
workflowMeta.findDatabase(warehouseManager.getConnection(), variables);
- wConnection = addConnectionLine(shell, wName, databaseMeta, lsMod);
+ wConnection = addConnectionLine(shell, wSpacer, databaseMeta, lsMod);
// if (warehouseManager.getDatabaseMeta() == null && workflowMeta.nrDatabases() == 1) {
// wConnection.select(0);
// }
@@ -221,7 +180,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlWarehouseName);
FormData fdlWarehouseName = new FormData();
fdlWarehouseName.left = new FormAttachment(0, 0);
- fdlWarehouseName.top = new FormAttachment(wConnection, margin * 2);
+ fdlWarehouseName.top = new FormAttachment(wConnection, margin);
fdlWarehouseName.right = new FormAttachment(middle, -margin);
wlWarehouseName.setLayoutData(fdlWarehouseName);
@@ -229,7 +188,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wWarehouseName);
FormData fdWarehouseName = new FormData();
fdWarehouseName.left = new FormAttachment(middle, 0);
- fdWarehouseName.top = new FormAttachment(wConnection, margin * 2);
+ fdWarehouseName.top = new FormAttachment(wConnection, margin);
fdWarehouseName.right = new FormAttachment(100, 0);
wWarehouseName.setLayoutData(fdWarehouseName);
wWarehouseName.addFocusListener(
@@ -323,7 +282,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
FormData fdgCreateGroup = new FormData();
fdgCreateGroup.left = new FormAttachment(0, 0);
fdgCreateGroup.right = new FormAttachment(100, 0);
- fdgCreateGroup.top = new FormAttachment(wAction, margin * 2);
+ fdgCreateGroup.top = new FormAttachment(wAction, margin);
wCreateGroup.setLayoutData(fdgCreateGroup);
// //////////////////////
@@ -337,7 +296,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateReplace);
FormData fdlCreateReplace = new FormData();
fdlCreateReplace.left = new FormAttachment(0, 0);
- fdlCreateReplace.top = new FormAttachment(0, margin * 2);
+ fdlCreateReplace.top = new FormAttachment(0, margin);
fdlCreateReplace.right = new FormAttachment(middle, -margin);
wlCreateReplace.setLayoutData(fdlCreateReplace);
@@ -345,7 +304,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wCreateReplace);
FormData fdCreateReplace = new FormData();
fdCreateReplace.left = new FormAttachment(middle, 0);
- fdCreateReplace.top = new FormAttachment(0, margin * 2);
+ fdCreateReplace.top = new FormAttachment(0, margin);
fdCreateReplace.right = new FormAttachment(100, 0);
wCreateReplace.setLayoutData(fdCreateReplace);
wCreateReplace.addListener(SWT.Selection, e -> warehouseManager.setChanged());
@@ -360,7 +319,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateFailIfExists);
FormData fdlCreateFailIfExists = new FormData();
fdlCreateFailIfExists.left = new FormAttachment(0, 0);
- fdlCreateFailIfExists.top = new FormAttachment(wCreateReplace, margin * 2);
+ fdlCreateFailIfExists.top = new FormAttachment(wCreateReplace, margin);
fdlCreateFailIfExists.right = new FormAttachment(middle, -margin);
wlCreateFailIfExists.setLayoutData(fdlCreateFailIfExists);
@@ -368,7 +327,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wCreateFailIfExists);
FormData fdCreateFailIfExists = new FormData();
fdCreateFailIfExists.left = new FormAttachment(middle, 0);
- fdCreateFailIfExists.top = new FormAttachment(wCreateReplace, margin * 2);
+ fdCreateFailIfExists.top = new FormAttachment(wCreateReplace, margin);
fdCreateFailIfExists.right = new FormAttachment(100, 0);
wCreateFailIfExists.setLayoutData(fdCreateFailIfExists);
wCreateFailIfExists.addListener(SWT.Selection, e -> warehouseManager.setChanged());
@@ -381,7 +340,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateWarehouseSize);
FormData fdlCreateWarehouseSize = new FormData();
fdlCreateWarehouseSize.left = new FormAttachment(0, 0);
- fdlCreateWarehouseSize.top = new FormAttachment(wCreateFailIfExists, margin * 2);
+ fdlCreateWarehouseSize.top = new FormAttachment(wCreateFailIfExists, margin);
fdlCreateWarehouseSize.right = new FormAttachment(middle, -margin);
wlCreateWarehouseSize.setLayoutData(fdlCreateWarehouseSize);
@@ -391,7 +350,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
wCreateWarehouseSize.addListener(SWT.Modify, e -> warehouseManager.setChanged());
FormData fdCreateWarehouseSize = new FormData();
fdCreateWarehouseSize.left = new FormAttachment(middle, 0);
- fdCreateWarehouseSize.top = new FormAttachment(wCreateFailIfExists, margin * 2);
+ fdCreateWarehouseSize.top = new FormAttachment(wCreateFailIfExists, margin);
fdCreateWarehouseSize.right = new FormAttachment(100, 0);
wCreateWarehouseSize.setLayoutData(fdCreateWarehouseSize);
wCreateWarehouseSize.setItems(WAREHOUSE_SIZE_DESCS);
@@ -404,7 +363,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateWarehouseType);
FormData fdlCreateWarehouseType = new FormData();
fdlCreateWarehouseType.left = new FormAttachment(0, 0);
- fdlCreateWarehouseType.top = new FormAttachment(wCreateWarehouseSize, margin * 2);
+ fdlCreateWarehouseType.top = new FormAttachment(wCreateWarehouseSize, margin);
fdlCreateWarehouseType.right = new FormAttachment(middle, -margin);
wlCreateWarehouseType.setLayoutData(fdlCreateWarehouseType);
@@ -414,7 +373,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
wCreateWarehouseType.addListener(SWT.Modify, e -> warehouseManager.setChanged());
FormData fdCreateWarehouseType = new FormData();
fdCreateWarehouseType.left = new FormAttachment(middle, 0);
- fdCreateWarehouseType.top = new FormAttachment(wCreateWarehouseSize, margin * 2);
+ fdCreateWarehouseType.top = new FormAttachment(wCreateWarehouseSize, margin);
fdCreateWarehouseType.right = new FormAttachment(100, 0);
wCreateWarehouseType.setLayoutData(fdCreateWarehouseType);
wCreateWarehouseType.setItems(WAREHOUSE_TYPE_DESCS);
@@ -429,7 +388,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateMaxClusterSize);
FormData fdlCreateMaxClusterSize = new FormData();
fdlCreateMaxClusterSize.left = new FormAttachment(0, 0);
- fdlCreateMaxClusterSize.top = new FormAttachment(wCreateWarehouseType, margin * 2);
+ fdlCreateMaxClusterSize.top = new FormAttachment(wCreateWarehouseType, margin);
fdlCreateMaxClusterSize.right = new FormAttachment(middle, -margin);
wlCreateMaxClusterSize.setLayoutData(fdlCreateMaxClusterSize);
@@ -440,7 +399,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
FormData fdCreateMaxClusterSize = new FormData();
fdCreateMaxClusterSize.left = new FormAttachment(middle, 0);
fdCreateMaxClusterSize.right = new FormAttachment(100, 0);
- fdCreateMaxClusterSize.top = new FormAttachment(wCreateWarehouseType, margin * 2);
+ fdCreateMaxClusterSize.top = new FormAttachment(wCreateWarehouseType, margin);
wCreateMaxClusterSize.setLayoutData(fdCreateMaxClusterSize);
// /////////////////////
@@ -453,7 +412,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateMinClusterSize);
FormData fdlCreateMinClusterSize = new FormData();
fdlCreateMinClusterSize.left = new FormAttachment(0, 0);
- fdlCreateMinClusterSize.top = new FormAttachment(wCreateMaxClusterSize, margin * 2);
+ fdlCreateMinClusterSize.top = new FormAttachment(wCreateMaxClusterSize, margin);
fdlCreateMinClusterSize.right = new FormAttachment(middle, -margin);
wlCreateMinClusterSize.setLayoutData(fdlCreateMinClusterSize);
@@ -464,7 +423,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
FormData fdCreateMinClusterSize = new FormData();
fdCreateMinClusterSize.left = new FormAttachment(middle, 0);
fdCreateMinClusterSize.right = new FormAttachment(100, 0);
- fdCreateMinClusterSize.top = new FormAttachment(wCreateMaxClusterSize, margin * 2);
+ fdCreateMinClusterSize.top = new FormAttachment(wCreateMaxClusterSize, margin);
wCreateMinClusterSize.setLayoutData(fdCreateMinClusterSize);
// /////////////////////
@@ -478,7 +437,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateAutoSuspend);
FormData fdlCreateAutoSuspend = new FormData();
fdlCreateAutoSuspend.left = new FormAttachment(0, 0);
- fdlCreateAutoSuspend.top = new FormAttachment(wCreateMinClusterSize, margin * 2);
+ fdlCreateAutoSuspend.top = new FormAttachment(wCreateMinClusterSize, margin);
fdlCreateAutoSuspend.right = new FormAttachment(middle, -margin);
wlCreateAutoSuspend.setLayoutData(fdlCreateAutoSuspend);
@@ -488,7 +447,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
FormData fdCreateAutoSuspend = new FormData();
fdCreateAutoSuspend.left = new FormAttachment(middle, 0);
fdCreateAutoSuspend.right = new FormAttachment(100, 0);
- fdCreateAutoSuspend.top = new FormAttachment(wCreateMinClusterSize, margin * 2);
+ fdCreateAutoSuspend.top = new FormAttachment(wCreateMinClusterSize, margin);
wCreateAutoSuspend.setLayoutData(fdCreateAutoSuspend);
// /////////////////////
@@ -500,7 +459,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateAutoResume);
FormData fdlCreateAutoResume = new FormData();
fdlCreateAutoResume.left = new FormAttachment(0, 0);
- fdlCreateAutoResume.top = new FormAttachment(wCreateAutoSuspend, margin * 2);
+ fdlCreateAutoResume.top = new FormAttachment(wCreateAutoSuspend, margin);
fdlCreateAutoResume.right = new FormAttachment(middle, -margin);
wlCreateAutoResume.setLayoutData(fdlCreateAutoResume);
@@ -508,7 +467,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wCreateAutoResume);
FormData fdCreateAutoResume = new FormData();
fdCreateAutoResume.left = new FormAttachment(middle, 0);
- fdCreateAutoResume.top = new FormAttachment(wCreateAutoSuspend, margin * 2);
+ fdCreateAutoResume.top = new FormAttachment(wCreateAutoSuspend, margin);
fdCreateAutoResume.right = new FormAttachment(100, 0);
wCreateAutoResume.setLayoutData(fdCreateAutoResume);
wCreateAutoResume.addListener(SWT.Selection, e -> warehouseManager.setChanged());
@@ -526,7 +485,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateInitialSuspend);
FormData fdlCreateInitialSuspend = new FormData();
fdlCreateInitialSuspend.left = new FormAttachment(0, 0);
- fdlCreateInitialSuspend.top = new FormAttachment(wCreateAutoResume, margin * 2);
+ fdlCreateInitialSuspend.top = new FormAttachment(wCreateAutoResume, margin);
fdlCreateInitialSuspend.right = new FormAttachment(middle, -margin);
wlCreateInitialSuspend.setLayoutData(fdlCreateInitialSuspend);
@@ -534,7 +493,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wCreateInitialSuspend);
FormData fdCreateInitialSuspend = new FormData();
fdCreateInitialSuspend.left = new FormAttachment(middle, 0);
- fdCreateInitialSuspend.top = new FormAttachment(wCreateAutoResume, margin * 2);
+ fdCreateInitialSuspend.top = new FormAttachment(wCreateAutoResume, margin);
fdCreateInitialSuspend.right = new FormAttachment(100, 0);
wCreateInitialSuspend.setLayoutData(fdCreateInitialSuspend);
wCreateInitialSuspend.addListener(SWT.Selection, e -> warehouseManager.setChanged());
@@ -547,7 +506,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateResourceMonitor);
FormData fdlCreateResourceMonitor = new FormData();
fdlCreateResourceMonitor.left = new FormAttachment(0, 0);
- fdlCreateResourceMonitor.top = new FormAttachment(wCreateInitialSuspend, margin * 2);
+ fdlCreateResourceMonitor.top = new FormAttachment(wCreateInitialSuspend, margin);
fdlCreateResourceMonitor.right = new FormAttachment(middle, -margin);
wlCreateResourceMonitor.setLayoutData(fdlCreateResourceMonitor);
@@ -557,7 +516,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
wCreateResourceMonitor.addListener(SWT.Modify, e -> warehouseManager.setChanged());
FormData fdCreateResourceMonitor = new FormData();
fdCreateResourceMonitor.left = new FormAttachment(middle, 0);
- fdCreateResourceMonitor.top = new FormAttachment(wCreateInitialSuspend, margin * 2);
+ fdCreateResourceMonitor.top = new FormAttachment(wCreateInitialSuspend, margin);
fdCreateResourceMonitor.right = new FormAttachment(100, 0);
wCreateResourceMonitor.setLayoutData(fdCreateResourceMonitor);
wCreateResourceMonitor.addFocusListener(
@@ -582,7 +541,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
PropsUi.setLook(wlCreateComment);
FormData fdlCreateComment = new FormData();
fdlCreateComment.left = new FormAttachment(0, 0);
- fdlCreateComment.top = new FormAttachment(wCreateResourceMonitor, margin * 2);
+ fdlCreateComment.top = new FormAttachment(wCreateResourceMonitor, margin);
fdlCreateComment.right = new FormAttachment(middle, -margin);
wlCreateComment.setLayoutData(fdlCreateComment);
@@ -592,7 +551,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
FormData fdCreateComment = new FormData();
fdCreateComment.left = new FormAttachment(middle, 0);
fdCreateComment.right = new FormAttachment(100, 0);
- fdCreateComment.top = new FormAttachment(wCreateResourceMonitor, margin * 2);
+ fdCreateComment.top = new FormAttachment(wCreateResourceMonitor, margin);
wCreateComment.setLayoutData(fdCreateComment);
/////////////////////
@@ -610,7 +569,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
FormData fdgDropGroup = new FormData();
fdgDropGroup.left = new FormAttachment(0, 0);
fdgDropGroup.right = new FormAttachment(100, 0);
- fdgDropGroup.top = new FormAttachment(wAction, margin * 2);
+ fdgDropGroup.top = new FormAttachment(wAction, margin);
wDropGroup.setLayoutData(fdgDropGroup);
// //////////////////////
@@ -651,7 +610,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
FormData fdgResumeGroup = new FormData();
fdgResumeGroup.left = new FormAttachment(0, 0);
fdgResumeGroup.right = new FormAttachment(100, 0);
- fdgResumeGroup.top = new FormAttachment(wAction, margin * 2);
+ fdgResumeGroup.top = new FormAttachment(wAction, margin);
wResumeGroup.setLayoutData(fdgResumeGroup);
// //////////////////////
@@ -693,7 +652,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
FormData fdgSuspendGroup = new FormData();
fdgSuspendGroup.left = new FormAttachment(0, 0);
fdgSuspendGroup.right = new FormAttachment(100, 0);
- fdgSuspendGroup.top = new FormAttachment(wAction, margin * 2);
+ fdgSuspendGroup.top = new FormAttachment(wAction, margin);
wSuspendGroup.setLayoutData(fdgSuspendGroup);
// //////////////////////
@@ -734,7 +693,7 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
FormData fdgAlterGroup = new FormData();
fdgAlterGroup.left = new FormAttachment(0, 0);
fdgAlterGroup.right = new FormAttachment(100, 0);
- fdgAlterGroup.top = new FormAttachment(wAction, margin * 2);
+ fdgAlterGroup.top = new FormAttachment(wAction, margin);
wAlterGroup.setLayoutData(fdgAlterGroup);
// //////////////////////
@@ -950,44 +909,13 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
fdAlterComment.top = new FormAttachment(wAlterResourceMonitor, margin);
wAlterComment.setLayoutData(fdAlterComment);
- // Some buttons
- Button wOK = new Button(shell, SWT.PUSH);
- wOK.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
-
- BaseTransformDialog.positionBottomButtons(
- shell, new Button[] {wOK, wCancel}, margin, wCreateGroup);
-
- // Add listeners
- Listener lsCancel = e -> cancel();
- Listener lsOK = e -> ok();
-
- wOK.addListener(SWT.Selection, lsOK);
- wCancel.addListener(SWT.Selection, lsCancel);
- wName.addListener(SWT.Modify, e -> warehouseManager.setChanged());
-
- // Detect [X] or ALT-F4 or something that kills this window...
- shell.addShellListener(
- new ShellAdapter() {
- @Override
- public void shellClosed(ShellEvent e) {
- cancel();
- }
- });
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build(wCreateGroup);
getData();
setFlags();
BaseTransformDialog.setSize(shell);
-
- shell.open();
- props.setDialogSize(shell, "WarehouseManagerSize");
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
-
+ focusActionName();
+ BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return warehouseManager;
}
@@ -1010,6 +938,11 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
shell.dispose();
}
+ @Override
+ protected void onActionNameModified() {
+ warehouseManager.setChanged();
+ }
+
public void getData() {
wName.setText(Const.NVL(warehouseManager.getName(), ""));
wConnection.setText(Const.NVL(warehouseManager.getConnection(), ""));
@@ -1065,9 +998,6 @@ public class WarehouseManagerDialog extends ActionDialog implements IActionDialo
if (StringUtil.isEmpty(wAction.getText())) {
wAction.setText(MANAGEMENT_ACTION_DESCS[0]);
}
-
- wName.selectAll();
- wName.setFocus();
}
private void cancel() {
diff --git a/plugins/actions/sql/src/main/java/org/apache/hop/workflow/actions/sql/ActionSqlDialog.java b/plugins/actions/sql/src/main/java/org/apache/hop/workflow/actions/sql/ActionSqlDialog.java
index a77220eec9..2d404108fa 100644
--- a/plugins/actions/sql/src/main/java/org/apache/hop/workflow/actions/sql/ActionSqlDialog.java
+++ b/plugins/actions/sql/src/main/java/org/apache/hop/workflow/actions/sql/ActionSqlDialog.java
@@ -33,20 +33,16 @@ import org.apache.hop.ui.core.widget.SQLStyledTextComp;
import org.apache.hop.ui.core.widget.StyledTextComp;
import org.apache.hop.ui.core.widget.TextComposite;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.util.EnvironmentUtils;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/**
* This dialog allows you to edit the SQL action settings. (select the connection and the sql script
@@ -62,8 +58,6 @@ public class ActionSqlDialog extends ActionDialog {
BaseMessages.getString(PKG, "ActionSQL.Filetype.All")
};
- private Text wName;
-
private MetaSelectionLine<DatabaseMeta> wConnection;
private Button wUseSubs;
@@ -96,51 +90,12 @@ public class ActionSqlDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionSQL.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Action name line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionSQL.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ createShell(BaseMessages.getString(PKG, "ActionSQL.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
// Connection line
DatabaseMeta databaseMeta = workflowMeta.findDatabase(action.getConnection(), variables);
- wConnection = addConnectionLine(shell, wName, databaseMeta, null);
+ wConnection = addConnectionLine(shell, wSpacer, databaseMeta, null);
wConnection.addListener(SWT.Selection, e -> getSqlReservedWords());
// SQL from file?
@@ -149,7 +104,7 @@ public class ActionSqlDialog extends ActionDialog {
PropsUi.setLook(wlSqlFromFile);
FormData fdlSqlFromFile = new FormData();
fdlSqlFromFile.left = new FormAttachment(0, 0);
- fdlSqlFromFile.top = new FormAttachment(wConnection, 2 * margin);
+ fdlSqlFromFile.top = new FormAttachment(wConnection, margin);
fdlSqlFromFile.right = new FormAttachment(middle, -margin);
wlSqlFromFile.setLayoutData(fdlSqlFromFile);
wSqlFromFile = new Button(shell, SWT.CHECK);
@@ -173,7 +128,7 @@ public class ActionSqlDialog extends ActionDialog {
PropsUi.setLook(wlFilename);
FormData fdlFilename = new FormData();
fdlFilename.left = new FormAttachment(0, 0);
- fdlFilename.top = new FormAttachment(wlSqlFromFile, 2 * margin);
+ fdlFilename.top = new FormAttachment(wlSqlFromFile, margin);
fdlFilename.right = new FormAttachment(middle, -margin);
wlFilename.setLayoutData(fdlFilename);
@@ -235,7 +190,7 @@ public class ActionSqlDialog extends ActionDialog {
PropsUi.setLook(wlUseSubs);
FormData fdlUseSubs = new FormData();
fdlUseSubs.left = new FormAttachment(0, 0);
- fdlUseSubs.top = new FormAttachment(wlUseOneStatement, 2 * margin);
+ fdlUseSubs.top = new FormAttachment(wlUseOneStatement, margin);
fdlUseSubs.right = new FormAttachment(middle, -margin);
wlUseSubs.setLayoutData(fdlUseSubs);
wUseSubs = new Button(shell, SWT.CHECK);
@@ -259,7 +214,7 @@ public class ActionSqlDialog extends ActionDialog {
FormData fdlPosition = new FormData();
fdlPosition.left = new FormAttachment(0, 0);
fdlPosition.right = new FormAttachment(100, 0);
- fdlPosition.bottom = new FormAttachment(wOk, -margin);
+ fdlPosition.bottom = new FormAttachment(wCancel, -margin);
wlPosition.setLayoutData(fdlPosition);
// Script line
@@ -284,6 +239,7 @@ public class ActionSqlDialog extends ActionDialog {
fdSql.top = new FormAttachment(wlSql, margin);
fdSql.right = new FormAttachment(100, -margin);
fdSql.bottom = new FormAttachment(wlPosition, -margin);
+ fdSql.height = 200;
wSql.setLayoutData(fdSql);
wSql.addListener(SWT.Modify, e -> setPosition());
wSql.addListener(SWT.KeyDown, e -> setPosition());
@@ -296,6 +252,7 @@ public class ActionSqlDialog extends ActionDialog {
getData();
activeSqlFromFile();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -334,9 +291,11 @@ public class ActionSqlDialog extends ActionDialog {
wSqlFromFile.setSelection(action.isSqlFromFile());
wSendOneStatement.setSelection(action.isSendOneStatement());
wFilename.setText(Const.nullToEmpty(action.getSqlFilename()));
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void activeSqlFromFile() {
diff --git a/plugins/actions/success/src/main/java/org/apache/hop/workflow/actions/success/ActionSuccessDialog.java b/plugins/actions/success/src/main/java/org/apache/hop/workflow/actions/success/ActionSuccessDialog.java
index 6057ff2659..3d22c833e6 100644
--- a/plugins/actions/success/src/main/java/org/apache/hop/workflow/actions/success/ActionSuccessDialog.java
+++ b/plugins/actions/success/src/main/java/org/apache/hop/workflow/actions/success/ActionSuccessDialog.java
@@ -21,30 +21,18 @@ import org.apache.hop.core.Const;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.i18n.BaseMessages;
-import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit a Action Success object. */
public class ActionSuccessDialog extends ActionDialog {
private static final Class<?> PKG = ActionSuccess.class;
- private Text wName;
-
private ActionSuccess action;
private boolean changed;
@@ -60,67 +48,27 @@ public class ActionSuccessDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionSuccessDialog.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setMinimumSize(400, 130);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionSuccessDialog.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "System.ActionName.Label"));
- wlName.setToolTipText(BaseMessages.getString(PKG, "System.ActionName.Tooltip"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
return action;
}
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
+ }
+
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
wName.setText(Const.nullToEmpty(action.getName()));
-
- wName.selectAll();
- wName.setFocus();
}
private void cancel() {
diff --git a/plugins/actions/tableexists/src/main/java/org/apache/hop/workflow/actions/tableexists/ActionTableExistsDialog.java b/plugins/actions/tableexists/src/main/java/org/apache/hop/workflow/actions/tableexists/ActionTableExistsDialog.java
index 593f74d772..61cb43043e 100644
--- a/plugins/actions/tableexists/src/main/java/org/apache/hop/workflow/actions/tableexists/ActionTableExistsDialog.java
+++ b/plugins/actions/tableexists/src/main/java/org/apache/hop/workflow/actions/tableexists/ActionTableExistsDialog.java
@@ -32,20 +32,16 @@ import org.apache.hop.ui.core.dialog.ErrorDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.MetaSelectionLine;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/**
* This dialog allows you to edit the Table Exists action settings. (select the connection and the
@@ -54,8 +50,6 @@ import org.eclipse.swt.widgets.Text;
public class ActionTableExistsDialog extends ActionDialog {
private static final Class<?> PKG = ActionTableExists.class;
- private Text wName;
-
private MetaSelectionLine<DatabaseMeta> wConnection;
private TextVar wTablename;
@@ -77,45 +71,15 @@ public class ActionTableExistsDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionTableExists.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionTableExists.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Action name
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionTableExists.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
// Connection line
DatabaseMeta databaseMeta = workflowMeta.findDatabase(action.getConnection(), variables);
- wConnection = addConnectionLine(shell, wName, databaseMeta, lsMod);
+ wConnection = addConnectionLine(shell, wSpacer, databaseMeta, lsMod);
// Schema name line
Label wlSchemaName = new Label(shell, SWT.RIGHT);
@@ -124,14 +88,14 @@ public class ActionTableExistsDialog extends ActionDialog {
FormData fdlSchemaName = new FormData();
fdlSchemaName.left = new FormAttachment(0, 0);
fdlSchemaName.right = new FormAttachment(middle, -margin);
- fdlSchemaName.top = new FormAttachment(wConnection, 2 * margin);
+ fdlSchemaName.top = new FormAttachment(wConnection, margin);
wlSchemaName.setLayoutData(fdlSchemaName);
Button wbSchema = new Button(shell, SWT.PUSH | SWT.CENTER);
PropsUi.setLook(wbSchema);
wbSchema.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbSchema = new FormData();
- fdbSchema.top = new FormAttachment(wConnection, 2 * margin);
+ fdbSchema.top = new FormAttachment(wConnection, margin);
fdbSchema.right = new FormAttachment(100, 0);
wbSchema.setLayoutData(fdbSchema);
wbSchema.addListener(SWT.Selection, e -> getSchemaNames());
@@ -141,7 +105,7 @@ public class ActionTableExistsDialog extends ActionDialog {
wSchemaname.addModifyListener(lsMod);
FormData fdSchemaname = new FormData();
fdSchemaname.left = new FormAttachment(middle, 0);
- fdSchemaname.top = new FormAttachment(wConnection, 2 * margin);
+ fdSchemaname.top = new FormAttachment(wConnection, margin);
fdSchemaname.right = new FormAttachment(wbSchema, -margin);
wSchemaname.setLayoutData(fdSchemaname);
@@ -173,18 +137,8 @@ public class ActionTableExistsDialog extends ActionDialog {
fdTablename.right = new FormAttachment(wbTable, -margin);
wTablename.setLayoutData(fdTablename);
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(
- shell, new Button[] {wOk, wCancel}, margin, wTablename);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -199,9 +153,11 @@ public class ActionTableExistsDialog extends ActionDialog {
if (action.getConnection() != null) {
wConnection.setText(action.getConnection());
}
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/telnet/src/main/java/org/apache/hop/workflow/actions/telnet/ActionTelnetDialog.java b/plugins/actions/telnet/src/main/java/org/apache/hop/workflow/actions/telnet/ActionTelnetDialog.java
index 2f0ce51dbf..1d98d5256f 100644
--- a/plugins/actions/telnet/src/main/java/org/apache/hop/workflow/actions/telnet/ActionTelnetDialog.java
+++ b/plugins/actions/telnet/src/main/java/org/apache/hop/workflow/actions/telnet/ActionTelnetDialog.java
@@ -25,27 +25,20 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Telnet action settings. */
public class ActionTelnetDialog extends ActionDialog {
private static final Class<?> PKG = ActionTelnet.class;
- private Text wName;
-
private TextVar wHostname;
private TextVar wTimeOut;
@@ -67,49 +60,20 @@ public class ActionTelnetDialog extends ActionDialog {
@Override
public IAction open() {
+ createShell(BaseMessages.getString(PKG, "ActionTelnet.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
-
- ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionTelnet.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionTelnet.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
+ ModifyListener lsMod = e -> action.setChanged();
// hostname line
Label wlHostname = new Label(shell, SWT.RIGHT);
wlHostname.setText(BaseMessages.getString(PKG, "ActionTelnet.Hostname.Label"));
PropsUi.setLook(wlHostname);
FormData fdlHostname = new FormData();
- fdlHostname.left = new FormAttachment(0, -margin);
- fdlHostname.top = new FormAttachment(wName, margin);
+ fdlHostname.left = new FormAttachment(0, 0);
+ fdlHostname.top = new FormAttachment(wSpacer, margin);
fdlHostname.right = new FormAttachment(middle, -margin);
wlHostname.setLayoutData(fdlHostname);
@@ -118,7 +82,7 @@ public class ActionTelnetDialog extends ActionDialog {
wHostname.addModifyListener(lsMod);
FormData fdHostname = new FormData();
fdHostname.left = new FormAttachment(middle, 0);
- fdHostname.top = new FormAttachment(wName, margin);
+ fdHostname.top = new FormAttachment(wlHostname, 0, SWT.CENTER);
fdHostname.right = new FormAttachment(100, 0);
wHostname.setLayoutData(fdHostname);
@@ -162,17 +126,8 @@ public class ActionTelnetDialog extends ActionDialog {
fdTimeOut.right = new FormAttachment(100, 0);
wTimeOut.setLayoutData(fdTimeOut);
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, wTimeOut);
-
getData();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -188,9 +143,11 @@ public class ActionTelnetDialog extends ActionDialog {
wPort.setText(Const.NVL(action.getPort(), String.valueOf(ActionTelnet.DEFAULT_PORT)));
wTimeOut.setText(Const.NVL(action.getTimeout(), String.valueOf(ActionTelnet.DEFAULT_TIME_OUT)));
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/truncatetables/src/main/java/org/apache/hop/workflow/actions/truncatetables/ActionTruncateTablesDialog.java b/plugins/actions/truncatetables/src/main/java/org/apache/hop/workflow/actions/truncatetables/ActionTruncateTablesDialog.java
index 4034e9edc1..16823d259e 100644
--- a/plugins/actions/truncatetables/src/main/java/org/apache/hop/workflow/actions/truncatetables/ActionTruncateTablesDialog.java
+++ b/plugins/actions/truncatetables/src/main/java/org/apache/hop/workflow/actions/truncatetables/ActionTruncateTablesDialog.java
@@ -19,7 +19,6 @@ package org.apache.hop.workflow.actions.truncatetables;
import java.util.Arrays;
import java.util.List;
-import org.apache.hop.core.Const;
import org.apache.hop.core.database.Database;
import org.apache.hop.core.database.DatabaseMeta;
import org.apache.hop.core.exception.HopDatabaseException;
@@ -34,9 +33,7 @@ import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.MetaSelectionLine;
import org.apache.hop.ui.core.widget.TableView;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -46,12 +43,10 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
/**
* This dialog allows you to edit the Truncate Tables action settings. (select the connection and
@@ -62,8 +57,6 @@ public class ActionTruncateTablesDialog extends ActionDialog {
private Button wbTable;
- private Text wName;
-
private MetaSelectionLine<DatabaseMeta> wConnection;
private ActionTruncateTables action;
@@ -87,55 +80,15 @@ public class ActionTruncateTablesDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionTruncateTables.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = (ModifyEvent e) -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionTruncateTables.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // Filename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionTruncateTables.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
// Connection line
DatabaseMeta dbMeta = workflowMeta.findDatabase(action.getConnection(), variables);
- wConnection = addConnectionLine(shell, wName, dbMeta, lsMod);
+ wConnection = addConnectionLine(shell, wSpacer, dbMeta, lsMod);
Label wlPrevious = new Label(shell, SWT.RIGHT);
wlPrevious.setText(BaseMessages.getString(PKG, "ActionTruncateTables.Previous.Label"));
@@ -169,7 +122,7 @@ public class ActionTruncateTablesDialog extends ActionDialog {
FormData fdbTable = new FormData();
fdbTable.left = new FormAttachment(0, margin);
fdbTable.right = new FormAttachment(100, -margin);
- fdbTable.top = new FormAttachment(wlPrevious, 2 * margin);
+ fdbTable.top = new FormAttachment(wlPrevious, margin);
wbTable.setLayoutData(fdbTable);
wbTable.addSelectionListener(
new SelectionAdapter() {
@@ -185,7 +138,7 @@ public class ActionTruncateTablesDialog extends ActionDialog {
FormData fdlFields = new FormData();
fdlFields.left = new FormAttachment(0, 0);
fdlFields.right = new FormAttachment(middle, -margin);
- fdlFields.top = new FormAttachment(wbTable, 2 * margin);
+ fdlFields.top = new FormAttachment(wbTable, margin);
wlFields.setLayoutData(fdlFields);
// Buttons to the right of the screen...
@@ -242,7 +195,7 @@ public class ActionTruncateTablesDialog extends ActionDialog {
fdFields.left = new FormAttachment(0, 0);
fdFields.top = new FormAttachment(wlFields, margin);
fdFields.right = new FormAttachment(wbdTablename, -margin);
- fdFields.bottom = new FormAttachment(wOk, -2 * margin);
+ fdFields.bottom = new FormAttachment(wCancel, -margin);
wFields.setLayoutData(fdFields);
// Delete files from the list of files...
@@ -259,6 +212,7 @@ public class ActionTruncateTablesDialog extends ActionDialog {
getData();
setPrevious();
+ focusActionName();
BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
@@ -274,8 +228,9 @@ public class ActionTruncateTablesDialog extends ActionDialog {
/** Copy information from the meta-data input to the dialog fields. */
public void getData() {
- wName.setText(Const.nullToEmpty(action.getName()));
-
+ if (action.getName() != null) {
+ wName.setText(action.getName());
+ }
if (action.getConnection() != null) {
wConnection.setText(action.getConnection());
}
@@ -299,9 +254,11 @@ public class ActionTruncateTablesDialog extends ActionDialog {
}
wPrevious.setSelection(action.isArgFromPrevious());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/unzip/src/main/java/org/apache/hop/workflow/actions/unzip/ActionUnZipDialog.java b/plugins/actions/unzip/src/main/java/org/apache/hop/workflow/actions/unzip/ActionUnZipDialog.java
index 2bdd63364f..a9e3945487 100644
--- a/plugins/actions/unzip/src/main/java/org/apache/hop/workflow/actions/unzip/ActionUnZipDialog.java
+++ b/plugins/actions/unzip/src/main/java/org/apache/hop/workflow/actions/unzip/ActionUnZipDialog.java
@@ -27,9 +27,7 @@ import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
@@ -47,7 +45,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
/** This dialog allows you to edit the Unzip action settings. */
public class ActionUnZipDialog extends ActionDialog {
@@ -62,8 +59,6 @@ public class ActionUnZipDialog extends ActionDialog {
public static final String CONST_ACTION_UN_ZIP_BROWSE_FOLDERS_LABEL =
"ActionUnZip.BrowseFolders.Label";
- private Text wName;
-
private Label wlZipFilename;
private Button wbZipFilename;
private Button wbSourceDirectory;
@@ -134,52 +129,12 @@ public class ActionUnZipDialog extends ActionDialog {
@Override
public IAction open() {
-
- shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
- PropsUi.setLook(shell);
- WorkflowDialog.setShellImage(shell, action);
+ createShell(BaseMessages.getString(PKG, "ActionUnZip.Title"), action);
+ buildButtonBar().ok(e -> ok()).cancel(e -> cancel()).build();
ModifyListener lsMod = e -> action.setChanged();
changed = action.hasChanged();
- FormLayout formLayout = new FormLayout();
- formLayout.marginWidth = PropsUi.getFormMargin();
- formLayout.marginHeight = PropsUi.getFormMargin();
-
- shell.setLayout(formLayout);
- shell.setText(BaseMessages.getString(PKG, "ActionUnZip.Title"));
-
- int middle = props.getMiddlePct();
- int margin = PropsUi.getMargin();
-
- // Buttons go at the very bottom
- //
- Button wOk = new Button(shell, SWT.PUSH);
- wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
- wOk.addListener(SWT.Selection, e -> ok());
- Button wCancel = new Button(shell, SWT.PUSH);
- wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
- wCancel.addListener(SWT.Selection, e -> cancel());
- BaseTransformDialog.positionBottomButtons(shell, new Button[] {wOk, wCancel}, margin, null);
-
- // ZipFilename line
- Label wlName = new Label(shell, SWT.RIGHT);
- wlName.setText(BaseMessages.getString(PKG, "ActionUnZip.Name.Label"));
- PropsUi.setLook(wlName);
- FormData fdlName = new FormData();
- fdlName.left = new FormAttachment(0, 0);
- fdlName.right = new FormAttachment(middle, -margin);
- fdlName.top = new FormAttachment(0, margin);
- wlName.setLayoutData(fdlName);
- wName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
- PropsUi.setLook(wName);
- wName.addModifyListener(lsMod);
- FormData fdName = new FormData();
- fdName.left = new FormAttachment(middle, 0);
- fdName.top = new FormAttachment(0, margin);
- fdName.right = new FormAttachment(100, 0);
- wName.setLayoutData(fdName);
-
CTabFolder wTabFolder = new CTabFolder(shell, SWT.BORDER);
PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
@@ -246,7 +201,7 @@ public class ActionUnZipDialog extends ActionDialog {
PropsUi.setLook(wlZipFilename);
FormData fdlZipFilename = new FormData();
fdlZipFilename.left = new FormAttachment(0, 0);
- fdlZipFilename.top = new FormAttachment(wlArgsPrevious, 2 * margin);
+ fdlZipFilename.top = new FormAttachment(wlArgsPrevious, margin);
fdlZipFilename.right = new FormAttachment(middle, -margin);
wlZipFilename.setLayoutData(fdlZipFilename);
@@ -257,7 +212,7 @@ public class ActionUnZipDialog extends ActionDialog {
BaseMessages.getString(PKG, CONST_ACTION_UN_ZIP_BROWSE_FOLDERS_LABEL));
FormData fdbSourceDirectory = new FormData();
fdbSourceDirectory.right = new FormAttachment(100, 0);
- fdbSourceDirectory.top = new FormAttachment(wlArgsPrevious, 2 * margin);
+ fdbSourceDirectory.top = new FormAttachment(wlArgsPrevious, margin);
wbSourceDirectory.setLayoutData(fdbSourceDirectory);
wbSourceDirectory.addListener(
@@ -269,7 +224,7 @@ public class ActionUnZipDialog extends ActionDialog {
wbZipFilename.setText(BaseMessages.getString(PKG, "ActionUnZip.BrowseFiles.Label"));
FormData fdbZipFilename = new FormData();
fdbZipFilename.right = new FormAttachment(wbSourceDirectory, -margin);
- fdbZipFilename.top = new FormAttachment(wlArgsPrevious, 2 * margin);
+ fdbZipFilename.top = new FormAttachment(wlArgsPrevious, margin);
wbZipFilename.setLayoutData(fdbZipFilename);
wZipFilename = new TextVar(variables, wSource, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
@@ -277,7 +232,7 @@ public class ActionUnZipDialog extends ActionDialog {
wZipFilename.addModifyListener(lsMod);
FormData fdZipFilename = new FormData();
fdZipFilename.left = new FormAttachment(middle, 0);
- fdZipFilename.top = new FormAttachment(wlArgsPrevious, 2 * margin);
+ fdZipFilename.top = new FormAttachment(wlArgsPrevious, margin);
fdZipFilename.right = new FormAttachment(wbZipFilename, -margin);
wZipFilename.setLayoutData(fdZipFilename);
@@ -374,7 +329,7 @@ public class ActionUnZipDialog extends ActionDialog {
PropsUi.setLook(wlTargetDirectory);
FormData fdlTargetDirectory = new FormData();
fdlTargetDirectory.left = new FormAttachment(0, 0);
- fdlTargetDirectory.top = new FormAttachment(wlRootZip, 2 * margin);
+ fdlTargetDirectory.top = new FormAttachment(wlRootZip, margin);
fdlTargetDirectory.right = new FormAttachment(middle, -margin);
wlTargetDirectory.setLayoutData(fdlTargetDirectory);
@@ -385,7 +340,7 @@ public class ActionUnZipDialog extends ActionDialog {
BaseMessages.getString(PKG, CONST_ACTION_UN_ZIP_BROWSE_FOLDERS_LABEL));
FormData fdbTargetDirectory = new FormData();
fdbTargetDirectory.right = new FormAttachment(100, 0);
- fdbTargetDirectory.top = new FormAttachment(wlRootZip, 2 * margin);
+ fdbTargetDirectory.top = new FormAttachment(wlRootZip, margin);
wbTargetDirectory.setLayoutData(fdbTargetDirectory);
wbTargetDirectory.addListener(
SWT.Selection, e -> BaseDialog.presentDirectoryDialog(shell, wTargetDirectory, variables));
@@ -400,7 +355,7 @@ public class ActionUnZipDialog extends ActionDialog {
wTargetDirectory.addModifyListener(lsMod);
FormData fdTargetDirectory = new FormData();
fdTargetDirectory.left = new FormAttachment(middle, 0);
- fdTargetDirectory.top = new FormAttachment(wlRootZip, 2 * margin);
+ fdTargetDirectory.top = new FormAttachment(wlRootZip, margin);
fdTargetDirectory.right = new FormAttachment(wbTargetDirectory, -margin);
wTargetDirectory.setLayoutData(fdTargetDirectory);
@@ -435,7 +390,7 @@ public class ActionUnZipDialog extends ActionDialog {
PropsUi.setLook(wlWildcard);
FormData fdlWildcard = new FormData();
fdlWildcard.left = new FormAttachment(0, 0);
- fdlWildcard.top = new FormAttachment(wlCreateFolder, 2 * margin);
+ fdlWildcard.top = new FormAttachment(wlCreateFolder, margin);
fdlWildcard.right = new FormAttachment(middle, -margin);
wlWildcard.setLayoutData(fdlWildcard);
wWildcard =
@@ -448,7 +403,7 @@ public class ActionUnZipDialog extends ActionDialog {
wWildcard.addModifyListener(lsMod);
FormData fdWildcard = new FormData();
fdWildcard.left = new FormAttachment(middle, 0);
- fdWildcard.top = new FormAttachment(wlCreateFolder, 2 * margin);
+ fdWildcard.top = new FormAttachment(wlCreateFolder, margin);
fdWildcard.right = new FormAttachment(100, 0);
wWildcard.setLayoutData(fdWildcard);
@@ -506,7 +461,7 @@ public class ActionUnZipDialog extends ActionDialog {
PropsUi.setLook(wlAddTime);
FormData fdlAddTime = new FormData();
fdlAddTime.left = new FormAttachment(0, 0);
- fdlAddTime.top = new FormAttachment(wlAddDate, 2 * margin);
+ fdlAddTime.top = new FormAttachment(wlAddDate, margin);
fdlAddTime.right = new FormAttachment(middle, -margin);
wlAddTime.setLayoutData(fdlAddTime);
wAddTime = new Button(wUnzippedFiles, SWT.CHECK);
@@ -532,7 +487,7 @@ public class ActionUnZipDialog extends ActionDialog {
PropsUi.setLook(wlSpecifyFormat);
FormData fdlSpecifyFormat = new FormData();
fdlSpecifyFormat.left = new FormAttachment(0, 0);
- fdlSpecifyFormat.top = new FormAttachment(wlAddTime, 2 * margin);
+ fdlSpecifyFormat.top = new FormAttachment(wlAddTime, margin);
fdlSpecifyFormat.right = new FormAttachment(middle, -margin);
wlSpecifyFormat.setLayoutData(fdlSpecifyFormat);
wSpecifyFormat = new Button(wUnzippedFiles, SWT.CHECK);
@@ -561,7 +516,7 @@ public class ActionUnZipDialog extends ActionDialog {
PropsUi.setLook(wlDateTimeFormat);
FormData fdlDateTimeFormat = new FormData();
fdlDateTimeFormat.left = new FormAttachment(0, 0);
- fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdlDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdlDateTimeFormat.right = new FormAttachment(middle, -margin);
wlDateTimeFormat.setLayoutData(fdlDateTimeFormat);
wDateTimeFormat = new CCombo(wUnzippedFiles, SWT.BORDER | SWT.READ_ONLY);
@@ -570,7 +525,7 @@ public class ActionUnZipDialog extends ActionDialog {
wDateTimeFormat.addModifyListener(lsMod);
FormData fdDateTimeFormat = new FormData();
fdDateTimeFormat.left = new FormAttachment(middle, 0);
- fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, 2 * margin);
+ fdDateTimeFormat.top = new FormAttachment(wlSpecifyFormat, margin);
fdDateTimeFormat.right = new FormAttachment(100, 0);
wDateTimeFormat.setLayoutData(fdDateTimeFormat);
for (String dat : dats) {
@@ -610,7 +565,7 @@ public class ActionUnZipDialog extends ActionDialog {
PropsUi.setLook(wlSetModificationDateToOriginal);
FormData fdlSetModificationDateToOriginal = new FormData();
fdlSetModificationDateToOriginal.left = new FormAttachment(0, 0);
- fdlSetModificationDateToOriginal.top = new FormAttachment(wlAddOriginalTimestamp, 2 * margin);
+ fdlSetModificationDateToOriginal.top = new FormAttachment(wlAddOriginalTimestamp, margin);
fdlSetModificationDateToOriginal.right = new FormAttachment(middle, -margin);
wlSetModificationDateToOriginal.setLayoutData(fdlSetModificationDateToOriginal);
wSetModificationDateToOriginal = new Button(wUnzippedFiles, SWT.CHECK);
@@ -637,7 +592,7 @@ public class ActionUnZipDialog extends ActionDialog {
FormData fdlIfFileExists = new FormData();
fdlIfFileExists.left = new FormAttachment(0, 0);
fdlIfFileExists.right = new FormAttachment(middle, -margin);
- fdlIfFileExists.top = new FormAttachment(wlSetModificationDateToOriginal, 2 * margin);
+ fdlIfFileExists.top = new FormAttachment(wlSetModificationDateToOriginal, margin);
wlIfFileExists.setLayoutData(fdlIfFileExists);
wIfFileExists = new CCombo(wUnzippedFiles, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
wIfFileExists.setItems(ActionUnZip.typeIfFileExistsDesc);
@@ -936,12 +891,13 @@ public class ActionUnZipDialog extends ActionDialog {
FormData fdTabFolder = new FormData();
fdTabFolder.left = new FormAttachment(0, 0);
- fdTabFolder.top = new FormAttachment(wName, margin);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
fdTabFolder.right = new FormAttachment(100, 0);
- fdTabFolder.bottom = new FormAttachment(wOk, -2 * margin);
+ fdTabFolder.bottom = new FormAttachment(wCancel, -margin);
wTabFolder.setLayoutData(fdTabFolder);
getData();
+ focusActionName();
setArgdPrevious();
afterUnZipActivate();
setDateTimeFormat();
@@ -1053,9 +1009,11 @@ public class ActionUnZipDialog extends ActionDialog {
wSetModificationDateToOriginal.setSelection(action.isSetOriginalModificationDate());
wIfFileExists.select(action.getIfFileExist().getOrignalCode());
wCreateMoveToDirectory.setSelection(action.isCreateMoveToDirectory());
+ }
- wName.selectAll();
- wName.setFocus();
+ @Override
+ protected void onActionNameModified() {
+ action.setChanged();
}
private void cancel() {
diff --git a/plugins/actions/waitforfile/src/main/java/org/apache/hop/workflow/actions/waitforfile/ActionWaitForFileDialog.java b/plugins/actions/waitforfile/src/main/java/org/apache/hop/workflow/actions/waitforfile/ActionWaitForFileDialog.java
index 6d8627c065..6da4d85d8e 100644
--- a/plugins/actions/waitforfile/src/main/java/org/apache/hop/workflow/actions/waitforfile/ActionWaitForFileDialog.java
+++ b/plugins/actions/waitforfile/src/main/java/org/apache/hop/workflow/actions/waitforfile/ActionWaitForFileDialog.java
@@ -25,22 +25,22 @@ import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.TextVar;
-import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.workflow.action.ActionDialog;
-import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
... 45626 lines suppressed ...