GWT与webdesign agency的工作流程

GWT与webdesign agency的工作流程,gwt,Gwt,与Web设计机构一起创建GWT Web应用程序的最佳方式是什么 我猜网站设计机构会给马一个静态html文件+css文件。我应该如何将它与GWT集成?我应该使用Button,….的.wrap()方法吗?还是有更好的办法 谢谢我认为第一部分是确定页面的哪些部分是静态的,哪些部分需要GWT 您将把它们的图像放在一个或多个文件中(它允许您在一个HTTP请求中获取所有图像) 您将把CSS放在一个文件夹中 顺便说一句,你也可以给他们一个链接,让他们知道你可以轻松地做什么 然后,如果他们给你一些静态文件,集成

与Web设计机构一起创建GWT Web应用程序的最佳方式是什么

我猜网站设计机构会给马一个静态html文件+css文件。我应该如何将它与GWT集成?我应该使用Button,….的.wrap()方法吗?还是有更好的办法


谢谢

我认为第一部分是确定页面的哪些部分是静态的,哪些部分需要GWT

您将把它们的图像放在一个或多个文件中(它允许您在一个HTTP请求中获取所有图像)

您将把CSS放在一个文件夹中

顺便说一句,你也可以给他们一个链接,让他们知道你可以轻松地做什么

然后,如果他们给你一些静态文件,集成它的更简单方法是使用有用的
标记,它允许你在GWT应用程序中放入纯HTML

例如,如果您的机构向您提供带有文本和按钮的HTML代码:

<div><input type="button"/></div>

您可以将其集成到uiBinder中,如下所示:

MyComponent.ui.xml

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
  <g:HTMLPanel>
    <!-- replace <input type="button"> with the corresponding GWT component -->
    <div><g:Button ui:field="myButton"/></div>
  </g:HTMLPanel>
</ui:UiBinder>
public class MyComponent extends Composite{

  public interface MyUiBinder extends UiBinder<HTMLPanel, MyComponent>{}

  //This allows you to get the button and work with it
  @UiField
  Button myButton;

  public MyComponent(){
    //use the .ui.xml file to get the HTMLPanel
    MyUiBinder uiBinder=GWT.create(MyUiBinder.class);
    HTMLPanel panel = uiBinder.createAndBindUi(this);
    this.initWidget(panel);
  }

  //GWT sees the @UiHandler anotation and automatically adds a handler on "myButton".
  @UiHandler("myButton")
  public void onClickEvent(ClickEvent event){
  }
}

MyComponent.java

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
  <g:HTMLPanel>
    <!-- replace <input type="button"> with the corresponding GWT component -->
    <div><g:Button ui:field="myButton"/></div>
  </g:HTMLPanel>
</ui:UiBinder>
public class MyComponent extends Composite{

  public interface MyUiBinder extends UiBinder<HTMLPanel, MyComponent>{}

  //This allows you to get the button and work with it
  @UiField
  Button myButton;

  public MyComponent(){
    //use the .ui.xml file to get the HTMLPanel
    MyUiBinder uiBinder=GWT.create(MyUiBinder.class);
    HTMLPanel panel = uiBinder.createAndBindUi(this);
    this.initWidget(panel);
  }

  //GWT sees the @UiHandler anotation and automatically adds a handler on "myButton".
  @UiHandler("myButton")
  public void onClickEvent(ClickEvent event){
  }
}
公共类MyComponent扩展了复合类{
公共接口MyUiBinder扩展了UiBinder{}
//这允许您获取按钮并使用它
@尤菲尔德
按钮myButton;
公共MyComponent(){
//使用.ui.xml文件获取HTMLPanel
MyUiBinder=GWT.create(MyUiBinder.class);
HTMLPanel=uiBinder.createAndBindUi(这个);
这个.initWidget(面板);
}
//GWT看到@UiHandler操作并自动在“myButton”上添加一个处理程序。
@UiHandler(“myButton”)
public void onClickEvent(单击事件){
}
}

希望有帮助。

这个答案很好。您需要确定您的项目是否复杂到需要GWT。GWT适用于需要客户机/服务器通信的web应用程序。如果你只想拥有一个具有UI功能的漂亮网站,你可以使用像.Hi这样的框架,谢谢你的回答。您如何看待这种技术:?本文中描述的技术(将整个HTML放在一个大字符串中)非常古老。这篇文章说,
“GWT正在研究一种解决这一问题的方法,该方法可能包含在1.6版本中”
。GWT的当前版本是
2.5.1
。uiBinder是一种更好的技术,它允许一个好的IDE(例如IntelliJ)为您提供自动完成功能。我想我的网站设计机构会给我一个.html和一个.css文件来进行设计。然后我需要将.html文件重写为uibinder.xml文件,对吗?