Author: mareshkau
Date: 2008-02-14 05:51:19 -0500 (Thu, 14 Feb 2008)
New Revision: 6313
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-788
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-02-14
10:19:05 UTC (rev 6312)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-02-14
10:51:19 UTC (rev 6313)
@@ -73,14 +73,13 @@
import org.eclipse.wst.sse.ui.internal.IModelProvider;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
import org.eclipse.wst.sse.ui.internal.actions.StructuredTextEditorActionConstants;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage;
import org.eclipse.wst.sse.ui.internal.properties.ConfigurablePropertySheetPage;
import
org.eclipse.wst.sse.ui.internal.provisional.extensions.ConfigurationPointCalculator;
import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
import org.eclipse.wst.xml.core.internal.document.AttrImpl;
-import org.eclipse.wst.xml.core.internal.document.DOMModelImpl;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.XModelBuffer;
@@ -88,7 +87,6 @@
import org.jboss.tools.common.model.XModelTransferBuffer;
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
import org.jboss.tools.common.model.ui.editors.dnd.DropCommandFactory;
@@ -185,7 +183,12 @@
pageContext = new SourceEditorPageContext();
}
IDocument document = getTextViewer().getDocument();
- pageContext.setDocument(document);
+ int offset = this.getTextViewer().getTextWidget().getCaretOffset();
+ IndexedRegion treeNode = ContentAssistUtils.getNodeAt(this.getTextViewer(),
offset);
+ Node node = (Node) treeNode;
+ pageContext.setReferenceNode(node);
+ pageContext.setDocument(document);
+
return pageContext;
}
@@ -631,6 +634,7 @@
//Fix for JBIDE-788
if (getEditor() != null) {
if(getEditor().getPageContext() instanceof VpeTaglibManager)
+
return (VpeTaglibManager)getEditor().getPageContext();
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-02-14
10:19:05 UTC (rev 6312)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-02-14
10:51:19 UTC (rev 6313)
@@ -25,7 +25,6 @@
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.jst.web.tld.VpeTaglibListener;
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
-import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -143,10 +142,13 @@
Iterator<TaglibData> iter = getTaglibs() .iterator();
while (iter.hasNext()) {
TaglibData taglib = (TaglibData)iter.next();
- if (!taglib.inList(clone)) {
- clone.add(taglib);
- }
+ //Max Areshkau we doesn't need double check
+// if (!taglib.inList(clone)) {
+// clone.add(taglib.clone());
+// }
+ clone.add(taglib);
}
+
return clone;
}