JBoss Tools SVN: r16651 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-07-17 09:58:24 -0400 (Fri, 17 Jul 2009)
New Revision: 16651
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3247Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeIncludeInfo.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreatorUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCustomTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeIncludeTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ResourceUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3247, support for custom tags from jar files has been added
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -275,10 +275,11 @@
"^\\s*(\\#|\\$)\\{facesContext.externalContext.requestContextPath\\}", Constants.EMPTY); //$NON-NLS-1$
IFile file = null;
- if (pageContext.getVisualBuilder().getCurrentIncludeInfo() != null)
- file = pageContext.getVisualBuilder().getCurrentIncludeInfo()
- .getFile();
-
+ if (pageContext.getVisualBuilder().getCurrentIncludeInfo() != null
+ &&(pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage() instanceof IFile)) {
+ file = (IFile) pageContext.getVisualBuilder().getCurrentIncludeInfo()
+ .getStorage();
+ }
if (file == null)
return resolvedValue;
@@ -588,10 +589,11 @@
IEditorInput input = pageContext.getEditPart().getEditorInput();
IPath inputPath = getInputParentPath(input);
//Fix For JBIDE-3030
- if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null) {
+ if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null
+ ||!(pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage() instanceof IFile)) {
return;
}
- String path = ElService.getInstance().replaceEl(pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile(), fileImageName);
+ String path = ElService.getInstance().replaceEl((IFile)pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage(), fileImageName);
File file = new File(inputPath.toOSString() + File.separator + path);
if (file.exists()) {
img.setAttribute(HTML.ATTR_SRC, HtmlComponentUtil.FILE_PROTOCOL + inputPath.toString() + "/" //$NON-NLS-1$
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -217,7 +217,7 @@
if (attr != null) {
String itemLabel = attr.getNodeValue();
String bundleValue = ResourceUtil.getBundleValue(pageContext,
- attr);
+ attr.getValue());
nsIDOMText text;
// if bundleValue differ from value then will be represent
// bundleValue, but text will be not edit
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -257,7 +257,7 @@
if (null != labelAttr) {
labelValue = labelAttr.getNodeValue();
bundleValue = ResourceUtil.getBundleValue(pageContext,
- labelAttr);
+ labelAttr.getValue());
}
if (ComponentUtil.isNotBlank(labelValue)) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -230,7 +230,7 @@
if (null != labelAttr) {
labelValue = labelAttr.getNodeValue();
bundleValue = ResourceUtil.getBundleValue(pageContext,
- labelAttr);
+ labelAttr.getValue());
}
if (ComponentUtil.isNotBlank(labelValue)) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -270,7 +270,7 @@
} else if (sourceElement.hasAttribute(LABEL)) {
Attr labelAttr = sourceElement.getAttributeNode(LABEL);
if (null != labelAttr) {
- String bundleValue = ResourceUtil.getBundleValue(pageContext, labelAttr);
+ String bundleValue = ResourceUtil.getBundleValue(pageContext, labelAttr.getValue());
mainTd.appendChild(visualDocument.createTextNode(bundleValue));
}
} else {
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml 2009-07-17 13:58:24 UTC (rev 16651)
@@ -7,8 +7,11 @@
xmlns:c="http://mydomain.com/jsf/myproject">
<body>
<!-- custom tags -->
+<div id="custom_tags">
<ma:paginator/>
-<ma:echo msg="Helle Custom Tags" />
+<ma:echo msg="Hello, Custom Tags!" />
<c:inputCurrency value="100"/>
+<ma:echo msg="Echo custom tag" />
+</div>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE3247/WebContent/pages/index.xhtml.xml 2009-07-17 13:58:24 UTC (rev 16651)
@@ -0,0 +1,53 @@
+<tests>
+<test id="custom_tags">
+<DIV ID="custom_tags" STYLE="-moz-user-modify: read-write;" >
+<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+<!-- h:inputHidden id="currentPage" replace, because if on page two fields, two elements with equal id has been used, but should be used only one -->
+<TABLE BORDER="0" STYLE="margin-right: auto; margin-left: auto; -moz-user-modify: read-only;">
+<TBODY>
+<TR>
+<TD>
+<INPUT TYPE="submit" VALUE="<<" STYLE="-moz-user-modify: read-only;"/>
+
+</TD>
+<TD>
+<INPUT TYPE="submit" VALUE="<" STYLE="-moz-user-modify: read-only;"/>
+
+</TD>
+<TD>
+<INPUT TYPE="submit" VALUE=">" STYLE="-moz-user-modify: read-only;"/>
+
+</TD>
+<TD>
+<INPUT TYPE="submit" VALUE=">>" STYLE="-moz-user-modify: read-only;"/>
+
+</TD>
+</TR>
+</TBODY>
+</TABLE>
+</DIV>
+<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+<SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
+<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+Hello, Custom Tags!
+</SPAN>
+</SPAN>
+</DIV>
+<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+$
+</SPAN>
+<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+100
+</SPAN>
+</DIV>
+<DIV VPE:INCLUDE-ELEMENT="yes" STYLE="-moz-user-modify: read-only;">
+<SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
+<SPAN CLASS="vpe-text" STYLE="-moz-user-modify: read-only;">
+Echo custom tag
+</SPAN>
+</SPAN>
+</DIV>
+</DIV>
+</test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -45,6 +45,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3144Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3163Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3197Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3247Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3376Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3396Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3441Test;
@@ -153,6 +154,7 @@
suite.addTestSuite(JBIDE4509Test.class);
suite.addTestSuite(JBIDE4510Test.class);
suite.addTestSuite(JBIDE4534Test.class);
+ suite.addTestSuite(JBIDE3247Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3247Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3247Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3247Test.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.vpe.ui.test.ComponentContentTest;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE3247Test extends ComponentContentTest{
+
+ public JBIDE3247Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE3247() throws Throwable {
+ performContentTest("index.xhtml"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected String getTestProjectName() {
+ return JsfAllTests.IMPORT_JBIDE3247_PROJECT_NAME;
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeIncludeInfo.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeIncludeInfo.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeIncludeInfo.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -10,27 +10,27 @@
******************************************************************************/
package org.jboss.tools.vpe.editor;
-import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IStorage;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class VpeIncludeInfo {
private Element element;
- private IFile file;
+ private IStorage storage;
private Document document;
- public VpeIncludeInfo(Element element, IFile file, Document document) {
+ public VpeIncludeInfo(Element element, IStorage storage, Document document) {
this.element = element;
- this.file = file;
+ this.storage = storage;
this.document = document;
}
public Element getElement() {
- return element;
+ return this.element;
}
- public IFile getFile() {
- return file;
+ public IStorage getStorage() {
+ return this.storage;
}
public Document getDocument() {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -24,6 +24,7 @@
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.graphics.Point;
@@ -160,7 +161,7 @@
}
private VpeDnd dropper;
- private Map<IFile, Document> includeDocuments = new HashMap<IFile, Document>();
+ private Map<IStorage, Document> includeDocuments = new HashMap<IStorage, Document>();
private boolean showInvisibleTags;
public VpeVisualDomBuilder(VpeDomMapping domMapping,
@@ -461,7 +462,6 @@
Node sourceNodeProxy = null;
// FIX FOR JBIDE-1568, added by Max Areshkau
try {
-
if (ElService.getInstance().isELNode(getPageContext(),
sourceNode)) {
@@ -2114,11 +2114,11 @@
return includeInfo;
}
- public boolean isFileInIncludeStack(IFile file) {
+ public boolean isFileInIncludeStack(IStorage file) {
if (file == null)
return false;
for (int i = 0; i < includeStack.size(); i++) {
- if (file.equals(((VpeIncludeInfo) includeStack.get(i)).getFile())) {
+ if (file.equals(((VpeIncludeInfo) includeStack.get(i)).getStorage())) {
return true;
}
}
@@ -2264,7 +2264,7 @@
this.xulRunnerEditor = xulRunnerEditor;
}
- public Map<IFile, Document> getIncludeDocuments() {
+ public Map<IStorage, Document> getIncludeDocuments() {
return includeDocuments;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -11,9 +11,11 @@
package org.jboss.tools.vpe.editor.context;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -21,9 +23,6 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.ide.IDE;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
@@ -33,18 +32,14 @@
import org.jboss.tools.jst.jsp.editor.IVisualContext;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.jst.web.tld.TaglibData;
-import org.jboss.tools.jst.web.tld.VpeTaglibListener;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeEditorPart;
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
-import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
-import org.jboss.tools.vpe.editor.util.FileUtil;
import org.jboss.tools.vpe.editor.util.XmlUtil;
import org.jboss.tools.vpe.resref.core.AbsoluteFolderReferenceList;
-import org.jboss.tools.vpe.resref.core.CSSReferenceList;
import org.jboss.tools.vpe.resref.core.RelativeFolderReferenceList;
import org.jboss.tools.vpe.resref.core.TaglibReferenceList;
import org.mozilla.interfaces.nsIDOMNode;
@@ -64,7 +59,14 @@
private VpeEditorPart editPart;
WtpKbConnector connector;
private nsIDOMNode currentVisualNode;
+ /**
+ * Created to store custom element attributes and use it in time of
+ * rendering
+ * @author mareshkau
+ */
+ private Map<String,String> customElementsAttributes;
+
public VpePageContext(BundleMap bundle, VpeEditorPart editPart) {
this.bundle = bundle;
this.editPart = editPart;
@@ -79,6 +81,22 @@
else return false;
}
+ /**
+ * Adds attribute to element attribute map
+ * @param key
+ * @param value
+ */
+ public void addAttributeInCustomElementsMap(String key, String value){
+ getCustomElementsAttributes().put(key, value);
+ }
+ /**
+ * Removes attribute from custom attribute map
+ * @param sourceBuilder
+ */
+ public void removeAttributeFromCustomElementMap(String key) {
+ getCustomElementsAttributes().remove(key);
+ }
+
public void setSourceDomBuilder(VpeSourceDomBuilder sourceBuilder) {
this.sourceBuilder = sourceBuilder;
refreshConnector();
@@ -244,28 +262,12 @@
}
- private void fireTaglibChanged(VpeTaglibListener taglibListener, List newTaglibs, List delTaglibs) {
- Iterator iter = delTaglibs.iterator();
- while (iter.hasNext()) {
- TaglibData taglib = (TaglibData)iter.next();
- taglibListener.removeTaglib(taglib.getUri(), taglib.getPrefix());
- }
- iter = newTaglibs.iterator();
- while (iter.hasNext()) {
- TaglibData taglib = (TaglibData)iter.next();
- taglibListener.addTaglib(taglib.getUri(), taglib.getPrefix());
- }
- }
-
public WtpKbConnector getConnector() {
- return connector;
+ return this.connector;
}
- public void addTaglibListener(VpeTaglibListener listener) {
- // TODO Auto-generated method stub
-
- }
+
public List<TaglibData> getTagLibs(Node sourceNode) {
return XmlUtil.getTaglibsForNode(sourceNode, this);
@@ -275,7 +277,7 @@
* @return the currentVisualNode
*/
public nsIDOMNode getCurrentVisualNode() {
- return currentVisualNode;
+ return this.currentVisualNode;
}
/**
@@ -300,4 +302,14 @@
}
}
+ /**
+ * @return the customElementsAttributes
+ */
+ public Map<String, String> getCustomElementsAttributes() {
+ if(this.customElementsAttributes==null) {
+ this.customElementsAttributes = new HashMap<String, String>();
+ }
+ return this.customElementsAttributes;
+ }
+
}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/proxy/VpeNodeInvocationHandler.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -12,10 +12,8 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
-import org.eclipse.core.resources.IFile;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.util.ElService;
-import org.jboss.tools.vpe.editor.util.ResourceUtil;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -43,15 +41,15 @@
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
- Object result = method.invoke(node, args);
+ Object result = method.invoke(this.node, args);
if(result instanceof String) {
String processedStr = (String) result;
result = replaceEL(processedStr);
} else if(result instanceof Attr) {
- result = VpeProxyUtil.createProxyForELExpressionNode(pageContext,
+ result = VpeProxyUtil.createProxyForELExpressionNode(this.pageContext,
(Node)result);
} else if(result instanceof NamedNodeMap) {
- result = VpeProxyUtil.createProxyForNamedNodeMap(pageContext, (NamedNodeMap)result);
+ result = VpeProxyUtil.createProxyForNamedNodeMap(this.pageContext, (NamedNodeMap)result);
}
return result;
}
@@ -62,16 +60,7 @@
*/
private String replaceEL(String toReplace) {
- String result = toReplace;
-
- result = ResourceUtil.getBundleValue(pageContext, toReplace);
-
- //mareshkau,fix for JBIDE-3030, el doesn't works for external files.
- if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null) {
- return result;
- }
- final IFile file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
- return ElService.getInstance().replaceEl(file, result);
+ return ElService.getInstance().replaceElAndResources(this.pageContext, toReplace);
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreatorUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreatorUtil.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreatorUtil.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -15,12 +15,17 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.custom.VpeCustomStringStorage;
import org.jboss.tools.vpe.editor.util.FileUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -125,11 +130,12 @@
IEditorInput input = pageContext.getEditPart().getEditorInput();
IFile file = null;
- if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null) {
+ if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null
+ || !(pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage() instanceof IFile)) {
file = FileUtil.getFile(input, fileName);
} else {
IFile includedFile =
- pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
+ (IFile) pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage();
file = FileUtil.getFile(fileName, includedFile);
}
@@ -167,7 +173,26 @@
}
return null;
}
+ /**
+ * Return dom document for read, document shoud be released from read
+ * @see VpeCreatorUtil#releaseDocumentFromRead(Document)
+ * @param file
+ * @return dom document for read
+ */
+ public static Document getDocumentForRead(String content) {
+ IDOMModel wtpModel = null;
+ IModelManager modelManager = StructuredModelManager.getModelManager();
+
+ wtpModel = (IDOMModel) modelManager
+ .createUnManagedStructuredModelFor("org.eclipse.wst.html.core.htmlsource"); //$NON-NLS-1$
+ IStructuredDocument document = wtpModel.getStructuredDocument();
+ document.set(content);
+ if (wtpModel != null)
+ return wtpModel.getDocument();
+ return null;
+ }
+
public static int getFacetType(Node node, VpePageContext pageContext) {
if (VpeCreatorUtil.isFacet(node)) {
return getFacetType(node);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCustomTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCustomTemplate.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCustomTemplate.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -10,19 +10,14 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.template;
-import java.util.ArrayList;
-import java.util.List;
-
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.resources.IStorage;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
-import org.jboss.tools.common.el.core.ELReferenceList;
-import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.vpe.editor.VpeIncludeInfo;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.custom.CustomTLDReference;
+import org.jboss.tools.vpe.editor.template.custom.VpeCustomStringStorage;
import org.jboss.tools.vpe.editor.util.NodesManagingUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMNode;
@@ -50,14 +45,13 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
- IPath pathToFile = CustomTLDReference
+ IStorage sourceFileStorage = CustomTLDReference
.getCustomElementPath(sourceNode, pageContext);
- if (pathToFile != null) {
- //add attributes to EL list
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(
- pathToFile);
- if (file != null && file.exists()) {
+ if (sourceFileStorage instanceof IFile) {
+ //add attributes to EL list
+ IFile file =(IFile) sourceFileStorage;
+ if (file.exists()) {
if (!pageContext.getVisualBuilder().isFileInIncludeStack(
file)) {
Document document = pageContext.getVisualBuilder()
@@ -69,38 +63,56 @@
.getIncludeDocuments().put(file, document);
}
if (document != null) {
- VpeCreationData creationData = createInclude(
- document, visualDocument);
- ResourceReference [] oldResourceReferences
- = VpeCustomTemplate
- .addAttributesToELExcpressions(
- sourceNode, file);
- creationData.setData(new TransferObject(
- oldResourceReferences, file));
- pageContext.getVisualBuilder().pushIncludeStack(
- new VpeIncludeInfo((Element) sourceNode,
- file, document));
- return creationData;
+ return createCreationData(pageContext, sourceNode, file, document, visualDocument);
}
}
}
+ }else if(sourceFileStorage instanceof VpeCustomStringStorage) {
+ VpeCustomStringStorage customStringStorage = (VpeCustomStringStorage) sourceFileStorage;
+ if (!pageContext.getVisualBuilder().isFileInIncludeStack(
+ customStringStorage)) {
+ Document document = pageContext.getVisualBuilder()
+ .getIncludeDocuments().get(customStringStorage);
+ if (document == null) {
+ document = VpeCreatorUtil.getDocumentForRead(customStringStorage.getContentString());
+ if (document != null)
+ pageContext.getVisualBuilder()
+ .getIncludeDocuments().put(customStringStorage, document);
+ }
+ if (document != null) {
+ return createCreationData(pageContext, sourceNode, customStringStorage, document, visualDocument);
+ }
+ }
}
-
VpeCreationData creationData = createStub(sourceNode.getNodeName(),
visualDocument);
creationData.setData(null);
return creationData;
- }
+ }
+
+ private VpeCreationData createCreationData(VpePageContext pageContext,Node sourceNode,
+ IStorage storage,
+ Document document, nsIDOMDocument visualDocument) {
+ VpeCreationData creationData = createInclude(
+ document, visualDocument);
+
+ VpeCustomTemplate.addAttributesToELExcpressions(
+ sourceNode, pageContext);
+ creationData.setData(storage);
+ pageContext.getVisualBuilder().pushIncludeStack(
+ new VpeIncludeInfo((Element) sourceNode,
+ storage, document));
+ return creationData;
+ }
+
@Override
public void validate(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument, VpeCreationData data){
- if(data.getData() instanceof TransferObject) {
- TransferObject trObject = (TransferObject) data.getData();
- ELReferenceList.getInstance().setAllResources(
- trObject.getCustomFile(), trObject.getResourceReferebces());
- data.setData(trObject.getCustomFile());
- }
-
+ NamedNodeMap attributesMap = sourceNode.getAttributes();
+ for(int i=0;i<attributesMap.getLength();i++) {
+ Attr attr = (Attr) attributesMap.item(i);
+ pageContext.removeAttributeFromCustomElementMap(attr.getName());
+ }
super.validate(pageContext, sourceNode, visualDocument, data);
}
@@ -111,36 +123,21 @@
* @param processedFile processed File
* @return resourceReferences - unchanged resource references
*/
- private static final ResourceReference[] addAttributesToELExcpressions(
- final Node sourceNode, final IFile processedFile){
-
- //obtain old resource references for this file
- ResourceReference[] resourceReferences = ELReferenceList.getInstance()
- .getAllResources(processedFile);
- //obtain attribute resource references for file
+ private static final void addAttributesToELExcpressions(
+ final Node sourceNode, final VpePageContext vpePageContext){
NamedNodeMap attributesMap = sourceNode.getAttributes();
- List<ResourceReference> addedAttrToElExpressions
- = new ArrayList<ResourceReference>();
+
for(int i=0;i<attributesMap.getLength();i++) {
Attr attr = (Attr) attributesMap.item(i);
- //adds attribute if such attribute not exists for page
- ResourceReference resRef = new ResourceReference(attr.getName(),
- ResourceReference.FILE_SCOPE);
- resRef.setProperties(attr.getValue());
- addedAttrToElExpressions.add(resRef);
+ vpePageContext.addAttributeInCustomElementsMap(attr.getName(), attr.getValue());
}
- ELReferenceList.getInstance().setAllResources(processedFile,
- addedAttrToElExpressions.toArray(new ResourceReference[0]));
- return resourceReferences;
}
@Override
public void beforeRemove(VpePageContext pageContext, Node sourceNode,
nsIDOMNode visualNode, Object data) {
IFile file = null;
- if(data instanceof TransferObject) {
- file = ((TransferObject)data).getCustomFile();
- } else if(data instanceof IFile) {
+ if(data instanceof IFile) {
file = (IFile) data;
}
super.beforeRemove(pageContext, sourceNode, visualNode, file);
@@ -160,38 +157,4 @@
offset+=sourceNode.getPrefix().length()+1+1;
return new Region(offset, 0);
}
-
- /**
- * Object which used to passing argument throw template event processing,
- * restore el expressions after processing custom template
- *
- * @author mareshkau
- *
- */
- private static class TransferObject {
- private ResourceReference [] resourceReferebces;
- private IFile customFile;
-
- /**
- * @param resourceReferebces
- * @param customFile
- */
- public TransferObject(ResourceReference[] resourceReferebces,
- IFile customFile) {
- this.resourceReferebces = resourceReferebces;
- this.customFile = customFile;
- }
- /**
- * @return the resourceReferebces
- */
- public ResourceReference[] getResourceReferebces() {
- return this.resourceReferebces;
- }
- /**
- * @return the customFile
- */
- public IFile getCustomFile() {
- return this.customFile;
- }
- }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeIncludeTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeIncludeTemplate.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeIncludeTemplate.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -63,8 +63,8 @@
if (vpeValue != null && vpeValue.stringValue().length() > 0) {
fileName = vpeValue.stringValue();
VpeIncludeInfo info = pageContext.getVisualBuilder().getCurrentIncludeInfo();
- if(info != null) {
- IFile templateFile = info.getFile();
+ if(info != null && info.getStorage() instanceof IFile) {
+ IFile templateFile = (IFile) info.getStorage();
IFile file = FileUtil.getFile(fileName, templateFile);
if (file != null) {
@@ -102,7 +102,7 @@
if (data.getData() != null) {
VpeIncludeInfo includeInfo = pageContext.getVisualBuilder().popIncludeStack();
if (includeInfo != null) {
- //VpeCreatorUtil.releaseDocumentFromRead(includeInfo.getDocument());
+// VpeCreatorUtil.releaseDocumentFromRead(includeInfo.getDocument());
}
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDReference.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -12,12 +12,17 @@
import java.util.List;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.filesystems.impl.RecognizedFileImpl;
import org.jboss.tools.common.model.filesystems.impl.SimpleFileImpl;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -42,7 +47,7 @@
* @param sourceNode
* @return full path to custom template if exist or null if not exist
*/
- public static IPath getCustomElementPath(Node sourceNode,
+ public static IStorage getCustomElementPath(Node sourceNode,
VpePageContext pageContext) {
List<TaglibData> taglibs = XmlUtil.getTaglibsForNode(sourceNode,
pageContext);
@@ -52,7 +57,7 @@
XModelObject xmodel = getCustomTaglibObject(pageContext,uri);
XModelObject o = xmodel.getChildByPath(sourceNode.getLocalName()
- + "/declaration"); //$NON-NLS-1$
+ +XModelObjectConstants.SEPARATOR +"declaration"); //$NON-NLS-1$
String sourceAttributeValue = null;
if (o != null) {
sourceAttributeValue = o.getAttributeValue("source"); //$NON-NLS-1$
@@ -62,14 +67,28 @@
return null;
}
if (xmodel instanceof SimpleFileImpl) {
- IPath pathToSourceFile = ((SimpleFileImpl) xmodel).getFile()
- .getFullPath();
+ IFile iFile = ((SimpleFileImpl) xmodel).getFile();
+ if(iFile==null) {
+ //possibly it's a jar file
+
+ XModelObject sourceFile = xmodel.getParent().getParent().getChildByPath(sourceAttributeValue.substring(1));
+ if(sourceFile instanceof RecognizedFileImpl) {
+ String content = ((RecognizedFileImpl)sourceFile).getAsText();
+ String name =((RecognizedFileImpl)sourceFile).getPresentationString();
+ IStorage customStorage = new VpeCustomStringStorage(content, name);
+ return customStorage;
+ }
+ return null;
+ }
+ IPath pathToSourceFile = iFile.getFullPath();
// pathToSourceFile now smth like this
// /customFaceletsTestProject/WebContent/tags/facelets.taglib.xml
// so we remove facelet taglib name now
pathToSourceFile = pathToSourceFile.removeLastSegments(1);
pathToSourceFile = pathToSourceFile.append(sourceAttributeValue);
- return pathToSourceFile;
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(
+ pathToSourceFile);
+ return file;
}
return null;
}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.template.custom;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeCustomStringStorage implements IStorage {
+
+ private String jarFileContent;
+ private String name;
+
+ public VpeCustomStringStorage(String input,String resourceName) {
+ this.jarFileContent = input;
+ this.name = resourceName;
+ }
+
+ public InputStream getContents() throws CoreException {
+ return new ByteArrayInputStream(this.jarFileContent.getBytes());
+ }
+
+ public IPath getFullPath() {
+ return null;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+ /**
+ *
+ * @return content of file in jar archive
+ */
+ public String getContentString() {
+ return this.jarFileContent;
+ }
+
+ public boolean isReadOnly() {
+ return true;
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -210,10 +210,11 @@
protected String resolveEL(VpePageContext pageContext, String value) {
String resolvedValue = value.replaceFirst("^\\s*(\\#|\\$)\\{facesContext.externalContext.requestContextPath\\}", ""); //$NON-NLS-1$ //$NON-NLS-2$
//Fix for JBIDE-3030
- if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null){
+ if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null
+ || !(pageContext.getVisualBuilder().getCurrentIncludeInfo() instanceof IFile)){
return resolvedValue;
}
- final IFile file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
+ final IFile file = (IFile) pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage();
resolvedValue = ElService.getInstance().replaceEl(file, resolvedValue);
return resolvedValue;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.ui.texteditor.TextNavigationAction;
import org.jboss.tools.common.el.core.ELReferenceList;
import org.jboss.tools.common.el.core.GlobalELReferenceList;
import org.jboss.tools.common.resref.core.ResourceReference;
@@ -27,6 +28,7 @@
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+import org.w3c.dom.Text;
/**
@@ -172,18 +174,58 @@
*/
public boolean isELNode(VpePageContext pageContext,Node sourceNode) {
boolean rst = false;
+ if(isInCustomElementsAttributes(pageContext,sourceNode)){
+ return true;
+ }
// fix for JBIDE-3030
- if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null) {
+ if((pageContext.getVisualBuilder().getCurrentIncludeInfo())==null
+ || !(pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage() instanceof IFile)) {
return rst;
}
- final IFile file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
+ final IFile file = (IFile) pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage();
- if (((this.isAvailable(file) && this.isAvailableForNode(sourceNode, file))) || isInResourcesBundle(pageContext, sourceNode)){
+ if (((this.isAvailable(file) && this.isAvailableForNode(sourceNode, file)))
+ || isInResourcesBundle(pageContext, sourceNode)){
rst = true;
}
return rst;
}
+ /**
+ * Checks is node exist in source custom element attribute map and if so,
+ * then retrun true
+ * @param pageContext
+ * @param sourceNode
+ * @return
+ */
+ private static boolean isInCustomElementsAttributes(VpePageContext pageContext,Node sourceNode){
+
+ String textValue = null;
+ if(sourceNode.getNodeType() == Node.TEXT_NODE) {
+ textValue = sourceNode.getNodeValue();
+ if (textValue != null) {
+ for(String key : pageContext.getCustomElementsAttributes().keySet()){
+ if(equalsExppression(textValue,key)){
+ return true;
+ }
+ }
+ }
+ }else if(sourceNode.getNodeType() == Node.ELEMENT_NODE) {
+ NamedNodeMap attributesMap = sourceNode.getAttributes();
+ for(int i=0;i<attributesMap.getLength();i++) {
+ Attr attr = (Attr) attributesMap.item(i);
+ textValue =attr.getValue();
+ if(textValue!=null) {
+ for(String key : pageContext.getCustomElementsAttributes().keySet()){
+ if(equalsExppression(textValue,key)){
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
/**
*
* @param pageContext
@@ -333,31 +375,42 @@
}
- public String replaceElAndResources(VpePageContext pageContext, Node attributeNode) {
+ public String replaceElAndResources(VpePageContext pageContext, String value) {
- String attribuString = null;
- if (attributeNode instanceof Attr) {
- attribuString = ((Attr) attributeNode).getValue();
- } else {
- attribuString = attributeNode.getNodeValue();
- }
- String rst = attribuString;
+ String rst = value;
- rst = ResourceUtil.getBundleValue(pageContext, attributeNode);
+ rst = ResourceUtil.getBundleValue(pageContext, value);
+ //replace custom attributes
+ rst = replaceCustomAttributes(pageContext,rst);
//fix for JBIDE-3030
- if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null) {
+ if((pageContext.getVisualBuilder().getCurrentIncludeInfo()==null)
+ || !(pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage() instanceof IFile)) {
return rst;
}
- final IFile file = pageContext.getVisualBuilder().getCurrentIncludeInfo().getFile();
+ final IFile file = (IFile) pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage();
rst = replaceEl(file, rst);
-
+
return rst;
}
+ private String replaceCustomAttributes(VpePageContext pageContext, String value){
+ String result = value;
+ for (String el : pageContext.getCustomElementsAttributes().keySet()) {
+ final String dollarEl = DOLLAR_PREFIX + el + SUFFIX;
+ final String sharpEl = SHARP_PREFIX + el + SUFFIX;
+ if (result.contains(dollarEl)) {
+ result = result.replace(dollarEl, pageContext.getCustomElementsAttributes().get(el));
+ }
+ if (result.contains(sharpEl)) {
+ result = result.replace(sharpEl,pageContext.getCustomElementsAttributes().get(el));
+ }
+ }
+ return result;
+ }
- private boolean equalsExppression(String value, String expression) {
+ private static boolean equalsExppression(String value, String expression) {
final String dollarEl = String.valueOf(DOLLAR_PREFIX) + expression
+ String.valueOf(SUFFIX);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/IELService.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -46,7 +46,7 @@
*
* @return the string
*/
- String replaceElAndResources(VpePageContext pageContext, Node attributeNode);
+ String replaceElAndResources(VpePageContext pageContext, String value);
/**
* Checks if is available.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ResourceUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ResourceUtil.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ResourceUtil.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -13,7 +13,6 @@
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.w3c.dom.Node;
/**
* @author Evgenij Stherbin
@@ -37,16 +36,4 @@
return bundle.getBundleValue(value);
}
- /**
- * get bundle.
- *
- * @param pageContext the page context
- * @param attr the attr
- *
- * @return the bundle value
- */
- public static String getBundleValue(VpePageContext pageContext, Node attr) {
- return getBundleValue(pageContext,attr.getNodeValue());
- }
-
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2009-07-17 13:44:20 UTC (rev 16650)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2009-07-17 13:58:24 UTC (rev 16651)
@@ -377,10 +377,13 @@
endPathIndex);
IFile file = null;
- if (pageContext.getVisualBuilder().getCurrentIncludeInfo() != null)
- file = pageContext.getVisualBuilder().getCurrentIncludeInfo()
- .getFile();
- if (file != null)
+ if ((pageContext.getVisualBuilder().getCurrentIncludeInfo() != null)
+ &&(pageContext.getVisualBuilder().getCurrentIncludeInfo()
+ .getStorage() instanceof IFile)) {
+ file = (IFile) pageContext.getVisualBuilder().getCurrentIncludeInfo()
+ .getStorage();
+ }
+ if(file!=null)
filePath = processUrl(filePath, file);
String firstPartValue = urls[i].substring(0, startPathIndex + 1);
@@ -827,10 +830,12 @@
"^\\s*(\\#|\\$)\\{facesContext.externalContext.requestContextPath\\}", Constants.EMPTY); //$NON-NLS-1$
IFile file = null;
- if (pageContext.getVisualBuilder().getCurrentIncludeInfo() != null)
- file = pageContext.getVisualBuilder().getCurrentIncludeInfo()
- .getFile();
-
+ if ( (pageContext.getVisualBuilder().getCurrentIncludeInfo() != null)
+ &&(pageContext.getVisualBuilder().getCurrentIncludeInfo()
+ .getStorage() instanceof IFile) ) {
+ file = (IFile) pageContext.getVisualBuilder().getCurrentIncludeInfo()
+ .getStorage();
+ }
if (file == null)
return resolvedValue;
16 years, 9 months
JBoss Tools SVN: r16650 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-17 09:44:20 -0400 (Fri, 17 Jul 2009)
New Revision: 16650
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1826
Tree selector in dialog in cell editor is switched to new kb.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java 2009-07-17 13:30:31 UTC (rev 16649)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java 2009-07-17 13:44:20 UTC (rev 16650)
@@ -12,7 +12,6 @@
import java.util.ArrayList;
-import org.jboss.tools.common.kb.ParamList;
import org.jboss.tools.jst.jsp.outline.ValueHelper;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType.Param;
16 years, 9 months
JBoss Tools SVN: r16649 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-17 09:30:31 -0400 (Fri, 17 Jul 2009)
New Revision: 16649
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1826
Tree selector in dialog in cell editor is switched to new kb.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2009-07-17 13:29:10 UTC (rev 16648)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2009-07-17 13:30:31 UTC (rev 16649)
@@ -321,9 +321,12 @@
filter = "";
bSurroundWithQuotes = true;
} else {
- if((filter.startsWith("'") || filter.startsWith("\""))
- && (filter.endsWith("'") || filter.endsWith("\""))) {
+ boolean b = filter.startsWith("'") || filter.startsWith("\"");
+ boolean e = filter.endsWith("'") || filter.endsWith("\"");
+ if((b) && (e)) {
filter = filter.substring(1, filter.length() - 1);
+ } else if(b && !returnEqualedVariablesOnly) {
+ filter = filter.substring(1);
} else {
//Value is set as expression itself, we cannot compute it
if(isMessages) status.setMapOrCollectionOrBundleAmoungTheTokens();
16 years, 9 months
JBoss Tools SVN: r16648 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: drop/treeviewer/model and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-17 09:29:10 -0400 (Fri, 17 Jul 2009)
New Revision: 16648
Removed:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogContentProposalProvider.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResourceFactory.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/BundlesPropertiesResourceElement.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/EnumerationResourceElement.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileElement.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileResourceElement.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ManagedBeanForMdElement.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ManagedBeanForPropElement.java
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/outline/JSPContentOutlineConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPTreeDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbImageFileResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbJsfValuesResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdActionResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanMethodResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBundleNameResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBundlePropertyResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdManagedBeanNameResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdTaglibResource.java
Log:
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -70,6 +70,7 @@
import org.jboss.tools.jst.jsp.support.kb.WTPKbdBeanMethodResource;
import org.jboss.tools.jst.jsp.support.kb.WTPKbdBeanPropertyResource;
import org.jboss.tools.jst.jsp.support.kb.WTPKbdBundlePropertyResource;
+import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.jst.web.tld.VpeTaglibListener;
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
@@ -197,15 +198,17 @@
int offset = contentAssistRequest.getReplacementBeginPosition() - start;
String matchString = currentValue.substring(0, offset);
ValueHelper h = new ValueHelper();
+ JspContentAssistProcessor processor = h.createContentAssistProcessor();
+ IPageContext pageContext = h.createPageContext(processor, offset);
IEditorInput input = h.getEditorInput();
ArrayList proposals = new ArrayList();
- WTPKbdBeanPropertyResource r1 = new WTPKbdBeanPropertyResource(input, h.getConnector());
+ WTPKbdBeanPropertyResource r1 = new WTPKbdBeanPropertyResource(input);
proposals.addAll(r1.queryProposal(matchString));
- WTPKbdBeanMethodResource r2 = new WTPKbdBeanMethodResource(input, h.getConnector());
+ WTPKbdBeanMethodResource r2 = new WTPKbdBeanMethodResource(input);
proposals.addAll(r2.queryProposal(matchString));
- WTPKbdBundlePropertyResource r3 = new WTPKbdBundlePropertyResource(input, h.getConnector());
+ WTPKbdBundlePropertyResource r3 = new WTPKbdBundlePropertyResource(input, pageContext);
proposals.addAll(r3.queryProposal(matchString));
- WTPKbJsfValuesResource r4 = new WTPKbJsfValuesResource(input, h.getConnector());
+ WTPKbJsfValuesResource r4 = new WTPKbJsfValuesResource(input);
proposals.addAll(r4.queryProposal(matchString));
int elStart = getELStartPosition(matchString);
Deleted: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.jsp.contentassist;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaPackageCompletionProcessor;
-import org.eclipse.jface.contentassist.IContentAssistSubjectControl;
-import org.eclipse.jface.contentassist.ISubjectControlContentAssistProcessor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
-import org.jboss.tools.common.el.core.model.ELInstance;
-import org.jboss.tools.common.el.core.model.ELModel;
-import org.jboss.tools.common.el.core.model.ELUtil;
-import org.jboss.tools.common.el.core.parser.ELParser;
-import org.jboss.tools.common.el.core.parser.ELParserUtil;
-import org.jboss.tools.common.kb.KbException;
-import org.jboss.tools.common.kb.KbProposal;
-import org.jboss.tools.common.kb.KbQuery;
-import org.jboss.tools.common.kb.wtp.WtpKbConnector;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
-import org.jboss.tools.jst.jsp.outline.ValueHelper;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class JSPDialogCellEditorContentAssistProcessor extends JavaPackageCompletionProcessor implements ISubjectControlContentAssistProcessor {
- Properties context;
- //ValueHelper valueHelper;
- boolean isFacelets = false;
-
- public JSPDialogCellEditorContentAssistProcessor() {}
-
- public void setContext(Properties context) {
- this.context = context;
- //valueHelper = (ValueHelper)context.get("valueHelper");
- updateFacelets();
- }
-
- public ICompletionProposal[] computeCompletionProposals(IContentAssistSubjectControl contentAssistSubjectControl, int documentOffset) {
- List proposals = new ArrayList();
-
- IDocument document = contentAssistSubjectControl.getDocument();
- String text = document.get();
- addAttributeValueProposals(proposals, text, documentOffset);
- ICompletionProposal[] ps = (ICompletionProposal[])proposals.toArray(new ICompletionProposal[0]);
- return FaceletsHtmlContentAssistProcessor.getUniqProposals(ps);
- }
-
- //not implemented
-
- public IContextInformation[] computeContextInformation(IContentAssistSubjectControl contentAssistSubjectControl, int documentOffset) {
- // TODO Auto-generated method stub
- return null;
- }
-
- //JSPActiveContentAssistProcessor
-
- public void addAttributeValueProposals(List proposalsList, String text, int offset) {
- ValueHelper valueHelper = new ValueHelper();
- WtpKbConnector wtpKbConnector = valueHelper.getPageConnector();
- if(wtpKbConnector == null) return;
- Node node = (Node)context.get("node"); //$NON-NLS-1$
- String tagName = "" + context.getProperty("nodeName"); //$NON-NLS-1$ //$NON-NLS-2$
- String attributeName = "" + context.getProperty("attributeName"); //$NON-NLS-1$ //$NON-NLS-2$
- String currentValue = text;
- String strippedValue = null;
- String matchString = null;
- // fixups
- matchString = currentValue.substring(0, offset);
- strippedValue = currentValue;
-
- String elProposalPrefix = ""; //$NON-NLS-1$
-
- ELParser p = ELParserUtil.getJbossFactory().createParser();
- ELModel model = p.parse(matchString);
- ELInstance is = ELUtil.findInstance(model, matchString.length());
-
- ELParser p1 = ELParserUtil.getJbossFactory().createParser();
- ELModel model1 = p1.parse(currentValue);
- ELInstance is1 = ELUtil.findInstance(model1, matchString.length());
-
- int elStartPosition = is == null ? -1 : is.getStartPosition();
-
- boolean faceletJsfTag = false;
-
- String htmlQuery = null;
- if(isFacelets && tagName.indexOf(':')<1 && !FaceletsHtmlContentAssistProcessor.JSFCAttributeName.equals(attributeName)) {
- Element element = (Element)node;
- String jsfTagName = valueHelper.getFaceletJsfTag(element);
- if(jsfTagName != null) {
- faceletJsfTag = true;
- tagName = jsfTagName;
- htmlQuery = new StringBuffer(KbQuery.TAG_SEPARATOR).append(FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart + tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(matchString).toString();
- }
- }
-
- if(!faceletJsfTag && isFacelets && tagName.indexOf(':')<0) {
- tagName = FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart + tagName;
- }
-
- String query = new StringBuffer(KbQuery.TAG_SEPARATOR).append(tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(matchString).toString();
- if(!isFacelets && tagName.indexOf(':') < 0) {
- query = WtpKbConnector.ADD_HTML_PREFIX + query;
- }
- try {
- Collection proposals = wtpKbConnector.getProposals(query);
- if(proposals.size()==0 && htmlQuery!=null) {
- proposals = wtpKbConnector.getProposals(htmlQuery);
- }
- for (Iterator iter = proposals.iterator(); iter.hasNext();) {
- KbProposal kbProposal = cleanFaceletProposal((KbProposal)iter.next());
- kbProposal.postProcess(strippedValue, offset);
- int relevance = kbProposal.getRelevance();
- if(relevance==KbProposal.R_NONE) {
- relevance = XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE;
- }
-
- if(kbProposal.getStart() >= 0) {
- String replacementString = kbProposal.getReplacementString().substring(2,kbProposal.getReplacementString().length() - 1);
- int replacementBeginPosition = /*contentAssistRequest.getReplacementBeginPosition() + */kbProposal.getStart();
- int replacementLength = kbProposal.getEnd() - kbProposal.getStart();
- int cursorPositionDelta = 0;
-
- // Add an EL-starting quotation characters if needed
- if (elStartPosition == -1) {
- replacementString = elProposalPrefix + replacementString;
- cursorPositionDelta += elProposalPrefix.length();
- }
-
- if(is1 == null || is1.getCloseInstanceToken() == null) {
- replacementString += "}"; //$NON-NLS-1$
- }
-
- int cursorPosition = kbProposal.getPosition() + cursorPositionDelta;
- String displayString = elProposalPrefix == null || elProposalPrefix.length() == 0 ?
- kbProposal.getReplacementString().substring(2,kbProposal.getReplacementString().length() - 1) :
- elProposalPrefix + kbProposal.getReplacementString().substring(2,kbProposal.getReplacementString().length() - 1) + "}" ; //$NON-NLS-1$
-
- Image image = kbProposal.hasImage() ?
- kbProposal.getImage() :
- SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE);
-
- AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(kbProposal.autoActivationContentAssistantAfterApplication(), replacementString,
- replacementBeginPosition, replacementLength, cursorPosition,
- image,
- kbProposal.getLabel(), null, kbProposal.getContextInfo(), relevance);
-
- proposalsList.add(proposal);
- } else {
- StringBuffer replacementStringBuffer = new StringBuffer(kbProposal.getReplacementString());
- int replacementBeginPosition = 0;
- int replacementLength = text.length();
- int cursorPositionDelta = 0;
- String replacementString = replacementStringBuffer.toString();
- int cursorPosition = kbProposal.getPosition() + cursorPositionDelta;
-
- Image image = kbProposal.hasImage() ?
- kbProposal.getImage() :
- SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE);
-
- AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(kbProposal.autoActivationContentAssistantAfterApplication(), replacementString,
- replacementBeginPosition, replacementLength, cursorPosition,
- image,
- kbProposal.getLabel(), null, kbProposal.getContextInfo(), relevance);
-
- proposalsList.add(proposal);
- }
- }
- } catch (KbException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
- }
- private KbProposal cleanFaceletProposal(KbProposal proposal) {
- if(isFacelets) {
- proposal.setLabel(removeFaceletsPrefix(proposal.getLabel()));
- proposal.setReplacementString(removeFaceletsPrefix(proposal.getReplacementString()));
- }
- return proposal;
- }
- private String removeFaceletsPrefix(String tagName) {
- if(tagName.startsWith(FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart)) {
- return tagName.substring(FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart.length());
- }
- return tagName;
- }
-
- void updateFacelets() {
- ValueHelper valueHelper = new ValueHelper();
- valueHelper.updateFacelets();
- isFacelets = valueHelper.isFacetets();
- }
-
-}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogContentProposalProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogContentProposalProvider.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogContentProposalProvider.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -73,9 +73,8 @@
valueHelper = new ValueHelper();
}
// pageContext = (IPageContext)context.get("pageContext");
- processor = valueHelper.isFacetets() ? new FaceletPageContectAssistProcessor() : new JspContentAssistProcessor();
- processor.createContext(getTextViewer(), offset);
- pageContext = processor.getContext();
+ processor = valueHelper.createContentAssistProcessor();
+ pageContext = valueHelper.createPageContext(processor, offset);
context.put("pageContext", pageContext); //$NON-NLS-1$
context.put("kbQuery", createKbQuery(Type.ATTRIBUTE_VALUE, "", "", offset, false)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -191,17 +190,6 @@
return elrfm.getResolvers(resource);
}
- //TODO move to helper
- protected ITextViewer getTextViewer() {
- IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editor == null) return null;
- if (editor instanceof JSPMultiPageEditor) {
- JSPMultiPageEditor jsp = (JSPMultiPageEditor)editor;
- return jsp.getSourceEditor().getTextViewer();
- }
- return null;
- }
-
protected KbQuery createKbQuery(Type type, String query, String stringQuery, int pos, boolean addAttr) {
KbQuery kbQuery = new KbQuery();
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -10,8 +10,12 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.drop.treeviewer.model;
+import java.util.ArrayList;
+
import org.jboss.tools.common.kb.ParamList;
import org.jboss.tools.jst.jsp.outline.ValueHelper;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType.Param;
/**
* @author Igels
@@ -21,7 +25,7 @@
public static AttributeValueResource[] EMPTY_LIST = new AttributeValueResource[0];
// private List children = new ArrayList();
- private ParamList params = new ParamList();
+ private Param[] params = new Param[0];
public AttributeValueResource(ModelElement parent) {
super(parent);
@@ -31,11 +35,21 @@
super(name, parent);
}
- public ParamList getParams() {
+ public Param[] getParams() {
return params;
}
- public void setParams(ParamList params) {
+ public String[] getParamsValues(String paramName) {
+ ArrayList<String> result = new ArrayList<String>();
+ for(Param param: params) {
+ if(paramName.equals(param.getName())) {
+ result.add(param.getValue());
+ }
+ }
+ return result.toArray(new String[result.size()]);
+ }
+
+ public void setParams(Param[] params) {
this.params = params;
}
@@ -47,14 +61,14 @@
}
protected ValueHelper valueHelper;
- protected String query;
+ protected KbQuery query;
- public void setQuery(String query, ValueHelper valueHelper) {
+ public void setQuery(KbQuery query, ValueHelper valueHelper) {
this.query = query;
this.valueHelper = valueHelper;
}
- public String getQuery() {
+ public KbQuery getQuery() {
return query;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResourceFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResourceFactory.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResourceFactory.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -14,8 +14,8 @@
import org.eclipse.ui.IEditorInput;
import org.jboss.tools.common.kb.KbDinamicResource;
+import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
-import org.jboss.tools.jst.jsp.support.kb.WTPTextJspKbConnector;
/**
* @author Igels
@@ -31,11 +31,11 @@
return INSTANCE;
}
- public AttributeValueResource createResource(IEditorInput editorInput, WTPTextJspKbConnector wtpTextJspKbConnector, ModelElement root, String type) {
- return createResource(editorInput, wtpTextJspKbConnector, null, root, type);
+ public AttributeValueResource createResource(IEditorInput editorInput, IPageContext pageContext, ModelElement root, String type) {
+ return createResource(editorInput, pageContext, null, root, type);
}
- public AttributeValueResource createResource(IEditorInput editorInput, WTPTextJspKbConnector wtpTextJspKbConnector, String name, ModelElement root, String type) {
+ public AttributeValueResource createResource(IEditorInput editorInput, IPageContext pageContext, String name, ModelElement root, String type) {
if(KbDinamicResource.BEAN_PROPERTY_TYPE.equals(type)) {
return new ManagedBeansPropertiesResourceElement(editorInput, name, root);
} else if(KbDinamicResource.BEAN_METHOD_BY_SYGNATURE_TYPE.equals(type)) {
@@ -43,7 +43,7 @@
} else if(KbDinamicResource.BUNDLE_NAME_TYPE.equals(type)) {
return new BundlesNameResourceElement(editorInput, name, root);
} else if(KbDinamicResource.BUNDLE_PROPERTY_TYPE.equals(type)) {
- return new BundlesPropertiesResourceElement(editorInput, wtpTextJspKbConnector, name, root);
+ return new BundlesPropertiesResourceElement(editorInput, pageContext, name, root);
} else if(KbDinamicResource.VIEW_ACTIONS_TYPE.equals(type)) {
return new ViewActionsResorceElement(editorInput, name, root);
} else if(KbDinamicResource.ENUMERATION_TYPE.equals(type)) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/BundlesPropertiesResourceElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/BundlesPropertiesResourceElement.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/BundlesPropertiesResourceElement.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -17,7 +17,8 @@
import org.eclipse.ui.IEditorInput;
-import org.jboss.tools.jst.jsp.support.kb.WTPTextJspKbConnector;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.IResourceBundle;
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
/**
@@ -28,17 +29,17 @@
public static String SUPPORTED_ID = WebPromptingProvider.JSF_BUNDLES;
private BundleAliasElement[] bundleAliasElements;
- private WTPTextJspKbConnector wtpTextJspKbConnector;
+ private IPageContext pageContext;
private Map bundles;
- public BundlesPropertiesResourceElement(IEditorInput editorInput, WTPTextJspKbConnector wtpTextJspKbConnector, ModelElement parent) {
+ public BundlesPropertiesResourceElement(IEditorInput editorInput, IPageContext pageContext, ModelElement parent) {
super(editorInput, parent);
- this.wtpTextJspKbConnector = wtpTextJspKbConnector;
+ this.pageContext = pageContext;
}
- public BundlesPropertiesResourceElement(IEditorInput editorInput, WTPTextJspKbConnector wtpTextJspKbConnector, String name, ModelElement parent) {
+ public BundlesPropertiesResourceElement(IEditorInput editorInput, IPageContext pageContext, String name, ModelElement parent) {
super(editorInput, name, parent);
- this.wtpTextJspKbConnector = wtpTextJspKbConnector;
+ this.pageContext = pageContext;
}
/**
@@ -56,12 +57,10 @@
if(registeredBunbles != null && registeredBunbles.size() > 1 && (registeredBunbles.get(0) instanceof Map)) {
bundles.putAll((Map)registeredBunbles.get(0));
}
- Map bundles2 = wtpTextJspKbConnector.getDeclaredBundles();
- Iterator it2 = bundles2.keySet().iterator();
- while(it2.hasNext()) {
- String alias = it2.next().toString();
- WTPTextJspKbConnector.LoadBundleInfo info = (WTPTextJspKbConnector.LoadBundleInfo)bundles2.get(alias);
- bundles.put(alias, info.getBaseName());
+ IResourceBundle[] bs = pageContext.getResourceBundles();
+ for (IResourceBundle b: bs) {
+ String alias = b.getVar();
+ bundles.put(alias, b.getBasename());
}
bundleAliasElements = new BundleAliasElement[bundles.size()];
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/EnumerationResourceElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/EnumerationResourceElement.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/EnumerationResourceElement.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.drop.treeviewer.model;
-import org.jboss.tools.common.kb.ParamList;
+import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType.Param;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
/**
@@ -33,10 +33,10 @@
*/
public ModelElement[] getChildren() {
if(enumerationElements==null) {
- ParamList params = getParams();
- enumerationElements = new EnumerationElement[params.getSize()];
+ Param[] params = getParams();
+ enumerationElements = new EnumerationElement[params.length];
for(int i=0; i<enumerationElements.length; i++) {
- String value = params.getParam(i).getValue();
+ String value = params[i].getValue();
enumerationElements[i] = new EnumerationElement(value, this);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileElement.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileElement.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -29,7 +29,7 @@
while(p != null && !p.getFullName().equals("/")) p = p.getParent(); //$NON-NLS-1$
if(p instanceof ImageFileResourceElement) {
ImageFileResourceElement r = (ImageFileResourceElement)p;
- path = r.wtpKbResource.encodePath(path, r.getQuery(), r.getValueHelper());
+ path = r.wtpKbResource.encodePath(path, r.getQuery().getLastParentTag(), r.getValueHelper());
}
return path;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileResourceElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileResourceElement.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileResourceElement.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -10,13 +10,13 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.drop.treeviewer.model;
+
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.ui.IEditorInput;
-import org.jboss.tools.common.kb.ParamList;
-import org.jboss.tools.common.kb.ParamList.Param;
import org.jboss.tools.jst.jsp.support.kb.WTPKbImageFileResource;
+import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType.Param;
/**
* @author Igels
@@ -41,11 +41,10 @@
}
}
- public void setParams(ParamList params) {
+ public void setParams(Param[] params) {
super.setParams(params);
- if(params != null && params.getSize() > 0 && wtpKbResource != null) {
- for (int i = 0; i < params.getSize(); i++) {
- Param p = params.getParam(i);
+ if(params != null && params.length > 0 && wtpKbResource != null) {
+ for (Param p: params) {
wtpKbResource.setConstraint(p.getName(), p.getValue());
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ManagedBeanForMdElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ManagedBeanForMdElement.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ManagedBeanForMdElement.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -54,9 +54,9 @@
ManagedBeanMethodResourceElement parentResource = getResource();
Properties types = new Properties();
- String[] typeValues = parentResource.getParams().getParamsValues("paramType"); //$NON-NLS-1$
+ String[] typeValues = parentResource.getParamsValues("paramType"); //$NON-NLS-1$
types.put(IWebPromptingProvider.PARAMETER_TYPES, typeValues);
- String[] returnTypes = parentResource.getParams().getParamsValues("returnType"); //$NON-NLS-1$
+ String[] returnTypes = parentResource.getParamsValues("returnType"); //$NON-NLS-1$
if(returnTypes.length>0) {
types.put(IWebPromptingProvider.RETURN_TYPE, returnTypes[0]);
} else {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ManagedBeanForPropElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ManagedBeanForPropElement.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ManagedBeanForPropElement.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -54,7 +54,7 @@
if(managedBeanPropertyElements==null) {
ManagedBeansPropertiesResourceElement parentResource = getResource();
String typeValue = null;
- String[] typeValues = parentResource.getParams().getParamsValues("type"); //$NON-NLS-1$
+ String[] typeValues = parentResource.getParamsValues("type"); //$NON-NLS-1$
if(typeValues.length>0) {
typeValue = typeValues[0];
}
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 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -114,6 +114,7 @@
import org.jboss.tools.jst.jsp.HTMLTextViewerConfiguration;
import org.jboss.tools.jst.jsp.JSPTextViewerConfiguration;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.contentassist.JspContentAssistProcessor;
import org.jboss.tools.jst.jsp.editor.IJSPTextEditor;
import org.jboss.tools.jst.jsp.editor.ITextFormatter;
import org.jboss.tools.jst.jsp.editor.IVisualContext;
@@ -121,7 +122,6 @@
import org.jboss.tools.jst.jsp.outline.JSPContentOutlineConfiguration;
import org.jboss.tools.jst.jsp.outline.JSPPropertySheetConfiguration;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
-import org.jboss.tools.jst.jsp.support.kb.WTPTextJspKbConnector;
import org.jboss.tools.jst.jsp.text.xpl.IStructuredTextOccurrenceStructureProvider;
import org.jboss.tools.jst.jsp.text.xpl.StructuredTextOccurrenceStructureProviderRegistry;
import org.jboss.tools.jst.jsp.ui.action.ExtendedFormatAction;
@@ -329,8 +329,6 @@
if (fOccurrenceModelUpdater != null)
fOccurrenceModelUpdater.install(this, getTextViewer());
- installActivePropmtSupport();
-
createDrop();
setModified(false);
getSourceViewer().removeTextListener(this);
@@ -581,29 +579,6 @@
return getSourceViewer().getAnnotationModel();
}
- private WTPTextJspKbConnector wtpTextJspKbConnector;
-
- private void installActivePropmtSupport() {
- IDocument document = getTextViewer().getDocument();
- IStructuredModel model = null;
- if (getDocumentProvider() instanceof IModelProvider) {
- model = ((IModelProvider) getDocumentProvider())
- .getModel(getEditorInput());
- } else {
- if (document instanceof IStructuredDocument) {
- model = getModel();
- }
- }
- if (wtpTextJspKbConnector == null
- && model != null
- && (getContentType().toLowerCase().indexOf("jsp") != -1 || getContentType() //$NON-NLS-1$
- .toLowerCase().indexOf("html") != -1)) { //$NON-NLS-1$
- wtpTextJspKbConnector = new WTPTextJspKbConnector(getEditorInput(),
- document, model);
- wtpTextJspKbConnector.setTaglibManagerProvider(parentEditor);
- }
- }
-
private String getContentType() {
String type = null;
try {
@@ -615,10 +590,6 @@
return type;
}
- public WTPTextJspKbConnector getWTPTextJspKbConnector() {
- return wtpTextJspKbConnector;
- }
-
public static class JSPStructuredTextViewer extends StructuredTextViewer
implements VpeTaglibManagerProvider, IIgnoreSelection {
@@ -1203,11 +1174,6 @@
pageContext = null;
}
- if (wtpTextJspKbConnector != null) {
- wtpTextJspKbConnector.setTaglibManagerProvider(null);
- wtpTextJspKbConnector.dispose();
- wtpTextJspKbConnector = null;
- }
super.dispose();
if (listener != null)
listener.dispose();
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -167,6 +167,7 @@
List modelQueryActionList = new ArrayList();
String query = "/" + element.getNodeName(); //$NON-NLS-1$
+ //TODO replace TagDescriptor with Component
TagDescriptor d = valueHelper.getTagDescriptor(query);
if(d != null) {
List as = d.getAttributesDescriptors();
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -1,1001 +1,1007 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.jsp.outline;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Stack;
-
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySheetEntry;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySource2;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.properties.EnumeratedStringPropertyDescriptor;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
-import org.jboss.tools.jst.jsp.contentassist.FaceletPageContectAssistProcessor;
-import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
-import org.jboss.tools.jst.jsp.contentassist.JspContentAssistProcessor;
-import org.jboss.tools.jst.jsp.editor.IVisualController;
-import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.PageProcessor;
-import org.jboss.tools.jst.web.kb.KbQuery.Type;
-import org.jboss.tools.jst.web.kb.taglib.IAttribute;
-import org.jboss.tools.jst.web.kb.taglib.IComponent;
-import org.jboss.tools.jst.web.kb.taglib.ICustomTagLibComponent;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * @author Kabanovich
- * XMLPropertySourceAdapter extension that overrides
- * creation of property descriptors.
- */
-
-public class JSPPropertySourceAdapter implements INodeAdapter, IPropertySource, IPropertySourceExtension, IPropertySource2 {//extends XMLPropertySourceAdapter {
- protected final static String CATEGORY_ATTRIBUTES = XMLUIMessages.XMLPropertySourceAdapter_0;
- private static final boolean SET_EXPERT_FILTER = false;
-
- private AttributeSorter sorter = null;
- private Node fNode = null;
- private boolean fCaseSensitive = true;
- private IPropertyDescriptor[] fDescriptors = null;
- private ValueHelper valueHelper = new ValueHelper();
- IPageContext pageContext;
- int offset = 0;
- KbQuery kbQuery;
- private Set attributeNames = new HashSet();
-
- public JSPPropertySourceAdapter(INodeNotifier target) {
- setTarget(target);
- }
-
- Map getWeights() {
- return sorter == null ? new HashMap() : sorter.weights;
- }
-
- public void setTarget(INodeNotifier target) {
- if(fNode == target) return;
- fNode = (target instanceof Node) ? (Node) target : null;
- if (fNode instanceof IDOMNode) {
- Document ownerDocument = fNode.getOwnerDocument();
- if (ownerDocument == null && fNode instanceof Document) {
- // if ownerDocument is null, then it must be the Document Node
- ownerDocument = (Document) fNode;
- }
- DocumentTypeAdapter adapter = ownerDocument == null ? null : (DocumentTypeAdapter) ((INodeNotifier) ownerDocument).getAdapterFor(DocumentTypeAdapter.class);
- if (adapter != null)
- fCaseSensitive = adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE;
- offset = ((IDOMElement)fNode).getStartOffset() + ("" + fNode.getNodeType()).length(); //$NON-NLS-1$
- }
- JspContentAssistProcessor processor = valueHelper.isFacetets() ? new FaceletPageContectAssistProcessor() : new JspContentAssistProcessor();
- processor.createContext(getTextViewer(), offset);
- pageContext = processor.getContext();
- kbQuery = createKbQueryForNode(processor, Type.ATTRIBUTE_NAME, "zzzzzz", "zzzzzz", offset); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- //TODO move to helper
- protected ITextViewer getTextViewer() {
- IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editor == null) return null;
- if (editor instanceof JSPMultiPageEditor) {
- JSPMultiPageEditor jsp = (JSPMultiPageEditor)editor;
- return jsp.getSourceEditor().getTextViewer();
- }
- return null;
- }
-
- public void setSorter(AttributeSorter sorter) {
- this.sorter = sorter;
- }
-
- /**
- * Returns the current collection of property descriptors.
- *
- * @return all valid descriptors.
- */
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if(fNode == null) {
- if(fDescriptors == null || fDescriptors.length > 0) {
- fDescriptors = new IPropertyDescriptor[0];
- }
- } else if (fDescriptors == null || fDescriptors.length == 0) {
- attributeNamesChanged();
- fDescriptors = createPropertyDescriptors();
- } else {
- if(attributeNamesChanged()) {
- updatePropertyDescriptors();
- }
-// return fDescriptors;
- }
- return fDescriptors;
- }
-
- private String getQuery(Attr attr) {
- return getQuery(attr.getName());
- }
-
- private String getQuery(String attributeName) {
- String tagName = fNode.getNodeName();
- String jsfTagName = null;
- if(fNode instanceof Element) {
- jsfTagName = valueHelper.getFaceletJsfTag((Element)fNode);
- }
- if(jsfTagName != null) tagName = jsfTagName;
- if(jsfTagName == null && valueHelper.isFacetets() && tagName.indexOf(':') < 0 && !FaceletsHtmlContentAssistProcessor.JSFCAttributeName.equals(attributeName)) {
- tagName = FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart + tagName;
- }
- return "/" + tagName + "@" + attributeName; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private IPropertyDescriptor[] createPropertyDescriptors() {
- if(sorter != null) sorter.clear();
- CMNamedNodeMap attrMap = null;
- CMElementDeclaration ed = getDeclaration();
- if (ed != null) {
- attrMap = ed.getAttributes();
- }
-
- List<IPropertyDescriptor> descriptorList = new ArrayList<IPropertyDescriptor>();
- List<String> names = new ArrayList<String>();
- List<String> namesLow = new ArrayList<String>();
- IPropertyDescriptor descriptor;
-
- Map<String, IAttribute> as = getAttributes();
-
- for (IAttribute d: as.values()) {
- descriptor = null;
- String attrName = d.getName();
- if (fCaseSensitive) {
- if (names.contains(attrName)) continue;
- } else {
- if (namesLow.contains(attrName.toLowerCase())) continue;
- }
- if(valueHelper.isAvailable(getQuery(attrName))
- || attrName.equals("style") //$NON-NLS-1$
- || attrName.equals("class")) { //$NON-NLS-1$
- descriptor = createJSPPropertyDescriptor(d, attrName, false);
- } else {
- System.out.println(attrName);
- descriptor = createTextPropertyDescriptor(attrName, CATEGORY_ATTRIBUTES, 0);
- }
- if (descriptor != null) {
- names.add(attrName);
- namesLow.add(attrName.toLowerCase());
- descriptorList.add(descriptor);
- }
- }
-/*
- if(td != null) {
- List list = td.getAttributesDescriptors();
- for (int i = 0; i < list.size(); i++) {
- descriptor = null;
- AttributeDescriptor d = (AttributeDescriptor)list.get(i);
- String attrName = d.getName();
- if (fCaseSensitive) {
- if (names.contains(attrName)) continue;
- } else {
- if (namesLow.contains(attrName.toLowerCase())) continue;
- }
- if(valueHelper.isAvailable(getQuery(attrName))
- || attrName.equals("style") //$NON-NLS-1$
- || attrName.equals("class")) { //$NON-NLS-1$
- descriptor = createJSPPropertyDescriptor(d, attrName, false);
- } else {
- descriptor = createTextPropertyDescriptor(attrName, CATEGORY_ATTRIBUTES, 0);
- }
- if (descriptor != null) {
- names.add(attrName);
- namesLow.add(attrName.toLowerCase());
- descriptorList.add(descriptor);
- }
- }
- }
-*/
- // add descriptors for existing attributes
- NamedNodeMap attributes = fNode.getAttributes();
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
- CMAttributeDeclaration attrDecl = null;
- Attr attr = (Attr) attributes.item(i);
- String attrName = attr.getName();
- if(names.contains(attrName)) continue;
- if(!fCaseSensitive && namesLow.contains(attrName.toLowerCase())) {
- continue;
- }
- // if metainfo is present for this attribute, use the
- // CMAttributeDeclaration to derive a descriptor
- if (attrMap != null) {
- if (fCaseSensitive)
- attrDecl = (CMAttributeDeclaration) attrMap.getNamedItem(attrName);
- else {
- for (int j = 0; j < attrMap.getLength(); j++) {
- if (!fCaseSensitive && attrMap.item(j).getNodeName().equalsIgnoreCase(attrName)) {
- attrDecl = (CMAttributeDeclaration) attrMap.item(j);
- break;
- }
- }
- }
- }
- // be consistent: if there's metainfo, use *that* as the
- // descriptor ID
- if (attrDecl != null) {
- descriptor = createPropertyDescriptor(attrDecl);
- if(descriptor instanceof TextPropertyDescriptor) {
- IAttribute a = as.get(attrName);
- if(valueHelper.isAvailable(getQuery(attr)) && a != null) {
- descriptor = createJSPPropertyDescriptor(a, attr.getName(), false);
-// descriptor = createJSPPropertyDescriptor(getQuery(attr), attr.getName(), false);
- }
- }
- if (descriptor != null) {
- names.add(attrDecl.getNodeName());
- namesLow.add(attrDecl.getNodeName().toLowerCase());
- }
- }
- else {
- IAttribute a = as.get(attrName);
- if(valueHelper.isAvailable(getQuery(attr)) && a != null) {
- descriptor = createJSPPropertyDescriptor(a, attr.getName(), false);
-// descriptor = createJSPPropertyDescriptor(getQuery(attr), attr.getName(), false);
- } else {
- descriptor = createDefaultPropertyDescriptor(attr.getName(), false);
- }
- if (descriptor != null)
- names.add(attr.getName());
- namesLow.add(attr.getName().toLowerCase());
- }
- if (descriptor != null) {
- descriptorList.add(descriptor);
- }
- }
- }
-
- // add descriptors from the metainfo that are not yet listed
- if (attrMap != null) {
- for (int i = 0; i < attrMap.getLength(); i++) {
- CMAttributeDeclaration attrDecl = null;
- attrDecl = (CMAttributeDeclaration) attrMap.item(i);
- String query = getQuery(attrDecl.getAttrName());
- if (names.contains(attrDecl.getAttrName())) continue;
- if(!fCaseSensitive && namesLow.contains(attrDecl.getAttrName().toLowerCase())) {
- continue;
- }
- IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl);
- if(holdDescriptor instanceof TextPropertyDescriptor) {
- IAttribute a = as.get(attrDecl.getAttrName());
- if(valueHelper.isAvailable(query) && a != null) {
- holdDescriptor = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
-// holdDescriptor = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
- }
- }
- if (holdDescriptor != null) {
- descriptorList.add(holdDescriptor);
- }
- }
- }
-
- IPropertyDescriptor[] descriptors = new IPropertyDescriptor[descriptorList.size()];
- for (int i = 0; i < descriptors.length; i++)
- descriptors[i] = (IPropertyDescriptor) descriptorList.get(i);
- return descriptors;
- }
-
- protected KbQuery createKbQueryForNode(JspContentAssistProcessor processor, Type type, String query, String stringQuery, int pos) {
- KbQuery kbQuery = new KbQuery();
-
- String[] parentTags = processor.getParentTags(false);
- parentTags = add(parentTags, fNode.getNodeName());
- kbQuery.setPrefix(getPrefix());
- kbQuery.setUri(processor.getUri(getPrefix()));
- kbQuery.setParentTags(parentTags);
- kbQuery.setParent(fNode.getNodeName());
- kbQuery.setMask(true);
- kbQuery.setType(type);
- kbQuery.setOffset(pos);
- kbQuery.setValue(query);
- kbQuery.setStringQuery(stringQuery);
-
- return kbQuery;
- }
-
- private String[] add(String[] result, String v) {
- String[] result1 = new String[result.length + 1];
- System.arraycopy(result, 0, result1, 0, result.length);
- result1[result.length] = v;
- return result1;
- }
- private String getPrefix() {
- int i = fNode.getNodeName().indexOf(':');
- return i < 0 ? null : fNode.getNodeName().substring(0, i);
- }
-
-
- private String getCategory(CMAttributeDeclaration attrDecl) {
- if (attrDecl != null) {
- if (attrDecl.supports("category")) { //$NON-NLS-1$
- return (String) attrDecl.getProperty("category"); //$NON-NLS-1$
- }
- }
- return CATEGORY_ATTRIBUTES;
- }
-
- private CMElementDeclaration getDeclaration() {
- if (fNode == null || fNode.getNodeType() != Node.ELEMENT_NODE)
- return null;
- Document document = fNode.getOwnerDocument();
- ModelQuery modelQuery = (document == null) ? null : ModelQueryUtil.getModelQuery(document);
- if (modelQuery != null) {
- return modelQuery.getCMElementDeclaration((Element) fNode);
- }
- return null;
- }
-/*
- private IPropertyDescriptor createJSPPropertyDescriptor(String query, String attributeName, boolean hideOnFilter) {
- AttributeDescriptor d = valueHelper.getAttributeDescriptor(query);
- return createJSPPropertyDescriptor(d, attributeName, hideOnFilter);
- }
-
- private IPropertyDescriptor createJSPPropertyDescriptor(AttributeDescriptor d, String attributeName, boolean hideOnFilter) {
- if(d != null && sorter != null) {
- if(d.isRequired()) sorter.setWeight(attributeName, 2);
- else if(d.isPreferable()) sorter.setWeight(attributeName, 1);
- else sorter.setWeight(attributeName, 0);
- }
- Properties context = new Properties();
- context.put("node", fNode); //$NON-NLS-1$
- context.setProperty("nodeName", fNode.getNodeName()); //$NON-NLS-1$
- context.setProperty("attributeName", attributeName); //$NON-NLS-1$
- context.put("valueHelper", valueHelper); //$NON-NLS-1$
- JSPPropertyDescriptor descriptor = new JSPPropertyDescriptor(context, attributeName, attributeName);
- descriptor.setCategory(getCategory(null));
- descriptor.setDescription(attributeName);
- return descriptor;
- }
-*/
- private IPropertyDescriptor createJSPPropertyDescriptor(IAttribute d, String attributeName, boolean hideOnFilter) {
- if(d != null && sorter != null) {
- if(d.isRequired()) sorter.setWeight(attributeName, 2);
- else if(d.isPreferable()) sorter.setWeight(attributeName, 1);
- else sorter.setWeight(attributeName, 0);
- }
- Properties context = new Properties();
- context.put("node", fNode); //$NON-NLS-1$
- context.setProperty("nodeName", fNode.getNodeName()); //$NON-NLS-1$
- context.setProperty("attributeName", attributeName); //$NON-NLS-1$
- context.put("valueHelper", valueHelper); //$NON-NLS-1$
- context.put("pageContext", pageContext); //$NON-NLS-1$
- JSPPropertyDescriptor descriptor = new JSPPropertyDescriptor(context, attributeName, attributeName);
- descriptor.setCategory(getCategory(null));
- descriptor.setDescription(attributeName);
- return descriptor;
- }
-
- private IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName, boolean hideOnFilter) {
- // The descriptor class used here is also used in
- // updatePropertyDescriptors()
- TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attributeName, attributeName);
- descriptor.setCategory(getCategory(null));
- descriptor.setDescription(attributeName);
-// if (hideOnFilter && SET_EXPERT_FILTER)
-// descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
- return descriptor;
- }
-
- /**
- * Simplified test that does not take into account
- * if element declaration changed.
- */
- boolean attributeNamesChanged() {
- Set<String> as = new HashSet<String>();
- NamedNodeMap attributes = fNode.getAttributes();
- boolean changed = false;
- if(attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attr = (Attr) attributes.item(i);
- String attrName = attr.getName();
- as.add(attrName);
- if(!attributeNames.contains(attrName)) changed = true;
- }
- }
- if(!changed && attributeNames.size() != as.size()) {
- changed = true;
- }
- if(changed) attributeNames = as;
- return changed;
- }
-
- protected void updatePropertyDescriptors() {
- if (fDescriptors == null || fDescriptors.length == 0) return;
-
- Map<String, IAttribute> as = getAttributes();
-
-
- // List of all names encountered in the tag and defined by the element
- List<String> declaredNames = new ArrayList<String>();
- // New descriptor list that will become fDescriptors after all
- // processing is done
- List<IPropertyDescriptor> descriptors = new ArrayList<IPropertyDescriptor>();
- // Names of the descriptors in the above List
- Set<String> descriptorNames = new HashSet<String>();
- Set<String> descriptorNamesLow = new HashSet<String>();
-
- // Update any descriptors derived from the metainfo
- CMElementDeclaration ed = getDeclaration();
- CMNamedNodeMap attrMap = null;
- if (ed != null) {
- attrMap = ed.getAttributes();
- }
- // Update exiting descriptors; not added to the final list here
- if (attrMap != null) {
- // Update existing descriptor types based on metainfo
- CMAttributeDeclaration attrDecl = null;
- for (int i = 0; i < attrMap.getLength(); i++) {
- attrDecl = (CMAttributeDeclaration) attrMap.item(i);
- String attrName = attrDecl.getAttrName();
- String query = getQuery(attrName);
- if (!declaredNames.contains(attrName)) {
- declaredNames.add(attrName);
- }
- for (int j = 0; j < fDescriptors.length; j++) {
- boolean sameName = (fCaseSensitive && fDescriptors[j].getId().equals(attrDecl.getNodeName())) || (!fCaseSensitive && attrDecl.getNodeName().equals(fDescriptors[j].getId().toString()));
- if (sameName) {
- String[] validValues = getValidValues(attrDecl);
- // Update the descriptor for this
- // CMAttributeDeclaration (only enumerated values get
- // updated for now)
- if (fDescriptors[j] instanceof EnumeratedStringPropertyDescriptor) {
- ((EnumeratedStringPropertyDescriptor) fDescriptors[j]).updateValues(validValues);
- }
- // Replace with better descriptor
- else if (validValues != null && validValues.length > 0) {
- fDescriptors[j] = createPropertyDescriptor(attrDecl);
- if(fDescriptors[j] instanceof TextPropertyDescriptor) {
- IAttribute a = as.get(attrName);
- if(valueHelper.isAvailable(query) && a != null) {
- fDescriptors[j] = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
-// fDescriptors[j] = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
- }
- }
- }
- }
- }
- }
- }
- else {
- // Update existing descriptors based on not having any metainfo
- for (int j = 0; j < fDescriptors.length; j++) {
- // Replace with basic descriptor
- if (!(fDescriptors[j] instanceof TextPropertyDescriptor)) {
- fDescriptors[j] = createDefaultPropertyDescriptor((String) fDescriptors[j].getId(), false);
- }
- }
- }
-
- NamedNodeMap attributes = fNode.getAttributes();
-
- // Remove descriptors for attributes that aren't present AND aren't
- // known through metainfo,
- // do this by only reusing existing descriptors for attributes that
- // are present or declared
- if(attributes != null) for (int i = 0; i < fDescriptors.length; i++) {
- if (fDescriptors[i] != null) {
- String descriptorName = fDescriptors[i].getId().toString();
- if ((declaredNames.contains(descriptorName) || (attributes.getNamedItem(descriptorName) != null)) && !descriptorNames.contains(descriptorName)) {
- descriptorNames.add(descriptorName);
- descriptorNamesLow.add(descriptorName.toLowerCase());
- descriptors.add(fDescriptors[i]);
- }
- }
- }
-
- // Add descriptors for declared attributes that don't already have one
- if (attrMap != null) {
- // Update existing descriptor types based on metainfo
- CMAttributeDeclaration attrDecl = null;
- for (int i = 0; i < attrMap.getLength(); i++) {
- attrDecl = (CMAttributeDeclaration) attrMap.item(i);
- String attrName = attrDecl.getAttrName();
- String query = getQuery(attrName);
- if (fCaseSensitive) {
- if (!descriptorNames.contains(attrName)) {
- IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
- if(descriptor instanceof TextPropertyDescriptor) {
- IAttribute a = as.get(attrName);
- if(valueHelper.isAvailable(query) && a != null) {
- descriptor = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
-// descriptor = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
- }
- }
- if (descriptor != null) {
- descriptorNames.add(attrName);
- descriptorNamesLow.add(attrName.toLowerCase());
- descriptors.add(descriptor);
- }
- }
- }
- else {
- boolean exists = descriptorNamesLow.contains(attrName.toLowerCase());
- if (!exists) {
- descriptorNames.add(attrName);
- descriptorNamesLow.add(attrName.toLowerCase());
- IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
- if(descriptor instanceof TextPropertyDescriptor) {
- IAttribute a = as.get(attrName);
- if(valueHelper.isAvailable(query) && a != null) {
- descriptor = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
-// descriptor = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
- }
- }
- if (descriptor != null) {
- descriptorNames.add(attrName);
- descriptorNamesLow.add(attrName.toLowerCase());
- descriptors.add(descriptor);
- }
- }
- }
- }
- }
-
- for (int i = 0; i < fDescriptors.length; i++) {
- if (fDescriptors[i] != null) {
- String descriptorName = fDescriptors[i].getId().toString();
- if (as.get(descriptorName) != null && !descriptorNames.contains(descriptorName)) {
- descriptorNames.add(descriptorName);
- descriptorNamesLow.add(descriptorName.toLowerCase());
- descriptors.add(fDescriptors[i]);
- }
- }
- }
- for (IAttribute d: as.values()) {
- String attrName = d.getName();
- if (fCaseSensitive) {
- if (descriptorNames.contains(attrName)) continue;
- } else {
- boolean exists = descriptorNamesLow.contains(attrName.toLowerCase());
- if (exists) continue;
- }
- descriptorNames.add(attrName);
- descriptorNamesLow.add(attrName.toLowerCase());
- IPropertyDescriptor descriptor = null;
- if(valueHelper.isAvailable(getQuery(attrName))) {
- descriptor = createJSPPropertyDescriptor(d, attrName, false);
- } else {
- descriptor = createTextPropertyDescriptor(attrName, CATEGORY_ATTRIBUTES, 0);
- }
- descriptors.add(descriptor);
- }
-/*
- if(td != null) {
- for (int i = 0; i < fDescriptors.length; i++) {
- if (fDescriptors[i] != null) {
- String descriptorName = fDescriptors[i].getId().toString();
- if (td.getAttributeDescriptor(descriptorName) != null && !descriptorNames.contains(descriptorName)) {
- descriptorNames.add(descriptorName);
- descriptorNamesLow.add(descriptorName.toLowerCase());
- descriptors.add(fDescriptors[i]);
- }
- }
- }
- List list = td.getAttributesDescriptors();
- for (int i = 0; i < list.size(); i++) {
- AttributeDescriptor d = (AttributeDescriptor)list.get(i);
- String attrName = d.getName();
- if (fCaseSensitive) {
- if (descriptorNames.contains(attrName)) continue;
- } else {
- boolean exists = descriptorNamesLow.contains(attrName.toLowerCase());
- if (exists) continue;
- }
- descriptorNames.add(attrName);
- descriptorNamesLow.add(attrName.toLowerCase());
- IPropertyDescriptor descriptor = null;
- if(valueHelper.isAvailable(getQuery(attrName))) {
- descriptor = createJSPPropertyDescriptor(d, attrName, false);
- } else {
- descriptor = createTextPropertyDescriptor(attrName, CATEGORY_ATTRIBUTES, 0);
- }
- descriptors.add(descriptor);
- }
- }
-*/
- // Add descriptors for existing attributes that don't already have one
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attr = (Attr) attributes.item(i);
- String attrName = attr.getName();
- if (fCaseSensitive) {
- if (!descriptorNames.contains(attrName)) {
- descriptorNames.add(attrName);
- descriptorNamesLow.add(attrName.toLowerCase());
- descriptors.add(createDefaultPropertyDescriptor(attrName, false));
- }
- } else {
- boolean exists = descriptorNamesLow.contains(attrName.toLowerCase());
- if (!exists) {
- descriptorNames.add(attrName);
- descriptorNamesLow.add(attrName.toLowerCase());
- descriptors.add(createDefaultPropertyDescriptor(attrName, false));
- }
- }
- }
- }
-
- // Update fDescriptors
- IPropertyDescriptor[] newDescriptors = new IPropertyDescriptor[descriptors.size()];
- for (int i = 0; i < newDescriptors.length; i++)
- newDescriptors[i] = (IPropertyDescriptor) descriptors.get(i);
- fDescriptors = newDescriptors;
- }
-
- private Stack<Object> fValuesBeingSet = new Stack<Object>();
-
- public void setPropertyValue(Object nameObject, Object value) {
- // Avoid cycling - can happen if a closing cell editor causes a
- // refresh
- // on the PropertySheet page and the setInput again asks the editor to
- // close; besides, why apply the same value twice?
- if (!fValuesBeingSet.isEmpty() && fValuesBeingSet.peek() == nameObject)
- return;
- fValuesBeingSet.push(nameObject);
- String name = nameObject.toString();
- String valueString = null;
- if (value != null)
- valueString = value.toString();
- NamedNodeMap attrMap = fNode.getAttributes();
- try {
- if (attrMap != null) {
- Attr attr = (Attr) attrMap.getNamedItem(name);
- if (attr != null) {
- // EXISTING VALUE
- // potential out of control loop if updating the value
- // triggers a viewer update, forcing the
- // active cell editor to save its value and causing the
- // loop to continue
- if (attr.getValue() == null || !attr.getValue().equals(valueString)) {
- if(valueString == null || valueString.length() == 0 && !isRequiredAttribute(attr.getName())) {
- fNode.getAttributes().removeNamedItem(attr.getName());
- } else {
- if (attr instanceof IDOMNode) {
- ((IDOMNode) attr).setValueSource(valueString);
- IVisualController controller = valueHelper.getController();
- if(controller != null) controller.visualRefresh();
- } else {
- attr.setValue(valueString);
- }
- }
- }
- }
- else {
- // NEW(?) value
- if (value != null && fNode.getOwnerDocument() != null) { // never create an empty attribute
- Attr newAttr = fNode.getOwnerDocument().createAttribute(name);
- if (newAttr instanceof IDOMNode)
- ((IDOMNode) newAttr).setValueSource(valueString);
- else
- newAttr.setValue(valueString);
- attrMap.setNamedItem(newAttr);
- }
- }
- }
- else {
- if (fNode instanceof Element) {
- ((Element) fNode).setAttribute(name, valueString);
- }
- }
- }
- catch (DOMException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
- fValuesBeingSet.pop();
- }
-
- boolean isRequiredAttribute(String attributeName) {
- Map<String, IAttribute> as = getAttributes();
- IAttribute d = as.get(attributeName);
-// String query = getQuery(attributeName);
-// AttributeDescriptor d = valueHelper.getAttributeDescriptor(query);
- if(d == null) return false; // do not remove unknown attribute? Remove it!
- return d.isRequired();
- }
-
- private Map<String, IAttribute> getAttributes() {
- IComponent[] components = PageProcessor.getInstance().getComponents(kbQuery, pageContext, true);
- Map<String, IAttribute> map = new HashMap<String, IAttribute>();
- for (IComponent component: components) {
- IAttribute[] as = component.getAttributes();
- for (IAttribute a: as) {
- String n = a.getName();
- if(map.containsKey(n) && !(component instanceof ICustomTagLibComponent)) {
- continue;
- }
- map.put(n, a);
- }
- }
- return map;
- }
-
- //////// XMLPropertyDescriptor
-
- public boolean isAdapterForType(Object type) {
- return type == IPropertySource.class;
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
- }
-
- public Object getEditableValue() {
- return null;
- }
-
- public Object getPropertyValue(Object nameObject) {
- String name = nameObject.toString();
- String returnedValue = null;
- NamedNodeMap attrMap = fNode.getAttributes();
- if (attrMap != null) {
- Node attribute = attrMap.getNamedItem(name);
- if (attribute != null) {
- if (attribute instanceof IDOMNode)
- returnedValue = ((IDOMNode) attribute).getValueSource();
- else
- returnedValue = attribute.getNodeValue();
- }
- }
- if (returnedValue == null)
- returnedValue = ""; //$NON-NLS-1$
- return returnedValue;
- }
-
- public boolean isPropertySet(Object propertyObject) {
- String property = propertyObject.toString();
-
- NamedNodeMap attrMap = fNode.getAttributes();
- if (attrMap != null)
- return attrMap.getNamedItem(property) != null;
- return false;
- }
-
- public void resetPropertyValue(Object propertyObject) {
- String property = propertyObject.toString();
- CMNamedNodeMap attrDecls = null;
-
- CMElementDeclaration ed = getDeclaration();
- if (ed != null) {
- attrDecls = ed.getAttributes();
- }
-
- NamedNodeMap attrMap = fNode.getAttributes();
- if (attrDecls != null) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(property);
- String defValue = null;
- if (attrDecl != null) {
- if (attrDecl.getAttrType() != null) {
- CMDataType helper = attrDecl.getAttrType();
- if (helper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && helper.getImpliedValue() != null)
- defValue = helper.getImpliedValue();
- }
- }
- if (defValue != null && defValue.length() > 0) {
- ((Attr) attrMap.getNamedItem(property)).setValue(defValue);
- }
- else {
- attrMap.removeNamedItem(property);
- }
- }
- else {
- attrMap.removeNamedItem(property);
- }
- }
-
- public boolean isPropertyRemovable(Object id) {
- return true;
- }
-
- public void removeProperty(Object propertyObject) {
- NamedNodeMap attrMap = fNode.getAttributes();
- if (attrMap != null) {
- Node attribute = attrMap.getNamedItem(propertyObject.toString());
- if (attribute != null) {
- try {
- attrMap.removeNamedItem(propertyObject.toString());
- }
- catch (DOMException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
- }
- }
- }
-
- public boolean isPropertyResettable(Object id) {
- boolean resettable = false;
- String property = id.toString();
- CMNamedNodeMap attrDecls = null;
-
- CMElementDeclaration ed = getDeclaration();
- if (ed != null) {
- attrDecls = ed.getAttributes();
- }
-
- if (attrDecls != null) {
- CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(property);
- if (attrDecl != null) {
- if (attrDecl.getAttrType() != null) {
- CMDataType helper = attrDecl.getAttrType();
- if (helper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && helper.getImpliedValue() != null) {
- resettable = true;
- }
- }
- }
- }
- return resettable;
- }
-
- protected IPropertyDescriptor createPropertyDescriptor(CMAttributeDeclaration attrDecl) {
- IPropertyDescriptor descriptor = null;
- CMDataType attrType = attrDecl.getAttrType();
-
- if (attrType != null) {
- // handle declarations that provide FIXED/ENUMERATED values
- if (attrType.getEnumeratedValues() != null && attrType.getEnumeratedValues().length > 0) {
- descriptor = createEnumeratedPropertyDescriptor(attrDecl, attrType);
- }
- else if ((attrDecl.getUsage() == CMAttributeDeclaration.FIXED || attrType.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED) && attrType.getImpliedValue() != null) {
- descriptor = createFixedPropertyDescriptor(attrDecl, attrType);
- }
- else {
- // plain text
- descriptor = createTextPropertyDescriptor(attrDecl);
- }
- }
- else {
- // no extra information given
- descriptor = createTextPropertyDescriptor(attrDecl);
- }
- return descriptor;
- }
-
- private IPropertyDescriptor createTextPropertyDescriptor(CMAttributeDeclaration attrDecl) {
- return createTextPropertyDescriptor(attrDecl.getAttrName(), getCategory(attrDecl), attrDecl.getUsage());
- }
-
- private IPropertyDescriptor createTextPropertyDescriptor(String name, String category, int usage) {
- TextPropertyDescriptor descriptor = new TextPropertyDescriptor(name, name);
- descriptor.setCategory(category);
- descriptor.setDescription(name);
- if (usage != CMAttributeDeclaration.REQUIRED && SET_EXPERT_FILTER)
- descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
- return descriptor;
- }
-
- private IPropertyDescriptor createEnumeratedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType valuesHelper) {
- // the displayName MUST be set
- EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrDecl.getAttrName(), attrDecl.getAttrName(), _getValidStrings(attrDecl, valuesHelper));
- descriptor.setCategory(getCategory(attrDecl));
- descriptor.setDescription(attrDecl.getAttrName());
- if (attrDecl.getUsage() != CMAttributeDeclaration.REQUIRED && SET_EXPERT_FILTER)
- descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
- return descriptor;
- }
-
- private IPropertyDescriptor createFixedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType helper) {
- // the displayName MUST be set
- EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrDecl.getNodeName(), attrDecl.getNodeName(), _getValidFixedStrings(attrDecl, helper));
- descriptor.setCategory(getCategory(attrDecl));
- descriptor.setDescription(attrDecl.getAttrName());
- return descriptor;
- }
-
- private String[] getValidValues(CMAttributeDeclaration attrDecl) {
- if (attrDecl == null)
- return new String[0];
-
- String[] validValues = null;
- CMDataType attrType = attrDecl.getAttrType();
- if (attrType != null) {
- validValues = _getValidStrings(attrDecl, attrType);
- }
- if (validValues == null)
- validValues = new String[0];
- return validValues;
- }
-
- private String[] _getValidStrings(CMAttributeDeclaration attrDecl, CMDataType valuesHelper) {
- String attributeName = attrDecl.getAttrName();
- List values = new ArrayList(1);
- boolean currentValueKnown = false;
- boolean checkIfCurrentValueIsKnown = (fNode.getAttributes() != null && fNode.getAttributes().getNamedItem(attributeName) != null && fNode.getAttributes().getNamedItem(attributeName).getNodeValue() != null);
- String currentValue = null;
- if (checkIfCurrentValueIsKnown)
- currentValue = fNode.getAttributes().getNamedItem(attributeName).getNodeValue();
-
- if (valuesHelper.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED && valuesHelper.getImpliedValue() != null) {
- // FIXED value
- currentValueKnown = currentValue != null && valuesHelper.getImpliedValue().equals(currentValue);
- values.add(valuesHelper.getImpliedValue());
- }
- else {
- // ENUMERATED values
- String[] valueStrings = null;
- // valueStrings = valuesHelper.getEnumeratedValues();
- Document document = fNode.getOwnerDocument();
- ModelQuery modelQuery = (document == null) ? null : ModelQueryUtil.getModelQuery(document);
- if (modelQuery != null && fNode.getNodeType() == Node.ELEMENT_NODE) {
- valueStrings = modelQuery.getPossibleDataTypeValues((Element) fNode, attrDecl);
- }
- else {
- valueStrings = attrDecl.getAttrType().getEnumeratedValues();
- }
- if (valueStrings != null) {
- for (int i = 0; i < valueStrings.length; i++) {
- if (checkIfCurrentValueIsKnown && valueStrings[i].equals(currentValue))
- currentValueKnown = true;
- values.add(valueStrings[i]);
- }
- }
- }
- if (valuesHelper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && valuesHelper.getImpliedValue() != null) {
- if (!values.contains(valuesHelper.getImpliedValue()))
- values.add(valuesHelper.getImpliedValue());
- }
-
- if (checkIfCurrentValueIsKnown && !currentValueKnown && currentValue != null && currentValue.length() > 0)
- values.add(currentValue);
- String[] validStrings = new String[values.size()];
- validStrings = (String[]) values.toArray(validStrings);
- return validStrings;
- }
-
- private String[] _getValidFixedStrings(CMAttributeDeclaration attrDecl, CMDataType helper) {
- String attributeName = attrDecl.getAttrName();
- List values = new ArrayList(1);
- String impliedValue = helper.getImpliedValue();
- if (impliedValue != null)
- values.add(impliedValue);
- boolean checkIfCurrentValueIsIncluded = (fNode.getAttributes() != null && fNode.getAttributes().getNamedItem(attributeName) != null && fNode.getAttributes().getNamedItem(attributeName).getNodeValue() != null);
- if (checkIfCurrentValueIsIncluded) {
- String currentValue = null;
- currentValue = fNode.getAttributes().getNamedItem(attributeName).getNodeValue();
- if (!currentValue.equals(impliedValue))
- values.add(currentValue);
- }
- String[] validStrings = new String[values.size()];
- validStrings = (String[]) values.toArray(validStrings);
- return validStrings;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.outline;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Stack;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySheetEntry;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.IPropertySource2;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
+import org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
+import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
+import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
+import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.eclipse.wst.xml.ui.internal.properties.EnumeratedStringPropertyDescriptor;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.contentassist.FaceletPageContectAssistProcessor;
+import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
+import org.jboss.tools.jst.jsp.contentassist.JspContentAssistProcessor;
+import org.jboss.tools.jst.jsp.editor.IVisualController;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.PageProcessor;
+import org.jboss.tools.jst.web.kb.KbQuery.Type;
+import org.jboss.tools.jst.web.kb.taglib.IAttribute;
+import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.ICustomTagLibComponent;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * @author Kabanovich
+ * XMLPropertySourceAdapter extension that overrides
+ * creation of property descriptors.
+ */
+
+public class JSPPropertySourceAdapter implements INodeAdapter, IPropertySource, IPropertySourceExtension, IPropertySource2 {//extends XMLPropertySourceAdapter {
+ protected final static String CATEGORY_ATTRIBUTES = XMLUIMessages.XMLPropertySourceAdapter_0;
+ private static final boolean SET_EXPERT_FILTER = false;
+
+ private AttributeSorter sorter = null;
+ private Node fNode = null;
+ private boolean fCaseSensitive = true;
+ private IPropertyDescriptor[] fDescriptors = null;
+ private ValueHelper valueHelper = new ValueHelper();
+ IPageContext pageContext;
+ int offset = 0;
+ KbQuery kbQuery, kbQueryAttr;
+ private Set attributeNames = new HashSet();
+
+ public JSPPropertySourceAdapter(INodeNotifier target) {
+ setTarget(target);
+ }
+
+ Map getWeights() {
+ return sorter == null ? new HashMap() : sorter.weights;
+ }
+
+ public void setTarget(INodeNotifier target) {
+ if(fNode == target) return;
+ fNode = (target instanceof Node) ? (Node) target : null;
+ if (fNode instanceof IDOMNode) {
+ Document ownerDocument = fNode.getOwnerDocument();
+ if (ownerDocument == null && fNode instanceof Document) {
+ // if ownerDocument is null, then it must be the Document Node
+ ownerDocument = (Document) fNode;
+ }
+ DocumentTypeAdapter adapter = ownerDocument == null ? null : (DocumentTypeAdapter) ((INodeNotifier) ownerDocument).getAdapterFor(DocumentTypeAdapter.class);
+ if (adapter != null)
+ fCaseSensitive = adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE;
+ offset = ((IDOMElement)fNode).getStartOffset() + ("" + fNode.getNodeType()).length(); //$NON-NLS-1$
+ }
+ JspContentAssistProcessor processor = valueHelper.isFacetets() ? new FaceletPageContectAssistProcessor() : new JspContentAssistProcessor();
+ processor.createContext(getTextViewer(), offset);
+ pageContext = processor.getContext();
+ kbQuery = createKbQuery(processor);
+ kbQueryAttr = createKbQuery(processor);
+ }
+
+ //TODO move to helper
+ protected ITextViewer getTextViewer() {
+ IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editor == null) return null;
+ if (editor instanceof JSPMultiPageEditor) {
+ JSPMultiPageEditor jsp = (JSPMultiPageEditor)editor;
+ return jsp.getSourceEditor().getTextViewer();
+ }
+ return null;
+ }
+
+ public void setSorter(AttributeSorter sorter) {
+ this.sorter = sorter;
+ }
+
+ /**
+ * Returns the current collection of property descriptors.
+ *
+ * @return all valid descriptors.
+ */
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if(fNode == null) {
+ if(fDescriptors == null || fDescriptors.length > 0) {
+ fDescriptors = new IPropertyDescriptor[0];
+ }
+ } else if (fDescriptors == null || fDescriptors.length == 0) {
+ attributeNamesChanged();
+ fDescriptors = createPropertyDescriptors();
+ } else {
+ if(attributeNamesChanged()) {
+ updatePropertyDescriptors();
+ }
+// return fDescriptors;
+ }
+ return fDescriptors;
+ }
+
+// private String getQuery(Attr attr) {
+// return getQuery(attr.getName());
+// }
+
+ private KbQuery getQuery(String attributeName) {
+// String tagName = fNode.getNodeName();
+// String jsfTagName = null;
+// if(fNode instanceof Element) {
+// jsfTagName = valueHelper.getFaceletJsfTag((Element)fNode);
+// }
+// if(jsfTagName != null) tagName = jsfTagName;
+// if(jsfTagName == null && valueHelper.isFacetets() && tagName.indexOf(':') < 0 && !FaceletsHtmlContentAssistProcessor.JSFCAttributeName.equals(attributeName)) {
+// tagName = FaceletsHtmlContentAssistProcessor.faceletHtmlPrefixStart + tagName;
+// }
+// return "/" + tagName + "@" + attributeName;
+ kbQueryAttr.setValue(attributeName);
+ kbQueryAttr.setStringQuery(attributeName);
+ return kbQueryAttr;
+ }
+
+ private IPropertyDescriptor[] createPropertyDescriptors() {
+ if(sorter != null) sorter.clear();
+ CMNamedNodeMap attrMap = null;
+ CMElementDeclaration ed = getDeclaration();
+ if (ed != null) {
+ attrMap = ed.getAttributes();
+ }
+
+ List<IPropertyDescriptor> descriptorList = new ArrayList<IPropertyDescriptor>();
+ List<String> names = new ArrayList<String>();
+ List<String> namesLow = new ArrayList<String>();
+ IPropertyDescriptor descriptor;
+
+ Map<String, IAttribute> as = getAttributes();
+
+ for (IAttribute d: as.values()) {
+ descriptor = null;
+ String attrName = d.getName();
+ if (fCaseSensitive) {
+ if (names.contains(attrName)) continue;
+ } else {
+ if (namesLow.contains(attrName.toLowerCase())) continue;
+ }
+ if(valueHelper.isAvailable(pageContext, getQuery(attrName))
+ || attrName.equals("style")
+ || attrName.equals("class")) {
+ descriptor = createJSPPropertyDescriptor(d, attrName, false);
+ } else {
+ System.out.println(attrName);
+ descriptor = createTextPropertyDescriptor(attrName, CATEGORY_ATTRIBUTES, 0);
+ }
+ if (descriptor != null) {
+ names.add(attrName);
+ namesLow.add(attrName.toLowerCase());
+ descriptorList.add(descriptor);
+ }
+ }
+/*
+ TagDescriptor td = valueHelper.getTagDescriptor("/" + fNode.getNodeName());
+ if(td != null) {
+ List list = td.getAttributesDescriptors();
+ for (int i = 0; i < list.size(); i++) {
+ descriptor = null;
+ AttributeDescriptor d = (AttributeDescriptor)list.get(i);
+ String attrName = d.getName();
+ if (fCaseSensitive) {
+ if (names.contains(attrName)) continue;
+ } else {
+ if (namesLow.contains(attrName.toLowerCase())) continue;
+ }
+ if(valueHelper.isAvailable(getQuery(attrName))
+ || attrName.equals("style")
+ || attrName.equals("class")) {
+ descriptor = createJSPPropertyDescriptor(d, attrName, false);
+ } else {
+ descriptor = createTextPropertyDescriptor(attrName, CATEGORY_ATTRIBUTES, 0);
+ }
+ if (descriptor != null) {
+ names.add(attrName);
+ namesLow.add(attrName.toLowerCase());
+ descriptorList.add(descriptor);
+ }
+ }
+ }
+*/
+ // add descriptors for existing attributes
+ NamedNodeMap attributes = fNode.getAttributes();
+ if (attributes != null) {
+ for (int i = 0; i < attributes.getLength(); i++) {
+ CMAttributeDeclaration attrDecl = null;
+ Attr attr = (Attr) attributes.item(i);
+ String attrName = attr.getName();
+ if(names.contains(attrName)) continue;
+ if(!fCaseSensitive && namesLow.contains(attrName.toLowerCase())) {
+ continue;
+ }
+ // if metainfo is present for this attribute, use the
+ // CMAttributeDeclaration to derive a descriptor
+ if (attrMap != null) {
+ if (fCaseSensitive)
+ attrDecl = (CMAttributeDeclaration) attrMap.getNamedItem(attrName);
+ else {
+ for (int j = 0; j < attrMap.getLength(); j++) {
+ if (!fCaseSensitive && attrMap.item(j).getNodeName().equalsIgnoreCase(attrName)) {
+ attrDecl = (CMAttributeDeclaration) attrMap.item(j);
+ break;
+ }
+ }
+ }
+ }
+ // be consistent: if there's metainfo, use *that* as the
+ // descriptor ID
+ if (attrDecl != null) {
+ descriptor = createPropertyDescriptor(attrDecl);
+ if(descriptor instanceof TextPropertyDescriptor) {
+ IAttribute a = as.get(attrName);
+ if(valueHelper.isAvailable(pageContext, getQuery(attr.getName())) && a != null) {
+ descriptor = createJSPPropertyDescriptor(a, attr.getName(), false);
+// descriptor = createJSPPropertyDescriptor(getQuery(attr), attr.getName(), false);
+ }
+ }
+ if (descriptor != null) {
+ names.add(attrDecl.getNodeName());
+ namesLow.add(attrDecl.getNodeName().toLowerCase());
+ }
+ }
+ else {
+ IAttribute a = as.get(attrName);
+ if(valueHelper.isAvailable(pageContext, getQuery(attr.getName())) && a != null) {
+ descriptor = createJSPPropertyDescriptor(a, attr.getName(), false);
+// descriptor = createJSPPropertyDescriptor(getQuery(attr), attr.getName(), false);
+ } else {
+ descriptor = createDefaultPropertyDescriptor(attr.getName(), false);
+ }
+ if (descriptor != null)
+ names.add(attr.getName());
+ namesLow.add(attr.getName().toLowerCase());
+ }
+ if (descriptor != null) {
+ descriptorList.add(descriptor);
+ }
+ }
+ }
+
+ // add descriptors from the metainfo that are not yet listed
+ if (attrMap != null) {
+ for (int i = 0; i < attrMap.getLength(); i++) {
+ CMAttributeDeclaration attrDecl = null;
+ attrDecl = (CMAttributeDeclaration) attrMap.item(i);
+ KbQuery query = getQuery(attrDecl.getAttrName());
+ if (names.contains(attrDecl.getAttrName())) continue;
+ if(!fCaseSensitive && namesLow.contains(attrDecl.getAttrName().toLowerCase())) {
+ continue;
+ }
+ IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl);
+ if(holdDescriptor instanceof TextPropertyDescriptor) {
+ IAttribute a = as.get(attrDecl.getAttrName());
+ if(valueHelper.isAvailable(pageContext, query) && a != null) {
+ holdDescriptor = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
+// holdDescriptor = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
+ }
+ }
+ if (holdDescriptor != null) {
+ descriptorList.add(holdDescriptor);
+ }
+ }
+ }
+
+ IPropertyDescriptor[] descriptors = new IPropertyDescriptor[descriptorList.size()];
+ for (int i = 0; i < descriptors.length; i++)
+ descriptors[i] = (IPropertyDescriptor) descriptorList.get(i);
+ return descriptors;
+ }
+
+ protected KbQuery createKbQuery(JspContentAssistProcessor processor) {
+ KbQuery kbQuery = new KbQuery();
+
+ String[] parentTags = processor.getParentTags(false);
+ parentTags = add(parentTags, fNode.getNodeName());
+ kbQuery.setPrefix(getPrefix());
+ kbQuery.setUri(processor.getUri(getPrefix()));
+ kbQuery.setParentTags(parentTags);
+ kbQuery.setParent(fNode.getNodeName());
+ kbQuery.setMask(false);
+ kbQuery.setType(Type.ATTRIBUTE_NAME);
+ kbQuery.setOffset(offset);
+ kbQuery.setValue("");
+ kbQuery.setStringQuery("");
+
+ return kbQuery;
+ }
+
+ private String[] add(String[] result, String v) {
+ String[] result1 = new String[result.length + 1];
+ System.arraycopy(result, 0, result1, 0, result.length);
+ result1[result.length] = v;
+ return result1;
+ }
+ private String getPrefix() {
+ int i = fNode.getNodeName().indexOf(':');
+ return i < 0 ? null : fNode.getNodeName().substring(0, i);
+ }
+
+
+ private String getCategory(CMAttributeDeclaration attrDecl) {
+ if (attrDecl != null) {
+ if (attrDecl.supports("category")) {
+ return (String) attrDecl.getProperty("category");
+ }
+ }
+ return CATEGORY_ATTRIBUTES;
+ }
+
+ private CMElementDeclaration getDeclaration() {
+ if (fNode == null || fNode.getNodeType() != Node.ELEMENT_NODE)
+ return null;
+ Document document = fNode.getOwnerDocument();
+ ModelQuery modelQuery = (document == null) ? null : ModelQueryUtil.getModelQuery(document);
+ if (modelQuery != null) {
+ return modelQuery.getCMElementDeclaration((Element) fNode);
+ }
+ return null;
+ }
+/*
+ private IPropertyDescriptor createJSPPropertyDescriptor(String query, String attributeName, boolean hideOnFilter) {
+ AttributeDescriptor d = valueHelper.getAttributeDescriptor(query);
+ return createJSPPropertyDescriptor(d, attributeName, hideOnFilter);
+ }
+
+ private IPropertyDescriptor createJSPPropertyDescriptor(AttributeDescriptor d, String attributeName, boolean hideOnFilter) {
+ if(d != null && sorter != null) {
+ if(d.isRequired()) sorter.setWeight(attributeName, 2);
+ else if(d.isPreferable()) sorter.setWeight(attributeName, 1);
+ else sorter.setWeight(attributeName, 0);
+ }
+ Properties context = new Properties();
+ context.put("node", fNode);
+ context.setProperty("nodeName", fNode.getNodeName());
+ context.setProperty("attributeName", attributeName);
+ context.put("valueHelper", valueHelper);
+ JSPPropertyDescriptor descriptor = new JSPPropertyDescriptor(context, attributeName, attributeName);
+ descriptor.setCategory(getCategory(null));
+ descriptor.setDescription(attributeName);
+ return descriptor;
+ }
+*/
+ private IPropertyDescriptor createJSPPropertyDescriptor(IAttribute d, String attributeName, boolean hideOnFilter) {
+ if(d != null && sorter != null) {
+ if(d.isRequired()) sorter.setWeight(attributeName, 2);
+ else if(d.isPreferable()) sorter.setWeight(attributeName, 1);
+ else sorter.setWeight(attributeName, 0);
+ }
+ Properties context = new Properties();
+ context.put("node", fNode);
+ context.setProperty("nodeName", fNode.getNodeName());
+ context.setProperty("attributeName", attributeName);
+ context.put("valueHelper", valueHelper);
+ context.put("pageContext", pageContext);
+ JSPPropertyDescriptor descriptor = new JSPPropertyDescriptor(context, attributeName, attributeName);
+ descriptor.setCategory(getCategory(null));
+ descriptor.setDescription(attributeName);
+ return descriptor;
+ }
+
+ private IPropertyDescriptor createDefaultPropertyDescriptor(String attributeName, boolean hideOnFilter) {
+ // The descriptor class used here is also used in
+ // updatePropertyDescriptors()
+ TextPropertyDescriptor descriptor = new TextPropertyDescriptor(attributeName, attributeName);
+ descriptor.setCategory(getCategory(null));
+ descriptor.setDescription(attributeName);
+// if (hideOnFilter && SET_EXPERT_FILTER)
+// descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
+ return descriptor;
+ }
+
+ /**
+ * Simplified test that does not take into account
+ * if element declaration changed.
+ */
+ boolean attributeNamesChanged() {
+ Set<String> as = new HashSet<String>();
+ NamedNodeMap attributes = fNode.getAttributes();
+ boolean changed = false;
+ if(attributes != null) {
+ for (int i = 0; i < attributes.getLength(); i++) {
+ Attr attr = (Attr) attributes.item(i);
+ String attrName = attr.getName();
+ as.add(attrName);
+ if(!attributeNames.contains(attrName)) changed = true;
+ }
+ }
+ if(!changed && attributeNames.size() != as.size()) {
+ changed = true;
+ }
+ if(changed) attributeNames = as;
+ return changed;
+ }
+
+ protected void updatePropertyDescriptors() {
+ if (fDescriptors == null || fDescriptors.length == 0) return;
+
+ Map<String, IAttribute> as = getAttributes();
+
+
+ // List of all names encountered in the tag and defined by the element
+ List<String> declaredNames = new ArrayList<String>();
+ // New descriptor list that will become fDescriptors after all
+ // processing is done
+ List<IPropertyDescriptor> descriptors = new ArrayList<IPropertyDescriptor>();
+ // Names of the descriptors in the above List
+ Set<String> descriptorNames = new HashSet<String>();
+ Set<String> descriptorNamesLow = new HashSet<String>();
+
+ // Update any descriptors derived from the metainfo
+ CMElementDeclaration ed = getDeclaration();
+ CMNamedNodeMap attrMap = null;
+ if (ed != null) {
+ attrMap = ed.getAttributes();
+ }
+ // Update exiting descriptors; not added to the final list here
+ if (attrMap != null) {
+ // Update existing descriptor types based on metainfo
+ CMAttributeDeclaration attrDecl = null;
+ for (int i = 0; i < attrMap.getLength(); i++) {
+ attrDecl = (CMAttributeDeclaration) attrMap.item(i);
+ String attrName = attrDecl.getAttrName();
+ KbQuery query = getQuery(attrName);
+ if (!declaredNames.contains(attrName)) {
+ declaredNames.add(attrName);
+ }
+ for (int j = 0; j < fDescriptors.length; j++) {
+ boolean sameName = (fCaseSensitive && fDescriptors[j].getId().equals(attrDecl.getNodeName())) || (!fCaseSensitive && attrDecl.getNodeName().equals(fDescriptors[j].getId().toString()));
+ if (sameName) {
+ String[] validValues = getValidValues(attrDecl);
+ // Update the descriptor for this
+ // CMAttributeDeclaration (only enumerated values get
+ // updated for now)
+ if (fDescriptors[j] instanceof EnumeratedStringPropertyDescriptor) {
+ ((EnumeratedStringPropertyDescriptor) fDescriptors[j]).updateValues(validValues);
+ }
+ // Replace with better descriptor
+ else if (validValues != null && validValues.length > 0) {
+ fDescriptors[j] = createPropertyDescriptor(attrDecl);
+ if(fDescriptors[j] instanceof TextPropertyDescriptor) {
+ IAttribute a = as.get(attrName);
+ if(valueHelper.isAvailable(pageContext, query) && a != null) {
+ fDescriptors[j] = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
+// fDescriptors[j] = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else {
+ // Update existing descriptors based on not having any metainfo
+ for (int j = 0; j < fDescriptors.length; j++) {
+ // Replace with basic descriptor
+ if (!(fDescriptors[j] instanceof TextPropertyDescriptor)) {
+ fDescriptors[j] = createDefaultPropertyDescriptor((String) fDescriptors[j].getId(), false);
+ }
+ }
+ }
+
+ NamedNodeMap attributes = fNode.getAttributes();
+
+ // Remove descriptors for attributes that aren't present AND aren't
+ // known through metainfo,
+ // do this by only reusing existing descriptors for attributes that
+ // are present or declared
+ if(attributes != null) for (int i = 0; i < fDescriptors.length; i++) {
+ if (fDescriptors[i] != null) {
+ String descriptorName = fDescriptors[i].getId().toString();
+ if ((declaredNames.contains(descriptorName) || (attributes.getNamedItem(descriptorName) != null)) && !descriptorNames.contains(descriptorName)) {
+ descriptorNames.add(descriptorName);
+ descriptorNamesLow.add(descriptorName.toLowerCase());
+ descriptors.add(fDescriptors[i]);
+ }
+ }
+ }
+
+ // Add descriptors for declared attributes that don't already have one
+ if (attrMap != null) {
+ // Update existing descriptor types based on metainfo
+ CMAttributeDeclaration attrDecl = null;
+ for (int i = 0; i < attrMap.getLength(); i++) {
+ attrDecl = (CMAttributeDeclaration) attrMap.item(i);
+ String attrName = attrDecl.getAttrName();
+ KbQuery query = getQuery(attrName);
+ if (fCaseSensitive) {
+ if (!descriptorNames.contains(attrName)) {
+ IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
+ if(descriptor instanceof TextPropertyDescriptor) {
+ IAttribute a = as.get(attrName);
+ if(valueHelper.isAvailable(pageContext, query) && a != null) {
+ descriptor = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
+// descriptor = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
+ }
+ }
+ if (descriptor != null) {
+ descriptorNames.add(attrName);
+ descriptorNamesLow.add(attrName.toLowerCase());
+ descriptors.add(descriptor);
+ }
+ }
+ }
+ else {
+ boolean exists = descriptorNamesLow.contains(attrName.toLowerCase());
+ if (!exists) {
+ descriptorNames.add(attrName);
+ descriptorNamesLow.add(attrName.toLowerCase());
+ IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
+ if(descriptor instanceof TextPropertyDescriptor) {
+ IAttribute a = as.get(attrName);
+ if(valueHelper.isAvailable(pageContext, query) && a != null) {
+ descriptor = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
+// descriptor = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
+ }
+ }
+ if (descriptor != null) {
+ descriptorNames.add(attrName);
+ descriptorNamesLow.add(attrName.toLowerCase());
+ descriptors.add(descriptor);
+ }
+ }
+ }
+ }
+ }
+
+ for (int i = 0; i < fDescriptors.length; i++) {
+ if (fDescriptors[i] != null) {
+ String descriptorName = fDescriptors[i].getId().toString();
+ if (as.get(descriptorName) != null && !descriptorNames.contains(descriptorName)) {
+ descriptorNames.add(descriptorName);
+ descriptorNamesLow.add(descriptorName.toLowerCase());
+ descriptors.add(fDescriptors[i]);
+ }
+ }
+ }
+ for (IAttribute d: as.values()) {
+ String attrName = d.getName();
+ if (fCaseSensitive) {
+ if (descriptorNames.contains(attrName)) continue;
+ } else {
+ boolean exists = descriptorNamesLow.contains(attrName.toLowerCase());
+ if (exists) continue;
+ }
+ descriptorNames.add(attrName);
+ descriptorNamesLow.add(attrName.toLowerCase());
+ IPropertyDescriptor descriptor = null;
+ if(valueHelper.isAvailable(pageContext, getQuery(attrName))) {
+ descriptor = createJSPPropertyDescriptor(d, attrName, false);
+ } else {
+ descriptor = createTextPropertyDescriptor(attrName, CATEGORY_ATTRIBUTES, 0);
+ }
+ descriptors.add(descriptor);
+ }
+/*
+ TagDescriptor td = valueHelper.getTagDescriptor("/" + fNode.getNodeName());
+ if(td != null) {
+ for (int i = 0; i < fDescriptors.length; i++) {
+ if (fDescriptors[i] != null) {
+ String descriptorName = fDescriptors[i].getId().toString();
+ if (td.getAttributeDescriptor(descriptorName) != null && !descriptorNames.contains(descriptorName)) {
+ descriptorNames.add(descriptorName);
+ descriptorNamesLow.add(descriptorName.toLowerCase());
+ descriptors.add(fDescriptors[i]);
+ }
+ }
+ }
+ List list = td.getAttributesDescriptors();
+ for (int i = 0; i < list.size(); i++) {
+ AttributeDescriptor d = (AttributeDescriptor)list.get(i);
+ String attrName = d.getName();
+ if (fCaseSensitive) {
+ if (descriptorNames.contains(attrName)) continue;
+ } else {
+ boolean exists = descriptorNamesLow.contains(attrName.toLowerCase());
+ if (exists) continue;
+ }
+ descriptorNames.add(attrName);
+ descriptorNamesLow.add(attrName.toLowerCase());
+ IPropertyDescriptor descriptor = null;
+ if(valueHelper.isAvailable(getQuery(attrName))) {
+ descriptor = createJSPPropertyDescriptor(d, attrName, false);
+ } else {
+ descriptor = createTextPropertyDescriptor(attrName, CATEGORY_ATTRIBUTES, 0);
+ }
+ descriptors.add(descriptor);
+ }
+ }
+*/
+ // Add descriptors for existing attributes that don't already have one
+ if (attributes != null) {
+ for (int i = 0; i < attributes.getLength(); i++) {
+ Attr attr = (Attr) attributes.item(i);
+ String attrName = attr.getName();
+ if (fCaseSensitive) {
+ if (!descriptorNames.contains(attrName)) {
+ descriptorNames.add(attrName);
+ descriptorNamesLow.add(attrName.toLowerCase());
+ descriptors.add(createDefaultPropertyDescriptor(attrName, false));
+ }
+ } else {
+ boolean exists = descriptorNamesLow.contains(attrName.toLowerCase());
+ if (!exists) {
+ descriptorNames.add(attrName);
+ descriptorNamesLow.add(attrName.toLowerCase());
+ descriptors.add(createDefaultPropertyDescriptor(attrName, false));
+ }
+ }
+ }
+ }
+
+ // Update fDescriptors
+ IPropertyDescriptor[] newDescriptors = new IPropertyDescriptor[descriptors.size()];
+ for (int i = 0; i < newDescriptors.length; i++)
+ newDescriptors[i] = (IPropertyDescriptor) descriptors.get(i);
+ fDescriptors = newDescriptors;
+ }
+
+ private Stack<Object> fValuesBeingSet = new Stack<Object>();
+
+ public void setPropertyValue(Object nameObject, Object value) {
+ // Avoid cycling - can happen if a closing cell editor causes a
+ // refresh
+ // on the PropertySheet page and the setInput again asks the editor to
+ // close; besides, why apply the same value twice?
+ if (!fValuesBeingSet.isEmpty() && fValuesBeingSet.peek() == nameObject)
+ return;
+ fValuesBeingSet.push(nameObject);
+ String name = nameObject.toString();
+ String valueString = null;
+ if (value != null)
+ valueString = value.toString();
+ NamedNodeMap attrMap = fNode.getAttributes();
+ try {
+ if (attrMap != null) {
+ Attr attr = (Attr) attrMap.getNamedItem(name);
+ if (attr != null) {
+ // EXISTING VALUE
+ // potential out of control loop if updating the value
+ // triggers a viewer update, forcing the
+ // active cell editor to save its value and causing the
+ // loop to continue
+ if (attr.getValue() == null || !attr.getValue().equals(valueString)) {
+ if(valueString == null || valueString.length() == 0 && !isRequiredAttribute(attr.getName())) {
+ fNode.getAttributes().removeNamedItem(attr.getName());
+ } else {
+ if (attr instanceof IDOMNode) {
+ ((IDOMNode) attr).setValueSource(valueString);
+ IVisualController controller = valueHelper.getController();
+ if(controller != null) controller.visualRefresh();
+ } else {
+ attr.setValue(valueString);
+ }
+ }
+ }
+ }
+ else {
+ // NEW(?) value
+ if (value != null && fNode.getOwnerDocument() != null) { // never create an empty attribute
+ Attr newAttr = fNode.getOwnerDocument().createAttribute(name);
+ if (newAttr instanceof IDOMNode)
+ ((IDOMNode) newAttr).setValueSource(valueString);
+ else
+ newAttr.setValue(valueString);
+ attrMap.setNamedItem(newAttr);
+ }
+ }
+ }
+ else {
+ if (fNode instanceof Element) {
+ ((Element) fNode).setAttribute(name, valueString);
+ }
+ }
+ }
+ catch (DOMException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ fValuesBeingSet.pop();
+ }
+
+ boolean isRequiredAttribute(String attributeName) {
+ Map<String, IAttribute> as = getAttributes();
+ IAttribute d = as.get(attributeName);
+// String query = getQuery(attributeName);
+// AttributeDescriptor d = valueHelper.getAttributeDescriptor(query);
+ if(d == null) return false; // do not remove unknown attribute? Remove it!
+ return d.isRequired();
+ }
+
+ private Map<String, IAttribute> getAttributes() {
+ IComponent[] components = PageProcessor.getInstance().getComponents(kbQuery, pageContext, true);
+ Map<String, IAttribute> map = new HashMap<String, IAttribute>();
+ for (IComponent component: components) {
+ IAttribute[] as = component.getAttributes();
+ for (IAttribute a: as) {
+ String n = a.getName();
+ if(map.containsKey(n) && !(component instanceof ICustomTagLibComponent)) {
+ continue;
+ }
+ map.put(n, a);
+ }
+ }
+ return map;
+ }
+
+ //////// XMLPropertyDescriptor
+
+ public boolean isAdapterForType(Object type) {
+ return type == IPropertySource.class;
+ }
+
+ public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
+ }
+
+ public Object getEditableValue() {
+ return null;
+ }
+
+ public Object getPropertyValue(Object nameObject) {
+ String name = nameObject.toString();
+ String returnedValue = null;
+ NamedNodeMap attrMap = fNode.getAttributes();
+ if (attrMap != null) {
+ Node attribute = attrMap.getNamedItem(name);
+ if (attribute != null) {
+ if (attribute instanceof IDOMNode)
+ returnedValue = ((IDOMNode) attribute).getValueSource();
+ else
+ returnedValue = attribute.getNodeValue();
+ }
+ }
+ if (returnedValue == null)
+ returnedValue = ""; //$NON-NLS-1$
+ return returnedValue;
+ }
+
+ public boolean isPropertySet(Object propertyObject) {
+ String property = propertyObject.toString();
+
+ NamedNodeMap attrMap = fNode.getAttributes();
+ if (attrMap != null)
+ return attrMap.getNamedItem(property) != null;
+ return false;
+ }
+
+ public void resetPropertyValue(Object propertyObject) {
+ String property = propertyObject.toString();
+ CMNamedNodeMap attrDecls = null;
+
+ CMElementDeclaration ed = getDeclaration();
+ if (ed != null) {
+ attrDecls = ed.getAttributes();
+ }
+
+ NamedNodeMap attrMap = fNode.getAttributes();
+ if (attrDecls != null) {
+ CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(property);
+ String defValue = null;
+ if (attrDecl != null) {
+ if (attrDecl.getAttrType() != null) {
+ CMDataType helper = attrDecl.getAttrType();
+ if (helper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && helper.getImpliedValue() != null)
+ defValue = helper.getImpliedValue();
+ }
+ }
+ if (defValue != null && defValue.length() > 0) {
+ ((Attr) attrMap.getNamedItem(property)).setValue(defValue);
+ }
+ else {
+ attrMap.removeNamedItem(property);
+ }
+ }
+ else {
+ attrMap.removeNamedItem(property);
+ }
+ }
+
+ public boolean isPropertyRemovable(Object id) {
+ return true;
+ }
+
+ public void removeProperty(Object propertyObject) {
+ NamedNodeMap attrMap = fNode.getAttributes();
+ if (attrMap != null) {
+ Node attribute = attrMap.getNamedItem(propertyObject.toString());
+ if (attribute != null) {
+ try {
+ attrMap.removeNamedItem(propertyObject.toString());
+ }
+ catch (DOMException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+ }
+ }
+
+ public boolean isPropertyResettable(Object id) {
+ boolean resettable = false;
+ String property = id.toString();
+ CMNamedNodeMap attrDecls = null;
+
+ CMElementDeclaration ed = getDeclaration();
+ if (ed != null) {
+ attrDecls = ed.getAttributes();
+ }
+
+ if (attrDecls != null) {
+ CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(property);
+ if (attrDecl != null) {
+ if (attrDecl.getAttrType() != null) {
+ CMDataType helper = attrDecl.getAttrType();
+ if (helper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && helper.getImpliedValue() != null) {
+ resettable = true;
+ }
+ }
+ }
+ }
+ return resettable;
+ }
+
+ protected IPropertyDescriptor createPropertyDescriptor(CMAttributeDeclaration attrDecl) {
+ IPropertyDescriptor descriptor = null;
+ CMDataType attrType = attrDecl.getAttrType();
+
+ if (attrType != null) {
+ // handle declarations that provide FIXED/ENUMERATED values
+ if (attrType.getEnumeratedValues() != null && attrType.getEnumeratedValues().length > 0) {
+ descriptor = createEnumeratedPropertyDescriptor(attrDecl, attrType);
+ }
+ else if ((attrDecl.getUsage() == CMAttributeDeclaration.FIXED || attrType.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED) && attrType.getImpliedValue() != null) {
+ descriptor = createFixedPropertyDescriptor(attrDecl, attrType);
+ }
+ else {
+ // plain text
+ descriptor = createTextPropertyDescriptor(attrDecl);
+ }
+ }
+ else {
+ // no extra information given
+ descriptor = createTextPropertyDescriptor(attrDecl);
+ }
+ return descriptor;
+ }
+
+ private IPropertyDescriptor createTextPropertyDescriptor(CMAttributeDeclaration attrDecl) {
+ return createTextPropertyDescriptor(attrDecl.getAttrName(), getCategory(attrDecl), attrDecl.getUsage());
+ }
+
+ private IPropertyDescriptor createTextPropertyDescriptor(String name, String category, int usage) {
+ TextPropertyDescriptor descriptor = new TextPropertyDescriptor(name, name);
+ descriptor.setCategory(category);
+ descriptor.setDescription(name);
+ if (usage != CMAttributeDeclaration.REQUIRED && SET_EXPERT_FILTER)
+ descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
+ return descriptor;
+ }
+
+ private IPropertyDescriptor createEnumeratedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType valuesHelper) {
+ // the displayName MUST be set
+ EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrDecl.getAttrName(), attrDecl.getAttrName(), _getValidStrings(attrDecl, valuesHelper));
+ descriptor.setCategory(getCategory(attrDecl));
+ descriptor.setDescription(attrDecl.getAttrName());
+ if (attrDecl.getUsage() != CMAttributeDeclaration.REQUIRED && SET_EXPERT_FILTER)
+ descriptor.setFilterFlags(new String[]{IPropertySheetEntry.FILTER_ID_EXPERT});
+ return descriptor;
+ }
+
+ private IPropertyDescriptor createFixedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType helper) {
+ // the displayName MUST be set
+ EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrDecl.getNodeName(), attrDecl.getNodeName(), _getValidFixedStrings(attrDecl, helper));
+ descriptor.setCategory(getCategory(attrDecl));
+ descriptor.setDescription(attrDecl.getAttrName());
+ return descriptor;
+ }
+
+ private String[] getValidValues(CMAttributeDeclaration attrDecl) {
+ if (attrDecl == null)
+ return new String[0];
+
+ String[] validValues = null;
+ CMDataType attrType = attrDecl.getAttrType();
+ if (attrType != null) {
+ validValues = _getValidStrings(attrDecl, attrType);
+ }
+ if (validValues == null)
+ validValues = new String[0];
+ return validValues;
+ }
+
+ private String[] _getValidStrings(CMAttributeDeclaration attrDecl, CMDataType valuesHelper) {
+ String attributeName = attrDecl.getAttrName();
+ List values = new ArrayList(1);
+ boolean currentValueKnown = false;
+ boolean checkIfCurrentValueIsKnown = (fNode.getAttributes() != null && fNode.getAttributes().getNamedItem(attributeName) != null && fNode.getAttributes().getNamedItem(attributeName).getNodeValue() != null);
+ String currentValue = null;
+ if (checkIfCurrentValueIsKnown)
+ currentValue = fNode.getAttributes().getNamedItem(attributeName).getNodeValue();
+
+ if (valuesHelper.getImpliedValueKind() == CMDataType.IMPLIED_VALUE_FIXED && valuesHelper.getImpliedValue() != null) {
+ // FIXED value
+ currentValueKnown = currentValue != null && valuesHelper.getImpliedValue().equals(currentValue);
+ values.add(valuesHelper.getImpliedValue());
+ }
+ else {
+ // ENUMERATED values
+ String[] valueStrings = null;
+ // valueStrings = valuesHelper.getEnumeratedValues();
+ Document document = fNode.getOwnerDocument();
+ ModelQuery modelQuery = (document == null) ? null : ModelQueryUtil.getModelQuery(document);
+ if (modelQuery != null && fNode.getNodeType() == Node.ELEMENT_NODE) {
+ valueStrings = modelQuery.getPossibleDataTypeValues((Element) fNode, attrDecl);
+ }
+ else {
+ valueStrings = attrDecl.getAttrType().getEnumeratedValues();
+ }
+ if (valueStrings != null) {
+ for (int i = 0; i < valueStrings.length; i++) {
+ if (checkIfCurrentValueIsKnown && valueStrings[i].equals(currentValue))
+ currentValueKnown = true;
+ values.add(valueStrings[i]);
+ }
+ }
+ }
+ if (valuesHelper.getImpliedValueKind() != CMDataType.IMPLIED_VALUE_NONE && valuesHelper.getImpliedValue() != null) {
+ if (!values.contains(valuesHelper.getImpliedValue()))
+ values.add(valuesHelper.getImpliedValue());
+ }
+
+ if (checkIfCurrentValueIsKnown && !currentValueKnown && currentValue != null && currentValue.length() > 0)
+ values.add(currentValue);
+ String[] validStrings = new String[values.size()];
+ validStrings = (String[]) values.toArray(validStrings);
+ return validStrings;
+ }
+
+ private String[] _getValidFixedStrings(CMAttributeDeclaration attrDecl, CMDataType helper) {
+ String attributeName = attrDecl.getAttrName();
+ List values = new ArrayList(1);
+ String impliedValue = helper.getImpliedValue();
+ if (impliedValue != null)
+ values.add(impliedValue);
+ boolean checkIfCurrentValueIsIncluded = (fNode.getAttributes() != null && fNode.getAttributes().getNamedItem(attributeName) != null && fNode.getAttributes().getNamedItem(attributeName).getNodeValue() != null);
+ if (checkIfCurrentValueIsIncluded) {
+ String currentValue = null;
+ currentValue = fNode.getAttributes().getNamedItem(attributeName).getNodeValue();
+ if (!currentValue.equals(impliedValue))
+ values.add(currentValue);
+ }
+ String[] validStrings = new String[values.size()];
+ validStrings = (String[]) values.toArray(validStrings);
+ return validStrings;
+ }
+
+}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPTreeDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPTreeDialog.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPTreeDialog.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -86,7 +86,7 @@
ValueHelper valueHelper = new ValueHelper();
- root = valueHelper.getInitalInput(query);
+ root = valueHelper.getInitalInput(pageContext, kbQuery);
treeViewer.setInput(root);
treeViewer.setSorter(new AttributeValueSorter());
getCommandBar().setEnabled(OK, false);
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -11,41 +11,23 @@
package org.jboss.tools.jst.jsp.outline;
import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.jboss.tools.common.kb.AttributeDescriptor;
-import org.jboss.tools.common.kb.AttributeValueDescriptor;
-import org.jboss.tools.common.kb.KbConnectorFactory;
-import org.jboss.tools.common.kb.KbConnectorType;
-import org.jboss.tools.common.kb.KbException;
-import org.jboss.tools.common.kb.KbTldResource;
import org.jboss.tools.common.kb.TagDescriptor;
-import org.jboss.tools.common.kb.wtp.JspWtpKbConnector;
-import org.jboss.tools.common.kb.wtp.TLDVersionHelper;
-import org.jboss.tools.common.kb.wtp.WtpKbConnector;
import org.jboss.tools.common.model.project.IPromptingProvider;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.contentassist.FaceletPageContectAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
+import org.jboss.tools.jst.jsp.contentassist.JspContentAssistProcessor;
import org.jboss.tools.jst.jsp.drop.treeviewer.model.AttributeValueResource;
import org.jboss.tools.jst.jsp.drop.treeviewer.model.AttributeValueResourceFactory;
import org.jboss.tools.jst.jsp.drop.treeviewer.model.ModelElement;
@@ -55,7 +37,12 @@
import org.jboss.tools.jst.jsp.editor.IVisualEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
-import org.jboss.tools.jst.jsp.support.kb.WTPTextJspKbConnector;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.PageProcessor;
+import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType;
+import org.jboss.tools.jst.web.kb.internal.taglib.CustomTagLibAttribute;
+import org.jboss.tools.jst.web.kb.taglib.IAttribute;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
import org.w3c.dom.Attr;
@@ -65,13 +52,12 @@
public class ValueHelper {
- private WTPTextJspKbConnector wtpTextJspKbConnector = null;
private boolean isFacelets = false;
public static IPromptingProvider seamPromptingProvider;
static {
- Object o = ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.seam.internal.core.el.SeamPromptingProvider"); //$NON-NLS-1$
+ Object o = ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.seam.internal.core.el.SeamPromptingProvider");
if(o instanceof IPromptingProvider) {
seamPromptingProvider = (IPromptingProvider)o;
}
@@ -79,7 +65,6 @@
//JBIDE-1983, coused a memmory link
// IVisualContext iVisualContext = null;
private boolean isVisualContextInitialized = false;
- private WtpKbConnector pageConnector = null;
public ValueHelper() {
boolean b = init();
@@ -89,89 +74,91 @@
public IVisualController getController() {
IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if(!(editor instanceof JSPMultiPageEditor)) return null;
- JSPTextEditor jspEditor = ((JSPMultiPageEditor)editor).getJspEditor();
IVisualEditor v = ((JSPMultiPageEditor)editor).getVisualEditor();
if(v == null) return null;
return v.getController();
}
boolean init() {
- if(isVisualContextInitialized || pageConnector != null) return true;
+ if(isVisualContextInitialized) return true;
IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if(!(editor instanceof JSPMultiPageEditor)) return false;
JSPTextEditor jspEditor = ((JSPMultiPageEditor)editor).getJspEditor();
isVisualContextInitialized = true;
- wtpTextJspKbConnector = jspEditor.getWTPTextJspKbConnector();
-
if(getIVisualContext() != null) {
updateFacelets();
}
- return getIVisualContext() != null || pageConnector != null;
+ return getIVisualContext() != null;
}
private IVisualContext getIVisualContext(){
-
+ JSPTextEditor jspEditor = getJSPTextEditor();
+ return (jspEditor == null) ? null : jspEditor.getPageContext();
+ }
+
+ public JspContentAssistProcessor createContentAssistProcessor() {
+ JSPTextEditor jspEditor = getJSPTextEditor();
+ if(jspEditor == null) return null;
+ return isFacetets() ? new FaceletPageContectAssistProcessor() : new JspContentAssistProcessor();
+ }
+
+ public IPageContext createPageContext(JspContentAssistProcessor processor, int offset) {
+ JSPTextEditor jspEditor = getJSPTextEditor();
+ if(jspEditor == null) return null;
+ processor.createContext(jspEditor.getTextViewer(), offset);
+ return processor.getContext();
+
+ }
+
+ protected JSPTextEditor getJSPTextEditor() {
IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if(!(editor instanceof JSPMultiPageEditor)) return null;
- JSPTextEditor jspEditor = ((JSPMultiPageEditor)editor).getJspEditor();
-
- return jspEditor.getPageContext();
+ return ((JSPMultiPageEditor)editor).getJspEditor();
}
-
- public ModelElement getInitalInput(String query) {
- AttributeDescriptor descriptor = getAttributeDescriptor(query);
- if(descriptor == null) return new RootElement("root", new ArrayList<AttributeValueResource>()); //$NON-NLS-1$
- AttributeValueDescriptor[] valueDescriptors = descriptor.getValueDesriptors();
+ public ModelElement getInitalInput(IPageContext pageContext, KbQuery kbQuery) {
+ IAttribute[] as = PageProcessor.getInstance().getAttributes(kbQuery, pageContext);
+ if(as == null || as.length == 0) return new RootElement("root", new ArrayList<AttributeValueResource>());
+ CustomTagLibAttribute ca = null;
+ for (IAttribute a: as) {
+ if(a instanceof CustomTagLibAttribute) {
+ ca = (CustomTagLibAttribute)a;
+ break;
+ }
+ }
+ CustomProposalType[] proposals = ca != null ? ca.getProposals() : new CustomProposalType[0];
List<AttributeValueResource> elements = new ArrayList<AttributeValueResource>();
- ModelElement root = new RootElement("root", elements); //$NON-NLS-1$
- for (int i = 0; i < valueDescriptors.length; i++) {
- AttributeValueResource resource = AttributeValueResourceFactory.getInstance().createResource(getEditorInput(), wtpTextJspKbConnector, root, valueDescriptors[i].getType());
- resource.setParams(valueDescriptors[i].getParams());
- resource.setQuery(query, this);
+ ModelElement root = new RootElement("root", elements);
+ for (int i = 0; i < proposals.length; i++) {
+ AttributeValueResource resource = AttributeValueResourceFactory.getInstance().createResource(getEditorInput(), pageContext, root, proposals[i].getType());
+ resource.setParams(proposals[i].getParams());
+ resource.setQuery(kbQuery, this);
elements.add(resource);
}
if(seamPromptingProvider != null && getFile() != null) {
Properties p = new Properties();
- p.put("file", getFile()); //$NON-NLS-1$
- List list = seamPromptingProvider.getList(null, "seam.is_seam_project", null, p); //$NON-NLS-1$
+ p.put("file", getFile());
+ List list = seamPromptingProvider.getList(null, "seam.is_seam_project", null, p);
if(list != null) {
- AttributeValueResource resource = AttributeValueResourceFactory.getInstance().createResource(getEditorInput(), wtpTextJspKbConnector, root, "seamVariables"); //$NON-NLS-1$
- resource.setQuery(query, this);
+ AttributeValueResource resource = AttributeValueResourceFactory.getInstance().createResource(getEditorInput(), pageContext, root, "seamVariables");
+ resource.setQuery(kbQuery, this);
elements.add(resource);
}
}
return root;
}
- public boolean isAvailable(String query) {
- RootElement root = (RootElement)getInitalInput(query);
+ public boolean isAvailable(IPageContext pageContext, KbQuery kbQuery) {
+ RootElement root = (RootElement)getInitalInput(pageContext, kbQuery);
return (root != null && root.getChildren().length > 0);
- ///return getAttributeDescriptor(query) != null;
}
- public AttributeDescriptor getAttributeDescriptor(String query) {
- if(!init()) return null;
- AttributeDescriptor result = null;
- try {
- result = getPageConnector().getAttributeInformation(query);
- } catch (KbException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
- return result;
- }
-
+ @Deprecated
public TagDescriptor getTagDescriptor(String query) {
if(!init()) return null;
- TagDescriptor result = null;
- try {
- result = getPageConnector().getTagInformation(query);
- } catch (KbException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
- return result;
+ return null;
}
public IEditorInput getEditorInput() {
@@ -192,10 +179,6 @@
return file == null ? null : file.getProject();
}
- public WTPTextJspKbConnector getConnector() {
- return wtpTextJspKbConnector;
- }
-
public VpeTaglibManager getTaglibManager() {
init();
@@ -210,11 +193,6 @@
}
}
- public WtpKbConnector getPageConnector() {
- if(getIVisualContext() != null) return getIVisualContext().getConnector();
- return pageConnector;
- }
-
public IDocument getDocument() {
IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if(editor instanceof JSPMultiPageEditor) {
@@ -230,95 +208,16 @@
//Support of StructuredTextEditor
boolean init2() {
- if(isVisualContextInitialized || pageConnector != null) return true;
+ if(isVisualContextInitialized) return true;
IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if(!(editor instanceof StructuredTextEditor)) return false;
StructuredTextEditor jspEditor = ((StructuredTextEditor)editor);
IDocument document = jspEditor.getDocumentProvider().getDocument(getEditorInput());
if(document == null) return false;
- installActivePropmtSupport(jspEditor, document);
- getConnector(document);
- return getIVisualContext() != null || pageConnector != null;
+// installActivePropmtSupport(jspEditor, document);
+ return getIVisualContext() != null;
}
- private void installActivePropmtSupport(StructuredTextEditor jspEditor, IDocument document) {
- IStructuredModel model = null;
- try {
- model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- if(wtpTextJspKbConnector == null && model != null &&
- (getContentType(model).toLowerCase().indexOf("jsp") != -1 || //$NON-NLS-1$
- getContentType(model).toLowerCase().indexOf("html") != -1)) { //$NON-NLS-1$
- clearTextConnectors();
- wtpTextJspKbConnector = (WTPTextJspKbConnector)wtpTextConnectors.get(getEditorInput());
- if(wtpTextJspKbConnector == null) {
- wtpTextJspKbConnector = new WTPTextJspKbConnector(jspEditor.getEditorInput(), document, model);
- wtpTextConnectors.put(getEditorInput(), wtpTextJspKbConnector);
- }
-/// wtpTextJspKbConnector.setTaglibManagerProvider(parentEditor);
- }
- } finally {
- if(model != null) {
- model.releaseFromRead();
- }
- }
- }
- private String getContentType(IStructuredModel model) {
- String type = null;
- try {
- type = model.getContentTypeIdentifier();
- } finally {
- if (type == null) type = ""; //$NON-NLS-1$
- }
- return type;
- }
- void getConnector(IDocument document) {
- try {
- pageConnector = (WtpKbConnector)KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR, document);
- registerTaglibs(pageConnector, document);
- } catch (KbException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
- }
- boolean registerTaglibs(WtpKbConnector wtpKbConnector, IDocument document) {
- if(wtpKbConnector == null) return false;
- TLDCMDocumentManager manager = TaglibController.getTLDCMDocumentManager(document);
- if(manager != null) {
- List list = manager.getTaglibTrackers();
- for (int i = 0; i < list.size(); i++) {
- TaglibTracker tracker = (TaglibTracker)list.get(i);
- if(tracker == null) continue;
- String version = TLDVersionHelper.getTldVersion(tracker);
- KbTldResource resource = new KbTldResource(tracker.getURI(), "", tracker.getPrefix(), version); //$NON-NLS-1$
- wtpKbConnector.registerResource(resource);
- }
- return true;
- }
- return false;
- }
-
- static Map wtpTextConnectors = new HashMap();
-
- void clearTextConnectors() {
- IWorkbenchPage workbenchPage = getWorkbenchPage();
- if(workbenchPage == null) {
- wtpTextConnectors.clear();
- return;
- }
- Iterator it = wtpTextConnectors.keySet().iterator();
- while(it.hasNext()) {
- IEditorInput input = (IEditorInput)it.next();
- if(workbenchPage.findEditor(input) == null) {
- it.remove();
- }
- }
- }
- private IWorkbenchPage getWorkbenchPage() {
- ModelUIPlugin plugin = ModelUIPlugin.getDefault();
- IWorkbench workbench = (plugin == null) ? null : plugin.getWorkbench();
- IWorkbenchWindow window = (workbench == null) ? null : workbench.getActiveWorkbenchWindow();
- return (window == null) ? null : window.getActivePage();
- }
-
public boolean isFacetets() {
return isFacelets;
}
@@ -331,17 +230,10 @@
if(list == null) return;
isFacelets = false;
IDocument document = getDocument();
- JspWtpKbConnector kbConnector = (JspWtpKbConnector)wtpTextJspKbConnector.getConnector();
- kbConnector.unregisterAllResources(true);
for(int i = 0; i < list.size(); i++) {
TaglibData data = list.get(i);
- FaceletsHtmlContentAssistProcessor.registerTld(data, kbConnector, document, getEditorInput());
isFacelets = isFacelets || data.getUri().equals(FaceletsHtmlContentAssistProcessor.faceletUri);
}
- if(isFacelets) {
- kbConnector.registerResource(FaceletsHtmlContentAssistProcessor.faceletHtmlResource);
- kbConnector.unregisterJspResource();
- }
}
public String getFaceletJsfTag(Element element) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbImageFileResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbImageFileResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbImageFileResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -30,7 +30,6 @@
import org.jboss.tools.common.kb.KbDinamicResource;
import org.jboss.tools.common.kb.KbProposal;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.filesystems.FilePathHelper;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbJsfValuesResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbJsfValuesResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbJsfValuesResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -24,8 +24,8 @@
"sessionScope", "applicationScope",
"facesContext", "view"};
- public WTPKbJsfValuesResource(IEditorInput editorInput, WTPTextJspKbConnector connector) {
- super(editorInput, connector);
+ public WTPKbJsfValuesResource(IEditorInput editorInput) {
+ super(editorInput);
}
public String getType() {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdActionResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdActionResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdActionResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -34,7 +34,7 @@
private String fPath;
public static String SUPPORTED_ID = WebPromptingProvider.JSF_VIEW_ACTIONS;
- public WTPKbdActionResource(IEditorInput editorInput, WTPTextJspKbConnector connector) {
+ public WTPKbdActionResource(IEditorInput editorInput) {
super(editorInput);
if(fXModelObject != null) {
fPath = XModelObjectLoaderUtil.getResourcePath(fXModelObject);
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanMethodResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanMethodResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanMethodResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -23,8 +23,8 @@
public class WTPKbdBeanMethodResource extends WTPKbdBeanPropertyResource {
public static String SUPPORTED_ID = WebPromptingProvider.JSF_BEAN_METHODS;
- public WTPKbdBeanMethodResource(IEditorInput editorInput, WTPTextJspKbConnector connector) {
- super(editorInput, connector);
+ public WTPKbdBeanMethodResource(IEditorInput editorInput) {
+ super(editorInput);
}
public boolean isReadyToUse() {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -28,7 +28,6 @@
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.el.core.model.ELUtil;
import org.jboss.tools.common.el.core.parser.ELParser;
-import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.kb.KbDinamicResource;
import org.jboss.tools.common.kb.KbProposal;
@@ -46,7 +45,7 @@
public Properties type = new Properties();
protected String query;
- public WTPKbdBeanPropertyResource(IEditorInput editorInput, WTPTextJspKbConnector connector) {
+ public WTPKbdBeanPropertyResource(IEditorInput editorInput) {
super(editorInput);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBundleNameResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBundleNameResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBundleNameResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -31,7 +31,7 @@
public class WTPKbdBundleNameResource extends WTPKbAbstractModelResource {
public static String SUPPORTED_ID = WebPromptingProvider.JSF_BUNDLES;
- public WTPKbdBundleNameResource(IEditorInput editorInput, WTPTextJspKbConnector connector) {
+ public WTPKbdBundleNameResource(IEditorInput editorInput) {
super(editorInput);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBundlePropertyResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBundlePropertyResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBundlePropertyResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -24,25 +24,26 @@
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.model.ELModel;
import org.jboss.tools.common.el.core.parser.ELParser;
-import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.kb.KbDinamicResource;
import org.jboss.tools.common.kb.KbProposal;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.IResourceBundle;
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
/**
* @author Jeremy
*/
public class WTPKbdBundlePropertyResource extends WTPKbdBeanPropertyResource {
- WTPTextJspKbConnector connector;
public static String SUPPORTED_ID = WebPromptingProvider.JSF_BUNDLE_PROPERTIES;
+ IPageContext context;
- public WTPKbdBundlePropertyResource(IEditorInput editorInput, WTPTextJspKbConnector connector) {
- super(editorInput, connector);
- this.connector = connector;
+ public WTPKbdBundlePropertyResource(IEditorInput editorInput, IPageContext context) {
+ super(editorInput);
+ this.context = context;
}
public Collection<KbProposal> queryProposal(String query) {
@@ -84,13 +85,11 @@
Set<String> sorted = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
- Map _bundles = connector.getDeclaredBundles();
+ IResourceBundle[] bs = context.getResourceBundles();
Map<String,String> bundles2 = new TreeMap<String,String>();
- Iterator _it = _bundles.keySet().iterator();
- while(_it.hasNext()) {
- String _var = _it.next().toString();
- WTPTextJspKbConnector.LoadBundleInfo info = (WTPTextJspKbConnector.LoadBundleInfo)_bundles.get(_var);
- bundles2.put(_var, info.getBaseName());
+ for (IResourceBundle b: bs) {
+ String _var = b.getVar();
+ bundles2.put(_var, b.getBasename());
}
List l = fProvider.getList(fXModel, WebPromptingProvider.JSF_REGISTERED_BUNDLES, null, null);
if(l != null && l.size() > 0 && (l.get(0) instanceof Map)) {
@@ -183,7 +182,7 @@
public boolean equals(Object o) {
if(!(o instanceof WTPKbdBundlePropertyResource)) return false;
WTPKbdBundlePropertyResource other = (WTPKbdBundlePropertyResource)o;
- return other.getType().equals(getType()) && other.getXModel() == getXModel() && connector.equals(other.connector);
+ return other.getType().equals(getType()) && other.getXModel() == getXModel();
}
/**
@@ -194,9 +193,9 @@
if(getXModel()!=null) {
hashCode += getXModel().hashCode();
}
- if(connector!=null) {
- hashCode += connector.hashCode();
- }
+// if(connector!=null) {
+// hashCode += connector.hashCode();
+// }
return hashCode;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdManagedBeanNameResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdManagedBeanNameResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdManagedBeanNameResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -17,8 +17,8 @@
public class WTPKbdManagedBeanNameResource extends WTPKbdBeanPropertyResource {
- public WTPKbdManagedBeanNameResource(IEditorInput editorInput, WTPTextJspKbConnector connector) {
- super(editorInput, connector);
+ public WTPKbdManagedBeanNameResource(IEditorInput editorInput) {
+ super(editorInput);
}
private static String[][] MANAGED_BEAN_NAME_WRAPPERS = {{"", ""}}; //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdTaglibResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdTaglibResource.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdTaglibResource.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -28,7 +28,7 @@
public class WTPKbdTaglibResource extends WTPKbAbstractModelResource {
String SUPPORTED_ID = WebPromptingProvider.JSF_GET_TAGLIBS;
- public WTPKbdTaglibResource(IEditorInput editorInput, WTPTextJspKbConnector connector) {
+ public WTPKbdTaglibResource(IEditorInput editorInput) {
super(editorInput);
}
Deleted: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java 2009-07-17 13:12:02 UTC (rev 16647)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java 2009-07-17 13:29:10 UTC (rev 16648)
@@ -1,461 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.jsp.support.kb;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
-import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.document.NodeContainer;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.jboss.tools.common.kb.KbConnector;
-import org.jboss.tools.common.kb.KbConnectorFactory;
-import org.jboss.tools.common.kb.KbConnectorType;
-import org.jboss.tools.common.kb.KbException;
-import org.jboss.tools.common.kb.KbResource;
-import org.jboss.tools.common.kb.TagDescriptor;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
-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.jboss.tools.jst.web.tld.VpeTaglibManagerProvider;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author Jeremy
- */
-public class WTPTextJspKbConnector implements KbConnector, VpeTaglibListener {
- private KbConnector kbConnector;
- private IDocument fDocument;
- private IEditorInput fEditorInput;
- private VpeTaglibManagerProvider taglibManagerProvider;
-
- protected IStructuredModel model;
- private Document dom;
- protected int timerTaskCount = 0;
-// protected boolean isGrammarInferenceEnabled;
- protected static Timer timer = new Timer(true);
-
- // Dinamic resources
-
- private WTPKbdBundleNameResource fBundleNameResourceRegistered = null;
- private WTPKbdBeanPropertyResource fBeanPropertyResourceRegistered = null;
- private WTPKbdBundlePropertyResource fBundlePropertyResourceRegistered = null;
- private WTPKbdActionResource fActionResourceRegistered = null;
- private WTPKbdBeanMethodResource fBeanMethodResourceRegistered = null;
- private WTPKbImageFileResource fImageFileResourced = null;
- private WTPKbdManagedBeanNameResource fManagedBeanNameResourceRegistered = null;
- private WTPKbJsfValuesResource fJSFValuesResource = null;
- WTPKbdTaglibResource fTaglibResource = null;
- private MyDocumentAdapter documentAdapter;
-
- public WTPTextJspKbConnector(IEditorInput editorInput, IDocument document, IStructuredModel model) {
- try {
- this.fDocument = document;
- this.fEditorInput = editorInput;
- this.model = model;
-
- this.dom = (model instanceof IDOMModel) ? ((IDOMModel) model).getDocument() : null;
-
- if (dom != null) {
- documentAdapter = new MyDocumentAdapter(dom);
- }
- kbConnector = KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR, document);
- WTPKbdBundleNameResource bundleNameResource = new WTPKbdBundleNameResource(fEditorInput, this);
- if (bundleNameResource.isReadyToUse()) {
- fBundleNameResourceRegistered = bundleNameResource;
- registerResource(fBundleNameResourceRegistered);
- }
- WTPKbdBeanPropertyResource beanPropertyResource = new WTPKbdBeanPropertyResource(fEditorInput, this);
- if (beanPropertyResource.isReadyToUse()) {
- fBeanPropertyResourceRegistered = beanPropertyResource;
- registerResource(fBeanPropertyResourceRegistered);
- }
- WTPKbdBundlePropertyResource bundlePropertyResource = new WTPKbdBundlePropertyResource(fEditorInput, this);
- if (bundlePropertyResource.isReadyToUse()) {
- fBundlePropertyResourceRegistered = bundlePropertyResource;
- registerResource(fBundlePropertyResourceRegistered);
- }
- WTPKbdActionResource actionResource = new WTPKbdActionResource(fEditorInput, this);
- if (actionResource.isReadyToUse()) {
- fActionResourceRegistered = actionResource;
- registerResource(fActionResourceRegistered);
- }
- WTPKbdBeanMethodResource beanMethodResource = new WTPKbdBeanMethodResource(fEditorInput, this);
- if (beanMethodResource.isReadyToUse()) {
- fBeanMethodResourceRegistered = beanMethodResource;
- registerResource(fBeanMethodResourceRegistered);
- }
- WTPKbImageFileResource imageFileResource = new WTPKbImageFileResource(fEditorInput);
- if(imageFileResource.isReadyToUse()) {
- fImageFileResourced = imageFileResource;
- registerResource(fImageFileResourced);
- }
- WTPKbdManagedBeanNameResource managedBeanNameResource = new WTPKbdManagedBeanNameResource(fEditorInput, this);
- if(managedBeanNameResource.isReadyToUse()) {
- fManagedBeanNameResourceRegistered = managedBeanNameResource;
- registerResource(fManagedBeanNameResourceRegistered);
- }
- WTPKbJsfValuesResource resource = new WTPKbJsfValuesResource(editorInput, this);
- if(resource.isReadyToUse()) {
- fJSFValuesResource = resource;
- registerResource(fJSFValuesResource);
- }
- WTPKbdTaglibResource taglibResource = new WTPKbdTaglibResource(editorInput, this);
- if(taglibResource.isReadyToUse()) {
- fTaglibResource = taglibResource;
- registerResource(fTaglibResource);
- }
- } catch (KbException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
- }
-
- public void setTaglibManagerProvider(VpeTaglibManagerProvider taglibManagerProvider) {
- this.taglibManagerProvider = taglibManagerProvider;
- }
-
-
- /**
- * @see org.jboss.tools.common.kb.KbConnector#queryTagInformation(java.lang.String)
- */
- public TagDescriptor getTagInformation(String query) throws KbException {
- return kbConnector.getTagInformation(query);
- }
-
- /**
- * @see org.jboss.tools.common.kb.KbConnector#getProposals(java.lang.String)
- */
- public Collection getProposals(String query) throws KbException {
- return kbConnector.getProposals(query);
- }
-
- /**
- * @see org.jboss.tools.common.kb.KbConnector#registerResource(org.jboss.tools.common.kb.KbResource)
- */
- public boolean registerResource(KbResource resource) {
- return kbConnector.registerResource(resource);
- }
-
- public KbConnector getConnector() {
- return kbConnector;
- }
-
- /**
- * @see org.jboss.tools.common.kb.KbConnector#unregisterResource(org.jboss.tools.common.kb.KbResource)
- */
- public void unregisterResource(KbResource resource) {
- kbConnector.unregisterResource(resource);
- }
-
- // Dinamic support
- private Map<String,Object> trackers = new HashMap<String,Object>();
- private Map<String,LoadBundleInfo> loadedBundles = new HashMap<String,LoadBundleInfo>();
-
- @SuppressWarnings("nls")
- private final static String[] TRACKERS_TO_WATCH = {"http://java.sun.com/jsf/core",
- "https://ajax4jsf.dev.java.net/ajax", "http://richfaces.org/a4j"
- };
- private boolean taglibTrackerListenerInstalled = false;
-
- public void invokeDelayedUpdateKnownTagLists() {
- // Previous code is
- // timer.schedule(new MyTimerTask(), 500);
- initTaglibPrefixes();
- updateKnownTagLists();
- }
-
- private boolean isTrackerToWatch(String trackerUri) {
- for(int i=0; TRACKERS_TO_WATCH != null && i<TRACKERS_TO_WATCH.length; i++) {
- if (TRACKERS_TO_WATCH[i].equals(trackerUri)) {
- return true;
- }
- }
- return false;
- }
-
- public void initTaglibPrefixes() {
- trackers.clear();
- if(taglibManagerProvider==null || taglibManagerProvider.getTaglibManager()==null) {
- TLDCMDocumentManager manager = TaglibController.getTLDCMDocumentManager(fDocument);
- if(manager!=null) {
- List list = manager.getTaglibTrackers();
- for(int i=0; i<list.size(); i++) {
- TaglibTracker tracker = (TaglibTracker)list.get(i);
- if (isTrackerToWatch(tracker.getURI())) {
- trackers.put(tracker.getPrefix(), tracker);
- }
- }
- }
- } else {
- List list = taglibManagerProvider.getTaglibManager().getTagLibs();
- for(int i=0; i<list.size(); i++) {
- TaglibData data = (TaglibData)list.get(i);
- if (isTrackerToWatch(data.getUri())) {
- trackers.put(data.getPrefix(), data);
- }
- }
- }
- }
-
- public void taglibPrefixChanged(String[] prefixs) {
- trackers.clear();
- if(taglibManagerProvider==null || taglibManagerProvider.getTaglibManager()==null) {
- TLDCMDocumentManager manager = TaglibController.getTLDCMDocumentManager(fDocument);
- List list = manager.getTaglibTrackers();
- for(int i=0; i<list.size(); i++) {
- TaglibTracker tracker = (TaglibTracker)list.get(i);
- if (isTrackerToWatch(tracker.getURI())) {
- trackers.put(tracker.getPrefix(), tracker);
- }
- }
- } else {
- List list = taglibManagerProvider.getTaglibManager().getTagLibs();
- for(int i=0; i<list.size(); i++) {
- TaglibData data = (TaglibData)list.get(i);
- if (isTrackerToWatch(data.getUri())) {
- trackers.put(data.getPrefix(), data);
- }
- }
- }
- invokeDelayedUpdateKnownTagLists();
- }
-
- public void addTaglib(String uri, String prefix) {
- }
-
- public void removeTaglib(String uri, String prefix) {
- }
-
- private boolean installTaglibTrackerListener() {
- if (taglibTrackerListenerInstalled) {
- return true;
- }
- if(taglibManagerProvider!=null) {
- VpeTaglibManager manager = taglibManagerProvider.getTaglibManager();
- if(manager!=null) {
- manager.addTaglibListener(this);
- taglibTrackerListenerInstalled = true;
- return true;
- }
- }
- return false;
- }
-
- public void updateKnownTagLists() {
- loadedBundles.clear();
-
- installTaglibTrackerListener();
-
- if (dom != null) {
- Element element = dom.getDocumentElement();
- NodeList children = (NodeContainer)dom.getChildNodes();
- if (element != null) {
- for (int i = 0; children != null && i < children.getLength(); i++) {
- IDOMNode xmlnode = (IDOMNode)children.item(i);
- update((IDOMNode)xmlnode);
- }
- }
- }
- }
-
- private void update(IDOMNode element) {
- if (element != null) {
- registerKbResourceForNode(element);
- for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof IDOMNode) {
- update((IDOMNode)child);
- }
- }
- }
- }
-
- public class LoadBundleInfo {
- IDOMNode loadBundleTag;
- String basename;
- String var;
-
- LoadBundleInfo(IDOMNode element, String basename, String var) {
- this.loadBundleTag = element;
- this.basename = basename;
- this.var = var;
- }
-
- int getLoadDeclarationOffset() {
- return loadBundleTag.getStartOffset();
- }
-
- public String getBaseName() {
- return basename;
- }
-
- String getVar() {
- return var;
- }
- }
-
- public Map getDeclaredBundles() {
- if (!taglibTrackerListenerInstalled) {
- initTaglibPrefixes();
- updateKnownTagLists();
- }
- return loadedBundles;
- }
-
- private void registerKbResourceForNode(IDOMNode node) {
- if (node == null) return;
- String name = node.getNodeName();
- if (name == null) return;
- if (!name.endsWith("loadBundle")) return; //$NON-NLS-1$
- if (name.indexOf(':') == -1) return;
- String prefix = name.substring(0, name.indexOf(':'));
-
- if (!trackers.containsKey(prefix)) return;
-
- NamedNodeMap attributes = node.getAttributes();
- if (attributes == null) return;
- String basename = (attributes.getNamedItem("basename") == null ? null : attributes.getNamedItem("basename").getNodeValue()); //$NON-NLS-1$ //$NON-NLS-2$
- String var = (attributes.getNamedItem("var") == null ? null : attributes.getNamedItem("var").getNodeValue()); //$NON-NLS-1$ //$NON-NLS-2$
- if (basename == null || basename.length() == 0 ||
- var == null || var.length() == 0) return;
-
- loadedBundles.put(var, new LoadBundleInfo(node, basename, var));
- }
-
- public void dispose() {
- if (documentAdapter != null && dom != null) {
- ((INodeNotifier) dom).removeAdapter(documentAdapter);
- }
- documentAdapter=null;
- dom=null;
- KbConnectorFactory.getIntstance().removeConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR, fDocument);
- }
-
- /**
- * This class listens to the changes in the CMDocument and triggers a CMDocument load
- */
- class MyDocumentAdapter extends DocumentAdapter {
- MyDocumentAdapter(Document document) {
- super(document);
- }
-
- public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index) {
- switch (eventType) {
- case INodeNotifier.ADD :
- {
- if (newValue instanceof Element) {
- adapt((Element) newValue);
- }
- break;
- }
- case INodeNotifier.REMOVE:
- {
- Node node = (Node) notifier;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- }
- break;
- }
-
- case INodeNotifier.CHANGE :
- case INodeNotifier.STRUCTURE_CHANGED :
- case INodeNotifier.CONTENT_CHANGED :
- {
- Node node = (Node) notifier;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- switch (eventType) {
- case INodeNotifier.CHANGE :
- {
- break;
- }
- case INodeNotifier.STRUCTURE_CHANGED :
- {
- // structure change
- break;
- }
- case INodeNotifier.CONTENT_CHANGED :
- {
- // some content changed
- break;
- }
- }
- }
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- } else {
- }
- break;
- }
- }
- invokeDelayedUpdateKnownTagLists();
- }
- }
-
- //
- protected class MyTimerTask extends TimerTask {
- public MyTimerTask() {
- super();
- timerTaskCount++;
- }
-
- public void run() {
- timerTaskCount--;
- if (timerTaskCount == 0) {
-// invokeCMDocumentLoad();
- initTaglibPrefixes();
- updateKnownTagLists();
- }
- }
- }
-
- // An abstract adapter that ensures that the children of a new Node are also adapted
- abstract class DocumentAdapter implements INodeAdapter {
- public DocumentAdapter(Document document) {
- ((INodeNotifier) document).addAdapter(this);
- adapt(document.getDocumentElement());
- }
-
- public void adapt(Element element) {
- if (element != null) {
- if (((INodeNotifier) element).getExistingAdapter(this) == null) {
- ((INodeNotifier) element).addAdapter(this);
-
- for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() == Node.ELEMENT_NODE) {
- adapt((Element) child);
- }
- }
- }
- }
- }
-
- public boolean isAdapterForType(Object type) {
- return type == this;
- }
-
- abstract public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index);
- }
-
-}
\ No newline at end of file
16 years, 9 months
JBoss Tools SVN: r16647 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-17 09:12:02 -0400 (Fri, 17 Jul 2009)
New Revision: 16647
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1826
Tree selector in dialog in cell editor is switched to new kb.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java 2009-07-17 12:43:24 UTC (rev 16646)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java 2009-07-17 13:12:02 UTC (rev 16647)
@@ -60,7 +60,12 @@
if(NAME_SPACE_TYPE.equals(type)) {
return new NameSpaceProposalType();
}
- WebKbPlugin.getDefault().logError("Unknown proposal type: " + type); //$NON-NLS-1$
- return null;
+
+ //WebKbPlugin.getDefault().logError("Unknown proposal type: " + type); //$NON-NLS-1$
+ //ExtendedProposalType will report if necessary
+
+ ExtendedProposalType proposalType = new ExtendedProposalType();
+
+ return proposalType;
}
}
\ No newline at end of file
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java 2009-07-17 13:12:02 UTC (rev 16647)
@@ -0,0 +1,20 @@
+package org.jboss.tools.jst.web.kb.internal.taglib;
+
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+
+public class ExtendedProposalType extends CustomProposalType {
+
+ public ExtendedProposalType() {}
+
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ return new TextProposal[0];
+ }
+
+ @Override
+ protected void init(IPageContext context) {
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 9 months
JBoss Tools SVN: r16646 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-07-17 08:43:24 -0400 (Fri, 17 Jul 2009)
New Revision: 16646
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4613
Load console configuration completion proposal added.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2009-07-17 12:42:06 UTC (rev 16645)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2009-07-17 12:43:24 UTC (rev 16646)
@@ -58,7 +58,6 @@
import org.eclipse.ui.texteditor.TextOperationAction;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.AbstractQueryEditor;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
@@ -153,19 +152,6 @@
final ConsoleConfiguration consoleConfiguration = getConsoleConfiguration();
- if(consoleConfiguration.getConfiguration()==null) {
- consoleConfiguration.build();
- consoleConfiguration.execute( new ExecutionContext.Command() {
-
- public Object execute() {
- if(consoleConfiguration.hasConfiguration()) {
- consoleConfiguration.getConfiguration().buildMappings();
- }
- return consoleConfiguration;
- }
- } );
- }
-
Set<String> imports = new HashSet<String>();
Configuration configuration = consoleConfiguration.getConfiguration();
if(configuration!=null) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2009-07-17 12:42:06 UTC (rev 16645)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2009-07-17 12:43:24 UTC (rev 16646)
@@ -21,8 +21,6 @@
*/
package org.hibernate.eclipse.criteriaeditor;
-import java.util.Arrays;
-
import org.eclipse.jdt.core.CompletionContext;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
@@ -40,6 +38,7 @@
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.hqleditor.CompletionHelper;
+import org.hibernate.eclipse.hqleditor.LoadConsoleCFGCompletionProposal;
import org.hibernate.util.StringHelper;
public class JavaCompletionProcessor implements IContentAssistProcessor {
@@ -113,8 +112,15 @@
results = collector.getJavaCompletionProposals();
}
- Arrays.sort( results, comparator );
CompletionHelper.transpose( null, -prefix.length(), results );
+
+ if (editor.getConsoleConfiguration().getConfiguration() == null){
+ ICompletionProposal[] results2 = new ICompletionProposal[results.length + 1];
+ System.arraycopy(results, 0, results2, 1, results.length);
+ results2[0] = new LoadConsoleCFGCompletionProposal(editor.getConsoleConfiguration());
+ return results2;
+ }
+
return results;
}
finally {
16 years, 9 months
JBoss Tools SVN: r16645 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console: views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-07-17 08:42:06 -0400 (Fri, 17 Jul 2009)
New Revision: 16645
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/RefreshAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4618 - add id for actions and define id for action groups
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -48,6 +48,8 @@
*/
public class AddConfigurationAction extends Action {
+ public static final String ADDCONFIG_ACTIONID = "actionid.addconfig"; //$NON-NLS-1$
+
/** Constant used to avoid unnecessary broadcast which is caused by the workaround for having the ClassPathTab not throwing
* and exception on unsaved configurations */
public static final String TEMPORARY_CONFIG_FLAG = "_TEMPORARY_CONFIG_"; //$NON-NLS-1$
@@ -58,6 +60,7 @@
this.part = part;
setText(HibernateConsoleMessages.AddConfigurationAction_add_config);
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.ADD) );
+ setId(ADDCONFIG_ACTIONID);
}
public void run() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -37,11 +37,15 @@
import org.hibernate.mapping.Property;
public class CriteriaEditorAction extends OpenQueryEditorAction {
+
+ public static final String CRITERIAEDITOR_ACTIONID = "actionid.criteriaeditor"; //$NON-NLS-1$
+
public CriteriaEditorAction() {
super( HibernateConsoleMessages.CriteriaEditorAction_hibernate_criteria_editor );
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.CRITERIA_EDITOR));
setToolTipText(HibernateConsoleMessages.CriteriaEditorAction_open_hibernate_criteria_editor);
setEnabled( true );
+ setId(CRITERIAEDITOR_ACTIONID);
}
protected void openQueryEditor(ConsoleConfiguration config, String query) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -27,12 +27,10 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.ui.IViewPart;
import org.eclipse.ui.actions.SelectionListenerAction;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
-import org.hibernate.eclipse.console.utils.ProjectUtils;
/**
* @author max
@@ -40,12 +38,15 @@
*/
public class DeleteConfigurationAction extends SelectionListenerAction {
+ public static final String DELETECONFIG_ACTIONID = "actionid.deleteconfig"; //$NON-NLS-1$
+
private StructuredViewer part;
public DeleteConfigurationAction(StructuredViewer selectionProvider) {
super(HibernateConsoleMessages.DeleteConfigurationAction_delete_config);
setEnabled(false);
this.part = selectionProvider;
+ setId(DELETECONFIG_ACTIONID);
}
public void run() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -41,6 +41,8 @@
*/
public class EditConsoleConfiguration extends ConsoleConfigurationBasedAction {
+ public static final String EDITCONSOLECONFIG_ACTIONID = "actionid.editconsoleconfig"; //$NON-NLS-1$
+
ConsoleConfiguration cfg = null;
/**
@@ -48,6 +50,7 @@
*/
public EditConsoleConfiguration() {
super(HibernateConsoleMessages.EditConsoleConfiguration_edit_config);
+ setId(EDITCONSOLECONFIG_ACTIONID);
}
public EditConsoleConfiguration(ConsoleConfiguration configuration) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -32,11 +32,15 @@
import org.hibernate.mapping.Property;
public class HQLScratchpadAction extends OpenQueryEditorAction {
+
+ public static final String HQLSCRATCHPAD_ACTIONID = "actionid.hqlscratchpad"; //$NON-NLS-1$
+
public HQLScratchpadAction() {
super( HibernateConsoleMessages.HQLScratchpadAction_hql_editor );
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.HQL_EDITOR));
setToolTipText(HibernateConsoleMessages.HQLScratchpadAction_open_hql_editor);
setEnabled( true );
+ setId(HQLSCRATCHPAD_ACTIONID);
}
protected void openQueryEditor(ConsoleConfiguration config, String query) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -46,6 +46,8 @@
*/
public class OpenMappingAction extends SelectionListenerAction {
+ public static final String OPENMAPPING_ACTIONID = "actionid.openmapping"; //$NON-NLS-1$
+
private final String imageFilePath = "icons/images/mapping.gif"; //$NON-NLS-1$
public OpenMappingAction() {
@@ -53,6 +55,7 @@
setToolTipText(HibernateConsoleMessages.OpenMappingAction_open_mapping_file);
setEnabled(true);
setImageDescriptor(HibernateConsolePlugin.getImageDescriptor(imageFilePath ));
+ setId(OPENMAPPING_ACTIONID);
}
public void run() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -41,6 +41,8 @@
@SuppressWarnings("restriction")
public class OpenSourceAction extends SelectionListenerAction {
+ public static final String OPENSOURCE_ACTIONID = "actionid.opensource"; //$NON-NLS-1$
+
private String imageFilePath = "icons/images/java.gif"; //$NON-NLS-1$
public OpenSourceAction() {
@@ -48,6 +50,7 @@
setToolTipText(HibernateConsoleMessages.OpenSourceAction_open_source_file);
setEnabled( true );
setImageDescriptor(HibernateConsolePlugin.getImageDescriptor(imageFilePath));
+ setId(OPENSOURCE_ACTIONID);
}
public void run() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/RefreshAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/RefreshAction.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/RefreshAction.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -35,6 +35,8 @@
*/
public class RefreshAction extends SelectionListenerAction {
+ public static final String REFRESH_ACTIONID = "actionid.refresh"; //$NON-NLS-1$
+
private final StructuredViewer viewer;
private String imageFilePath = "icons/images/refresh_run.gif"; //$NON-NLS-1$
@@ -42,6 +44,7 @@
super(HibernateConsoleMessages.RefreshAction_refresh);
this.viewer = viewer;
setImageDescriptor(HibernateConsolePlugin.getImageDescriptor(imageFilePath ));
+ setId(REFRESH_ACTIONID);
}
public void run() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -22,6 +22,7 @@
package org.hibernate.eclipse.console.views;
import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -42,8 +43,6 @@
import org.hibernate.eclipse.console.actions.RefreshAction;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
-import org.hibernate.mapping.RootClass;
-import org.hibernate.mapping.Subclass;
/**
* @author max
@@ -51,6 +50,31 @@
*/
public class ConfigurationsViewActionGroup extends ActionGroup {
+ /**
+ * menu group for open primal editors related actions.
+ * Value: <code>"group.primalEditors"</code>
+ */
+ public static final String GROUP_PRIMAL_EDITORS = "group.primalEditors"; //$NON-NLS-1$
+ public static final String GROUP_PRIMAL_EDITORS_LAST = "group.primalEditors.last"; //$NON-NLS-1$
+ /**
+ * menu group for Hibernate Console Configuration related actions.
+ * Value: <code>"group.consoleConfig"</code>
+ */
+ public static final String GROUP_CONSOLE_CONFIG = "group.consoleConfig"; //$NON-NLS-1$
+ public static final String GROUP_CONSOLE_CONFIG_LAST = "group.consoleConfig.last"; //$NON-NLS-1$
+ /**
+ * menu group for addition Hibernate related actions.
+ * Value: <code>"group.addition"</code>
+ */
+ public static final String GROUP_ADDITION = "group.addition"; //$NON-NLS-1$
+ public static final String GROUP_ADDITION_LAST = "group.addition.last"; //$NON-NLS-1$
+ /**
+ * menu group for open other editors related actions.
+ * Value: <code>"group.otherEditors"</code>
+ */
+ public static final String GROUP_OTHER_EDITORS = "group.otherEditors"; //$NON-NLS-1$
+ public static final String GROUP_OTHER_EDITORS_LAST = "group.otherEditors.last"; //$NON-NLS-1$
+
private Action addConfigurationAction;
private SelectionListenerAction deleteConfigurationAction;
private SelectionListenerAction refreshAction;
@@ -119,30 +143,39 @@
}
public void fillContextMenu(IMenuManager menu) {
- if (getContext() == null) return;
+ if (getContext() == null) {
+ return;
+ }
IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
- if (selection == null) return;
+ if (selection == null) {
+ return;
+ }
Object first = selection.getFirstElement();
- menu.add(hqlEditorAction);
- menu.add(criteriaEditorAction);
- menu.add(new Separator() );
- menu.add(addConfigurationAction);
- if (first instanceof ConsoleConfiguration){
- menu.add(reloadConfigurationAction);
- menu.add(editConfigurationAction);
- menu.add(deleteConfigurationAction);
+ menu.add(new Separator(GROUP_PRIMAL_EDITORS));
+ menu.appendToGroup(GROUP_PRIMAL_EDITORS, hqlEditorAction);
+ menu.appendToGroup(GROUP_PRIMAL_EDITORS, criteriaEditorAction);
+ menu.add(new GroupMarker(GROUP_PRIMAL_EDITORS_LAST));
+ menu.add(new Separator(GROUP_CONSOLE_CONFIG));
+ menu.appendToGroup(GROUP_CONSOLE_CONFIG, addConfigurationAction);
+ if (first instanceof ConsoleConfiguration) {
+ menu.appendToGroup(GROUP_CONSOLE_CONFIG, reloadConfigurationAction);
+ menu.appendToGroup(GROUP_CONSOLE_CONFIG, editConfigurationAction);
+ menu.appendToGroup(GROUP_CONSOLE_CONFIG, deleteConfigurationAction);
}
- menu.add(new Separator() );
- menu.add(refreshAction);
+ menu.add(new GroupMarker(GROUP_CONSOLE_CONFIG_LAST));
+ menu.add(new Separator(GROUP_ADDITION));
+ menu.appendToGroup(GROUP_ADDITION, refreshAction);
if (first instanceof ConsoleConfiguration){
- menu.add(schemaExportAction);
+ menu.appendToGroup(GROUP_ADDITION, schemaExportAction);
}
- menu.add(new Separator() );
+ menu.add(new GroupMarker(GROUP_ADDITION_LAST));
+ menu.add(new Separator(GROUP_OTHER_EDITORS));
// TODO: shouldn't these and maybe the others not be defined via menu extension points ?
if (first != null && (first instanceof PersistentClass || first.getClass() == Property.class)) {
- menu.add(openSourceAction);
- menu.add(openMappingAction);
+ menu.appendToGroup(GROUP_OTHER_EDITORS, openSourceAction);
+ menu.appendToGroup(GROUP_OTHER_EDITORS, openMappingAction);
}
+ menu.add(new GroupMarker(GROUP_OTHER_EDITORS_LAST));
}
public void fillActionBars(IActionBars actionBars) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -13,6 +13,8 @@
public class ReloadConfigurationAction extends ConsoleConfigurationBasedAction {
+ public static final String RELOADCONFIG_ACTIONID = "actionid.reloadconfig"; //$NON-NLS-1$
+
private StructuredViewer viewer;
protected ReloadConfigurationAction(StructuredViewer sv) {
@@ -20,6 +22,7 @@
setEnabledWhenNoSessionFactory(true);
viewer = sv;
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.RELOAD) );
+ setId(RELOADCONFIG_ACTIONID);
}
protected void doRun() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2009-07-17 09:45:49 UTC (rev 16644)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2009-07-17 12:42:06 UTC (rev 16645)
@@ -40,6 +40,8 @@
*/
public class SchemaExportAction extends ConsoleConfigurationBasedAction {
+ public static final String SCHEMAEXPORT_ACTIONID = "actionid.schemaexport"; //$NON-NLS-1$
+
private StructuredViewer viewer;
/**
@@ -47,6 +49,7 @@
*/
protected SchemaExportAction(String text) {
super( text );
+ setId(SCHEMAEXPORT_ACTIONID);
}
/**
@@ -55,6 +58,7 @@
public SchemaExportAction(StructuredViewer selectionProvider) {
super( HibernateConsoleMessages.SchemaExportAction_run_schemaexport );
this.viewer = selectionProvider;
+ setId(SCHEMAEXPORT_ACTIONID);
}
public void doRun() {
16 years, 9 months
JBoss Tools SVN: r16644 - workspace/Denny/bpel/bpel-plugins.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-07-17 05:45:49 -0400 (Fri, 17 Jul 2009)
New Revision: 16644
Added:
workspace/Denny/bpel/bpel-plugins/org.jboss.bpel.as.integration_1.0.0.jar
workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.archives.webtools_1.0.0.jar
workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.classpath.core_1.0.0.jar
workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.classpath.ui_1.0.0.jar
workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.core_1.0.0.jar
workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.ui.mbeans_1.0.0.jar
workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.ui_1.0.0.jar
workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.wtp.override.core_1.0.0.200907171740.jar
workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.wtp.override.ui_1.0.0.200907171740.jar
Modified:
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.apache.ode.deploy.model_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.apache.ode.deploy.ui_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.apache.ode.runtime_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.common.model_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.common.ui_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.model_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.runtimes_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.ui_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.validator_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.wsil.model_0.4.0.jar
workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.xpath10_0.4.0.jar
Log:
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.apache.ode.deploy.model_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.apache.ode.deploy.ui_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.apache.ode.runtime_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.common.model_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.common.ui_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.model_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.runtimes_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.ui_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.validator_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.wsil.model_0.4.0.jar
===================================================================
(Binary files differ)
Modified: workspace/Denny/bpel/bpel-plugins/org.eclipse.bpel.xpath10_0.4.0.jar
===================================================================
(Binary files differ)
Added: workspace/Denny/bpel/bpel-plugins/org.jboss.bpel.as.integration_1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/bpel/bpel-plugins/org.jboss.bpel.as.integration_1.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.archives.webtools_1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.archives.webtools_1.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.classpath.core_1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.classpath.core_1.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.classpath.ui_1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.classpath.ui_1.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.core_1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.core_1.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.ui.mbeans_1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.ui.mbeans_1.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.ui_1.0.0.jar
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.ui_1.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.wtp.override.core_1.0.0.200907171740.jar
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.wtp.override.core_1.0.0.200907171740.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.wtp.override.ui_1.0.0.200907171740.jar
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/bpel/bpel-plugins/org.jboss.ide.eclipse.as.wtp.override.ui_1.0.0.200907171740.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 9 months
JBoss Tools SVN: r16643 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-07-17 04:01:23 -0400 (Fri, 17 Jul 2009)
New Revision: 16643
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/src/org/jboss/tools/jsf/vpe/ajax4jsf/test/Ajax4JsfTestPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentTest.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfTestPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/src/org/jboss/tools/jsf/vpe/jstl/test/JstlTestPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.myfaces.test/src/org/jboss/tools/jsf/vpe/myfaces/test/MyFacesTestPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesTestPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamTestPlugin.java
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsBeanComponentTest.java
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsFormComponentTest.java
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsLogicComponentTest.java
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsNestedComponentTest.java
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsTilesComponentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Externalize English strings
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/src/org/jboss/tools/jsf/vpe/ajax4jsf/test/Ajax4JsfTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/src/org/jboss/tools/jsf/vpe/ajax4jsf/test/Ajax4JsfTestPlugin.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.ajax4jsf.test/src/org/jboss/tools/jsf/vpe/ajax4jsf/test/Ajax4JsfTestPlugin.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -67,9 +67,9 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle
- .getEntry("/resources")); // $NON-NLS-1$
+ .getEntry("/resources")); //$NON-NLS-1$
} catch (Exception e) {
- url = bundle.getEntry("/resources"); // $NON-NLS-1$
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$
}
return (url == null) ? null : url.getPath();
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -74,9 +74,9 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle
- .getEntry("/resources")); // $NON-NLS-1$
+ .getEntry("/resources")); //$NON-NLS-1$
} catch (Exception e) {
- url = bundle.getEntry("/resources"); // $NON-NLS-1$
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$
}
return (url == null) ? null : url.getPath();
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -91,7 +91,7 @@
public static Test suite() {
- TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); // $NON-NLS-1$ //$NON-NLS-1$
+ TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); //$NON-NLS-1$ //$NON-NLS-1$
// $JUnit-BEGIN$
suite.addTestSuite(JsfComponentTest.class);
suite.addTestSuite(Jsf20ComponentContentTest.class);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentTest.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentTest.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -35,99 +35,99 @@
*/
public void testCommandButton() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/commandButton.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/commandButton.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testCommandLink() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/commandLink.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/commandLink.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testDataTable() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/dataTable.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/dataTable.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testForm() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/form.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/form.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testGraphicImage() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/graphicImage.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/graphicImage.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testInputHidden() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/inputHidden.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/inputHidden.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testInputSecret() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/inputSecret.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/inputSecret.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testInputText() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/inputText.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/inputText.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testInputTextArea() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/inputTextArea.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/inputTextArea.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMessage() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/message.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/message.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMessages() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/messages.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/messages.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testOutputFormat() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/outputFormat.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/outputFormat.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testOutputLabel() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/outputLabel.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/outputLabel.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testOutputLink() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/outputLink.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/outputLink.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testOutputText() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/outputText.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/outputText.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testPanelGrid() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/panelGrid.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/panelGrid.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testPanelGroup() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/panelGroup.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/panelGroup.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelectBooleanCheckbox() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectBooleanCheckbox.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectBooleanCheckbox.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelectManyCheckbox() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectManyCheckbox.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectManyCheckbox.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelectManyListbox() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectManyListbox.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectManyListbox.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelectManyMenu() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectManyMenu.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectManyMenu.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelectOneListbox() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectOneListbox.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectOneListbox.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelectOneMenu() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectOneMenu.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectOneMenu.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelectOneRadio() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectOneRadio.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectOneRadio.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
/*
@@ -135,82 +135,82 @@
*/
public void testActionListener() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/actionListener.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/actionListener.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testAttribute() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/attribute.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/attribute.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testConvertDateTime() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/convertDateTime.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/convertDateTime.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testConvertNumber() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/convertNumber.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/convertNumber.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testConverter() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/converter.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/converter.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testFacet() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/facet.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/facet.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testLoadBundle() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/loadBundle.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/loadBundle.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testParam() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/param.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/param.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testPhaseListener() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/phaseListener.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/phaseListener.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelectItem() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectItem.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectItem.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelectItems() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectItems.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/selectItems.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSetPropertyActionListener() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/setPropertyActionListener.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/setPropertyActionListener.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSubview() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/subview.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/subview.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testValidateDoubleRange() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/validateDoubleRange.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/validateDoubleRange.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testValidateLength() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/validateLength.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/validateLength.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testValidateLongRange() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/validateLongRange.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/validateLongRange.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testValidator() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/validator.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/validator.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testValueChangeListener() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/valueChangeListener.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/valueChangeListener.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testVerbatim() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/verbatim.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/verbatim.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testView() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/view.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("components/view.jsp",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfTestPlugin.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfTestPlugin.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -75,9 +75,9 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle
- .getEntry("/resources")); // $NON-NLS-1$
+ .getEntry("/resources")); //$NON-NLS-1$
} catch (Exception e) {
- url = bundle.getEntry("/resources"); // $NON-NLS-1$
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$
}
return (url == null) ? null : url.getPath();
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/src/org/jboss/tools/jsf/vpe/jstl/test/JstlTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/src/org/jboss/tools/jsf/vpe/jstl/test/JstlTestPlugin.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/src/org/jboss/tools/jsf/vpe/jstl/test/JstlTestPlugin.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -62,9 +62,9 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle
- .getEntry("/resources")); // $NON-NLS-1$ //$NON-NLS-1$
+ .getEntry("/resources")); //$NON-NLS-1$ //$NON-NLS-1$
} catch (Exception e) {
- url = bundle.getEntry("/resources"); // $NON-NLS-1$ //$NON-NLS-1$
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$ //$NON-NLS-1$
}
return (url == null) ? null : url.getPath();
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.myfaces.test/src/org/jboss/tools/jsf/vpe/myfaces/test/MyFacesTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.myfaces.test/src/org/jboss/tools/jsf/vpe/myfaces/test/MyFacesTestPlugin.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.myfaces.test/src/org/jboss/tools/jsf/vpe/myfaces/test/MyFacesTestPlugin.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -57,9 +57,9 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle
- .getEntry("/resources")); // $NON-NLS-1$
+ .getEntry("/resources")); //$NON-NLS-1$
} catch (Exception e) {
- url = bundle.getEntry("/resources"); // $NON-NLS-1$
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$
}
return (url == null) ? null : url.getPath();
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesTestPlugin.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesTestPlugin.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -25,7 +25,7 @@
public class RichFacesTestPlugin extends BaseUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.jsf.vpe.richfaces.test"; // $NON-NLS-1$
+ public static final String PLUGIN_ID = "org.jboss.tools.jsf.vpe.richfaces.test"; //$NON-NLS-1$
// The shared instance
private static RichFacesTestPlugin plugin;
@@ -74,9 +74,9 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle
- .getEntry("/resources")); // $NON-NLS-1$
+ .getEntry("/resources")); //$NON-NLS-1$
} catch (Exception e) {
- url = bundle.getEntry("/resources"); // $NON-NLS-1$
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$
}
return (url == null) ? null : url.getPath();
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamTestPlugin.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamTestPlugin.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -74,9 +74,9 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle
- .getEntry("/resources")); // $NON-NLS-1$
+ .getEntry("/resources")); //$NON-NLS-1$
} catch (Exception e) {
- url = bundle.getEntry("/resources"); // $NON-NLS-1$
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$
}
return (url == null) ? null : url.getPath();
}
Modified: trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsBeanComponentTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsBeanComponentTest.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsBeanComponentTest.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -34,46 +34,46 @@
*/
public void testCookie() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/cookie.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/cookie.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testDefine() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/define.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/define.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testHeader() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/header.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/header.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testInclude() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/include.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/include.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMessage() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/message.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/message.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testParameter() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/parameter.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/parameter.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testResource() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/resource.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/resource.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSize() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/size.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/size.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testStruts() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/struts.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/struts.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testWrite() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/write.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/write.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testPage() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/page.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/bean/page.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
}
Modified: trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsFormComponentTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsFormComponentTest.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsFormComponentTest.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -34,66 +34,66 @@
*/
public void testCancel() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/cancel.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/cancel.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testCheckbox() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/checkbox.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/checkbox.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testFile() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/file.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/file.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testForm() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/form.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/form.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testHidden() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/hidden.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/hidden.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMultibox() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/multibox.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/multibox.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testOption() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/option.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/option.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testOptions() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/options.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/options.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testRadio() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/radio.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/radio.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testReset() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/reset.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/reset.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelect() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/select.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/select.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSubmit() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/submit.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/submit.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testText() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/text.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/text.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testButton() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/button.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/button.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testPassword() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/password.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/password.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testTextarea() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/textarea.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/form/textarea.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
}
Modified: trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -34,50 +34,50 @@
*/
public void testBase() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/base.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/base.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testErrors() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/errors.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/errors.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testFrame() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/frame.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/frame.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testHtml() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/html.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/html.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testImage() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/image.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/image.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testImg() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/img.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/img.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testLink() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/link.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/link.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testRewrite() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/rewrite.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/rewrite.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMessages() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/messages.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/messages.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testJavascript() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/javascript.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/javascript.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testOptionsCollection() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/optionsCollection.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/optionsCollection.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testXHTML() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/xhtml.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/xhtml.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
}
Modified: trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsLogicComponentTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsLogicComponentTest.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsLogicComponentTest.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -34,70 +34,70 @@
*/
public void testEmpty() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/empty.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/empty.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testNotEmpty() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/notEmpty.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/notEmpty.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testEqual() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/equal.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/equal.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testNotEqual() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/notEqual.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/notEqual.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testGreaterEqual() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/greaterEqual.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/greaterEqual.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testGreaterThan() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/greaterThan.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/greaterThan.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testIterate() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/iterate.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/iterate.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testLessEqual() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/lessEqual.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/lessEqual.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testLessThan() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/lessThan.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/lessThan.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMatch() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/match.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/match.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testNotMatch() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/notMatch.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/notMatch.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testForward() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/forward.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/forward.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMessagesNotPresent() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/messagesNotPresent.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/messagesNotPresent.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMessagesPresent() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/messagesPresent.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/messagesPresent.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testNotPresent() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/notPresent.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/notPresent.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testPresent() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/present.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/present.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testRedirect() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/redirect.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/logic/redirect.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
}
Modified: trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsNestedComponentTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsNestedComponentTest.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsNestedComponentTest.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -34,98 +34,98 @@
*/
public void testNest() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/nest.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/nest.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testRoot() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/root.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/root.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testSelect() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/select.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/select.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testText() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/text.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/text.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testWriteNesting() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/writeNesting.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/writeNesting.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testCheckbox() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/checkbox.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/checkbox.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testDefine() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/define.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/define.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testEmpty() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/empty.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/empty.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testEqual() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/equal.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/equal.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testErrors() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/errors.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/errors.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testFile() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/file.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/file.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testForm() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/form.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/form.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testGraterEqual() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/greaterEqual.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/greaterEqual.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testGraterThan() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/greaterThan.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/greaterThan.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testHidden() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/hidden.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/hidden.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testImage() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/image.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/image.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testImg() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/img.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/img.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testIterate() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/iterate.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/iterate.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testLessEqual() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/lessEqual.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/lessEqual.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testLessThan() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/lessThan.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/lessThan.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testLink() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/link.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/link.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMatch() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/match.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/match.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMessage() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/message.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/message.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testMessages() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/messages.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/nested/messages.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
}
Modified: trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsTilesComponentTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsTilesComponentTest.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsTilesComponentTest.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -34,38 +34,38 @@
*/
public void testAdd() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/add.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/add.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testDefinition() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/definition.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/definition.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testGet() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/get.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/get.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testGetAsString() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/getAsString.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/getAsString.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testImportAttribute() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/importAttribute.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/importAttribute.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testInitComponentDefinitions() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/initComponentDefinitions.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/initComponentDefinitions.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testInsert() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/insert.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/insert.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testPutList() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/putList.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/putList.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testUserAttribute() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/userAttribute.jsp", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/tiles/userAttribute.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java 2009-07-17 07:47:26 UTC (rev 16642)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java 2009-07-17 08:01:23 UTC (rev 16643)
@@ -67,9 +67,9 @@
URL url = null;
try {
url = bundle == null ? null : FileLocator.resolve(bundle
- .getEntry("/resources")); // $NON-NLS-1$
+ .getEntry("/resources")); //$NON-NLS-1$
} catch (Exception e) {
- url = bundle.getEntry("/resources"); // $NON-NLS-1$
+ url = bundle.getEntry("/resources"); //$NON-NLS-1$
}
return (url == null) ? null : url.getPath();
}
16 years, 9 months
JBoss Tools SVN: r16641 - in trunk: struts/plugins/org.jboss.tools.struts and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-07-17 03:41:14 -0400 (Fri, 17 Jul 2009)
New Revision: 16641
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/build.properties
trunk/struts/plugins/org.jboss.tools.struts/build.properties
Log:
Added build-time dependencies which were breaking incremental builds in development environment. See JBIDE-4349.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/build.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/build.properties 2009-07-17 06:59:02 UTC (rev 16640)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/build.properties 2009-07-17 07:41:14 UTC (rev 16641)
@@ -7,3 +7,4 @@
META-INF/,\
web.jar,\
catalog/
+additional.bundles = org.eclipse.jem.util
Modified: trunk/struts/plugins/org.jboss.tools.struts/build.properties
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/build.properties 2009-07-17 06:59:02 UTC (rev 16640)
+++ trunk/struts/plugins/org.jboss.tools.struts/build.properties 2009-07-17 07:41:14 UTC (rev 16641)
@@ -6,3 +6,4 @@
about.html,\
META-INF/,\
struts.jar
+additional.bundles = org.eclipse.wst.server.core
16 years, 9 months