/** * ************************************************************************* Clear the option * buttons ************************************************************************ */ private void clearOptions() { if (m_optionsRadio.size() > 0) { for (Button opt : m_optionsRadio) { opt.dispose(); } m_optionsRadio.clear(); } if (m_optionScroll != null) { m_optionContainer.dispose(); m_optionScroll.dispose(); m_optionScroll = null; } if (m_optionsCombo != null) { m_optionsCombo.dispose(); m_optionsCombo = null; } m_selectedOption = -1; updateButtons(); }
public ComboboxFigure(Composite parent, final IPropertySource propertySource) { super(); Combo cb = new Combo(parent, SWT.DROP_DOWN); cb.setVisible(false); cb.setBounds(-100, -100, 10, 10); Point p = cb.computeSize(SWT.DEFAULT, SWT.DEFAULT); cb.dispose(); mComboHeight = p.y; setLayoutManager(new XYLayout()); Rectangle[] bounds = calculateBounds( (Rectangle) propertySource.getPropertyValue(InstallOptionsWidget.PROPERTY_BOUNDS)); mComboFigure = new ComboFigure(parent, new CustomPropertySourceWrapper(propertySource, bounds[0])); mListFigure = new ListFigure( parent, new CustomPropertySourceWrapper(propertySource, bounds[1]), SWT.SINGLE); mListFigure.setBorder(new LineBorder(ColorManager.getColor(ColorManager.BLACK))); mListFigure.setVisible(mShowDropdown); add(mComboFigure); add(mListFigure); }