exportaction.java

来自「mywork是rcp开发的很好的例子」· Java 代码 · 共 44 行

JAVA
44
字号
/*
 * Created on 2003-4-10
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package net.sf.pim.action;

import net.sf.component.config.ConfigHelper;
import net.sf.util.persistence.LegacyWorkDataManager;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;

/**
 * @author lzhang
 *         <p/>
 *         To change the template for this generated type comment go to
 *         Window>Preferences>Java>Code Generation>Code and Comments
 */
public class ExportAction extends UiAction {
    public ExportAction() {
        super();
        name = "导出...";
        gif = "export.gif";
    }

    public void run() {
    	super.run();
        FileDialog fd = new FileDialog(parent.getTv().getTable().getShell(), SWT.SAVE);
        fd.setText("导出当前工作列表");
        fd.setFilterExtensions(new String[]{"*.xml"});
        fd.setFilterPath(ConfigHelper.getDataHome());
        fd.open();
        String fname = fd.getFileName();
        if (fname.equals(""))
            return;

        fname = fd.getFilterPath() + "/" + fname;

        LegacyWorkDataManager.exportWork(parent.getData(), fname);
    }
}

⌨️ 快捷键说明

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