protected void beforeAboutForm(Form f) {
super.beforeAboutForm(f);
Toolbar toolBar = new Toolbar();
f.setToolBar(toolBar);
toolBar.setUIID("TitleContainer");
toolBar.setTitle("About");
Command cmdBack = new Command("") {
public void actionPerformed(ActionEvent evt) {
goToPrevForm();
}
};
cmdBack.setIcon(this.getResource().getImage("ic_back.png"));
toolBar.addCommandToLeftBar(cmdBack);
Command cmdHelp = new Command("Help") {
public void actionPerformed(ActionEvent evt) {
faqs();
}
};
//cmdHelp.setIcon(this.getResource().getImage("ic_back.png"));
toolBar.addCommandToRightBar(cmdHelp);
f.revalidate();
}
protected void beforeOziomaForm(Form f) {
super.beforeOziomaForm(f);
ActionListener aListener = new ActionListener(){
public void actionPerformed(ActionEvent ae)
{
Display.getInstance().exitApplication();
}
};
f.addKeyListener(BACK_COMMAND_ID, aListener);
Container con = findConPane(f);
Button btnVersion = findBtnNewVersion(con);
if(!versionOutOfDate)
{
con.removeComponent(btnVersion);
}
homeForm = f;
addHomeToolbar();
//toolBar.getMenuBar().getMenuStyle().setBgColor(255);
f.revalidate();
}
public void addHomeToolbar()
{
Form f = homeForm;
final Toolbar toolBar = new Toolbar();
f.setToolBar(toolBar);
toolBar.setUIID("TitleContainer");
if(this.authenticated)
toolBar.addComponentToSideMenu(this.getUserInfoContainer());
Command cmdUser = new Command(" My Account") {
public void actionPerformed(ActionEvent evt) {
if(isLogin())
showForm("UserAccountForm", null);
}
};
cmdUser.setIcon(this.getResource().getImage("ic_user.png"));
cmdUser.setRolloverIcon(this.getResource().getImage("ic_user_select.png"));
//cmdUser.setPressedIcon(this.getResource().getImage("ic_user_select.png"));
toolBar.addCommandToSideMenu(cmdUser);
/*Command cmdContest = new Command(" Ozi Contest") {
public void actionPerformed(ActionEvent evt) {
}
};
cmdContest.setIcon(this.getResource().getImage("ic_magic.png"));
cmdContest.setRolloverIcon(this.getResource().getImage("ic_magic_select.png"));
toolBar.addCommandToSideMenu(cmdContest);*/
Command cmdNotify = new Command(" Notifications") {
public void actionPerformed(ActionEvent evt) {
if(isLogin())
showForm("NotificationForm", null);
}
};
cmdNotify.setIcon(this.getResource().getImage("ic_notifications.png"));
cmdNotify.setRolloverIcon(this.getResource().getImage("ic_notifications_select.png"));
toolBar.addCommandToSideMenu(cmdNotify);
Command cmdVoucherLocator = new Command(" Voucher Locator") {
public void actionPerformed(ActionEvent evt) {
showForm("VoucherLocatorForm", null);
}
};
cmdVoucherLocator.setIcon(this.getResource().getImage("ic_tack.png"));
cmdVoucherLocator.setRolloverIcon(this.getResource().getImage("ic_tack_select.png"));
toolBar.addCommandToSideMenu(cmdVoucherLocator);
Command cmdSupport = new Command(" Ozi Support") {
public void actionPerformed(ActionEvent evt) {
showForm("OziSupportForm", null);
}
};
cmdSupport.setIcon(this.getResource().getImage("ic_headset.png"));
cmdSupport.setRolloverIcon(this.getResource().getImage("ic_headset_select.png"));
toolBar.addCommandToSideMenu(cmdSupport);
Command cmdSettings = new Command(" Settings") {
public void actionPerformed(ActionEvent evt) {
if(isLogin())
showForm("SettingsForm", null);
}
};
cmdSettings.setIcon(this.getResource().getImage("ic_settings.png"));
cmdSettings.setRolloverIcon(this.getResource().getImage("ic_settings_select.png"));
toolBar.addCommandToSideMenu(cmdSettings);
Command cmdAbout = new Command(" About") {
public void actionPerformed(ActionEvent evt) {
showForm("AboutForm", null);
}
};
cmdAbout.setIcon(this.getResource().getImage("ic_shining.png"));
cmdAbout.setRolloverIcon(this.getResource().getImage("ic_shining_select.png"));
toolBar.addCommandToSideMenu(cmdAbout);
String loginState = this.isAuthenticated() ? " Sign Out":" Sign In";
Command signInOut = new Command(loginState) {
public void actionPerformed(ActionEvent evt) {
if(isLogin())
logout();
if(getCommandName().trim().equals("Sign Out"))
{
setCommandName(" Sign In");
setIcon(getResource().getImage("ic_locked.png"));
setRolloverIcon(getResource().getImage("ic_locked_select.png"));
}
}
};
if(this.isAuthenticated())
{
signInOut.setIcon(this.getResource().getImage("ic_unlocked.png"));
signInOut.setRolloverIcon(this.getResource().getImage("ic_unlocked_select.png"));
}
else
{
signInOut.setIcon(this.getResource().getImage("ic_locked.png"));
signInOut.setRolloverIcon(this.getResource().getImage("ic_locked_select.png"));
}
toolBar.addCommandToSideMenu(signInOut);
Container conTitleArea = new Container();
conTitleArea.setLayout(new BorderLayout());
ShareButton btnShare = new ShareButton();
btnShare.setIcon(this.getResource().getImage("ic_share.png"));
btnShare.setTextToShare("Ozioma brings flexibility to you and wants to be your messaging companion on any platform "
+ "- Web, Mobile, PC, Mac, API, Wordpress, Facebook, Excel etc. For bulk sms, sms template,"
+ "birthday messenger, free sms, sms campaign, ad campaign, sms forwarding, scheduling with recurrences, contact grouping, etc."
+ " Think convenience while messaging, think Ozioma. "
+ "\nDownload link: http://ozioma.net");
btnShare.setUIID("BorderCenterCustomButton");
conTitleArea.addComponent(BorderLayout.EAST, btnShare);
toolBar.setTitleComponent(conTitleArea);
Label lblTitle = new Label("Ozioma");
lblTitle.setUIID("Title");
conTitleArea.addComponent(BorderLayout.CENTER, lblTitle);
Command cmdFacebook = new Command("Like on Facebook ") {
public void actionPerformed(ActionEvent evt) {
}
};
//cmdFacebook.setIcon(this.getResource().getImage("ic_favorite.png"));
toolBar.addCommandToOverflowMenu(cmdFacebook);
toolBar.addCommandToOverflowMenu(new Command("Recommend") {
public void actionPerformed(ActionEvent evt) {
if(isLogin())
showForm("RecommendForm", null);
}
});
toolBar.addCommandToOverflowMenu(new Command("Help/FAQs") {
public void actionPerformed(ActionEvent evt) {
faqs();
}
});
toolBar.addCommandToOverflowMenu(new Command("Exit") {
public void actionPerformed(ActionEvent evt) {
Display.getInstance().exitApplication();
}
});
toolBar.getMenuBar().addFocusListener(new FocusListener(){
public void focusGained(Component cmp) {
System.out.println("The side menu has gained focus");
}
public void focusLost(Component cmp) {
System.out.println("The side menu has losed focus");
}
});
}