contentinput.java

来自「Mofire的JAR压缩包」· Java 代码 · 共 66 行

JAVA
66
字号
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   ContentInput.java

package com.modofo.mofire;

import javax.microedition.lcdui.*;

// Referenced classes of package com.modofo.mofire:
//			EditForm, MoFire

public class ContentInput extends TextBox
	implements CommandListener
{

	private Command postCmd;
	private Command backCmd;
	private Command saveCmd;
	private EditForm editForm;

	public ContentInput(String title, String text, int maxSize, int constraints)
	{
		super(title, text, maxSize, constraints);
		postCmd = new Command("Post", 4, 2);
		addCommand(postCmd);
		saveCmd = new Command("Save", 4, 2);
		addCommand(saveCmd);
		backCmd = new Command("Back", 2, 1);
		addCommand(backCmd);
		setCommandListener(this);
	}

	public void setEditForm(EditForm frm)
	{
		editForm = frm;
	}

	public void commandAction(Command arg0, Displayable arg1)
	{
		if (arg0 == postCmd)
			doPostCmd();
		else
		if (arg0 == backCmd)
			doBackCmd();
		else
		if (arg0 == saveCmd)
			doSaveCmd();
	}

	private void doSaveCmd()
	{
		editForm.savePost(getString().trim());
	}

	private void doBackCmd()
	{
		MoFire.getInstance().setCurrent(editForm);
	}

	private void doPostCmd()
	{
		editForm.postContent(getString().trim());
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?