아래 코드에 따라 IToolBarManager에 콤보 상자를 추가 할 수 있습니다. 이제는 누구나 IContributionItem 내부에서 작성된 콤보 상자에 액세스하는 방법을 알고 있습니까?IContributionItem의 콤보 상자에 액세스하는 방법
친절 감사, 키리아 코스
IToolBarManager mgr = this.getViewSite().getActionBars().getToolBarManager();
IContributionItem comboCI = new ControlContribution("test") {
protected Control createControl(Composite parent) {
final Combo c = new Combo(parent, SWT.READ_ONLY);
c.add("one");
c.add("two");
c.add("three");
c.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
c.add("four");
}
});
return c;
}
};
mgr.add(comboCI);
정확히 무슨 당신이 원하는 무엇입니까? 이미 "외부"에 현재 값을 전달하는 데 사용할 수있는 수신기가 있습니다 ... –
다른 이벤트가 트리거 될 때 콤보 상자의 값을 변경하려고하므로 외부의 콤보 상자에 액세스해야합니다. 선언 된 범위의 – Kyriakos
콤보 자체는'SelectionEvent'의'item' 멤버 변수로 발견됩니다 ... –