[jbosstools-issues] [JBoss JIRA] (JBIDE-11588) Open-on of EL from Visual Page Editor works incorrectly
Viacheslav Kabanovich (JIRA)
jira-events at lists.jboss.org
Thu Apr 19 18:13:18 EDT 2012
Viacheslav Kabanovich created JBIDE-11588:
---------------------------------------------
Summary: Open-on of EL from Visual Page Editor works incorrectly
Key: JBIDE-11588
URL: https://issues.jboss.org/browse/JBIDE-11588
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: Visual Page Editor core
Affects Versions: 3.3.0.Beta2
Reporter: Viacheslav Kabanovich
Assignee: Yahor Radtsevich
Case 1.
EXECUTE: Write <p>#{user.name} works at #{employee.name}</p> in a page, where 'user' is a bean with property 'name'.
EXECUTE: Find this text in Visual editor and double click against 'name' in the second instance of EL.
ASSERT: Source of bean 'employee' is open with method getName() selected.
FAILURE: Source of bean 'user' is open, no method is selected.
Case 2.
EXECUTE: <h:outputLabel value="#{user.name}" /> in a page. (or h:outputText)
EXECUTE: Find this text in Visual editor and double click against 'name'.
ASSERT: Source of bean 'user' is open with method getName() selected.
FAILURE: Source of bean 'user' is open, but no method is selected.
Methods DocbookTextTemplate.getSourceRegionForOpenOn() and AbstractEditableJsfTemplate.getSourceRegionForOpenOn() find position for open-on as TextUtil.getStartELDocumentPosition(sourceNode), which finds first occurence of '#{' and first non-space symbol after it; the exact position of double click is neglected. The two cases above can be fixed by
{code}
Point selection = pageContext.getSourceBuilder().getSelectionRange();
if(selection != null) {
return new Region(selection.x, 0);
}
{code}
inserted in the beginning of these methods, because double click in Visual part selects a word, so that selection in source is correct.
Unfortunately, there are other cases, e.g. <h:inputText value="#{user.name}"/> (or h:commandButton, h:inputTextArea, etc.). In these cases, double click does not select a word, so that source selection will not be correct. Why? Attribute 'value' that is used for rendering these elements is often bound by EL to a bean property. I suggest that selecting/editing text in 'value' in h:inputText (as well as in all similar cases) be implemented as it is in h:outputText.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list