Subversion Repositories SmartDukaan

Rev

Rev 2313 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
306 ashish 1
package in.shop2020.hotspot.dashbaord.client.inbox;
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
/**
14
 * The top panel, which contains the 'welcome' message and various links.
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);
4397 rajveer 20
  @UiField Anchor alertsCountLink;
306 ashish 21
  @UiField Anchor signOutLink;
22
  @UiField Anchor aboutLink;
23
  @UiField HTML greetingLabel;
24
 
25
  public TopPanel() {
26
 
27
    initWidget(binder.createAndBindUi(this));
28
  }
29
 
30
  @UiHandler("aboutLink")
31
  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();
36
    dlg.setText("Hotspot Order life cycle dashboard built by Shop2020");
37
    dlg.show();
38
    dlg.center();
39
  }
40
 
41
  public void changeGreeting(String greeting){
42
	  greetingLabel.setText("Aloha! "+ greeting);
43
  }
4397 rajveer 44
 
45
  public void updateAlertsCount(long count){
46
	  alertsCountLink.setText("Alerts: " + count);
47
  }
306 ashish 48
 
4397 rajveer 49
  public Anchor getAlertsCountLink(){
50
	  return alertsCountLink;
51
  }
52
 
306 ashish 53
  public Anchor getSignOutLink(){
54
	  return signOutLink;
55
  }
56
}