JBoss Tools SVN: r9034 - in trunk/core: plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-06-30 17:59:04 -0400 (Mon, 30 Jun 2008)
New Revision: 9034
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariables.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/ModelUtil.java
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelUtilTest.java
Log:
Unit test regressions fixed
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariables.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariables.java 2008-06-30 19:37:26 UTC (rev 9033)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/model/other/internal/WorkspaceVariables.java 2008-06-30 21:59:04 UTC (rev 9034)
@@ -5,6 +5,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.VariablesPlugin;
import org.jboss.ide.eclipse.archives.core.model.IArchivesVFS;
@@ -60,8 +61,14 @@
public IPath workspacePathToAbsolutePath(IPath path) {
IResource r = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+ IPath append = new Path("");
+ while( r == null && path.segmentCount() > 0) {
+ append = new Path(path.lastSegment()).append(append);
+ path = path.removeLastSegments(1);
+ r = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+ }
if( r != null )
- return r.getLocation();
+ return r.getLocation().append(append);
return null;
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/ModelUtil.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/ModelUtil.java 2008-06-30 19:37:26 UTC (rev 9033)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/ModelUtil.java 2008-06-30 21:59:04 UTC (rev 9034)
@@ -136,35 +136,29 @@
}
- public static boolean otherFilesetMatchesPathAndOutputLocation(IArchiveFileSet fileset, FileWrapper file) {
- return otherFilesetMatchesPathAndOutputLocation(fileset, file, null);
- }
-
/**
* Do any filesets other than the parameter match this path?
- * @param fileset
- * @param path
- * @param root a node to start with, or null if the entire model
- * @return
*/
- public static boolean otherFilesetMatchesPathAndOutputLocation(IArchiveFileSet fileset, FileWrapper file, IArchiveNode root) {
- return otherFilesetMatchesPathAndOutputLocation(fileset, new Path(file.getAbsolutePath()), file.getFilesetRelative(), root);
+ public static boolean otherFilesetMatchesPathAndOutputLocation(IArchiveFileSet fileset, FileWrapper file) {
+ return otherFilesetMatchesPathAndOutputLocation(fileset, new Path(file.getAbsolutePath()),
+ file.getFilesetRelative(), file.getRootArchiveRelative().toString(), null);
}
- public static boolean otherFilesetMatchesPathAndOutputLocation(IArchiveFileSet fileset, IPath absolute, IArchiveNode root) {
- return otherFilesetMatchesPathAndOutputLocation(fileset, absolute, null, root);
- }
- public static boolean otherFilesetMatchesPathAndOutputLocation(IArchiveFileSet fileset, IPath absolute, String fsRelative, IArchiveNode root) {
+ public static boolean otherFilesetMatchesPathAndOutputLocation(IArchiveFileSet fileset, IPath absolute,
+ String fsRelative, String rootArchiveRelative, IArchiveNode root) {
IArchiveFileSet[] filesets = ModelUtil.getMatchingFilesets(root, absolute);
if( filesets.length == 0 || (filesets.length == 1 && Arrays.asList(filesets).contains(fileset))) {
return false;
} else {
// other filesets DO match... but are they at the same location in the archive?
- boolean relativePathsMatch;
- boolean destinationsMatch;
+ boolean relativePathsMatch = false;
+ boolean destinationsMatch = false;
+ FileWrapper[] matches;
for( int i = 0; i < filesets.length; i++ ) {
if( fileset.equals(filesets[i])) continue;
- relativePathsMatch = filesets[i].matchesPath(absolute, fsRelative);
+ matches = filesets[i].getMatches(absolute);
+ for( int j = 0; j < matches.length; j++ )
+ relativePathsMatch |= matches[j].getRootArchiveRelative().toString().equals(rootArchiveRelative);
destinationsMatch = fileset.getRootArchive().getArchiveFilePath().equals(filesets[i].getRootArchive().getArchiveFilePath());
if( relativePathsMatch && destinationsMatch ) {
Modified: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelUtilTest.java
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelUtilTest.java 2008-06-30 19:37:26 UTC (rev 9033)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelUtilTest.java 2008-06-30 21:59:04 UTC (rev 9034)
@@ -14,6 +14,7 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory.DirectoryScannerExtension.FileWrapper;
import org.jboss.ide.eclipse.archives.core.model.internal.ArchiveNodeImpl;
import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
import org.jboss.ide.eclipse.archives.test.ArchivesTest;
@@ -127,13 +128,13 @@
IPath xml = inputs.append("fileTrees").append("misc").append("rug.xml");
IArchiveFileSet[] xmlFS = ModelUtil.getMatchingFilesets(rootArchive, xml);
assertTrue(xmlFS.length == 2);
- assertFalse(ModelUtil.otherFilesetMatchesPathAndOutputLocation(xmlFS[0], xml, rootArchive));
- assertFalse(ModelUtil.otherFilesetMatchesPathAndOutputLocation(xmlFS[1], xml, rootArchive));
+ assertFalse(testMatches(xmlFS[0], xml, rootArchive));
+ assertFalse(testMatches(xmlFS[1], xml, rootArchive));
IPath html = inputs.append("fileTrees").append("misc").append("someHtml.html");
IArchiveFileSet[] htmlFS = ModelUtil.getMatchingFilesets(rootArchive, html);
assertTrue(htmlFS.length == 1);
- assertFalse(ModelUtil.otherFilesetMatchesPathAndOutputLocation(htmlFS[0], html, rootArchive));
+ assertFalse(testMatches(htmlFS[0], html, rootArchive));
// add a temporary fileset that will match exactly
IArchiveFileSet otherFS = ArchiveNodeFactory.createFileset();
@@ -142,6 +143,13 @@
otherFS.setSourcePath(xmlFS[0].getSourcePath());
xmlFS[0].getParent().addChild(otherFS);
- assertTrue(ModelUtil.otherFilesetMatchesPathAndOutputLocation(xmlFS[0], xml, rootArchive));
+ assertTrue(testMatches(xmlFS[0], xml, rootArchive));
}
+
+ private boolean testMatches(IArchiveFileSet fs, IPath absoluteFile, IArchiveNode node) {
+ FileWrapper[] wrappers = fs.getMatches(absoluteFile);
+ return ModelUtil.otherFilesetMatchesPathAndOutputLocation(fs, absoluteFile, wrappers[0].getFilesetRelative(), wrappers[0].getRootArchiveRelative().toString(), node);
+
+ }
+
}
16 years, 6 months
JBoss Tools SVN: r9033 - in branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: contentassist/xpl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-06-30 15:37:26 -0400 (Mon, 30 Jun 2008)
New Revision: 9033
Modified:
branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java
branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/xpl/JSPBaseContentAssistProcessor.java
branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2437 CA suggests only proposals for EL.
Issue is fixed for 2.1.3
Modified: branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java
===================================================================
--- branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java 2008-06-30 19:28:31 UTC (rev 9032)
+++ branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java 2008-06-30 19:37:26 UTC (rev 9033)
@@ -78,89 +78,151 @@
return;
}
- String matchStringForQuery = matchString;
- String strippedValueForQuery = strippedValue;
int elStartPosition = getELStartPosition(matchString);
int delta = 0;
- String proposalPrefix = "";
- String proposalSufix = "";
+ String elProposalPrefix = "";
+ String elQueryString = null;
+ String queryString = null;
if (elStartPosition == -1) {
+ queryString = matchString;
+ elQueryString = "#{";
+ delta = matchString.length();
if(isCharSharp(matchString, offset-1)) {
- proposalPrefix = "{"; //$NON-NLS-1$
+ elProposalPrefix = "{"; //$NON-NLS-1$
+ queryString = null; // Do not request for ordinar attr-value proposals
+ // in case of starting EL-expression
} else {
- proposalPrefix = "#{"; //$NON-NLS-1$
+ elProposalPrefix = "#{"; //$NON-NLS-1$
}
- }
-
- if (elStartPosition == -1) {
- matchStringForQuery = "#{";
- strippedValueForQuery = "";
- delta = matchString.length();
+ if (matchString.startsWith("\"") || matchString.startsWith("'")) {
+ queryString = matchString.substring(1);
+ }
} else {
- matchStringForQuery = matchString.substring(elStartPosition);
- strippedValueForQuery = matchStringForQuery;
- delta = matchString.length() - matchStringForQuery.length();
+ // // Do not request for ordinar attr-value proposals
+ // in case of EL-expression
+ queryString = null;
+ elQueryString = matchString.substring(elStartPosition);
+ delta = matchString.length() - elQueryString.length();
}
// Correct delta if matchString starts with a quote (exclude that quote)
if (matchString.startsWith("\"") || matchString.startsWith("'")) {
- strippedValueForQuery = matchString.substring(0,1) + strippedValueForQuery;
delta--;
}
-
- String query = new StringBuffer(KbQuery.TAG_SEPARATOR).append(tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(matchStringForQuery).toString();
- 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(strippedValueForQuery, offset - delta);
- int relevance = kbProposal.getRelevance();
- if(relevance==KbProposal.R_NONE) {
- relevance = XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE;
- }
-
- if(kbProposal.getStart() >= 0) {
- String replacementString = kbProposal.getReplacementString();
- int replacementBeginPosition = contentAssistRequest.getReplacementBeginPosition() + kbProposal.getStart() + delta;
- int replacementLength = kbProposal.getEnd() - kbProposal.getStart();
- int cursorPositionDelta = 0;
-
- // Add an EL-starting quotation characters if needed
- if (elStartPosition == -1) {
- replacementString = proposalPrefix + replacementString;
- cursorPositionDelta += proposalPrefix.length();
- }
-
- if((currentValue.length() > StringUtils.strip(currentValue).length()) &&
- (currentValue.endsWith("\"") || currentValue.endsWith("'")) ) {
- if(!currentValue.endsWith("}\"")) {
- replacementString += "}";
- }
- } else {
- if(elStartPosition == -1 && !currentValue.endsWith("}")) {
- replacementString += "}";
- }
-// replacementString += ("\"");
- }
- int cursorPosition = kbProposal.getPosition() + cursorPositionDelta;
- String displayString = elStartPosition == -1 ?
- proposalPrefix + kbProposal.getReplacementString() + "}" :
- kbProposal.getReplacementString();
- AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(
- kbProposal.autoActivationContentAssistantAfterApplication(),
- replacementString,
- replacementBeginPosition, replacementLength, cursorPosition,
- SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
- displayString, null, kbProposal.getContextInfo(), relevance);
- contentAssistRequest.addProposal(proposal);
- }
- }
- } catch (KbException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
+
+ Collection proposals = null;
+ if (queryString != null) {
+ // Query to request for ordinar proposals
+ try {
+ String query = new StringBuffer(KbQuery.TAG_SEPARATOR).append(tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(queryString).toString();
+ proposals = wtpKbConnector.getProposals(query);
+ if(proposals.size()==0 && htmlQuery!=null) {
+ proposals = wtpKbConnector.getProposals(htmlQuery);
+ }
+ if(proposals != null) {
+ for (Iterator iter = proposals.iterator(); iter.hasNext();) {
+ KbProposal kbProposal = cleanFaceletProposal((KbProposal)iter.next());
+ kbProposal.postProcess(queryString, offset - delta);
+ if (kbProposal.getReplacementString().startsWith("#{"))
+ continue; // Do not process EL-proposals here!!!
+
+ int relevance = kbProposal.getRelevance();
+ if(relevance==KbProposal.R_NONE) {
+ relevance = XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE;
+ }
+
+ if(kbProposal.getStart() < 0) {
+ StringBuffer replacementStringBuffer = new StringBuffer(kbProposal.getReplacementString());
+ int replacementBeginPosition = contentAssistRequest.getReplacementBeginPosition();
+ int replacementLength = contentAssistRequest.getReplacementLength();
+ int cursorPositionDelta = 0;
+ if(currentValue.startsWith("\"") || currentValue.startsWith("'")) {
+ replacementBeginPosition = replacementBeginPosition +1;
+ replacementLength--;
+ } else {
+ cursorPositionDelta++;
+ replacementStringBuffer.insert(0, "\"");
+ }
+ if((currentValue.endsWith("\"") || currentValue.endsWith("'")) &&
+ strippedValue.length() < currentValue.length() ) {
+ replacementLength--;
+ }
+
+ String replacementString = replacementStringBuffer.toString();
+ int cursorPosition = kbProposal.getPosition() + cursorPositionDelta;
+ AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(kbProposal.autoActivationContentAssistantAfterApplication(), replacementString,
+ replacementBeginPosition, replacementLength, cursorPosition, SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
+ kbProposal.getLabel(), null, kbProposal.getContextInfo(), relevance);
+ contentAssistRequest.addProposal(proposal);
+
+ }
+ }
+ }
+ } catch (KbException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ Collection elProposals = null;
+ if (elQueryString != null) {
+ // Query to request for EL-proposals
+ try {
+ String query = new StringBuffer(KbQuery.TAG_SEPARATOR).append(tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(elQueryString).toString();
+ elProposals = wtpKbConnector.getProposals(query);
+ } catch (KbException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ if(elProposals != null) {
+ for (Iterator iter = elProposals.iterator(); iter.hasNext();) {
+ KbProposal kbProposal = cleanFaceletProposal((KbProposal)iter.next());
+ kbProposal.postProcess("\"" + elQueryString, offset - delta);
+ if (!kbProposal.getReplacementString().startsWith("#{"))
+ continue; // Process the only EL-proposals here!!!
+ 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() + delta;
+ 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((currentValue.length() > StringUtils.strip(currentValue).length()) &&
+ (currentValue.endsWith("\"") || currentValue.endsWith("'")) ) {
+ String restOfCurrentValue = currentValue.substring(matchString.length());
+
+ if(getELEndPosition(matchString, currentValue) == -1) {
+ replacementString += "}";
+ }
+ } else {
+ if(elStartPosition == -1 && !currentValue.endsWith("}")) {
+ replacementString += "}";
+ }
+ // replacementString += ("\"");
+ }
+ 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) + "}" ;
+ AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(
+ kbProposal.autoActivationContentAssistantAfterApplication(),
+ replacementString,
+ replacementBeginPosition, replacementLength, cursorPosition,
+ SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
+ displayString, null, kbProposal.getContextInfo(), relevance);
+ contentAssistRequest.addProposal(proposal);
+ }
+ }
+ }
+ }
}
private KbProposal cleanFaceletProposal(KbProposal proposal) {
@@ -191,7 +253,7 @@
}
/*
- * Checks if the EL start starting characters are present
+ * Checks if the EL operand starting characters are present
* @return
*/
private int getELStartPosition(String matchString) {
@@ -234,4 +296,78 @@
return '#' == matchString.charAt(offset);
}
+ /*
+ * Checks if the EL operand ending character is present
+ * @return
+ */
+ private int getELEndPosition(String matchString, String currentValue) {
+ if (matchString == null || matchString.length() == 0 ||
+ currentValue == null || currentValue.length() == 0 ||
+ currentValue.length() < matchString.length())
+ return -1;
+
+ String restOfCurrentValue = currentValue.substring(matchString.length());
+ int offset = -1;
+
+ char inQuotesChar = 0;
+ while (++offset < restOfCurrentValue.length()) {
+ if (inQuotesChar == 0) {
+ if ('}' == restOfCurrentValue.charAt(offset))
+ return matchString.length() + offset;
+
+ if ('#' == restOfCurrentValue.charAt(offset))
+ return -1;
+
+ if ('"' == restOfCurrentValue.charAt(offset) ||
+ '\'' == restOfCurrentValue.charAt(offset)) {
+ inQuotesChar = restOfCurrentValue.charAt(offset);
+ }
+
+ if ('\\' == restOfCurrentValue.charAt(offset)) {
+ int backslashCount = 1;
+
+ while ((offset + backslashCount) < restOfCurrentValue.length() &&
+ restOfCurrentValue.charAt(offset + backslashCount) == '\\') {
+ backslashCount++;
+ }
+
+ if (offset + backslashCount >= restOfCurrentValue.length())
+ return -1;
+
+ if (backslashCount % 2 == 1 &&
+ ('"' == restOfCurrentValue.charAt(offset + backslashCount) ||
+ '\'' == restOfCurrentValue.charAt(offset + backslashCount))) {
+ inQuotesChar = restOfCurrentValue.charAt(offset + backslashCount);
+ offset += backslashCount;
+ }
+ }
+ } else {
+ if ('"' == restOfCurrentValue.charAt(offset) ||
+ '\'' == restOfCurrentValue.charAt(offset)) {
+ inQuotesChar = 0;
+ }
+
+ if ('\\' == restOfCurrentValue.charAt(offset)) {
+ int backslashCount = 1;
+
+ while ((offset + backslashCount) < restOfCurrentValue.length() &&
+ restOfCurrentValue.charAt(offset + backslashCount) == '\\') {
+ backslashCount++;
+ }
+
+ if (offset + backslashCount >= restOfCurrentValue.length())
+ return -1;
+
+ if (backslashCount % 2 == 1 &&
+ ('"' == restOfCurrentValue.charAt(offset + backslashCount) ||
+ '\'' == restOfCurrentValue.charAt(offset + backslashCount))) {
+ inQuotesChar = 0;
+ offset += backslashCount;
+ }
+ }
+ }
+ }
+ return -1;
+ }
+
}
\ No newline at end of file
Modified: branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/xpl/JSPBaseContentAssistProcessor.java
===================================================================
--- branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/xpl/JSPBaseContentAssistProcessor.java 2008-06-30 19:28:31 UTC (rev 9032)
+++ branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/xpl/JSPBaseContentAssistProcessor.java 2008-06-30 19:37:26 UTC (rev 9033)
@@ -77,7 +77,7 @@
// offset = contentAssistRequest.getMatchString().length();
// } else {
matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
- strippedValue = currentValue;
+ strippedValue = StringUtils.strip(currentValue);
offset = contentAssistRequest.getMatchString().length();
// }
addFaceletAttributeValueProposals(
Modified: branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java
===================================================================
--- branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java 2008-06-30 19:28:31 UTC (rev 9032)
+++ branches/jbosstools-2.1.x/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java 2008-06-30 19:37:26 UTC (rev 9033)
@@ -202,6 +202,12 @@
if(callEnd != null && callEnd.end >= offset) proposal.setEnd(callEnd.end); else proposal.setEnd(offset);
int pos = proposal.getReplacementString().length();
+ // JBIDE-2437: Because of the issue add EL open/close brackets to the proposal replacement string
+ // This will allow us to separate EL-proposals from all the others.
+ proposal.setReplacementString("#{" + proposal.getReplacementString() + "}");
+ proposal.setLabel("#{" + proposal.getLabel() + "}");
+
+
// JBIDE-2334: JSPAciveContentAssistProcessor (a class which calls this method)
// is to process opening and closing EL charachers
/*
16 years, 6 months
JBoss Tools SVN: r9032 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-06-30 15:28:31 -0400 (Mon, 30 Jun 2008)
New Revision: 9032
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2437 CA suggests only proposals for EL.
Issue is fixed for 3.0.0
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java 2008-06-30 19:08:58 UTC (rev 9031)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java 2008-06-30 19:28:31 UTC (rev 9032)
@@ -78,7 +78,6 @@
return;
}
-// String strippedValueForQuery = strippedValue;
int elStartPosition = getELStartPosition(matchString);
int delta = 0;
String elProposalPrefix = "";
@@ -87,7 +86,6 @@
if (elStartPosition == -1) {
queryString = matchString;
elQueryString = "#{";
-// strippedValueForQuery = "";
delta = matchString.length();
if(isCharSharp(matchString, offset-1)) {
elProposalPrefix = "{"; //$NON-NLS-1$
@@ -104,13 +102,11 @@
// in case of EL-expression
queryString = null;
elQueryString = matchString.substring(elStartPosition);
-// strippedValueForQuery = elQueryString;
delta = matchString.length() - elQueryString.length();
}
// Correct delta if matchString starts with a quote (exclude that quote)
if (matchString.startsWith("\"") || matchString.startsWith("'")) {
-// strippedValueForQuery = matchString.substring(0,1) + strippedValueForQuery;
delta--;
}
@@ -301,7 +297,7 @@
}
/*
- * Checks if the EL operand starting characters are present
+ * Checks if the EL operand ending character is present
* @return
*/
private int getELEndPosition(String matchString, String currentValue) {
16 years, 6 months
JBoss Tools SVN: r9031 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: contentassist/xpl and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-06-30 15:08:58 -0400 (Mon, 30 Jun 2008)
New Revision: 9031
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/xpl/JSPBaseContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2437 CA suggests only proposals for EL.
Issue is fixed for 3.0.0
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java 2008-06-30 17:49:16 UTC (rev 9030)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPActiveContentAssistProcessor.java 2008-06-30 19:08:58 UTC (rev 9031)
@@ -78,89 +78,155 @@
return;
}
- String matchStringForQuery = matchString;
- String strippedValueForQuery = strippedValue;
+// String strippedValueForQuery = strippedValue;
int elStartPosition = getELStartPosition(matchString);
int delta = 0;
- String proposalPrefix = "";
- String proposalSufix = "";
+ String elProposalPrefix = "";
+ String elQueryString = null;
+ String queryString = null;
if (elStartPosition == -1) {
+ queryString = matchString;
+ elQueryString = "#{";
+// strippedValueForQuery = "";
+ delta = matchString.length();
if(isCharSharp(matchString, offset-1)) {
- proposalPrefix = "{"; //$NON-NLS-1$
+ elProposalPrefix = "{"; //$NON-NLS-1$
+ queryString = null; // Do not request for ordinar attr-value proposals
+ // in case of starting EL-expression
} else {
- proposalPrefix = "#{"; //$NON-NLS-1$
+ elProposalPrefix = "#{"; //$NON-NLS-1$
}
- }
-
- if (elStartPosition == -1) {
- matchStringForQuery = "#{";
- strippedValueForQuery = "";
- delta = matchString.length();
+ if (matchString.startsWith("\"") || matchString.startsWith("'")) {
+ queryString = matchString.substring(1);
+ }
} else {
- matchStringForQuery = matchString.substring(elStartPosition);
- strippedValueForQuery = matchStringForQuery;
- delta = matchString.length() - matchStringForQuery.length();
+ // // Do not request for ordinar attr-value proposals
+ // in case of EL-expression
+ queryString = null;
+ elQueryString = matchString.substring(elStartPosition);
+// strippedValueForQuery = elQueryString;
+ delta = matchString.length() - elQueryString.length();
}
// Correct delta if matchString starts with a quote (exclude that quote)
if (matchString.startsWith("\"") || matchString.startsWith("'")) {
- strippedValueForQuery = matchString.substring(0,1) + strippedValueForQuery;
+// strippedValueForQuery = matchString.substring(0,1) + strippedValueForQuery;
delta--;
}
-
- String query = new StringBuffer(KbQuery.TAG_SEPARATOR).append(tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(matchStringForQuery).toString();
- 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(strippedValueForQuery, offset - delta);
- int relevance = kbProposal.getRelevance();
- if(relevance==KbProposal.R_NONE) {
- relevance = XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE;
- }
-
- if(kbProposal.getStart() >= 0) {
- String replacementString = kbProposal.getReplacementString();
- int replacementBeginPosition = contentAssistRequest.getReplacementBeginPosition() + kbProposal.getStart() + delta;
- int replacementLength = kbProposal.getEnd() - kbProposal.getStart();
- int cursorPositionDelta = 0;
-
- // Add an EL-starting quotation characters if needed
- if (elStartPosition == -1) {
- replacementString = proposalPrefix + replacementString;
- cursorPositionDelta += proposalPrefix.length();
- }
-
- if((currentValue.length() > StringUtils.strip(currentValue).length()) &&
- (currentValue.endsWith("\"") || currentValue.endsWith("'")) ) {
- if(!currentValue.endsWith("}\"")) {
- replacementString += "}";
- }
- } else {
- if(elStartPosition == -1 && !currentValue.endsWith("}")) {
- replacementString += "}";
- }
-// replacementString += ("\"");
- }
- int cursorPosition = kbProposal.getPosition() + cursorPositionDelta;
- String displayString = elStartPosition == -1 ?
- proposalPrefix + kbProposal.getReplacementString() + "}" :
- kbProposal.getReplacementString();
- AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(
- kbProposal.autoActivationContentAssistantAfterApplication(),
- replacementString,
- replacementBeginPosition, replacementLength, cursorPosition,
- SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
- displayString, null, kbProposal.getContextInfo(), relevance);
- contentAssistRequest.addProposal(proposal);
- }
- }
- } catch (KbException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
+
+ Collection proposals = null;
+ if (queryString != null) {
+ // Query to request for ordinar proposals
+ try {
+ String query = new StringBuffer(KbQuery.TAG_SEPARATOR).append(tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(queryString).toString();
+ proposals = wtpKbConnector.getProposals(query);
+ if(proposals.size()==0 && htmlQuery!=null) {
+ proposals = wtpKbConnector.getProposals(htmlQuery);
+ }
+ if(proposals != null) {
+ for (Iterator iter = proposals.iterator(); iter.hasNext();) {
+ KbProposal kbProposal = cleanFaceletProposal((KbProposal)iter.next());
+ kbProposal.postProcess(queryString, offset - delta);
+ if (kbProposal.getReplacementString().startsWith("#{"))
+ continue; // Do not process EL-proposals here!!!
+
+ int relevance = kbProposal.getRelevance();
+ if(relevance==KbProposal.R_NONE) {
+ relevance = XMLRelevanceConstants.R_XML_ATTRIBUTE_VALUE;
+ }
+
+ if(kbProposal.getStart() < 0) {
+ StringBuffer replacementStringBuffer = new StringBuffer(kbProposal.getReplacementString());
+ int replacementBeginPosition = contentAssistRequest.getReplacementBeginPosition();
+ int replacementLength = contentAssistRequest.getReplacementLength();
+ int cursorPositionDelta = 0;
+ if(currentValue.startsWith("\"") || currentValue.startsWith("'")) {
+ replacementBeginPosition = replacementBeginPosition +1;
+ replacementLength--;
+ } else {
+ cursorPositionDelta++;
+ replacementStringBuffer.insert(0, "\"");
+ }
+ if((currentValue.endsWith("\"") || currentValue.endsWith("'")) &&
+ strippedValue.length() < currentValue.length() ) {
+ replacementLength--;
+ }
+
+ String replacementString = replacementStringBuffer.toString();
+ int cursorPosition = kbProposal.getPosition() + cursorPositionDelta;
+ AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(kbProposal.autoActivationContentAssistantAfterApplication(), replacementString,
+ replacementBeginPosition, replacementLength, cursorPosition, SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
+ kbProposal.getLabel(), null, kbProposal.getContextInfo(), relevance);
+ contentAssistRequest.addProposal(proposal);
+
+ }
+ }
+ }
+ } catch (KbException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ Collection elProposals = null;
+ if (elQueryString != null) {
+ // Query to request for EL-proposals
+ try {
+ String query = new StringBuffer(KbQuery.TAG_SEPARATOR).append(tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(elQueryString).toString();
+ elProposals = wtpKbConnector.getProposals(query);
+ } catch (KbException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ }
+ if(elProposals != null) {
+ for (Iterator iter = elProposals.iterator(); iter.hasNext();) {
+ KbProposal kbProposal = cleanFaceletProposal((KbProposal)iter.next());
+ kbProposal.postProcess("\"" + elQueryString, offset - delta);
+ if (!kbProposal.getReplacementString().startsWith("#{"))
+ continue; // Process the only EL-proposals here!!!
+ 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() + delta;
+ 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((currentValue.length() > StringUtils.strip(currentValue).length()) &&
+ (currentValue.endsWith("\"") || currentValue.endsWith("'")) ) {
+ String restOfCurrentValue = currentValue.substring(matchString.length());
+
+ if(getELEndPosition(matchString, currentValue) == -1) {
+ replacementString += "}";
+ }
+ } else {
+ if(elStartPosition == -1 && !currentValue.endsWith("}")) {
+ replacementString += "}";
+ }
+ // replacementString += ("\"");
+ }
+ 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) + "}" ;
+ AutoContentAssistantProposal proposal = new AutoContentAssistantProposal(
+ kbProposal.autoActivationContentAssistantAfterApplication(),
+ replacementString,
+ replacementBeginPosition, replacementLength, cursorPosition,
+ SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE),
+ displayString, null, kbProposal.getContextInfo(), relevance);
+ contentAssistRequest.addProposal(proposal);
+ }
+ }
+ }
+ }
}
private KbProposal cleanFaceletProposal(KbProposal proposal) {
@@ -191,7 +257,7 @@
}
/*
- * Checks if the EL start starting characters are present
+ * Checks if the EL operand starting characters are present
* @return
*/
private int getELStartPosition(String matchString) {
@@ -234,4 +300,78 @@
return '#' == matchString.charAt(offset);
}
+ /*
+ * Checks if the EL operand starting characters are present
+ * @return
+ */
+ private int getELEndPosition(String matchString, String currentValue) {
+ if (matchString == null || matchString.length() == 0 ||
+ currentValue == null || currentValue.length() == 0 ||
+ currentValue.length() < matchString.length())
+ return -1;
+
+ String restOfCurrentValue = currentValue.substring(matchString.length());
+ int offset = -1;
+
+ char inQuotesChar = 0;
+ while (++offset < restOfCurrentValue.length()) {
+ if (inQuotesChar == 0) {
+ if ('}' == restOfCurrentValue.charAt(offset))
+ return matchString.length() + offset;
+
+ if ('#' == restOfCurrentValue.charAt(offset))
+ return -1;
+
+ if ('"' == restOfCurrentValue.charAt(offset) ||
+ '\'' == restOfCurrentValue.charAt(offset)) {
+ inQuotesChar = restOfCurrentValue.charAt(offset);
+ }
+
+ if ('\\' == restOfCurrentValue.charAt(offset)) {
+ int backslashCount = 1;
+
+ while ((offset + backslashCount) < restOfCurrentValue.length() &&
+ restOfCurrentValue.charAt(offset + backslashCount) == '\\') {
+ backslashCount++;
+ }
+
+ if (offset + backslashCount >= restOfCurrentValue.length())
+ return -1;
+
+ if (backslashCount % 2 == 1 &&
+ ('"' == restOfCurrentValue.charAt(offset + backslashCount) ||
+ '\'' == restOfCurrentValue.charAt(offset + backslashCount))) {
+ inQuotesChar = restOfCurrentValue.charAt(offset + backslashCount);
+ offset += backslashCount;
+ }
+ }
+ } else {
+ if ('"' == restOfCurrentValue.charAt(offset) ||
+ '\'' == restOfCurrentValue.charAt(offset)) {
+ inQuotesChar = 0;
+ }
+
+ if ('\\' == restOfCurrentValue.charAt(offset)) {
+ int backslashCount = 1;
+
+ while ((offset + backslashCount) < restOfCurrentValue.length() &&
+ restOfCurrentValue.charAt(offset + backslashCount) == '\\') {
+ backslashCount++;
+ }
+
+ if (offset + backslashCount >= restOfCurrentValue.length())
+ return -1;
+
+ if (backslashCount % 2 == 1 &&
+ ('"' == restOfCurrentValue.charAt(offset + backslashCount) ||
+ '\'' == restOfCurrentValue.charAt(offset + backslashCount))) {
+ inQuotesChar = 0;
+ offset += backslashCount;
+ }
+ }
+ }
+ }
+ return -1;
+ }
+
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/xpl/JSPBaseContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/xpl/JSPBaseContentAssistProcessor.java 2008-06-30 17:49:16 UTC (rev 9030)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/xpl/JSPBaseContentAssistProcessor.java 2008-06-30 19:08:58 UTC (rev 9031)
@@ -16,6 +16,7 @@
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
+import org.eclipse.wst.sse.core.utils.StringUtils;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
@@ -76,7 +77,7 @@
// offset = contentAssistRequest.getMatchString().length();
// } else {
matchString = currentValue.substring(0, contentAssistRequest.getMatchString().length());
- strippedValue = currentValue;
+ strippedValue = StringUtils.strip(currentValue);
offset = contentAssistRequest.getMatchString().length();
// }
addFaceletAttributeValueProposals(
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 2008-06-30 17:49:16 UTC (rev 9030)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPKbdBeanPropertyResource.java 2008-06-30 19:08:58 UTC (rev 9031)
@@ -202,6 +202,12 @@
if(callEnd != null && callEnd.end >= offset) proposal.setEnd(callEnd.end); else proposal.setEnd(offset);
int pos = proposal.getReplacementString().length();
+ // JBIDE-2437: Because of the issue add EL open/close brackets to the proposal replacement string
+ // This will allow us to separate EL-proposals from all the others.
+ proposal.setReplacementString("#{" + proposal.getReplacementString() + "}");
+ proposal.setLabel("#{" + proposal.getLabel() + "}");
+
+
// JBIDE-2334: JSPAciveContentAssistProcessor (a class which calls this method)
// is to process opening and closing EL charachers
/*
16 years, 6 months
JBoss Tools SVN: r9030 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-30 13:49:16 -0400 (Mon, 30 Jun 2008)
New Revision: 9030
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
Log:
add more info to assert message
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2008-06-30 17:24:59 UTC (rev 9029)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2008-06-30 17:49:16 UTC (rev 9030)
@@ -276,7 +276,7 @@
RenameResourceProcessor processor = new RenameResourceProcessor(resource);
RenameRefactoring refactoring = new RenameRefactoring(processor);
INameUpdating nameUpdateingAdapter = ((INameUpdating)refactoring.getAdapter(INameUpdating.class));
- assertNotNull("Cannot get IUnameUpdating adapter for renaming '" +resource.getFullPath().toString() + "'",nameUpdateingAdapter);
+ assertNotNull("Cannot get INameUpdating adapter for renaming '" +resource.getFullPath().toString() + "'",nameUpdateingAdapter);
nameUpdateingAdapter.setNewElementName(newFolderName);
IReferenceUpdating reference = (IReferenceUpdating)refactoring.getAdapter(IReferenceUpdating.class);
if(reference != null) {
16 years, 6 months
JBoss Tools SVN: r9029 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-06-30 13:24:59 -0400 (Mon, 30 Jun 2008)
New Revision: 9029
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
junit for http://jira.jboss.com/jira/browse/JBIDE-2362
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 2008-06-30 17:21:32 UTC (rev 9028)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-06-30 17:24:59 UTC (rev 9029)
@@ -34,6 +34,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1568Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1718Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2170Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2362Test;
import org.jboss.tools.jsf.vpe.jsf.test.perfomance.PerfomanceTest;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
import org.jboss.tools.vpe.ui.test.beans.ImportBean;
@@ -70,6 +71,7 @@
suite.addTestSuite(JBIDE2297Test.class);
suite.addTestSuite(JsfJbide2170Test.class);
suite.addTestSuite(JBIDE2434Test.class);
+ suite.addTestSuite(JsfJbide2362Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
16 years, 6 months
JBoss Tools SVN: r9027 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-06-30 13:18:34 -0400 (Mon, 30 Jun 2008)
New Revision: 9027
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java
Log:
junit for http://jira.jboss.com/jira/browse/JBIDE-2362
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java 2008-06-30 17:18:34 UTC (rev 9027)
@@ -0,0 +1,302 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.jboss.tools.vpe.editor.util.SelectionUtil;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Node;
+
+/**
+ *
+ * @author sdzmitrovich
+ *
+ * test for http://jira.jboss.com/jira/browse/JBIDE-1718
+ *
+ */
+public class JsfJbide2362Test extends VpeTest {
+
+ public static final String IMPORT_PROJECT_NAME = "jsfTest";
+
+ private static final String SELECTION_PAGE_NAME = "JBIDE/2362/selection.jsp";
+ private static final String EDITING_PAGE_NAME = "JBIDE/2362/editing.jsp";
+ private static final String OUTPUT_TEXT = "outputText";
+ private static final String INSERT_TEXT = "value=\"x\"";
+
+ public JsfJbide2362Test(String name) {
+ super(name);
+ }
+
+ /**
+ * It is simple selection test. We set cursor for each source node ( from
+ * VpeDomMapping). Then we compare visual nodes which was selected and which
+ * was associated with current source node.
+ *
+ * @throws Throwable
+ */
+ public void testSimpleSourceSelection() throws Throwable {
+
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(SELECTION_PAGE_NAME,
+ IMPORT_PROJECT_NAME);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get controller
+ VpeController controller = getVpeController(part);
+ assertNotNull(controller);
+
+ // get dommapping
+ VpeDomMapping domMapping = controller.getDomMapping();
+
+ assertNotNull(domMapping);
+
+ // get source map
+ Map<Node, VpeNodeMapping> sourceMap = domMapping.getSourceMap();
+ assertNotNull(sourceMap);
+
+ // get collection of VpeNodeMapping
+ Collection<VpeNodeMapping> mappings = sourceMap.values();
+ assertNotNull(mappings);
+
+ // get editor control
+ StyledText styledText = part.getSourceEditor().getTextViewer()
+ .getTextWidget();
+ assertNotNull(styledText);
+
+ // get xulrunner editor
+ XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
+ assertNotNull(xulRunnerEditor);
+
+ domMapping.printMapping();
+
+ for (VpeNodeMapping nodeMapping : mappings) {
+
+ /**
+ * exclude out DomDocument ( it is added to mapping specially ) and
+ * nodes without visual representation
+ */
+ if (!(nodeMapping.getSourceNode() instanceof IDOMDocument)
+ && (nodeMapping.getVisualNode() != null)) {
+
+ SelectionUtil.setSourceSelection(controller.getPageContext(),
+ nodeMapping.getSourceNode(), 0, 0);
+
+ // TestUtil.delay(50);
+
+ assertNotNull(xulRunnerEditor.getLastSelectedNode());
+ assertEquals(nodeMapping.getVisualNode(), xulRunnerEditor
+ .getLastSelectedNode());
+ }
+ }
+
+ // check exception
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ // /**
+ // * It is simple selection test.
+ // *
+ // * @throws Throwable
+ // */
+ // public void testSimpleVisualSelection() throws Throwable {
+ //
+ // // wait
+ // TestUtil.waitForJobs();
+ // // set exception
+ // setException(null);
+ //
+ // // get test page path
+ // IFile file = (IFile) TestUtil.getComponentPath(SELECTION_PAGE_NAME,
+ // IMPORT_PROJECT_NAME);
+ //
+ // IEditorInput input = new FileEditorInput(file);
+ //
+ // // open and get editor
+ // JSPMultiPageEditor part = openEditor(input);
+ //
+ // // get controller
+ // VpeController controller = getVpeController(part);
+ // assertNotNull(controller);
+ //
+ // // get dommapping
+ // VpeDomMapping domMapping = controller.getDomMapping();
+ //
+ // assertNotNull(domMapping);
+ //
+ // // get source map
+ // Map<nsIDOMNode, VpeNodeMapping> visualMap = domMapping.getVisualMap();
+ // assertNotNull(visualMap);
+ //
+ // // get collection of VpeNodeMapping
+ // Collection<VpeNodeMapping> mappings = visualMap.values();
+ // assertNotNull(mappings);
+ //
+ // // get editor control
+ // StyledText styledText = part.getSourceEditor().getTextViewer()
+ // .getTextWidget();
+ // assertNotNull(styledText);
+ //
+ // // get xulrunner editor
+ // XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
+ // assertNotNull(xulRunnerEditor);
+ //
+ // VpeSelectionController selectionController = controller
+ // .getVisualSelectionController();
+ //
+ // StructuredTextEditor sourceEditor = controller.getSourceEditor();
+ // assertNotNull(sourceEditor);
+ //
+ // IStructuredModel model = NodesManagingUtil
+ // .getStructuredModel(sourceEditor);
+ // assertNotNull(model);
+ //
+ // for (VpeNodeMapping nodeMapping : mappings) {
+ //
+ // selectionController.getSelection(0).collapse(
+ // nodeMapping.getVisualNode(), 0);
+ //
+ // TestUtil.delay(5000);
+ //
+ // Point range = SelectionUtil.getSourceSelection(sourceEditor);
+ //
+ // assertEquals(nodeMapping.getSourceNode(), SelectionUtil
+ // .getSourceNodeByPosition(model, range.x));
+ // }
+ //
+ // // check exception
+ // if (getException() != null) {
+ // throw getException();
+ // }
+ //
+ // }
+
+ /**
+ * It is simple selection test. We set cursor for each source node ( from
+ * VpeDomMapping). Then we compare visual nodes which was selected and which
+ * was associated with current source node.
+ *
+ * @throws Throwable
+ */
+ public void testEditingSourceSelection() throws Throwable {
+
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(EDITING_PAGE_NAME,
+ IMPORT_PROJECT_NAME);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get controller
+ VpeController controller = getVpeController(part);
+ assertNotNull(controller);
+
+ // get dommapping
+ VpeDomMapping domMapping = controller.getDomMapping();
+
+ assertNotNull(domMapping);
+
+ // get source map
+ Map<Node, VpeNodeMapping> sourceMap = domMapping.getSourceMap();
+ assertNotNull(sourceMap);
+
+ // get collection of VpeNodeMapping
+ Collection<VpeNodeMapping> mappings = sourceMap.values();
+ assertNotNull(mappings);
+
+ // get editor control
+ StyledText styledText = part.getSourceEditor().getTextViewer()
+ .getTextWidget();
+ assertNotNull(styledText);
+
+ // get xulrunner editor
+ XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
+ assertNotNull(xulRunnerEditor);
+
+ domMapping.printMapping();
+
+ for (VpeNodeMapping nodeMapping : mappings) {
+
+ /**
+ * exclude out DomDocument ( it is added to mapping specially ) and
+ * nodes without visual representation
+ */
+ if (OUTPUT_TEXT.equals(nodeMapping.getSourceNode().getLocalName())) {
+
+ IDOMElement element = (IDOMElement) nodeMapping.getSourceNode();
+
+ SelectionUtil.setSourceSelection(controller.getPageContext(),
+ element, 0, 0);
+
+ nsIDOMNode firstSelectedNode = xulRunnerEditor
+ .getLastSelectedNode();
+
+ assertEquals(nodeMapping.getVisualNode(), firstSelectedNode);
+
+ int endStart = element.getStartEndOffset() - 1;
+
+ styledText.setCaretOffset(endStart);
+ styledText.insert(" ");
+ TestUtil.delay(50);
+ for (int i = 0; i < INSERT_TEXT.length(); i++) {
+ endStart++;
+ styledText.setCaretOffset(endStart);
+ styledText.insert(String.valueOf(INSERT_TEXT.charAt(i)));
+ TestUtil.delay(50);
+ }
+
+ assertNotNull(xulRunnerEditor.getLastSelectedNode());
+ assertEquals(firstSelectedNode, xulRunnerEditor
+ .getLastSelectedNode());
+ }
+ }
+
+ // check exception
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+}
16 years, 6 months
JBoss Tools SVN: r9026 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE: 2362 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-06-30 13:18:16 -0400 (Mon, 30 Jun 2008)
New Revision: 9026
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2362/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2362/editing.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2362/selection.jsp
Log:
http://jira.jboss.com/jira/browse/JBIDE-2362
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2362/editing.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2362/editing.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2362/editing.jsp 2008-06-30 17:18:16 UTC (rev 9026)
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<html>
+<head>
+</head>
+<body>
+
+<f:view>
+ <h:outputText></h:outputText>
+</f:view>
+</body>
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2362/selection.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2362/selection.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2362/selection.jsp 2008-06-30 17:18:16 UTC (rev 9026)
@@ -0,0 +1,608 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<html>
+<head>
+</head>
+<body>
+
+<f:view>
+ <f:subview id="subview">
+ <h1><h:outputText value="Selection" /></h1>
+
+ <h:form id="selection">
+
+ <h3><h:outputText value="JSF's TAGS" /></h3>
+ <h:commandButton value="commandButton" />
+ </b>
+ <h:commandLink value="commandLink" />
+ </b>
+ <h:dataTable value="data">
+
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Last Name" />
+ </f:facet>
+
+ <h:outputText value="Dupont" />
+
+ <f:facet name="footer">
+ <h:outputText value="footer" />
+ </f:facet>
+
+ </h:column>
+
+ </h:dataTable>
+
+ </b>
+ <h:graphicImage value="/img/image.jpeg" />
+ </b>
+ <h:inputHidden value="inputHidden" />
+ </b>
+ <h:inputSecret value="inputSecret" />
+ </b>
+ <h:inputText value="inputText" />
+ </b>
+ <h:inputTextarea value="inputTextArea" />
+ </b>
+ <h:message for="name" />
+ </b>
+ <h:messages style="color: red" />
+ </b>
+ <h:outputText value="outputFormat" />
+ </b>
+ <h:outputLabel value="outputLabel" />
+ </b>
+ <h:outputLink value="www.exadel.com">
+ outputLink
+ </h:outputLink>
+ </b>
+ <h:outputText value="outputText" />
+ </b>
+ <h:panelGrid columns="2">
+
+ <h:panelGroup>
+ <h:outputText value="1" />
+ <h:outputText value="2" />
+ </h:panelGroup>
+ <h:panelGroup>
+ <h:outputText value="3" />
+ <h:outputText value="4" />
+ </h:panelGroup>
+ </h:panelGrid>
+ </b>
+ <h:selectBooleanCheckbox value="false" />
+ <h:selectManyCheckbox value="someValue">
+ <f:selectItem itemLabel="check1" />
+ <f:selectItems value="someValue" />
+ </h:selectManyCheckbox>
+ <h:selectManyListbox value="someValue">
+ <f:selectItem itemLabel="value1" itemValue="value1" />
+ <f:selectItem itemLabel="value2" itemValue="value2" />
+ </h:selectManyListbox>
+ </b>
+ <h:selectManyMenu value="someValue">
+ <f:selectItem itemLabel="value1" itemValue="value1" />
+ <f:selectItem itemLabel="value2" itemValue="value2" />
+ </h:selectManyMenu>
+ </b>
+ <h:selectOneListbox value="someValue">
+ <f:selectItem itemLabel="value1" itemValue="value1" />
+ <f:selectItem itemLabel="value2" itemValue="value2" />
+ </h:selectOneListbox>
+ </b>
+ <h:selectOneMenu value="someValue">
+ <f:selectItem itemLabel="value2" itemValue="value2" />
+
+ </h:selectOneMenu>
+ <h:selectOneRadio>
+ <f:selectItem itemLabel="value1" />
+ <f:selectItem itemLabel="value2" />
+ </h:selectOneRadio>
+ <f:verbatim>
+ verbatim
+ </f:verbatim>
+ <h3><h:outputText value="RICHFACES TAGS" /></h3>
+ <!-- Virtual earth component -->
+ <rich:virtualEarth>
+ <rich:toolTip>
+ <h:outputText value="This is virtual earth component" />
+ </rich:toolTip>
+ </rich:virtualEarth>
+
+ <!-- Tree component -->
+ <rich:tree style="width:300px">
+ <!-- Tree Nodes component -->
+ <rich:treeNodesAdaptor>
+ <!-- Tree Node component -->
+ <rich:treeNode type="artist">
+ <h:outputText value="Node1" />
+ </rich:treeNode>
+ <rich:treeNode type="album">
+ <h:outputText value="Node2" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ <!-- Recursive TreeNodes component -->
+ <rich:recursiveTreeNodesAdaptor>
+ <rich:treeNode type="song">
+ <h:outputText value="Leaf1" />
+ </rich:treeNode>
+ <rich:treeNode type="song">
+ <h:outputText value="Leaf2" />
+ </rich:treeNode>
+ </rich:recursiveTreeNodesAdaptor>
+ </rich:tree>
+
+ <!-- Separator component -->
+ <rich:separator />
+
+ <!-- Toggle Panel component -->
+ <rich:togglePanel value="#{toggleBean.skinChooserState1}"
+ switchType="client" stateOrder="closed,tip1, tip2,tip3">
+
+ <f:facet name="closed">
+ <!-- Toggle Control component-->
+ <rich:toggleControl>
+ <h:graphicImage id="pic" style="border-width:0"
+ value="/pictures/clickme.gif" />
+ </rich:toggleControl>
+ </f:facet>
+
+ <f:facet name="tip1">
+ <ui:include src="/pages/tipBlock.xhtml">
+ <ui:param name="tip"
+ value="rich:toggleControl might bre located inside of outside
+ of the rich:toogleControl it works for. In case of outside location, the control
+ attribute 'for' should refer to the toggle panel id." />
+ <ui:param name="next" value="tip2" />
+ </ui:include>
+ </f:facet>
+
+ <f:facet name="tip2">
+ <ui:include src="/pages/tipBlock.xhtml">
+ <ui:param name="tip"
+ value="Attribute initialState defines the first state appear
+ when the page is loaded. If this attribute is not specified, the first state
+ mentioned in the attribute stateOrder will be the first" />
+ <ui:param name="previous" value="tip1" />
+ <ui:param name="next" value="tip3" />
+ </ui:include>
+ </f:facet>
+
+ <f:facet name="tip3">
+ <ui:include src="/pages/tipBlock.xhtml">
+ <ui:param name="tip"
+ value="Note that rich:toggleControl similar to
+ h:commandLink for 'server' mode and smilar to a4j:commandLink for 'ajax' mode.
+ Set immediate attribute to true if jsf form has other input field that might
+ cause the validation error. Otherwize, the state switched will not perform" />
+ <ui:param name="previous" value="tip2" />
+ </ui:include>
+ </f:facet>
+ </rich:togglePanel>
+
+ <!-- Tool Bar component -->
+ <rich:toolBar id="bar" height="30">
+ <!-- Tool Bar Group component -->
+ <rich:toolBarGroup>
+ <h:outputText value="Group1.1" />
+ <h:outputText value="Group1.2" />
+ <h:outputText value="Group1.3" />
+ </rich:toolBarGroup>
+ <!-- Tool Bar Group component -->
+ <rich:toolBarGroup>
+ <h:outputText value="Group2.1" />
+ <h:outputText value="Group2.2" />
+ </rich:toolBarGroup>
+ <!-- Tool Bar Group component -->
+ <rich:toolBarGroup location="right">
+ <h:outputText value="Group3.1" />
+ <h:outputText value="Group3.2" />
+ </rich:toolBarGroup>
+ </rich:toolBar>
+
+ <!-- Suggestion Box component -->
+ <h:inputText value="#{suggestionBox.property}" id="text" />
+ <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",["
+ rules="#{suggestionBox.rules}"
+ suggestionAction="#{suggestionBox.autocomplete}" var="result"
+ fetchValue="#{result.text}" rows="#{suggestionBox.intRows}"
+ first="#{suggestionBox.intFirst}" minChars="#{suggestionBox.minchars}"
+ shadowOpacity="#{suggestionBox.shadowOpacity}"
+ border="#{suggestionBox.border}" width="#{suggestionBox.width}"
+ height="#{suggestionBox.height}"
+ shadowDepth="#{suggestionBox.shadowDepth}"
+ cellpadding="#{suggestionBox.cellpadding}">
+ <h:column>
+ <h:outputText value="#{result.text}" />
+ </h:column>
+ </rich:suggestionbox>
+
+ <!-- Tab panel component -->
+ <rich:tabPanel>
+ <!-- Tab component -->
+ <rich:tab label="First">
+ Here is tab #1
+ </rich:tab>
+ <rich:tab label="Second">
+ Here is tab #2
+ </rich:tab>
+ <rich:tab label="Third">
+ Here is tab #3
+ </rich:tab>
+ </rich:tabPanel>
+
+ <!-- Spacer component -->
+ <rich:spacer width="720" height="10" />
+
+ <!-- Simple Toggle Panel component -->
+ <rich:simpleTogglePanel switchType="client"
+ label="Test simple toggle panel">
+ This is simple toggle panel
+ </rich:simpleTogglePanel>
+
+ <!-- Scrollable Data Table component -->
+ <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1"
+ height="200px" width="700px" rows="10" columnClasses="col"
+ sortMode="single">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Car" />
+ </f:facet>
+ <h:outputText value="Car1" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Model" />
+ </f:facet>
+ <h:outputText value="Model1" />
+ </rich:column>
+ </rich:scrollableDataTable>
+
+ <!-- Panel Menu component -->
+ <h:panelGrid columns="2" columnClasses="cols" width="100%">
+ <rich:panelMenu style="width:200px" mode="ajax"
+ iconExpandedGroup="disc" iconCollapsedGroup="disc"
+ iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
+ iconCollapsedTopGroup="chevronDown" iconCollapsedTopPosition="right">
+ <!-- Panel Menu Group component -->
+ <rich:panelMenuGroup label="Group 1">
+ <rich:panelMenuItem label="Item 1.1"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 1.1" />
+ </rich:panelMenuItem>
+ <!-- Panel Menu Item component -->
+ <rich:panelMenuItem label="Item 1.2"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 1.2" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1.3"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 1.3" />
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ <rich:panelMenuGroup label="Group 2">
+ <rich:panelMenuItem label="Item 2.1"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 2.1" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2.2"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 2.2" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2.3"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 2.3" />
+ </rich:panelMenuItem>
+ <rich:panelMenuGroup label="Group 2.4">
+ <rich:panelMenuItem label="Item 2.4.1"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 2.4.1" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2.4.2"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 2.4.2" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2.4.3"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 2.4.3" />
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ <rich:panelMenuItem label="Item 2.5"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 2.5" />
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ <rich:panelMenuGroup label="Group 3">
+ <rich:panelMenuItem label="Item 3.1"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 3.1" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 3.2"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 3.2" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 3.3"
+ action="#{panelMenu.updateCurrent}">
+ <f:param name="current" value="Item 3.3" />
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ </rich:panelMenu>
+ </h:panelGrid>
+
+ <!-- Panel component -->
+ <rich:panel>
+ <f:facet name="header">
+ This rich panel component
+ </f:facet>
+ Test rich panel component
+ </rich:panel>
+
+
+ <!-- Panel bar component -->
+ <rich:panelBar height="50" width="500">
+ <rich:panelBarItem label="Panel bar item 1">
+ Test panel bar item component
+ </rich:panelBarItem>
+ <rich:panelBarItem label="Panel bar item 2">
+ Test panel bar item component
+ </rich:panelBarItem>
+ </rich:panelBar>
+
+ <!-- Paint 2D component -->
+ <rich:paint2D id="painter" width="300" height="120" data="#{paintData}"
+ format="png" paint="#{paintBean.paint}" />
+ <rich:spacer width="720" height="10" />
+
+ <!-- Calendar -->
+ <rich:calendar />
+
+ <!-- Data Grid -->
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Car Store"></h:outputText>
+ </f:facet>
+ <h:form>
+ <rich:dataGrid columns="2" elements="12">
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Car"></h:outputText>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Price:"></h:outputText>
+ <h:outputText value="30000" />
+ <h:outputText value="Mileage:"></h:outputText>
+ <h:outputText value="345345345" />
+ <h:outputText value="VIN:"></h:outputText>
+ <h:outputText value="HKFFGHGKHJKLJ" />
+ <h:outputText value="Stock:"></h:outputText>
+ <h:outputText value="GHKFGH" />
+ </h:panelGrid>
+ </rich:panel>
+ </rich:dataGrid>
+ </h:form>
+ </rich:panel>
+
+ <!-- DataDefenitionList -->
+ <rich:dataDefinitionList rows="5">
+ <h:outputText value="testDefinitionList" />
+ </rich:dataDefinitionList>
+
+ <!-- Data Filter Slider -->
+ <rich:dataFilterSlider startRange="1" endRange="1000" increment="100"
+ trailer="true" />
+
+ <!-- Data List -->
+ <rich:dataList rows="5">
+ <h:outputText value="testList" />
+ </rich:dataList>
+
+ <!-- Data Ordered List -->
+ <rich:dataOrderedList rows="5">
+ <h:outputText value="testOrderedList" />
+ </rich:dataOrderedList>
+
+ <!-- Data Table -->
+ <rich:dataTable onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
+ onRowMouseOut="this.style.backgroundColor='#F2F2F2'" cellpadding="0"
+ cellspacing="0" width="700" border="0" value="table">
+
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column rowspan="2">
+ <rich:spacer />
+ </rich:column>
+ <rich:column colspan="3">
+ <h:outputText value="Expenses" />
+ </rich:column>
+ <rich:column rowspan="2">
+ <h:outputText value="subtotals" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="Meals" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Hotels" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Transport" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+ <rich:column colspan="5">
+ <h:outputText value="Minsk" />
+ </rich:column>
+
+ <rich:subTable onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
+ onRowMouseOut="this.style.backgroundColor='F9F9F9'" value="SubTable">
+ <rich:column>
+ <h:outputText value="25-Aug-97"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="30"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="30"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="100"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="20"></h:outputText>
+ </rich:column>
+ </rich:subTable>
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column><h:outputText value="Totals"></h:outputText></rich:column>
+ <rich:column>
+ <h:outputText value="30"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="50"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="10"></h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="20"></h:outputText>
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+ </rich:dataTable>
+
+ <!-- Data Scroller -->
+ <rich:datascroller>
+ </rich:datascroller>
+
+ <!-- Drag and Drop -->
+ <rich:dragIndicator id="indicator" />
+ <h:form id="form">
+ <h:panelGrid columnClasses="panelc" columns="4" width="100%">
+ <rich:panel style="width:100px">
+ <f:facet name="header">
+ <h:outputText value="Source List" />
+ </f:facet>
+ <h:dataTable id="src" columns="1" value="#{dndBean.frameworks}"
+ var="fm">
+ <h:column>
+ <a4j:outputPanel style="border:1px solid gray;padding:2px;"
+ layout="block">
+ <rich:dragSupport dragIndicator=":indicator"
+ dragType="#{fm.family}" dragValue="#{fm}">
+ <rich:dndParam name="label" value="#{fm.name}" />
+ </rich:dragSupport>
+ <h:outputText value="Test"></h:outputText>
+ </a4j:outputPanel>
+ </h:column>
+ </h:dataTable>
+ </rich:panel>
+ <rich:panel styleClass="dropTargetPanel">
+ <f:facet name="header">
+ <h:outputText value="PHP Frameworks" />
+ </f:facet>
+ <rich:dropSupport id="php" acceptedTypes="PHP" dropValue="PHP"
+ dropListener="#{eventBean.processDrop}" reRender="phptable, src">
+ </rich:dropSupport>
+ <h:dataTable id="phptable" columns="1"
+ value="#{dndBean.containerPHP}" var="fm">
+ <h:column>
+ <h:outputText value="Test"></h:outputText>
+ </h:column>
+ </h:dataTable>
+ </rich:panel>
+ <rich:panel styleClass="dropTargetPanel">
+ <f:facet name="header">
+ <h:outputText value=".NET Frameworks" />
+ </f:facet>
+ <rich:dropSupport id="dnet" acceptedTypes="DNET" dropValue="DNET"
+ dropListener="#{eventBean.processDrop}" reRender="dnettable, src">
+ </rich:dropSupport>
+ <h:dataTable id="dnettable" columns="1"
+ value="#{dndBean.containerDNET}" var="fm">
+ <h:column>
+ <h:outputText value="Test"></h:outputText>
+ </h:column>
+ </h:dataTable>
+ </rich:panel>
+ <rich:panel styleClass="dropTargetPanel">
+ <f:facet name="header">
+ <h:outputText value="ColdFusion Frameworks" />
+ </f:facet>
+ <rich:dropSupport id="cf" acceptedTypes="CF" dropValue="CF"
+ dropListener="#{eventBean.processDrop}" reRender="cftable, src">
+ </rich:dropSupport>
+ <h:dataTable id="cftable" columns="1" value="#{dndBean.containerCF}"
+ var="fm">
+ <h:column>
+ <h:outputText value="Test"></h:outputText>
+ </h:column>
+ </h:dataTable>
+ </rich:panel>
+ </h:panelGrid>
+ <a4j:commandButton action="#{dndBean.reset}" value="Start Over"
+ reRender="src,phptable,cftable,dnettable" />
+ </h:form>
+
+ <!-- Effect -->
+ <rich:panel id="fadebox" styleClass="box">
+ <f:facet name="header">Fade Effect</f:facet>
+ <rich:effect event="onclick" type="Fade" />
+ <rich:effect event="onclick" for="fadebox" type="Appear"
+ params="delay:3.0,duration:0.5" />
+ <h:outputText value="Click to Activate" />
+ </rich:panel>
+
+ <!-- Google map -->
+ <rich:gmap>
+ </rich:gmap>
+
+ <!-- Input Number Slider -->
+ <rich:inputNumberSlider maxValue="50">
+ </rich:inputNumberSlider>
+
+ <!-- Input Number Spinner -->
+ <rich:inputNumberSpinner minValue="1" maxValue="50">
+ </rich:inputNumberSpinner>
+
+ <!-- Insert -->
+ <rich:insert></rich:insert>
+
+ <!-- Drop Down Menu,Menu Group, Menu Item, Menu Separator -->
+ <rich:dropDownMenu value="File">
+ <rich:menuItem submitMode="ajax" value="New">
+ </rich:menuItem>
+ <rich:menuItem submitMode="ajax" value="Open" />
+ <rich:menuGroup value="Save As...">
+ <rich:menuItem submitMode="ajax" value="Text File" />
+ <rich:menuItem submitMode="ajax" value="PDF File" />
+ </rich:menuGroup>
+ <rich:menuItem submitMode="ajax" value="Close" />
+ <rich:menuSeparator id="menuSeparator11" />
+ <rich:menuItem submitMode="ajax" value="Exit" />
+ </rich:dropDownMenu>
+
+ <!-- Message -->
+ <rich:message>
+ </rich:message>
+
+ <!-- Messages -->
+ <rich:messages>
+ </rich:messages>
+
+ <!-- Modal Panel -->
+ <rich:modalPanel id="mp" minHeight="200" minWidth="450" height="200"
+ width="500" zindex="2000">
+ <f:facet name="header">
+ <h:outputText value="Modal Panel Title" />
+ </f:facet>
+ </rich:modalPanel>
+
+ <!-- componentControl -->
+ <rich:componentControl for="mp" attachTo="link" operation="show" event="onclick"/>
+
+ </h:form>
+ </f:subview>
+</f:view>
+</body>
+</html>
\ No newline at end of file
16 years, 6 months
JBoss Tools SVN: r9025 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-06-30 13:17:55 -0400 (Mon, 30 Jun 2008)
New Revision: 9025
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2362
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java 2008-06-30 16:07:30 UTC (rev 9024)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeDomMapping.java 2008-06-30 17:17:55 UTC (rev 9025)
@@ -325,4 +325,8 @@
public Map<nsIDOMNode, VpeNodeMapping> getVisualMap() {
return visualMap;
}
+
+ public Map<Node, VpeNodeMapping> getSourceMap() {
+ return sourceMap;
+ }
}
16 years, 6 months