use of org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage in project tdi-studio-se by Talend.
the class FindDialog method getFindTarget.
/**
* Gets the target for find action.
*
* @return The target for find action
*/
private static IFindTarget getFindTarget() {
IWorkbenchPart activePart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
if (activePart instanceof IFindTarget) {
return (IFindTarget) activePart;
}
PropertySheet part = (PropertySheet) activePart;
if (part == null) {
return null;
}
IPage page = part.getCurrentPage();
if (!(page instanceof TabbedPropertySheetPage)) {
return null;
}
TabbedPropertySheetPage propertySheetPage = (TabbedPropertySheetPage) page;
ISection[] sections = propertySheetPage.getCurrentTab().getSections();
if (sections.length != 1) {
return null;
}
ISection section = sections[0];
if (!(section instanceof IFindTarget)) {
return null;
}
return (IFindTarget) section;
}
Aggregations