public static IObservableList observeString ( final IObservableValue value, final String delimiter, final String pattern ) { return new StringSplitListObservable ( value, delimiter, pattern, null ); }
@Override public Object remove ( final int index ) { checkRealm (); final Object result = this.wrappedList.remove ( index ); updateValue (); return result; }
@Override public void handleDispose ( final DisposeEvent event ) { dispose (); } };
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 () ); }
private void handleValueChange ( final ValueDiff diff ) { updateWrappedList ( makeList ( diff.getNewValue () ) ); }
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 () ); }
@SuppressWarnings ( { "rawtypes", "unchecked" } ) @Override public boolean addAll ( final int index, final Collection c ) { checkRealm (); final boolean result = this.wrappedList.addAll ( index, c ); updateValue (); return result; }
@Override public boolean remove ( final Object o ) { checkRealm (); final boolean result = this.wrappedList.remove ( o ); updateValue (); return result; }
@SuppressWarnings ( { "rawtypes", "unchecked" } ) @Override public boolean removeAll ( final Collection c ) { checkRealm (); final boolean result = this.wrappedList.removeAll ( c ); updateValue (); return result; }
@SuppressWarnings ( "unchecked" ) @Override public boolean add ( final Object o ) { checkRealm (); final boolean result = this.wrappedList.add ( o ); updateValue (); return result; }
@SuppressWarnings ( { "rawtypes", "unchecked" } ) @Override public boolean addAll ( final Collection c ) { checkRealm (); final boolean result = this.wrappedList.addAll ( c ); updateValue (); return result; }
@Override public void clear () { checkRealm (); this.wrappedList.clear (); updateValue (); }
@SuppressWarnings ( "unchecked" ) @Override public void add ( final int index, final Object element ) { checkRealm (); this.wrappedList.add ( index, element ); updateValue (); }
@SuppressWarnings ( { "rawtypes", "unchecked" } ) @Override public boolean retainAll ( final Collection c ) { checkRealm (); final boolean result = this.wrappedList.retainAll ( c ); updateValue (); return result; }
@Override public Object move ( final int oldIndex, final int newIndex ) { checkRealm (); final Object result = super.move ( oldIndex, newIndex ); updateValue (); return result; }