Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Databinding ListViewer(Based on combo selection listviewer should be undated with list values)
Databinding ListViewer [message #1804144] Tue, 19 March 2019 09:46 Go to next message
VJ M is currently offline VJ MFriend
Messages: 3
Registered: March 2019
Junior Member
Hi Team,

This is my first question in this forum. I have been trying to create data binding between Combo viewer and List Viewer. My query is
If I select a values in the Combo Viewer I need to update a list of values in the ListViewer. Listviewer values has to be changed based on combo selection. All values are of type String

Please check my code I have written

//Dialog Code
//Assume I created a contentcomposite already

ComboViewer comboViewer = new ComboViewer(parent, SWT.READ_ONLY);        comboViewer.setContentProvider(ArrayContentProvider.getInstance());
comboViewer.setLabelProvider(new LabelProvider());       
comboViewer.setInput(importModel.getcViewerList()); //will get values for combo viewer

ListViewer listViewer = new ListViewer(parent);
 listViewer.setContentProvider(ArrayContentProvider.getInstance());
 listViewer.setLabelProvider(new LabelProvider());


//Model Class

public class TestModel {

    private Collection<String> testList = new ArrayList<>();

    private String testValue1;

    public Collection<String> gettestList() {
        return testList;
    }

    public void settestList(Collection<String> teslist) {
        this.vehicleClassesList = teslist;
    }
}


I tried to bind the values using Databinding Contex but I am unable to get the result I am new to java and databinding I read few tutorials to get it done. I need some help on this please suggest how we can use databinding on this.


Thanks in advance.
VJM
Re: Databinding ListViewer [message #1804267 is a reply to message #1804144] Thu, 21 March 2019 14:48 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi VJ,

This seems to be a SWT question, rather than a question about Epsilon. You should try asking over at the SWT forum:

https://www.eclipse.org/forums/index.php/f/100/

Kind regards,
Antonio
Previous Topic:Create new model elements in EOL
Next Topic:Customize Button in Eclipse Toolbar
Goto Forum:
  


Current Time: Thu Apr 25 17:55:46 GMT 2024

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

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

Back to the top