[jbosstools-issues] [JBoss JIRA] (JBIDE-14735) Improve text formatting when dropping widgets from Palette view

Alexey Kazakov (JIRA) jira-events at lists.jboss.org
Fri Jun 21 19:09:20 EDT 2013


    [ https://issues.jboss.org/browse/JBIDE-14735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783762#comment-12783762 ] 

Alexey Kazakov commented on JBIDE-14735:
----------------------------------------

It's much better now. But I still see a couple of issues.
It works perfect when you drop a snippet to an empty line. But a new line is inserted if you drop the snippet to a not-empty line.
Suppose we have the following code:
{code}
<div data-role="content">
	<p>Page content goes here.</p>

</div>
{code}
And we drop a button to the empty line right after <p>Page content goes here.</p>
So we get:
{code}
<div data-role="content">
	<p>Page content goes here.</p>
	<a href="" id="button-1" data-role="button">Link button</a>
	
</div>
{code}
It's good.

But if we have something like this:
{code}
<td></td>
{code}
And drop a button between <td> and </td> then we get:
{code}
<td>
	<a href="" id="button-2" data-role="button">Link button</a>
	</td>
{code}
This is not correct. We should not format the text if we insert an one-line snippet into a not-empty line.
We still should format the text if we insert a multi-line snippet into a not-empty line but we don't do it correctly now. See the following example if we drop a group of buttons between <td> and </td>:
{code}
<td>
	<div data-role="controlgroup" id="buttons-1">
		<a href="#" data-role="button">A</a>
		<a href="#" data-role="button">B</a>
		<a href="#" data-role="button">C</a>
	</div>
	</td>
{code}
Should be
{code}
<td>
	<div data-role="controlgroup" id="buttons-1">
		<a href="#" data-role="button">A</a>
		<a href="#" data-role="button">B</a>
		<a href="#" data-role="button">C</a>
	</div>
</td>
{code}
instead.
                
> Improve text formatting when dropping widgets from Palette view
> ---------------------------------------------------------------
>
>                 Key: JBIDE-14735
>                 URL: https://issues.jboss.org/browse/JBIDE-14735
>             Project: Tools (JBoss Tools)
>          Issue Type: Enhancement
>          Components: jsp/jsf/xml/html source editing
>            Reporter: Alexey Kazakov
>            Assignee: Victor Rubezhny
>              Labels: new_and_noteworthy
>             Fix For: 4.2.x
>
>
> 1. Suppose we have the following code:
> {code}
> <div data-role="page" id="page-1">
>   <div data-role="content">|
>   </div>
> </div>
> {code}
> | marks the cursor position.
> 2. Press Enter right after <div data-role="content">:
> {code}
> <div data-role="page" id="page-1">
>   <div data-role="content">
>   |
>   </div>
> </div>
> {code}
> 3. Then click on *button* widget in jQuery Mobile Palette. Click on OK.
> The following code is generated:
> {code}
> <div data-role="page" id="page-1">
>   <div data-role="content">
>   <a href="" id="button-1" data-role="button">Link button</a>
>   
>   </div>
> </div>
> {code}
> But it should be
> {code}
> <div data-role="page" id="page-1">
>   <div data-role="content">
>     <a href="" id="button-1" data-role="button">Link button</a>
>   
>   </div>
> </div>
> {code}
> instead.
> Also we probably should use the preferences/settings of the editor to insert space symbols (N spaces/tab) instead of hardcoded "  ".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list