Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/GWT_Sandbox/MultiModule/common/src/org/litesoft/sandbox/infrastructure/client/widgets/HelpWidget.java

Diff revisions: vs.
  @@ -7,10 +7,8 @@
7 7 import com.google.gwt.user.client.*;
8 8 import com.google.gwt.user.client.ui.*;
9 9
10 - public class HelpWidget extends Composite implements IsWidget
11 - {
12 - interface HelpWidgetUIBinder extends UiBinder<Widget, HelpWidget>
13 - {
10 + public class HelpWidget extends Composite implements IsWidget {
11 + interface HelpWidgetUIBinder extends UiBinder<Widget, HelpWidget> {
14 12 }
15 13
16 14 @UiField Image helpImage;
  @@ -20,40 +18,34 @@
20 18
21 19 private static HelpWidgetUIBinder uiBinder = GWT.create( HelpWidgetUIBinder.class );
22 20
23 - public HelpWidget()
24 - {
21 + public HelpWidget() {
25 22 initWidget( uiBinder.createAndBindUi( this ) );
26 23 helpImage.getElement().getStyle().setVisibility( Style.Visibility.HIDDEN );
27 24 }
28 25
29 - public HelpWidget( String section, String context )
30 - {
26 + public HelpWidget( String section, String context ) {
31 27 this();
32 28 setSection( section );
33 29 setContext( context );
34 30 }
35 31
36 - public void setSection( String section )
37 - {
32 + public void setSection( String section ) {
38 33 this.section = (section == null) ? "" : section.trim(); // default trimmed
39 34 }
40 35
41 - public void setContext( String context )
42 - {
36 + public void setContext( String context ) {
43 37 this.context = (context == null) ? "" : context.trim();
44 38 }
45 39
46 40 // <g:Anchor tabIndex='-1' ui:field = 'helpurl' href='' text="?" target='simple EDI - help'/>
47 - @Override protected void onAttach()
48 - {
41 + @Override
42 + protected void onAttach() {
49 43 super.onAttach();
50 - if ( section.length() != 0 )
51 - {
44 + if ( section.length() != 0 ) {
52 45 helpImage.setTitle( "Display Help for: " + section + " " + context );
53 - helpImage.addClickHandler( new ClickHandler()
54 - {
55 - @Override public void onClick( ClickEvent event )
56 - {
46 + helpImage.addClickHandler( new ClickHandler() {
47 + @Override
48 + public void onClick( ClickEvent event ) {
57 49 Window.open( "http://litesoft.org/help/" + section + ".html#" + context, "help", "" );
58 50 }
59 51 } );