Subversion Repositories SmartDukaan

Rev

Rev 1962 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1962 Rev 2427
Line 3... Line 3...
3
import com.google.gwt.core.client.GWT;
3
import com.google.gwt.core.client.GWT;
4
import com.google.gwt.event.dom.client.ClickEvent;
4
import com.google.gwt.event.dom.client.ClickEvent;
5
import com.google.gwt.uibinder.client.UiBinder;
5
import com.google.gwt.uibinder.client.UiBinder;
6
import com.google.gwt.uibinder.client.UiField;
6
import com.google.gwt.uibinder.client.UiField;
7
import com.google.gwt.uibinder.client.UiHandler;
7
import com.google.gwt.uibinder.client.UiHandler;
8
import com.google.gwt.user.client.Window;
-
 
9
import com.google.gwt.user.client.ui.Anchor;
8
import com.google.gwt.user.client.ui.Anchor;
10
import com.google.gwt.user.client.ui.Composite;
9
import com.google.gwt.user.client.ui.Composite;
11
import com.google.gwt.user.client.ui.HTML;
10
import com.google.gwt.user.client.ui.HTML;
12
import com.google.gwt.user.client.ui.Widget;
11
import com.google.gwt.user.client.ui.Widget;
13
 
12
 
14
/**
13
/**
15
 * The top panel, which contains the 'welcome' message and various links.
14
 * Contains logo, welcome message, about and sign out link.
16
 */
15
 */
17
public class TopPanel extends Composite {
16
public class TopPanel extends Composite {
18
 
17
 
19
  interface Binder extends UiBinder<Widget, TopPanel> { }
18
  interface Binder extends UiBinder<Widget, TopPanel> { }
20
  private static final Binder binder = GWT.create(Binder.class);
19
  private static final Binder binder = GWT.create(Binder.class);
Line 27... Line 26...
27
    initWidget(binder.createAndBindUi(this));
26
    initWidget(binder.createAndBindUi(this));
28
  }
27
  }
29
 
28
 
30
  @UiHandler("aboutLink")
29
  @UiHandler("aboutLink")
31
  void onAboutClicked(ClickEvent event) {
30
  void onAboutClicked(ClickEvent event) {
32
    // When the 'About' item is selected, show the AboutDialog.
-
 
33
    // Note that showing a dialog box does not block -- execution continues
-
 
34
    // normally, and the dialog fires an event when it is closed.
-
 
35
    StatusDialog dlg = new StatusDialog();
31
    StatusDialog dlg = new StatusDialog();
36
    dlg.setText("Catalog Dashboard.\nYou can edit the item details here.");
32
    dlg.setText("Catalog Dashboard.\nYou can edit the item details here.");
37
    dlg.show();
33
    dlg.show();
38
    dlg.center();
34
    dlg.center();
39
  }
35
  }
40
  
36
  
-
 
37
  /**
-
 
38
   * Called from CatalogDashboard.java after login authentication is successful.
-
 
39
   * @param greeting
-
 
40
   */
41
  public void changeGreeting(String greeting){
41
  public void changeGreeting(String greeting){
42
	  greetingLabel.setText("Aloha! "+ greeting);
42
	  greetingLabel.setText("Welcome "+ greeting);
43
  }
43
  }
44
  
44
  
-
 
45
  /**
-
 
46
   * Click listener of sign out link is added in CatalogDashboard.initMainDB(String)
-
 
47
   * @return
-
 
48
   */
45
  public Anchor getSignOutLink(){
49
  public Anchor getSignOutLink(){
46
	  return signOutLink;
50
	  return signOutLink;
47
  }
51
  }
48
}
52
}
49
53