litesoft
@ 948
litesoft / trunk / GWT_Sandbox / FormEngine / src / com / temp / client / foundation / widget / PageTitle.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
package com.temp.client.foundation.widget; import com.google.gwt.event.dom.client.*; import com.temp.client.foundation.pavment.*; import com.temp.client.foundation.util.*; public class PageTitle extends AbstractHorizontalLabeledPageWidget { private static final String PAGE_TITLE_STYLE_NAME = "title-bar"; private static final String TITLE_STYLE_NAME = "title-bar-text"; private Refreshable refreshable; private NamedImageButton refresh = new NamedImageButton( "littleRefresh", new ClickHandler() { @Override public void onClick( ClickEvent event ) { if ( refreshable != null ) { refreshable.refresh(); } } } ); public PageTitle() { super( PAGE_TITLE_STYLE_NAME, TITLE_STYLE_NAME ); horizontalPanel.add( titleLabel ); horizontalPanel.add( new LeftRightSiblings() ); horizontalPanel.add( refresh ); UtilsGwt.hide( refresh ); refresh.setTitle( "Refresh" ); } public Refreshable getRefreshable() { return refreshable; } public void setRefreshable( Refreshable refreshable ) { this.refreshable = refreshable; UtilsGwt.setHidden( refresh, (refreshable == null) ); } @Override public void setId( String id ) { super.setId( id ); refresh.getElement().setId( id + "Refresh" ); } } |