Search in sources :

Example 1 with IPropertySheetEntry

use of org.eclipse.ui.views.properties.IPropertySheetEntry in project webtools.sourceediting by eclipse.

the class ConfigurablePropertySheetPage method remove.

void remove() {
    if (fSelectedEntries != null) {
        Object[] entries = fSelectedEntries;
        ISelection selection = fInput;
        boolean needsRefresh = false;
        if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
            IPropertySource source = getConfiguration().getPropertySourceProvider(this).getPropertySource(((IStructuredSelection) selection).getFirstElement());
            if (source != null && source instanceof IPropertySourceExtension) {
                for (int i = 0; i < entries.length; i++) {
                    if (entries[i] instanceof IPropertySheetEntry) {
                        IPropertySheetEntry entry = (IPropertySheetEntry) entries[i];
                        needsRefresh = true;
                        ((IPropertySourceExtension) source).removeProperty(entry.getDisplayName());
                    }
                }
            }
        }
        if (needsRefresh) {
            refresh();
        }
    }
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IPropertySourceExtension(org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension) IPropertySource(org.eclipse.ui.views.properties.IPropertySource) IPropertySheetEntry(org.eclipse.ui.views.properties.IPropertySheetEntry) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

ISelection (org.eclipse.jface.viewers.ISelection)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 IPropertySheetEntry (org.eclipse.ui.views.properties.IPropertySheetEntry)1 IPropertySource (org.eclipse.ui.views.properties.IPropertySource)1 IPropertySourceExtension (org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension)1