[jbosstools-dev] VPE editor

Denis Golovin dgolovin at exadel.com
Wed Mar 12 19:55:16 EDT 2008


I agree with lazy Visual Editor update idea, it should be implemented 
some way, for example Swing also does it for painting swing Components. 
It looks like now all events are processed in the same thread, where 
they were fired.

I have one more idea about VPE layout. I have crazy idea about getting 
rid of tabs at all. We have a Source/Visual part that have a split lets 
just have button that can hide source part or visual it almost the same 
like having source and visual tabs. You'll say, but we have preview tab. 
Why we cannot just let user switch visual part from edit mode to preview 
mode.

This way it could be any combination of source/visual editing/preview.

All actions to control the editor can be placed to Editor Related 
toolbar it will contains:
1. Preview Mode toggle button with two states (preview/visual editing);
2. Show Source with two states (source visible/source invisible)
3. Show Visual (visual visible/visual invisible)
4. Enabling/disabling formatting toolbar
5. Refresh
7. Synchronize
4. Preferences

So the case for those people who dont like wisaul editor at all will simple:
    1. Open editor first
    2. Unset Show Visual
    3.  Editor becomes just source editor
For visual editing only hide source
For editing with preview switch preview mode
For asynchronous preview set Synchronize


So if we are generating ides about VPE, I also have some after playing with

http://jira.jboss.com/jira/browse/JBIDE-1304,
http://jira.jboss.com/jira/browse/JBIDE-1600,
http://jira.jboss.com/jira/browse/JBIDE-1227

I just have finished DocBook preview, it is preview because there are 
actually some issues in VPE that doesn't allow me to say it is editor. 
Short comment how to use it can be found here 
http://jira.jboss.com/jira/browse/JBIDE-1304#action_12402618 with 
several screen-shots.

What I did:
1. I created plug-in with VPE template (see attachment for 
http://jira.jboss.com/jira/browse/JBIDE-1304) that is just a simple 
template that cover only DocBook tags I found in
https://svn.jboss.org/repos/jbosstools/trunk/documentation/development/usecases/en/modules/seam.xml
and
https://svn.jboss.org/repos/jbosstools/trunk/documentation/guides/Legacy-jsf-struts/en/modules/jsf_application.xml
2. Then I tried to make Visual Editor available in open with menu for 
XML files, but there is a simple way to handle it by menu Open 
With/Other... .
3. Start JBossTools with attached plug-in
4. Checkout Documentation plug-in from SVN
5. Open separate module mentioned above and see how it looks like.

During my quest I realized there are several problems with  VPE:
1. It always handle tags without prefixes as HTML tags
2. all tags without prefix is stored in same hash map in 
VpeTemplateManager and there is no way separate templates for html tags 
from docbook tags. That means I can use html tags in DocBook XML and it 
will work fine and vice versa.
3. It doesn't shows attributes for xml tags because some exceptions
4. There is no way to process <![CDATA[]> blocks

What would be nice to have:
1. There is dialog with settings for unknown tags, it would be nice not 
only setup predefined parameters but do something meaningful: show 
unknown tag as known html tag
2. It wold be nice to say VPE use this template from eclipse workspace 
or local  file  system  or even load all templates from defined location 
(related to http://jira.jboss.com/jira/browse/JBIDE-1600)
3. VPE should provide the way to change default template for unknown tags.
4. VPE should allow points to location where to save templates created 
by Template Dialog mentioned above.
5. Combination of points 1 and 4 is a fast way to create simple 
templates as I did for DocBook.

Regards
Denis

Snjezana Peco wrote:
> Hi,
>
> I have two suggestions for improving performance in the VPE editor:
>
> - lazy Visual Editor update
> The Visual editor is updated on every keystroke. I propose to postpone 
> the update for some time. This means - if a user enters a few keys 
> quickly, the Visual editor will be updated only once. There is the 
> org.eclipse.wst.sse.ui.sourcevalidation extenison point within the 
> Webtools project that can be used for adding this feature. It is also 
> possible to implement this feature using the code I added when fixing 
> http://jira.jboss.com/jira/browse/JBIDE-1479 (we could use 400 ms 
> during editing; this is the default value for the sourcevalidation 
> extenison point).
>
> - adding the Link (Synchronize) action to the Visual editor next to 
> the Preferences, Refresh, Page Design Options actions.
> This action would be a check box similar to the "Link with editor" in 
> the Package Explorer view. It would be checked/enabled by default. In 
> that case, the VPE would behave as it does now. If the user disables 
> the action, the VPE wouldn't be updated (VpeController.notifyChanged() 
> wouldn't be called). This would be very useful when editing large JSP 
> files. The user could always call Refresh (or check Link) to show the 
> visual part of the editor.
>
> These features are easy to implement and don't require a lot of 
> changes in the code.
>
> Snjeza
>
>
>
>
>
>
> _______________________________________________
> jbosstools-dev mailing list
> jbosstools-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosstools-dev




More information about the jbosstools-dev mailing list