Subversion Repositories SmartDukaan

Rev

Rev 1961 | Rev 2427 | 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.Window;
9
import com.google.gwt.user.client.ui.Anchor;
10
import com.google.gwt.user.client.ui.Composite;
11
import com.google.gwt.user.client.ui.HTML;
12
import com.google.gwt.user.client.ui.Widget;
13
 
14
/**
15
 * The top panel, which contains the 'welcome' message and various links.
16
 */
17
public class TopPanel extends Composite {
18
 
19
  interface Binder extends UiBinder<Widget, TopPanel> { }
20
  private static final Binder binder = GWT.create(Binder.class);
21
 
22
  @UiField Anchor signOutLink;
23
  @UiField Anchor aboutLink;
24
  @UiField HTML greetingLabel;
25
 
26
  public TopPanel() {
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("Catalog Dashboard.\nYou can edit the item details here.");
37
    dlg.show();
38
    dlg.center();
39
  }
40
 
41
  public void changeGreeting(String greeting){
42
	  greetingLabel.setText("Aloha! "+ greeting);
43
  }
44
 
45
  public Anchor getSignOutLink(){
46
	  return signOutLink;
47
  }
48
}