Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Parsley » how to make a ComboView not selectable(comboviewer emf parsley)
how to make a ComboView not selectable [message #1849975] Thu, 10 February 2022 06:34 Go to next message
Olivier BISSON is currently offline Olivier BISSONFriend
Messages: 6
Registered: February 2022
Junior Member
Hello,
I'm discovering EMF Parsley. In my test, in need to know how to make a comboView not selectable (unmodifiable)

In the photo attached, you will find expected.
The first field (text field) is already unmodifiable and i need to do the same with the 2nd field (comboView).

Below the code for the 1st field
Instance: attribute -> { val t = createText("") t.editable = false t.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)) return t }


Someone has an idea ?
Thanks
Oliver
  • Attachment: tempsnip.png
    (Size: 9.77KB, Downloaded 117 times)
Re: how to make a ComboView not selectable [message #1849976 is a reply to message #1849975] Thu, 10 February 2022 06:52 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi Olivier

I'm not sure I understand your question... you simply have to use the Java API of the combo view, just like you did with the text edit. Parsley simply relies on the Java API of the SWT and Jface controls.


Re: how to make a ComboView not selectable [message #1849980 is a reply to message #1849976] Thu, 10 February 2022 08:29 Go to previous messageGo to next message
Olivier BISSON is currently offline Olivier BISSONFriend
Messages: 6
Registered: February 2022
Junior Member
Hello Lorenzo,

first thanks for your reply.

In fact, here is what i have aleady tried :

Instance : attribute -> { val t = createComboViewer().combo t.enabled = false t.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)) return t }
target observeSelection()

-> field combo is not selectable but value is empty.
console stacktrace : "cannot be cast to java.lang.String"
Instance : attribute -> { val t = new Combo(parent, SWT.READ_ONLY) t.enabled = false t.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)) return t }
target observeSelection()

-> field combo is not selectable but value is empty.
console stacktrace : "cannot be cast to java.lang.String"
Instance: attribute -> { val t = createComboViewer().combo t.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)) return t }
target observeSelection()


-> field combo is not selectable but value is empty.
console stacktrace : "cannot be cast to java.lang.String"

I m not sure how to bind ?

Thanks for your help
Oliver
Re: how to make a ComboView not selectable [message #1849981 is a reply to message #1849980] Thu, 10 February 2022 08:50 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
You may want to first understand how to do that outside of Parsley: first, try to learn how to perform databinding of a combo and then how to make it disabled. Then you can add the corresponding code to Parsley. I'm afraid I don't know much about databinding for this specific case.
You may also want to inspect how Parsley internally performs databinding for a combo (i.e., how it does that by default) or how EMF does that.


Re: how to make a ComboView not selectable [message #1861587 is a reply to message #1849981] Fri, 20 October 2023 09:40 Go to previous message
Terry Frost is currently offline Terry FrostFriend
Messages: 2
Registered: October 2023
Junior Member
Thanks!
Previous Topic:Any plan for a JavaFx implementation ?
Goto Forum:
  


Current Time: Fri Apr 19 22:23:04 GMT 2024

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

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

Back to the top