Eclipse RCP
SWT CTabFolder 클래스 setSimple 설정
jayden-lee
2019. 4. 15. 00:13
728x90
SWT 또는 Eclipse RCP(Plugin) 애플리케이션에서 탭 폴더를 나타내기 위해서 CTabFolder Composite를 주로 사용한다. CTabFolder Composite을 생성한 후, setSimple(boolean) 메서드를 통해 Render 옵션을 설정할 수 있다.
Eclipse Doc 문서에 setSimple(boolean) 메서드가 어떤 역할을 하는지 설명되어 있다.
setSimple(boolean) 메서드에 true 또는 false 옵션 값을 설정함에 따라 CTabFolder UI가 달라진다.
@Override
public void createPartControl(Composite parent) {
parent.setLayout(new GridLayout());
final Label lbl1 = new Label(parent, SWT.NONE);
lbl1.setText("Simple False 설정");
final CTabFolder cTabFolder1 = new CTabFolder(parent, SWT.BORDER);
cTabFolder1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
cTabFolder1.setSimple(false);
final Label lbl2 = new Label(parent, SWT.NONE);
lbl2.setText("Simple True 설정");
final CTabFolder cTabFolder2 = new CTabFolder(parent, SWT.BORDER);
cTabFolder2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
cTabFolder2.setSimple(true);
for (int i = 0; i < 8; i++) {
CTabItem item = new CTabItem(cTabFolder1, SWT.CLOSE);
item.setText("Item " + i);
Text text = new Text(cTabFolder1, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
text.setText("Text for item " + i);
item.setControl(text);
}
for (int i = 0; i < 8; i++) {
CTabItem item = new CTabItem(cTabFolder2, SWT.CLOSE);
item.setText("Item " + i);
Text text = new Text(cTabFolder2, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
text.setText("Text for item " + i);
item.setControl(text);
}
}