[332472] Breakpoints being added to JSPs are not being hit
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.properties b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
index 35aa393..1df7ca2 100644
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.properties
+++ b/bundles/org.eclipse.jst.jsp.ui/plugin.properties
@@ -111,3 +111,5 @@
proposalCategory.jspTemplates=JSP Template Proposals
proposalCategory.jsp=JSP Proposals
proposalCategory.jspJava=JSP Java Proposals
+
+classPatternProvider.name = Class Pattern Provider
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.ui/plugin.xml b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
index bb02d00..66f7099 100644
--- a/bundles/org.eclipse.jst.jsp.ui/plugin.xml
+++ b/bundles/org.eclipse.jst.jsp.ui/plugin.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
+ <extension-point id="classPatternProvider" name="%classPatternProvider.name" schema="schema/classPatternProvider.exsd"/>
<extension point="org.eclipse.ui.editors">
<editor
diff --git a/bundles/org.eclipse.jst.jsp.ui/schema/classPatternProvider.exsd b/bundles/org.eclipse.jst.jsp.ui/schema/classPatternProvider.exsd
new file mode 100644
index 0000000..92e6106
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/schema/classPatternProvider.exsd
@@ -0,0 +1,106 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.jst.jsp.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.jst.jsp.ui" id="classPatternProvider" name="Class Pattern Provider"/>
+ </appInfo>
+ <documentation>
+ Provides a way for adding additional class patterns to the JavaStratumBreakpointProvider
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element internal="true" />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="classPatternProvider"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="classPatternProvider">
+ <complexType>
+ <attribute name="contentType" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="pattern" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/ClassPatternRegistry.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/ClassPatternRegistry.java
new file mode 100644
index 0000000..321570a
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/ClassPatternRegistry.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.breakpointproviders;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
+
+/**
+ * This registry provides all additional class patterns to be associated with a specific content type
+ *
+ */
+public class ClassPatternRegistry {
+
+ private static ClassPatternRegistry fInstance = null;
+
+ private Map fPatterns = null;
+
+ private ClassPatternRegistry() {
+ IExtensionRegistry registry = RegistryFactory.getRegistry();
+ if (registry != null) {
+ IConfigurationElement[] elements = RegistryFactory.getRegistry().getConfigurationElementsFor(JSPUIPlugin.ID, "classPatternProvider"); //$NON-NLS-1$
+ fPatterns = new HashMap(elements.length);
+ for (int i = 0; i < elements.length; i++) {
+ final IConfigurationElement element = elements[i];
+ final String contentType = element.getAttribute("contentType"); //$NON-NLS-1$
+ String pattern = element.getAttribute("pattern"); //$NON-NLS-1$
+ if (pattern != null && contentType != null) {
+ String old = (String) fPatterns.get(contentType);
+ final StringBuffer buffer = old == null ? new StringBuffer() : new StringBuffer(old);
+ pattern = pattern.trim();
+ if (pattern.length() > 0) {
+ if (pattern.charAt(0) != ',' && buffer.length() > 0 && buffer.charAt(buffer.length() - 1) != ',')
+ buffer.append(',');
+ buffer.append(pattern);
+ fPatterns.put(contentType, buffer.toString());
+ }
+ }
+
+ }
+ }
+ }
+
+ /**
+ * Returns an iterator for the additional class patterns to be associated with the provided content type id.
+ * @param contentType the content type id to find patterns for
+ * @return an iterator for the additional class patterns
+ */
+ public String getClassPattern(String contentType) {
+ return fPatterns != null ? (String) fPatterns.get(contentType) : null;
+ }
+
+ public static synchronized ClassPatternRegistry getInstance() {
+ if (fInstance == null) {
+ fInstance = new ClassPatternRegistry();
+ }
+ return fInstance;
+ }
+}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
index ec9081e..c4e7bad 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/breakpointproviders/JavaStratumBreakpointProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -126,11 +126,19 @@
}
StringBuffer patternBuffer = new StringBuffer("_" + shortName);
for (int i = 0; i < types.length; i++) {
- Object pattern = ((Map) fData).get(types[i].getId());
+ final String id = types[i].getId();
+ Object pattern = ((Map) fData).get(id);
if (pattern != null) {
patternBuffer.append(","); //$NON-NLS-1$
patternBuffer.append(pattern);
}
+ // Append contributions
+ final String contributions = ClassPatternRegistry.getInstance().getClassPattern(id);
+ if (contributions != null && contributions.length() > 0) {
+ if (contributions.charAt(0) != ',')
+ patternBuffer.append(',');
+ patternBuffer.append(contributions);
+ }
}
return patternBuffer.toString();
}