/
GroupChatNickEditFrame.java
56 lines (52 loc) · 1.92 KB
/
GroupChatNickEditFrame.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.tomclaw.mandarin.xmpp;
import com.tomclaw.mandarin.main.ActionExec;
import com.tomclaw.mandarin.main.MidletMain;
import com.tomclaw.tcuilite.*;
import com.tomclaw.tcuilite.localization.Localization;
import java.io.IOException;
/**
* Solkin Igor Viktorovich, TomClaw Software, 2003-2013
* http://www.tomclaw.com/
* @author Solkin
*/
public class GroupChatNickEditFrame extends Window {
private Field nickField;
public GroupChatNickEditFrame( final XmppAccountRoot xmppAccountRoot,
final XmppItem xmppItem ) {
super( MidletMain.screen );
/** Header **/
header = new Header( Localization.getMessage( "GROUP_CHAT_NICK_EDIT" ) );
/** Soft **/
soft = new Soft( MidletMain.screen );
/** Left soft items **/
soft.leftSoft = new PopupItem( Localization.getMessage( "BACK" ) ) {
public void actionPerformed() {
MidletMain.screen.setActiveWindow( s_prevWindow );
}
};
/** Right soft items **/
soft.rightSoft = new PopupItem( Localization.getMessage( "APPLY" ) ) {
public void actionPerformed() {
try {
XmppSender.sendPresence( xmppAccountRoot.xmppSession.xmlWriter, null,
xmppItem.userId.concat( "/" ).concat( nickField.getText() ),
null, XmppStatusUtil.getStatusDescr(
xmppAccountRoot.statusIndex ), null, 5, false, null, null );
xmppItem.groupChatNick = nickField.getText();
} catch ( IOException ex ) {
ActionExec.showFail( "IO_EXCEPTION" );
}
MidletMain.screen.setActiveWindow( s_prevWindow );
}
};
/** Pane **/
Pane pane = new Pane( null, false );
pane.addItem( new Label( Localization.getMessage( "NICK_NAME" ) ) );
nickField = new Field( xmppItem.groupChatNick );
nickField.setFocusable( true );
nickField.setFocused( true );
pane.addItem( nickField );
/** Setting GObject **/
setGObject( pane );
}
}