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