}
public void commandAction(Command command, Displayable displayable) {
int selIndex = this.getSelectedIndex();
System.out.println(String.valueOf(selIndex));
textMsg original = null;
if(displayable == this && command == backCmd)
{
try {
gvME.dispMan.switchDisplayable(null, gvME.getInbox());
} catch (IOException ex) {
Logger.add(getClass().getName(), ex.getMessage());
ex.printStackTrace();
} catch (Exception ex) {
Logger.add(getClass().getName(), ex.getMessage());
ex.printStackTrace();
}
}
else if(displayable == readMsg && command == backCmd)
{
gvME.dispMan.switchDisplayable(null, this);
}
else if(!MsgListToItemMap.isEmpty())
{
original = (textMsg) MsgListToItemMap.elementAt(selIndex);
if(command == fwdCmd)
{
WriteMsg wm = new WriteMsg("Forward", convo);
gvME.dispMan.switchDisplayable(null, wm);
}
else if(command == replyCmd)
{
WriteMsg wm = new WriteMsg("Reply", convo);
gvME.dispMan.switchDisplayable(null, wm);
}
else if(command == callCmd)
{
if(settings.getCallFrom().equals(""))
gvME.dispMan.switchDisplayable(gvME.getNoCallFromAlert(), settings.getChangeSettingsMenu());
else
{
MakeCall mc = new MakeCall(convo.getReplyNum(), convo.getSender());
gvME.dispMan.switchDisplayable(null, mc);
mc = null;
}
}
else if(displayable == this && command == viewMsgCmd)
{
gvME.dispMan.switchDisplayable(null, getReadMsg(convo.getSender()));
readMsg.append(tools.decodeString(original.getMessage())); //decodes string from utf8
}
else if(displayable == readMsg && command == msgPropsCmd)
{
textConvo propsConvo = convo;
propsConvo.setLastMsg(original);