View | Details | Raw Unified | Return to bug 255460
Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/PDEUIMessages.java (+1 lines)
Lines 1030-1035 Link Here
1030
	public static String ManifestEditor_DetailExtension_edit;
1030
	public static String ManifestEditor_DetailExtension_edit;
1031
	public static String ManifestEditor_DetailExtension_up;
1031
	public static String ManifestEditor_DetailExtension_up;
1032
	public static String ManifestEditor_DetailExtension_down;
1032
	public static String ManifestEditor_DetailExtension_down;
1033
	public static String ManifestEditor_DetailExtension_missingExtPointSchema;
1033
1034
1034
	public static String ManifestEditor_ExportSection_title;
1035
	public static String ManifestEditor_ExportSection_title;
1035
	public static String ManifestEditor_ExportSection_desc;
1036
	public static String ManifestEditor_ExportSection_desc;
(-)src/org/eclipse/pde/internal/ui/pderesources.properties (+1 lines)
Lines 272-277 Link Here
272
ManifestEditor_DetailExtension_edit = Edit...
272
ManifestEditor_DetailExtension_edit = Edit...
273
ManifestEditor_DetailExtension_up = Up
273
ManifestEditor_DetailExtension_up = Up
274
ManifestEditor_DetailExtension_down = Down
274
ManifestEditor_DetailExtension_down = Down
275
ManifestEditor_DetailExtension_missingExtPointSchema = No schema found for ''{0}'' extension point
275
276
276
ManifestEditor_ExportSection_title = Library Visibility
277
ManifestEditor_ExportSection_title = Library Visibility
277
ManifestEditor_ExportSection_desc = Specify the portions of the selected library that should be visible to other plug-ins:
278
ManifestEditor_ExportSection_desc = Specify the portions of the selected library that should be visible to other plug-ins:
(-)src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsSection.java (+35 lines)
Lines 15-24 Link Here
15
import org.eclipse.core.resources.IProject;
15
import org.eclipse.core.resources.IProject;
16
import org.eclipse.core.runtime.*;
16
import org.eclipse.core.runtime.*;
17
import org.eclipse.jface.action.*;
17
import org.eclipse.jface.action.*;
18
import org.eclipse.jface.dialogs.IMessageProvider;
18
import org.eclipse.jface.util.IPropertyChangeListener;
19
import org.eclipse.jface.util.IPropertyChangeListener;
19
import org.eclipse.jface.util.PropertyChangeEvent;
20
import org.eclipse.jface.util.PropertyChangeEvent;
20
import org.eclipse.jface.viewers.*;
21
import org.eclipse.jface.viewers.*;
21
import org.eclipse.jface.wizard.WizardDialog;
22
import org.eclipse.jface.wizard.WizardDialog;
23
import org.eclipse.osgi.util.NLS;
22
import org.eclipse.pde.core.IModelChangedEvent;
24
import org.eclipse.pde.core.IModelChangedEvent;
23
import org.eclipse.pde.core.IModelChangedListener;
25
import org.eclipse.pde.core.IModelChangedListener;
24
import org.eclipse.pde.core.plugin.*;
26
import org.eclipse.pde.core.plugin.*;
Lines 639-644 Link Here
639
	public void refresh() {
641
	public void refresh() {
640
		IPluginModelBase model = (IPluginModelBase) getPage().getModel();
642
		IPluginModelBase model = (IPluginModelBase) getPage().getModel();
641
		fExtensionTree.setInput(model.getPluginBase());
643
		fExtensionTree.setInput(model.getPluginBase());
644
		reportMissingExtensionPointSchemas(model.getPluginBase());
642
		selectFirstExtension();
645
		selectFirstExtension();
643
		getManagedForm().fireSelectionChanged(ExtensionsSection.this, fExtensionTree.getSelection());
646
		getManagedForm().fireSelectionChanged(ExtensionsSection.this, fExtensionTree.getSelection());
644
		super.refresh();
647
		super.refresh();
Lines 662-670 Link Here
662
			IPluginObject parent = changeObject instanceof IPluginExtension ? ((IPluginModelBase) getPage().getModel()).getPluginBase() : pobj.getParent();
665
			IPluginObject parent = changeObject instanceof IPluginExtension ? ((IPluginModelBase) getPage().getModel()).getPluginBase() : pobj.getParent();
663
			if (event.getChangeType() == IModelChangedEvent.INSERT) {
666
			if (event.getChangeType() == IModelChangedEvent.INSERT) {
664
				fExtensionTree.refresh(parent);
667
				fExtensionTree.refresh(parent);
668
				if (changeObject instanceof IPluginExtension) {
669
					IPluginExtension ext = (IPluginExtension) changeObject;
670
					if (ext.getSchema() == null)
671
						reportMissingExtensionPointSchema(ext.getPoint());
672
				}
665
				fExtensionTree.setSelection(new StructuredSelection(changeObject), true);
673
				fExtensionTree.setSelection(new StructuredSelection(changeObject), true);
666
				fExtensionTree.getTree().setFocus();
674
				fExtensionTree.getTree().setFocus();
667
			} else if (event.getChangeType() == IModelChangedEvent.REMOVE) {
675
			} else if (event.getChangeType() == IModelChangedEvent.REMOVE) {
676
				if (changeObject instanceof IPluginExtension) {
677
					IPluginExtension ext = (IPluginExtension) changeObject;
678
					IPluginExtension[] extensions = ((IPluginBase) parent).getExtensions();
679
					boolean found = false;
680
					// search if there is at least another extension extending the same point than the one being removed
681
					for (int i = 0; i < extensions.length; i++) {
682
						String point = extensions[i].getPoint();
683
						if (ext.getPoint().equals(point)) {
684
							found = true;
685
							break;
686
						}
687
					}
688
					if (!found)
689
						getManagedForm().getMessageManager().removeMessage(ext.getPoint());
690
				}
668
				fExtensionTree.remove(pobj);
691
				fExtensionTree.remove(pobj);
669
			} else {
692
			} else {
670
				if (event.getChangedProperty().equals(IPluginParent.P_SIBLING_ORDER)) {
693
				if (event.getChangedProperty().equals(IPluginParent.P_SIBLING_ORDER)) {
Lines 1673-1676 Link Here
1673
		return selection.size() == 1;
1696
		return selection.size() == 1;
1674
	}
1697
	}
1675
1698
1699
	private void reportMissingExtensionPointSchemas(IPluginBase pluginBase) {
1700
		IPluginExtension[] extensions = pluginBase.getExtensions();
1701
		for (int i = 0; i < extensions.length; i++) {
1702
			IPluginExtension ext = extensions[i];
1703
			if (ext.getSchema() == null)
1704
				reportMissingExtensionPointSchema(ext.getPoint());
1705
		}
1706
	}
1707
1708
	private void reportMissingExtensionPointSchema(String point) {
1709
		getManagedForm().getMessageManager().addMessage(point, NLS.bind(PDEUIMessages.ManifestEditor_DetailExtension_missingExtPointSchema, point), null, IMessageProvider.WARNING);
1710
	}
1676
}
1711
}

Return to bug 255460