📄 basedialog.java
字号:
/**
* @(#)$RCSfile: BaseDialog.java,v $ $Revision: 1.2 $
*
* ====================================================================
* Copyright 2001, Reaxion Corp.,
* 11418 105th PL NE, Kirkland, WA, 98033, USA
* All rights reserved.
* ====================================================================
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Tequila SyncML.
*
* The Initial Developer of the Original Code is Reaxion Corp.
* All Rights Reserved.
*/
package com.reaxion.tequila.client.syncml.ui;
import javax.microedition.lcdui.*;
import com.reaxion.tequila.syncml.util.*;
/**
* @version $1.0$
* @author Oleg A. Oksyuk
*/
public abstract class BaseDialog extends Form implements CommandListener, IDialog
{
/**
* These are the commands available in all the demos.
*/
private Command[] commands = SyncMidlet.getDemoCommands();
/**
* These are callback events invoked whenever the matching command
* is invoked.
*/
private Runnable[] callbacks = SyncMidlet.getDemoActions();
/**
* This constructor creates new BaseDemo with the given title & creates
* the standard commands for the demos.
*/
public BaseDialog(String title)
{
super(title);
setCommandListener(this) ;
for(int iter = 0 ; iter < commands.length ; iter++)
{
addCommand(commands[iter]);
}
}
/**
* Indicates that a command event has occurred. This implementation loops
* through the default callbacks and decides if one of them should be
* invoked.
*/
public void commandAction(Command c, Displayable d)
{
Log.println("commandAction");
for(int iter = 0 ; iter < commands.length ; iter++)
{
if(commands[iter] == c)
{
callbacks[iter].run();
return;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -