/*
* APIKEY.java
*
* Copyright (C) 2008 by delta_foxtrot@users.sourceforge.net
* http://gpsavenger.sf.net
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.blackberry.api.browser.*;
public class APIKEY extends MainScreen
{
EditField ef = new EditField("API Key: ", "", 32, Field.FOCUSABLE);
public APIKEY()
{
super();
LabelField title = new LabelField("Please enter your API Key", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
setTitle(title);
add(ef);
HorizontalFieldManager hfm = new HorizontalFieldManager();
ButtonField bf = new ButtonField("OK");
bf.setChangeListener(new FieldChangeListener()
{
public void fieldChanged(Field field, int context)
{
doOK();
}
});
ButtonField bf2 = new ButtonField("Register");
bf2.setChangeListener(new FieldChangeListener()
{
public void fieldChanged(Field field, int context)
{
Browser.getDefaultSession().displayPage("http://www.opencellid.org/users/signup");
}
});
hfm.add(bf);
hfm.add(bf2);
add(hfm);
}
private void doOK()
{
ociApp.setkey(ef.toString());
UiApplication.getUiApplication().pushScreen(new ociScreen());
UiApplication.getUiApplication().popScreen(this);
}
}