Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Eclipse Scout with Kotlin(Use Kotlin classes with FormData annotations)
Eclipse Scout with Kotlin [message #1776171] Mon, 13 November 2017 11:59 Go to next message
Stéphane Levy is currently offline Stéphane LevyFriend
Messages: 6
Registered: July 2017
Junior Member
Hello,

I hava tried to developp my Eclipse Scout pages / form with the Kotlin langage : https://kotlinlang.org/ . It works well with pages and allowes to reduce considerably the amount of code.

Exemple of the HelloWorldPage :
class HelloWorldPage : AbstractPageWithNodes(){
	override fun getConfiguredLeaf() = true
	override fun getConfiguredTableVisible() = false
	override fun getConfiguredTitle() =	TEXTS.get("HelloWorld")
	override fun getConfiguredDetailForm() = HelloWorldForm::class.java
}


But I can't manage to produce FormData generated classes. The SDK doesn't seem to look forkotlin classes to generate classes.
Is there a way to indicate to the generator to look for Kotlin classes ?

An other question, is there a plan to integrate Kotlin into the ECLIPSE scout framework, for example generate kotlin classes directly ? This could be a great feature for Eclipse Scout because Kotlin is a very interesting langage that allows a more concise and secure development.
Thank you very much.

Form example :
@FormData(value = HelloWorldFormData2::class, sdkCommand = FormData.SdkCommand.CREATE)
class HelloWorldForm : AbstractForm() {
    	init {
		setHandler(ViewHandler())
	}
       @Order(1000.0)
	class MainBox : AbstractGroupBox() {

		@Order(1000.0)
		class TopBox : AbstractGroupBox() {

			override fun getConfiguredLabel() = TEXTS.get("MessageFromServer")

			@Order(1000.0)
			class MessageField : AbstractStringField() {
				override fun getConfiguredGridW() = 2
				override fun getConfiguredLabel() = TEXTS.get("Message")
				override fun getConfiguredEnabled() = false
			}
		}
	}
	inner class ViewHandler : AbstractFormHandler() {

		override fun execLoad() {
			// Code
		}
	}
}

[Updated on: Mon, 13 November 2017 12:00]

Report message to a moderator

Re: Eclipse Scout with Kotlin [message #1776362 is a reply to message #1776171] Wed, 15 November 2017 17:00 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 139
Registered: September 2011
Senior Member
Hi Stéphane,

Thank you very much for sharing your experience with us! Indeed it looks very nice and compact.

You are right: Currently Kotlin is not supported. Feel free to open a bug for adding Kotlin support. But I cannot make any promises if or when it could be implemented.

Until now there is no plan to integrate Kotlin. Neither in parsing and DTO creation nor in the creation of new source code.

Kind regards
Mat
Re: Eclipse Scout with Kotlin [message #1776616 is a reply to message #1776362] Sat, 18 November 2017 15:06 Go to previous message
Stéphane Levy is currently offline Stéphane LevyFriend
Messages: 6
Registered: July 2017
Junior Member
Hi MAt,

Thank you for your answer.

We can still have a full kotlin project without the formdata generation if we use the Spring boot project.

I have prepared an example here https://github.com/slevy85/scout-boot-kotlin.

It is based on the scout boot minimal archetype.

Stephane.

[Updated on: Sat, 18 November 2017 15:07]

Report message to a moderator

Previous Topic:[Oxygen] Copy & Paste of Table Rows
Next Topic:Using Eclipse Scout on Mac OSx: an improvement proposal
Goto Forum:
  


Current Time: Tue Nov 13 04:53:56 GMT 2018

Powered by FUDForum. Page generated in 0.01692 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top