2013-06-02 48 views
0

我用Java編寫一個Eclipse插件,現在我想用一個ComboBoxPropertyDescriptor獲取ComboBoxPropertyDescriptor選擇在Eclipse插件

public class MyComboBoxDescriptor extends ComboBoxPropertyDescriptor { 

public MyComboBoxDescriptor(Object id, String displayName) { 
    super(id, displayName, new String[]{"value1", "value2", "value3"}); 
} 

我怎樣才能在運行時所選擇的價值?

+0

與您的問題沒有特別的關係,但您是否注意到javadoc中的註釋_This類可能會被實例化;它不打算被分類._?如果你想建立你自己的,你應該實現[IPropertyDescriptor](http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/視圖/屬性/ IPropertyDescriptor.html) –

回答

0

如果您使用PropertySheet和您自己的org.eclipse.ui.views.properties.IPropertySource實現,則在選擇該值時,標準ComboBoxPropertyDescriptor應該告訴屬性源。