*** empty log message ***
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/WorkspaceModelManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/WorkspaceModelManager.java
index c625e27..4bcb249 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/WorkspaceModelManager.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/WorkspaceModelManager.java
@@ -410,16 +410,22 @@
}
return false;
}
+
public static boolean isPluginProject(IProject project) {
if (project.isOpen() == false)
return false;
+ return project.exists(new Path("plugin.xml")) || project.exists(new Path("fragment.xml"));
+ }
+
+ public static boolean isJavaPluginProject(IProject project) {
+ if (!isPluginProject(project)) return false;
try {
if (!project.hasNature(JavaCore.NATURE_ID)) return false;
-
} catch (CoreException e) {
PDEPlugin.logException(e);
+ return false;
}
- return project.exists(new Path("plugin.xml")) || project.exists(new Path("fragment.xml"));
+ return true;
}
private void ensureModelExists(IProject pluginProject) {
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/base/schema/ISchema.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/base/schema/ISchema.java
index db9d857..791f900 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/base/schema/ISchema.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/base/schema/ISchema.java
@@ -9,6 +9,7 @@
import java.util.*;
import org.eclipse.pde.internal.base.model.*;
import org.eclipse.pde.model.*;
+import org.eclipse.core.runtime.CoreException;
/**
* Objects of this class encapsulate data loaded from
* the XML Schema file that defines an Eclipse extension point.
@@ -28,6 +29,8 @@
* to receive notification about these changes.
*/
public interface ISchema extends ISchemaObject, IModelChangeProvider {
+ String P_POINT = "pointId";
+ String P_PLUGIN = "pluginId";
/**
* Releases all data in this schema. From this point on,
* the first subsequent reference of this schema will
@@ -74,7 +77,12 @@
* Returns an Id of the extension point that is defined in this schema.
* @return extension point Id of this schema
*/
+public String getQualifiedPointId();
+
public String getPointId();
+public void setPointId(String pointId) throws CoreException;
+public String getPluginId();
+public void setPluginId(String pluginId) throws CoreException;
/**
* Returns an object that holds a reference to this schema.
* Descriptors are responsible for loading and disposing
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/builders/SchemaTransformer.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/builders/SchemaTransformer.java
index 6262388..e645dde 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/builders/SchemaTransformer.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/builders/SchemaTransformer.java
@@ -205,7 +205,7 @@
out.append("<BODY>\n");
out.append("<H1><CENTER>" + schema.getName() + "</CENTER></H1>\n");
out.append("<H2>Identifier</H2>\n");
- out.append(schema.getPointId());
+ out.append(schema.getQualifiedPointId());
out.append("<H2>Description</H2>\n");
transformText(out, schema.getDescription());
out.append("<H2>Markup</H2>\n");
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/feature/InfoSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/feature/InfoSection.java
index 9f5fd80..39b9b07 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/feature/InfoSection.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/feature/InfoSection.java
@@ -91,7 +91,7 @@
layout.verticalSpacing = 9;
container.setLayout(layout);
GridData gd;
-
+
Label label = factory.createLabel(container, null);
gd = new GridData();
gd.horizontalSpan = 3;
@@ -122,8 +122,7 @@
urlText.setLayoutData(gd);
factory.createLabel(container, null);
- label =
- factory.createLabel(container, PDEPlugin.getResourceString(KEY_TEXT));
+ label = factory.createLabel(container, PDEPlugin.getResourceString(KEY_TEXT));
gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
label.setLayoutData(gd);
@@ -274,9 +273,16 @@
public void documentAboutToBeChanged(DocumentEvent e) {
}
});
+ featureModel.addModelChangedListener(this);
updateEditorInput(featureModel.getFeature().getFeatureInfo(0), false);
}
+ public void dispose() {
+ IFeatureModel featureModel = (IFeatureModel) getFormPage().getModel();
+ featureModel.removeModelChangedListener(this);
+ super.dispose();
+ }
+
private void infoModified() {
IFeatureModel featureModel = (IFeatureModel) getFormPage().getModel();
if (!ignoreChange && featureModel instanceof IEditable) {
@@ -288,12 +294,23 @@
resetButton.setEnabled(true);
}
+ public void modelChanged(IModelChangedEvent e) {
+ if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) {
+ IFeatureModel model = (IFeatureModel) getFormPage().getModel();
+ int index = sectionCombo.getSelectionIndex();
+ IFeatureInfo info = model.getFeature().getFeatureInfo(index);
+ setDirty(false);
+ element=null;
+ updateEditorInput(info, false);
+ }
+ }
+
private void initializeSectionCombo() {
sectionCombo.setItems(
new String[] {
PDEPlugin.getResourceString(KEY_INFO_DESCRIPTION),
PDEPlugin.getResourceString(KEY_INFO_COPYRIGHT),
- PDEPlugin.getResourceString(KEY_INFO_LICENSE) });
+ PDEPlugin.getResourceString(KEY_INFO_LICENSE)});
sectionCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/DependenciesForm.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/DependenciesForm.java
index 525b3ea..e6f4a86 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/DependenciesForm.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/DependenciesForm.java
@@ -15,6 +15,7 @@
import org.eclipse.swt.*;
import org.eclipse.pde.internal.*;
import org.eclipse.jface.action.*;
+import org.eclipse.core.resources.*;
public class DependenciesForm extends ScrollableSectionForm {
public static final String TITLE = "ManifestEditor.DependenciesForm.title";
@@ -88,8 +89,13 @@
}
public boolean fillContextMenu(IMenuManager manager) {
- manager.add(importListSection.getBuildpathAction());
- manager.add(new Separator());
+ IResource resource =
+ ((IPluginModelBase) page.getModel()).getUnderlyingResource();
+ if (resource != null
+ && WorkspaceModelManager.isJavaPluginProject(resource.getProject())) {
+ manager.add(importListSection.getBuildpathAction());
+ manager.add(new Separator());
+ }
return true;
}
}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/ImportListSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/ImportListSection.java
index c849a34..8bc5acb 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/ImportListSection.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/ImportListSection.java
@@ -314,9 +314,16 @@
public void commitChanges(boolean onSave) {
if (onSave) {
- boolean shouldUpdate = BuildpathPreferencePage.isManifestUpdate();
- if (shouldUpdate)
- updateBuildPath();
+ IResource resource =
+ ((IPluginModelBase) getFormPage().getModel()).getUnderlyingResource();
+ if (resource!=null) {
+ IProject project = resource.getProject();
+ if (WorkspaceModelManager.isJavaPluginProject(project)) {
+ boolean shouldUpdate = BuildpathPreferencePage.isManifestUpdate();
+ if (shouldUpdate)
+ updateBuildPath();
+ }
+ }
}
setDirty(false);
}
@@ -329,7 +336,9 @@
return buildpathAction;
}
- private void computeBuildPath(final IPluginModelBase model, final boolean save) {
+ private void computeBuildPath(
+ final IPluginModelBase model,
+ final boolean save) {
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
monitor.beginTask(PDEPlugin.getResourceString(KEY_UPDATING_BUILD_PATH), 1);
@@ -371,8 +380,8 @@
for (int i = 0; i < objects.length; i++) {
Object obj = objects[i];
if (obj instanceof ImportObject) {
- ImportObject iobj = (ImportObject)obj;
- PluginImport iimport = (PluginImport)iobj.getImport();
+ ImportObject iobj = (ImportObject) obj;
+ PluginImport iimport = (PluginImport) iobj.getImport();
iimport.setModel(model);
iimport.setParent(plugin);
plugin.add(iimport);
@@ -383,7 +392,8 @@
}
}
protected boolean canPaste(Object target, Object[] objects) {
- if (objects[0] instanceof ImportObject) return true;
+ if (objects[0] instanceof ImportObject)
+ return true;
return false;
}
}
\ No newline at end of file
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/NewElementAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/NewElementAction.java
index a4de05a..886d559 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/NewElementAction.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/NewElementAction.java
@@ -60,7 +60,7 @@
return project.getName() + "." + tag + counter;
}
private String getCounterKey(ISchemaElement elementInfo) {
- return elementInfo.getSchema().getPointId()+"."+elementInfo.getName();
+ return elementInfo.getSchema().getQualifiedPointId()+"."+elementInfo.getName();
}
private String getElementName() {
return elementInfo!=null?elementInfo.getName() : UNKNOWN_ELEMENT_TAG;
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/PluginAdapterFactory.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/PluginAdapterFactory.java
index 9bd1785..1bda896 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/PluginAdapterFactory.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/manifest/PluginAdapterFactory.java
@@ -48,7 +48,7 @@
return new UnknownElementPropertySource(element);
} else {
// Use or build custom property page for this class
- String key = elementInfo.getSchema().getPointId() + "." + elementInfo.getName();
+ String key = elementInfo.getSchema().getQualifiedPointId() + "." + elementInfo.getName();
Hashtable table = getElementTable(element);
ExtensionElementPropertySource customSource = (ExtensionElementPropertySource) table.get(key);
if (customSource == null) {
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/schema/SchemaForm.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/schema/SchemaForm.java
index 8c2711b..06428b9 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/schema/SchemaForm.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/schema/SchemaForm.java
@@ -18,6 +18,7 @@
import org.eclipse.pde.internal.base.model.*;
public class SchemaForm extends ScrollableSectionForm implements IModelChangedListener {
+ private SchemaSpecSection schemaSpecSection;
private ElementSection elementSection;
private DescriptionSection descriptionSection;
private GrammarSection grammarSection;
@@ -39,14 +40,20 @@
GridData gd;
Control control;
-
- elementSection = new ElementSection(page);
- control = elementSection.createControl(parent, factory);
- gd = new GridData(GridData.FILL_BOTH);
+
+ schemaSpecSection = new SchemaSpecSection(page);
+ control = schemaSpecSection.createControl(parent, factory);
+ gd = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
control.setLayoutData(gd);
grammarSection = new GrammarSection(page);
control = grammarSection.createControl(parent, factory);
+ gd = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
+ gd.verticalSpan = 2;
+ control.setLayoutData(gd);
+
+ elementSection = new ElementSection(page);
+ control = elementSection.createControl(parent, factory);
gd = new GridData(GridData.FILL_BOTH);
control.setLayoutData(gd);
@@ -66,6 +73,7 @@
manager.linkSections(elementSection, grammarSection);
manager.linkSections(elementSection, descriptionSection);
+ registerSection(schemaSpecSection);
registerSection(elementSection);
registerSection(grammarSection);
registerSection(descriptionSection);
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/schema/SchemaSpecSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/schema/SchemaSpecSection.java
new file mode 100644
index 0000000..0caf36f
--- /dev/null
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/editor/schema/SchemaSpecSection.java
@@ -0,0 +1,157 @@
+package org.eclipse.pde.internal.editor.schema;
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.pde.internal.editor.*;
+import org.eclipse.update.ui.forms.internal.*;
+import org.eclipse.pde.internal.PDEPlugin;
+import org.eclipse.pde.model.*;
+import org.eclipse.pde.internal.base.schema.*;
+import org.eclipse.pde.internal.schema.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.layout.*;
+import org.eclipse.core.runtime.CoreException;
+
+
+public class SchemaSpecSection extends PDEFormSection {
+ public static final String SECTION_TITLE = "SchemaEditor.SpecSection.title";
+ public static final String SECTION_DESC = "SchemaEditor.SpecSection.desc";
+ public static final String SECTION_PLUGIN = "SchemaEditor.SpecSection.plugin";
+ public static final String SECTION_POINT = "SchemaEditor.SpecSection.point";
+ public static final String SECTION_NAME = "SchemaEditor.SpecSection.name";
+
+ private FormEntry pluginText;
+ private FormEntry pointText;
+ private FormEntry nameText;
+ private boolean updateNeeded;
+
+public SchemaSpecSection(SchemaFormPage page) {
+ super(page);
+ setHeaderText(PDEPlugin.getResourceString(SECTION_TITLE));
+ setDescription(PDEPlugin.getResourceString(SECTION_DESC));
+ setCollapsable(true);
+ setCollapsed(true);
+}
+public void commitChanges(boolean onSave) {
+ Schema schema = (Schema) getFormPage().getModel();
+ pluginText.commit();
+ pointText.commit();
+ nameText.commit();
+}
+
+public Composite createClient(Composite parent, FormWidgetFactory factory) {
+ Composite container = factory.createComposite(parent);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.verticalSpacing = 9;
+ layout.horizontalSpacing = 6;
+ container.setLayout(layout);
+
+ final Schema schema = (Schema)getFormPage().getModel();
+
+ pluginText = new FormEntry(createText(container, PDEPlugin.getResourceString(SECTION_PLUGIN), factory));
+ pluginText.addFormTextListener(new IFormTextListener() {
+ public void textValueChanged(FormEntry text) {
+ schema.setPluginId(text.getValue());
+ }
+ public void textDirty(FormEntry text) {
+ forceDirty();
+ }
+ });
+
+ pointText = new FormEntry(createText(container, PDEPlugin.getResourceString(SECTION_POINT), factory));
+ pointText.addFormTextListener(new IFormTextListener() {
+ public void textValueChanged(FormEntry text) {
+ schema.setPointId(text.getValue());
+ }
+ public void textDirty(FormEntry text) {
+ forceDirty();
+ }
+ });
+
+ nameText = new FormEntry(createText(container, PDEPlugin.getResourceString(SECTION_POINT), factory));
+ nameText.addFormTextListener(new IFormTextListener() {
+ public void textValueChanged(FormEntry text) {
+ schema.setName(text.getValue());
+ getFormPage().getForm().setHeadingText(schema.getName());
+ //((SchemaEditor) getFormPage().getEditor()).updateTitle();
+ }
+ public void textDirty(FormEntry text) {
+ forceDirty();
+ }
+ });
+
+ GridData gd = (GridData) pointText.getControl().getLayoutData();
+ gd.widthHint = 150;
+
+ factory.paintBordersFor(container);
+ return container;
+}
+
+private void forceDirty() {
+ setDirty(true);
+ ISchema schema = (ISchema)getFormPage().getModel();
+ if (schema instanceof IEditable) {
+ IEditable editable = (IEditable)schema;
+ editable.setDirty(true);
+ getFormPage().getEditor().fireSaveNeeded();
+ }
+}
+
+public void dispose() {
+ ISchema schema = (ISchema) getFormPage().getModel();
+ schema.removeModelChangedListener(this);
+ super.dispose();
+}
+
+public void initialize(Object input) {
+ ISchema schema = (ISchema)input;
+ update(input);
+ if (!(schema instanceof IEditable)) {
+ pluginText.getControl().setEnabled(false);
+ pointText.getControl().setEnabled(false);
+ nameText.getControl().setEnabled(false);
+ }
+ schema.addModelChangedListener(this);
+}
+public boolean isDirty() {
+ return pluginText.isDirty()
+ || pointText.isDirty()
+ || nameText.isDirty();
+}
+
+public void modelChanged(IModelChangedEvent e) {
+ if (e.getChangeType()==IModelChangedEvent.WORLD_CHANGED) {
+ updateNeeded=true;
+ }
+}
+public void setFocus() {
+ if (pointText != null)
+ pointText.getControl().setFocus();
+}
+private void setIfDefined(FormEntry formText, String value) {
+ if (value != null) {
+ formText.setValue(value, true);
+ }
+}
+private void setIfDefined(Text text, String value) {
+ if (value != null)
+ text.setText(value);
+}
+public void update() {
+ if (updateNeeded) {
+ this.update(getFormPage().getModel());
+ }
+}
+public void update(Object input) {
+ ISchema schema = (ISchema)input;
+ setIfDefined(pluginText, schema.getPluginId());
+ setIfDefined(pointText, schema.getPointId());
+ setIfDefined(nameText, schema.getName());
+ getFormPage().getForm().setHeadingText(schema.getName());
+ updateNeeded=false;
+}
+}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLaunchConfigurationDelegate.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLaunchConfigurationDelegate.java
index 218c39f..ca8cf7c 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLaunchConfigurationDelegate.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLaunchConfigurationDelegate.java
@@ -27,6 +27,7 @@
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jdt.launching.sourcelookup.JavaSourceLocator;
+import org.eclipse.pde.internal.WorkspaceModelManager;
public class WorkbenchLaunchConfigurationDelegate
implements ILaunchConfigurationDelegate, ILauncherSettings {
@@ -359,10 +360,12 @@
try {
File pluginDir =
new File(new URL("file:" + plugins[i].getInstallLocation()).getFile());
- IContainer project =
+ IContainer container =
root.getContainerForLocation(new Path(pluginDir.getPath()));
- if (project instanceof IProject) {
- javaProjects.add(JavaCore.create((IProject) project));
+ if (container instanceof IProject) {
+ IProject project = (IProject)container;
+ if (WorkspaceModelManager.isJavaPluginProject(project))
+ javaProjects.add(JavaCore.create(project));
}
} catch (MalformedURLException e) {
PDEPlugin.log(e);
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherDelegate.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherDelegate.java
index 8feac0b..c5e4481 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherDelegate.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/launcher/WorkbenchLauncherDelegate.java
@@ -294,10 +294,12 @@
try {
File pluginDir =
new File(new URL("file:" + plugins[i].getInstallLocation()).getFile());
- IContainer project =
+ IContainer container =
root.getContainerForLocation(new Path(pluginDir.getPath()));
- if (project instanceof IProject) {
- javaProjects.add(JavaCore.create((IProject) project));
+ if (container instanceof IProject) {
+ IProject project = (IProject)container;
+ if (WorkspaceModelManager.isJavaPluginProject(project))
+ javaProjects.add(JavaCore.create(project));
}
} catch (MalformedURLException e) {
PDEPlugin.log(e);
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/model/feature/Feature.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/model/feature/Feature.java
index 78aeebd..ee1c61d 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/model/feature/Feature.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/model/feature/Feature.java
@@ -334,6 +334,9 @@
ws = null;
nl = null;
arch = null;
+ infos[0] = null;
+ infos[1] = null;
+ infos[2] = null;
}
public void setProviderName(String providerName) throws CoreException {
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/pderesources.properties b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/pderesources.properties
index a90e9a1..48d4905 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/pderesources.properties
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/pderesources.properties
@@ -392,6 +392,12 @@
SchemaEditor.ElementPR.labelAttribute = Label Attribute
SchemaEditor.ElementPR.invalid = "{0}" is not a valid attribute name
+SchemaEditor.SpecSection.title = General Information
+SchemaEditor.SpecSection.desc = This section describes general information about this schema.
+SchemaEditor.SpecSection.plugin = Plug-in Id:
+SchemaEditor.SpecSection.point = Point Id:
+SchemaEditor.SpecSection.name = Point Name:
+
SchemaEditor.ElementSection.title = Extension Point Elements
SchemaEditor.ElementSection.desc = The following XML elements and attributes are allowed\nin this extension point:
SchemaEditor.ElementSection.newElement = &New Element
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/schema/EditableSchema.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/schema/EditableSchema.java
index 5c2eeb7..e39779f 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/schema/EditableSchema.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/schema/EditableSchema.java
@@ -13,8 +13,8 @@
public class EditableSchema extends Schema implements IEditable {
private boolean dirty;
-public EditableSchema(String id, String name) {
- super(id, name);
+public EditableSchema(String pluginId, String pointId, String name) {
+ super(pluginId, pointId, name);
}
public EditableSchema(ISchemaDescriptor schemaDescriptor, java.net.URL url) {
super(schemaDescriptor, url);
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/schema/Schema.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/schema/Schema.java
index dd54ce2..956e8b2 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/schema/Schema.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/schema/Schema.java
@@ -23,20 +23,23 @@
private Vector listeners = new Vector();
private Vector elements = new Vector();
private Vector docSections = new Vector();
- private String internalId;
+ private String pointId;
+ private String pluginId;
private ISchemaDescriptor schemaDescriptor;
private boolean loaded;
private Vector references;
private String description;
- private String name;
+ private String name="";
private boolean notificationEnabled;
public final static java.lang.String INDENT = " ";
private boolean disposed=false;
private Hashtable lineTable;
-public Schema(String id, String name) {
- internalId = id;
- setName(name);
+
+public Schema(String pluginId, String pointId, String name) {
+ this.pluginId = pluginId;
+ this.pointId = pointId;
+ this.name = name;
}
public Schema(ISchemaDescriptor schemaDescriptor, URL url) {
this.schemaDescriptor = schemaDescriptor;
@@ -171,10 +174,19 @@
public ISchemaObject getParent() {
return null;
}
-public String getPointId() {
+public String getQualifiedPointId() {
//return schemaDescriptor!=null?schemaDescriptor.getPointId():internalId;
- return internalId;
+ return pluginId + "."+pointId;
}
+
+public String getPluginId() {
+ return pluginId;
+}
+
+public String getPointId() {
+ return pointId;
+}
+
public ISchema getSchema() {
return this;
}
@@ -552,7 +564,8 @@
if (meta.getNodeName().equals("meta.schema")) {
section = "overview";
setName(getAttribute(meta, "name"));
- internalId = getAttribute(meta, "plugin") + "." + getAttribute(meta, "id");
+ pluginId = getAttribute(meta, "plugin");
+ pointId = getAttribute(meta, "id");
} else
if (meta.getNodeName().equals("meta.section")) {
section = getAttribute(meta, "type");
@@ -604,7 +617,8 @@
lineTable = null;
elements = new Vector();
docSections = new Vector();
- internalId = null;
+ pointId = null;
+ pluginId = null;
references = null;
description = null;
name = null;
@@ -642,10 +656,21 @@
fireModelObjectChanged(this, P_DESCRIPTION, oldValue, description);
}
public void setName(String newName) {
+ if (newName==null) newName = "";
String oldValue = name;
name = newName;
fireModelObjectChanged(this, P_NAME, oldValue, name);
}
+public void setPluginId(String newId) {
+ String oldValue = pluginId;
+ pluginId = newId;
+ fireModelObjectChanged(this, P_PLUGIN, oldValue, newId);
+}
+public void setPointId(String newId) {
+ String oldValue = pointId;
+ pointId = newId;
+ fireModelObjectChanged(this, P_POINT, oldValue, newId);
+}
public void setNotificationEnabled(boolean newNotificationEnabled) {
notificationEnabled = newNotificationEnabled;
}
@@ -689,7 +714,7 @@
}
}
public void write(String indent, PrintWriter writer) {
- String pointId = this.getPointId();
+ String pointId = this.getQualifiedPointId();
int loc = pointId.lastIndexOf('.');
String pluginId = "";
if (loc!= -1) {
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/extension/BaseExtensionPointMainPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/extension/BaseExtensionPointMainPage.java
index ac7243b..b03467a 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/extension/BaseExtensionPointMainPage.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/extension/BaseExtensionPointMainPage.java
@@ -117,9 +117,9 @@
idText.setFocus();
setControl(container);
}
- private InputStream createSchemaStream(String plugin, String id, String name) {
- String fullId = plugin + "." + id;
- EditableSchema schema = new EditableSchema(fullId, name);
+ private InputStream createSchemaStream(String pluginId, String pointId, String name) {
+ if (name.length()==0) name = pointId;
+ EditableSchema schema = new EditableSchema(pluginId, pointId, name);
schema.setDescription(PDEPlugin.getResourceString(KEY_SECTIONS_OVERVIEW));
DocumentSection section;
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/extension/NewSchemaFileWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/extension/NewSchemaFileWizard.java
index 1c1da86..c1d05a1 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/extension/NewSchemaFileWizard.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/extension/NewSchemaFileWizard.java
@@ -9,6 +9,7 @@
import org.eclipse.ui.*;
import org.eclipse.jface.viewers.*;
import org.eclipse.pde.internal.*;
+import org.eclipse.jdt.core.IJavaProject;
public class NewSchemaFileWizard extends Wizard implements INewWizard {
private NewSchemaFileMainPage mainPage;
@@ -26,9 +27,13 @@
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
Object sel = selection.getFirstElement();
- if (sel instanceof IContainer)
+ if (sel instanceof IJavaProject) {
+ container = ((IJavaProject)sel).getProject();
+ }
+ else if (sel instanceof IContainer)
container = (IContainer) sel;
}
+
public boolean performFinish() {
return mainPage.finish();
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/imports/UpdateClasspathAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/imports/UpdateClasspathAction.java
index f0ab8fd..6082170 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/imports/UpdateClasspathAction.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/wizards/imports/UpdateClasspathAction.java
@@ -55,7 +55,7 @@
} else if (elem instanceof IJavaProject) {
project = ((IJavaProject) elem).getProject();
}
- if (project != null && WorkspaceModelManager.isPluginProject(project)) {
+ if (project != null && WorkspaceModelManager.isJavaPluginProject(project)) {
IPluginModelBase model = findModelFor(project);
if (model != null) {
models.add(model);