Skip to main content



      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 01:34 Go to next message
Eclipse UserFriend
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 214 times)
Re: how to make a ComboView not selectable [message #1849976 is a reply to message #1849975] Thu, 10 February 2022 01:52 Go to previous messageGo to next message
Eclipse UserFriend
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 03:29 Go to previous messageGo to next message
Eclipse UserFriend
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 03:50 Go to previous messageGo to next message
Eclipse UserFriend
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 05:40 Go to previous message
Eclipse UserFriend
Thanks!
Previous Topic:Any plan for a JavaFx implementation ?
Goto Forum:
  


Current Time: Tue May 13 11:39:56 EDT 2025

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

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

Back to the top