public void createListSection ( final ScrolledForm form, final ConfigurationEditorInput input, final String attribute, final String label, final String delimiter, final String pattern ) { final IObservableList list = StringSplitListObservable.observeString ( Observables.observeMapEntry ( input.getDataMap (), attribute, String.class ), delimiter, pattern ); // section final Section section = this.toolkit.createSection ( form.getBody (), ExpandableComposite.TITLE_BAR ); section.setText ( label ); final Composite client = this.toolkit.createComposite ( section, SWT.NONE ); section.setClient ( client ); this.toolkit.paintBordersFor ( client ); client.setLayout ( new GridLayout ( 1, true ) ); final GridData gd = new GridData ( GridData.FILL_BOTH ); gd.horizontalSpan = 2; section.setLayoutData ( gd ); // fields final ListViewer viewer = new ListViewer ( client ); viewer.setContentProvider ( new ObservableListContentProvider () ); viewer.setInput ( list ); viewer.getControl ().setLayoutData ( new GridData ( GridData.FILL_BOTH ) ); viewer.setSorter ( new ViewerSorter () ); }
public void createListSection ( final ScrolledForm form, final ConfigurationEditorInput input, final String attribute, final String label, final String delimiter, final String pattern ) { final IObservableList list = StringSplitListObservable.observeString ( Observables.observeMapEntry ( input.getDataMap (), attribute, String.class ), delimiter, pattern ); // section final Section section = this.toolkit.createSection ( form.getBody (), ExpandableComposite.TITLE_BAR ); section.setText ( label ); final Composite client = this.toolkit.createComposite ( section, SWT.NONE ); section.setClient ( client ); this.toolkit.paintBordersFor ( client ); client.setLayout ( new GridLayout ( 1, true ) ); final GridData gd = new GridData ( GridData.FILL_BOTH ); gd.horizontalSpan = 2; section.setLayoutData ( gd ); // fields final ListViewer viewer = new ListViewer ( client ); viewer.setContentProvider ( new ObservableListContentProvider () ); viewer.setInput ( list ); viewer.getControl ().setLayoutData ( new GridData ( GridData.FILL_BOTH ) ); viewer.setSorter ( new ViewerSorter () ); }