You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.7 KiB
60 lines
1.7 KiB
/* |
|
* Copyright (C), 2015-2019 |
|
* FileName: ParamAction |
|
* Author: xx |
|
* Date: 2019/09/09 |
|
* Description: ParamAction |
|
* History: |
|
* <author> <time> <version> <desc> |
|
* 作者姓名 修改时间 版本号 描述 |
|
*/ |
|
package com.fr.plugin.isgd.menu; |
|
|
|
import com.fanruan.api.design.DesignKit; |
|
import com.fanruan.api.design.ui.container.BasicDialog; |
|
import com.fanruan.api.util.IOKit; |
|
import com.fr.design.actions.JWorkBookAction; |
|
import com.fr.design.dialog.DialogActionAdapter; |
|
import com.fr.design.mainframe.JWorkBook; |
|
import com.fr.main.impl.WorkBook; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import static com.fr.plugin.isgd.Constants.ACTION_NAME; |
|
import static com.fr.plugin.isgd.Constants.ICON_PATH; |
|
|
|
/** |
|
* <功能简述><br> |
|
* <ParamAction> |
|
* |
|
* @author xx |
|
* @create 2019/09/09 |
|
* @since 1.0.0 |
|
*/ |
|
public class ParamAction extends JWorkBookAction { |
|
public ParamAction(JWorkBook jWorkBook) { |
|
super(jWorkBook); |
|
this.setSmallIcon(IOKit.readIcon(ICON_PATH)); |
|
setName(ACTION_NAME); |
|
} |
|
|
|
@Override |
|
public void actionPerformed(ActionEvent actionEvent) { |
|
final JWorkBook jwb = getEditingComponent(); |
|
if (jwb == null) { |
|
return; |
|
} |
|
final WorkBook wb = jwb.getTarget(); |
|
final ParamConfigPane configPane = new ParamConfigPane(); |
|
configPane.populate(wb); |
|
BasicDialog dialog = configPane.showWindow(DesignKit.getDesignerFrame(), new DialogActionAdapter() { |
|
@Override |
|
public void doOk() { |
|
ParamConfig config = configPane.update(); |
|
wb.addAttrMark(config); |
|
jwb.fireTargetModified(); |
|
} |
|
}); |
|
dialog.setVisible(true); |
|
} |
|
}
|
|
|