private void updateSelectedTab() { ICPropertyTab newTab = (ICPropertyTab) folder.getSelection()[0].getData(); if (newTab != null && currentTab != newTab) { recentTabs.put(getClass(), newTab.getClass()); if (currentTab != null) currentTab.handleTabEvent(ICPropertyTab.VISIBLE, null); currentTab = newTab; currentTab.handleTabEvent(ICPropertyTab.VISIBLE, NOT_NULL); } }
private Composite createRequestEditor(Composite parent) { final Composite rootControl = new Composite(parent, SWT.NONE); rootControl.setLayout(new FillLayout()); requestTabFolder = new TabFolder(rootControl, SWT.TOP); requestTabItem = new TabItem(requestTabFolder, SWT.NONE); requestTabItem.setText("Request"); requestEditor = new RequestEditor(requestTabFolder, requestBuilder); requestTabItem.setControl(requestEditor); requestTabItem.setData(requestEditor); requestHeaderTabItem = new TabItem(requestTabFolder, SWT.NONE); requestHeaderTabItem.setText("Headers"); requestHeaderEditor = new HeaderEditor(requestTabFolder, requestBuilder, 0); requestHeaderTabItem.setControl(requestHeaderEditor); requestHeaderTabItem.setData(requestHeaderEditor); requestTabFolder.addSelectionListener(createRequestTabFolderSelectionListener()); requestTabFolderItem = requestTabFolder.getSelection()[0]; requestBuilderPartCurr = (IHttpBuilderPart) requestTabFolderItem.getData(); return rootControl; }