如何在gwt中使gmail搜索框类似ui(How to make gmail search box similar ui in gwt)

编程入门 行业动态 更新时间:2024-10-27 04:31:59
如何在gwt中使gmail搜索框类似ui(How to make gmail search box similar ui in gwt)

我们正在使用GWT创建一个需要像gmail这样的搜索框小部件的应用程序。 我不知道如何以及从哪里开始制作这样的小部件。 基本上我应该用什么小部件/组件来制作带有下拉图标的文本框,如果我点击下拉图标,它会打开一个带有高级搜索的面板,使用gwt.Please帮助

We are making an application using GWT that require a search box widget like gmail has. I dont know how and where to start to make such widget. Basically what widget/component should i use to make a text box with a dropdown icon,where if i click the dropdown icon it opens a panel with advanced search using gwt.Please help

最满意答案

使用UiBinder工具,您可以快速设计您想要的内容:

`

<g:HTMLPanel> <g:VerticalPanel> <g:HorizontalPanel> <g:TextBox/> <g:PushButton text="V" ui:field="pushButton"/> <g:PushButton text="Search"/> </g:HorizontalPanel> <g:VerticalPanel ui:field="optionsPanel"> <g:HorizontalPanel> <g:Label text="Foo"/> <g:TextBox/> </g:HorizontalPanel> <g:HorizontalPanel> <g:Label text="Bar"/> <g:TextBox/> </g:HorizontalPanel> </g:VerticalPanel> </g:VerticalPanel> </g:HTMLPanel>

`

和`package yde.dev.client;

import com.google.gwt.core.client.GWT; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.PushButton; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.event.dom.client.ClickEvent;

公共类SearchLikeGmail扩展Composite {

private static SearchLikeGmailUiBinder uiBinder = GWT .create(SearchLikeGmailUiBinder.class); @UiField VerticalPanel optionsPanel; @UiField PushButton moreOptionsBttn; interface SearchLikeGmailUiBinder extends UiBinder<Widget, SearchLikeGmail> { } public SearchLikeGmail() { initWidget(uiBinder.createAndBindUi(this)); optionsPanel.setVisible( false ); } @UiHandler("moreOptionsBttn") void onMoreOptionsBttnClick(ClickEvent event) { optionsPanel.setVisible( true ); }

}

with UiBinder tool, you can design fastly what you wish :

`

<g:HTMLPanel> <g:VerticalPanel> <g:HorizontalPanel> <g:TextBox/> <g:PushButton text="V" ui:field="pushButton"/> <g:PushButton text="Search"/> </g:HorizontalPanel> <g:VerticalPanel ui:field="optionsPanel"> <g:HorizontalPanel> <g:Label text="Foo"/> <g:TextBox/> </g:HorizontalPanel> <g:HorizontalPanel> <g:Label text="Bar"/> <g:TextBox/> </g:HorizontalPanel> </g:VerticalPanel> </g:VerticalPanel> </g:HTMLPanel>

`

and ` package yde.dev.client;

import com.google.gwt.core.client.GWT; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.PushButton; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.event.dom.client.ClickEvent;

public class SearchLikeGmail extends Composite {

private static SearchLikeGmailUiBinder uiBinder = GWT .create(SearchLikeGmailUiBinder.class); @UiField VerticalPanel optionsPanel; @UiField PushButton moreOptionsBttn; interface SearchLikeGmailUiBinder extends UiBinder<Widget, SearchLikeGmail> { } public SearchLikeGmail() { initWidget(uiBinder.createAndBindUi(this)); optionsPanel.setVisible( false ); } @UiHandler("moreOptionsBttn") void onMoreOptionsBttnClick(ClickEvent event) { optionsPanel.setVisible( true ); }

} `

更多推荐

本文发布于:2023-07-26 18:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1279337.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:类似   如何在   gmail   gwt   similar

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!