23.12.2014 Views

NASA uses Eclipse RCP applications for experiments on the ...

NASA uses Eclipse RCP applications for experiments on the ...

NASA uses Eclipse RCP applications for experiments on the ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Do <strong>the</strong> c<strong>on</strong>structi<strong>on</strong> and customizati<strong>on</strong> of <strong>the</strong> CTabFolder <br />

!protected C<strong>on</strong>trol createPerspectiveBarC<strong>on</strong>trol(Composite parent){!<br />

! !m_cTabFolder = new CTabFolder(parent, SWT.TOP) {!<br />

! ! !public int getBorderWidth() { return 10; }!<br />

! !};!<br />

! !setTabFolderF<strong>on</strong>t(m_cTabFolder);!<br />

! !m_cTabFolder.setMinimumCharacters(20);!<br />

! !m_cTabFolder.setTabHeight(40);!<br />

! !m_cTabFolder.setSimple(false);!<br />

! !m_cTabFolder.setBorderVisible(true);!<br />

! !m_cTabFolder.setBackground(ColorProvider.INSTANCE.WIDGET_BACKGROUND);!<br />

! !return m_cTabFolder;!<br />

!}!<br />

A method to create a tab <br />

!protected CTabItem createTabItem(CTabFolder tabFolder, String title, !<br />

! ! ! ! ! C<strong>on</strong>trol c<strong>on</strong>trol, final String id) {!<br />

! !CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);!<br />

! !tabItem.setText(" " + title + " ");!<br />

! !tabItem.setData(id);!<br />

! !tabItem.setC<strong>on</strong>trol(c<strong>on</strong>trol);!<br />

! !return tabItem;!<br />

!}!<br />

A method to select a perspective <br />

!protected void selectPerspective(String perspectiveID, Selecti<strong>on</strong>Event e){!<br />

! !IWorkbenchPage page = m_workbenchWindow.getActivePage();!<br />

! !if(page != null) {!<br />

! ! !IPerspectiveDescriptor descriptor = !!<br />

! ! ! !m_perspectiveRegistry.findPerspectiveWithId(perspectiveID);!<br />

! ! !page.setPerspective(descriptor);!<br />

! ! !page.getActivePart().setFocus();!<br />

! !}!<br />

!! <str<strong>on</strong>g>Eclipse</str<strong>on</strong>g> <str<strong>on</strong>g>RCP</str<strong>on</strong>g> <str<strong>on</strong>g>for</str<strong>on</strong>g> ISS Experiments <br />

15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!