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:
Tutorial Part 1:
http://consoliii.blogspot.co.uk/2014/04/creating-gwt-compatible-parser-using.html
Tutorial Part
2: http://consoliii.blogspot.co.uk/2014/04/creating-gwt-compatible-parser-using_15.html
Demo Project: https://github.com/ainsley/javacc_gwt_tutorial
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
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
<?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>