Exemplo n.º 1
0
  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);
  }
Exemplo n.º 2
0
 /* (non-Javadoc)
  * @see net.sf.eclipsensis.installoptions.figures.IInstallOptionsFigure#setDisabled(boolean)
  */
 public void setDisabled(boolean disabled) {
   mListFigure.setDisabled(disabled);
   mComboFigure.setDisabled(disabled);
 }
Exemplo n.º 3
0
 public void setShowDropdown(boolean flag) {
   if (mShowDropdown != flag) {
     mShowDropdown = flag;
     mListFigure.setVisible(mShowDropdown);
   }
 }
Exemplo n.º 4
0
 public void setListItems(List<String> listItems) {
   mListFigure.setListItems(listItems);
 }
Exemplo n.º 5
0
 public List<String> getListItems() {
   return mListFigure.getListItems();
 }
Exemplo n.º 6
0
 /* (non-Javadoc)
  * @see net.sf.eclipsensis.installoptions.figures.IInstallOptionsFigure#refresh()
  */
 public void refresh() {
   mComboFigure.refresh();
   mListFigure.refresh();
 }
Exemplo n.º 7
0
 public void setState(String state) {
   mComboFigure.setState(state);
   mListFigure.setState(state);
 }