RCP/SWT & JFACE

rcp toolbar에서 label등 각종 contribution item 생성방법

반응형

    ToolBarManager manager = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL);
    
LabelContributionItem labelItem = new LabelContributionItem("myLabelId");  //Label ContibutionItem 생성
    manager.add(labelItem);
    
TextContributionItem textItem = new TextContributionItem("myTextId");
    manager.add(textItem);
    
ToolBar toolbar = manager.createControl(parent);
    
return toolbar;

 

출처: <http://stackoverflow.com/questions/28900682/what-is-the-proper-way-to-add-custom-controls-to-the-eclipse-toolbar-using-work>

반응형