Author: dazarov
Date: 2010-03-01 08:15:13 -0500 (Mon, 01 Mar 2010)
New Revision: 20539
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/dnd/PaletteTaglibInserter.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4876
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/dnd/PaletteTaglibInserter.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/dnd/PaletteTaglibInserter.java 2010-03-01
04:44:09 UTC (rev 20538)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/dnd/PaletteTaglibInserter.java 2010-03-01
13:15:13 UTC (rev 20539)
@@ -25,6 +25,7 @@
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
@@ -128,7 +129,6 @@
* @return
*/
public static IndexedRegion getNodeAt(IDocument d, int documentOffset) {
-
if (d == null)
return null;
@@ -136,7 +136,7 @@
IModelManager mm = StructuredModelManager.getModelManager();
IStructuredModel model = null;
if (mm != null)
- model = mm.getExistingModelForRead(d);
+ model = mm.getModelForRead((IStructuredDocument)d);
try {
if (model != null) {
int lastOffset = documentOffset;
@@ -214,7 +214,7 @@
IStructuredModel model = null;
try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(d);
+ model =
StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)d);
IDOMDocument xmlDocument = (model instanceof IDOMModel) ? ((IDOMModel)
model).getDocument() : null;
if (xmlDocument == null) {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java 2010-03-01
04:44:09 UTC (rev 20538)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java 2010-03-01
13:15:13 UTC (rev 20539)
@@ -49,7 +49,6 @@
libs.put("a4j", "http://richfaces.org/a4j"); //$NON-NLS-1$
//$NON-NLS-2$
libs.put("a", "http://richfaces.org/a4j"); //$NON-NLS-1$
//$NON-NLS-2$
libs.put("c", "http://java.sun.com/jstl/core"); //$NON-NLS-1$
//$NON-NLS-2$
- libs.put("jsp", "http://java.sun.com/JSP/Page"); //$NON-NLS-1$
//$NON-NLS-2$
}
private IFile file;
@@ -90,6 +89,8 @@
IDocument document = getDocument(file);
properties = new Properties();
+ properties.put(JSPPaletteInsertHelper.PROPOPERTY_ADD_TAGLIB, "true");
//$NON-NLS-1$
+ properties.put(PaletteInsertHelper.PROPOPERTY_START_TEXT, ""); //$NON-NLS-1$
properties.put(JSPPaletteInsertHelper.PROPOPERTY_TAGLIBRARY_URI, libs.get(prefix));
properties.put(JSPPaletteInsertHelper.PROPOPERTY_DEFAULT_PREFIX, prefix);
properties.put(PaletteInsertHelper.PROPOPERTY_SELECTION_PROVIDER, new
ISelectionProvider() {
@@ -108,8 +109,8 @@
public void addSelectionChangedListener(ISelectionChangedListener listener) {
}
});
- properties.put(JSPPaletteInsertHelper.PROPOPERTY_ADD_TAGLIB, "true");
//$NON-NLS-1$
+
Properties p = PaletteTaglibInserter.getPrefixes(document, properties);
if(p.containsValue(prefix))