Subversion Repositories SmartDukaan

Rev

Rev 1962 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1961 ankur.sing 1
package in.shop2020.catalog.dashboard.client;
2
 
3
import com.google.gwt.core.client.GWT;
4
import com.google.gwt.event.dom.client.ClickEvent;
5
import com.google.gwt.uibinder.client.UiBinder;
6
import com.google.gwt.uibinder.client.UiField;
7
import com.google.gwt.uibinder.client.UiHandler;
8
import com.google.gwt.user.client.ui.Anchor;
9
import com.google.gwt.user.client.ui.Composite;
10
import com.google.gwt.user.client.ui.HTML;
11
import com.google.gwt.user.client.ui.Widget;
12
 
13
/**
2427 ankur.sing 14
 * Contains logo, welcome message, about and sign out link.
1961 ankur.sing 15
 */
16
public class TopPanel extends Composite {
17
 
18
  interface Binder extends UiBinder<Widget, TopPanel> { }
19
  private static final Binder binder = GWT.create(Binder.class);
20
 
21
  @UiField Anchor signOutLink;
22
  @UiField Anchor aboutLink;
23
  @UiField HTML greetingLabel;
24
 
25
  public TopPanel() {
26
    initWidget(binder.createAndBindUi(this));
27
  }
28
 
29
  @UiHandler("aboutLink")
30
  void onAboutClicked(ClickEvent event) {
31
    StatusDialog dlg = new StatusDialog();
32
    dlg.setText("Catalog Dashboard.\nYou can edit the item details here.");
33
    dlg.show();
34
    dlg.center();
35
  }
36
 
2427 ankur.sing 37
  /**
38
   * Called from CatalogDashboard.java after login authentication is successful.
39
   * @param greeting
40
   */
1961 ankur.sing 41
  public void changeGreeting(String greeting){
2427 ankur.sing 42
	  greetingLabel.setText("Welcome "+ greeting);
1961 ankur.sing 43
  }
44
 
2427 ankur.sing 45
  /**
46
   * Click listener of sign out link is added in CatalogDashboard.initMainDB(String)
47
   * @return
48
   */
1961 ankur.sing 49
  public Anchor getSignOutLink(){
50
	  return signOutLink;
51
  }
52
}