///
Action 调用 Command
public class xxxxxAction extends AbstractAIFAction { public xxxxxAction(AbstractAIFUIApplication abstractaifuiapplication, String s) { super(abstractaifuiapplication, s); } public xxxxxAction(AbstractAIFApplication abstractaifapplication, Frame frame, String s) { super(abstractaifapplication, frame, s); } public void run() { try { new xxxxxCommand().executeModal(); } catch (Exception e) { e.printStackTrace(); } return; } }
///
Handler 调用 Command
public class RevisesHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent arg0) throws ExecutionException { try { RevisesCommand cmd = new RevisesCommand(); cmd.executeModal(); cmd.indata(); } catch (Exception e) { e.printStackTrace(); } return null; } }
///
Command 调用 Dialog
public class RevisesCommand extends AbstractAIFCommand { private RevisesDialog dialog; public RevisesCommand() { dialog = new RevisesDialog(); setRunnable(dialog); } public void indata() { // indata需要使用线程 不然界面卡死 dialog.indata(); } }
///
Command 调用 Operation
public class xxxxxCommand extends AbstractAIFCommand { AbstractAIFOperation op = new xxxxxOperation(); TcApp.getSession().queueOperation(op); }
///
Dialog 调用 Operation
public class xxxxxDialog extends AbstractAIFDialog implements ActionListener { public ImportDialog() { super(TcApp.getParent(), true); } @Override public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("OK")) { AbstractAIFOperation op = new xxxxxOperation(); TcApp.getSession().queueOperation(op); } } }
///
注册菜单必须的类
com.teamcenter.rac.aifrcp;bundle-version="9000.1.0",
com.teamcenter.rac.kernel;bundle-version="9000.1.0",
com.teamcenter.rac.util;bundle-version="9000.1.0"