Sunday, September 20, 2015

Re: ANTLR GWT

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<WINDOW active="false" autoHide="false" blinkModal="false" closable="true" constrain="true" maximizable="false" minHeight="100" minWidth="200" minimizable="false" modal="false" onEsc="true" resizable="true" animCollapse="true" animationDuration="500" bodyBorder="false" collapsible="false" expanded="true" headerVisible="true" headingText="Logowanie" hideCollapseTool="false" minButtonWidth="0" titleCollapse="false" enabled="true" height="100" shadow="true" visible="true" width="200">
<VERTICALLAYOUTCONTAINER adjustForScroll="false" enabled="true" height="0" shadow="false" visible="true" width="0">
<ITEM xsi:type="gxtFieldLabel" labelAlign="LEFT" labelPad="0" labelWidth="30" text="Login" enabled="true" height="0" shadow="false" visible="true" width="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<TEXTFIELD allowBlank="false" readOnly="false" selectOnFocus="false" enabled="true" height="0" shadow="false" visible="true" width="0"/>
</ITEM>
<ITEM xsi:type="gxtFieldLabel" labelAlign="LEFT" labelPad="0" labelWidth="30" text="Hasło" enabled="true" height="0" shadow="false" visible="true" width="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PASSWORDFIELD allowBlank="false" readOnly="false" selectOnFocus="false" enabled="true" height="0" shadow="false" visible="true" width="0"/>
</ITEM>
</VERTICALLAYOUTCONTAINER>
<ADDBUTTON>
<TEXTBUTTON text="Zaloguj" enabled="true" height="0" shadow="false" visible="true" width="0"/>
</ADDBUTTON>
</WINDOW>

W dniu 18.09.2015 o 19:57, Jens pisze:

With JavaCC you get code that is not dependant on any JAR and I think that I've seen that JavaCC can generate javascript code.

Yes, starting with JavaCC 6.1 you can use the "modern" mode to generate Java that can be translated to JavaScript via GWT.

A tutorial + Demo project can be found here:


Hello,
Thank you for the information about the JavaCC. I want to write a parser that Help me generate a GUI GWT.

I have a code which I generate a GUI and XML:


TextFieldModel loginFieldModel = new TextFieldModel();
        PasswordFieldModel passFieldModel = new PasswordFieldModel();

        FieldLabelModel labelLogin = new FieldLabelModel();
        labelLogin.setLabelAlign(LabelAlignModel.LEFT);
        labelLogin.setText("Login");
        labelLogin.setLabelWidth(30);
        labelLogin.setWidget(loginFieldModel);

        FieldLabelModel labelpass = new FieldLabelModel();
        labelpass.setLabelAlign(LabelAlignModel.LEFT);
        labelpass.setText("Hasło");
        labelpass.setLabelWidth(30);
        labelpass.setWidget(passFieldModel);

        VerticalLayoutDataModel vLayoutDataModel = new VerticalLayoutDataModel();
        vLayoutDataModel.setWidth(1);

        VerticalLayoutContainerModel vLayoutContainerModel = new VerticalLayoutContainerModel();
        vLayoutContainerModel.add(labelLogin);
        vLayoutContainerModel.add(labelpass);

        TextButtonModel loginButton = new TextButtonModel();
        loginButton.setText("Zaloguj");

        WindowModel windowModel = new WindowModel();
        windowModel.setHeaderVisible(true);
        windowModel.setHeadingText("Logowanie");
        windowModel.setWidget(vLayoutContainerModel);
        windowModel.addButton(loginButton);
        windowModel.show();

This code can generate such a window as in the enclosure with XML.

Do you use JavaCC to build a parser for XML is such a good move?

Regards

No comments:

Post a Comment