Search in sources :

Example 1 with TabContents

use of org.eclipse.ui.views.properties.tabbed.TabContents in project tdi-studio-se by Talend.

the class PartListener method validatePart.

/**
     * Validates the given part.
     * 
     * @param partRef
     *            The part reference
     * @return True if the given part is valid for further operation
     */
private boolean validatePart(IWorkbenchPartReference partRef) {
    // check if the part is a property sheet
    if (!partRef.getId().equals(IPageLayout.ID_PROP_SHEET)) {
        return false;
    }
    // check if the property sheet is the corresponding one
    if (!propertySection.getPropertySheetId().equals(partRef.getPart(false).toString())) {
        return false;
    }
    // checks if the section is the corresponding one
    TabContents currentTab = tabbedPropertySheetPage.getCurrentTab();
    if (currentTab == null) {
        return false;
    }
    ISection[] sections = currentTab.getSections();
    if (sections == null || sections.length == 0 || !propertySection.equals(sections[0])) {
        return false;
    }
    return true;
}
Also used : ISection(org.eclipse.ui.views.properties.tabbed.ISection) TabContents(org.eclipse.ui.views.properties.tabbed.TabContents)

Aggregations

ISection (org.eclipse.ui.views.properties.tabbed.ISection)1 TabContents (org.eclipse.ui.views.properties.tabbed.TabContents)1