We need to modify the code so that if there is no display view, it should
automatically open the editor in the source view.


On Fri, Dec 13, 2013 at 11:03 AM, Kuo Zhang <notifications@github.com>wrote:

> In
> tools/plugins/com.liferay.ide.layouttpl.ui/src/com/liferay/ide/layouttpl/ui/editor/LayoutTplEditor.java:
>
> > @@ -192,13 +203,16 @@ public boolean isSaveAsAllowed()
> >      public void refreshSourceModel()
> >      {
> >          IDOMModel domModel = getSourceModel();
> > -        domModel.aboutToChangeModel();
> > -        String name = getSourceFileName();
> > -        String templateSource = LayoutTplUtil.getTemplateSource( diagram, name );
> > -        domModel.getStructuredDocument().setText( this, templateSource );
> > -        domModel.changedModel();
> > -        domModel.releaseFromEdit();
> > -        getCommandStack().markSaveLocation();
> > +        if( domModel != null )
>
> Hey, Greg, To avoid the case where the user add some contents to source
> view, then switch to visual view, the visual view still shows like older
> version.My plan is to set the source model null in the layouttpl editor, I
> tried to forbid refreshSourceModel and refreshVisualModel, but some
> exceptions are throwed.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/gamerson/liferay-ide/pull/374/files#r8323252>
> .
>



-- 
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com