lemon
5 months ago
9 changed files with 200 additions and 8 deletions
@ -0,0 +1,59 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.menu.ShortCut; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
/** |
||||
* @author lemon |
||||
* @since |
||||
* Created on |
||||
* 设计器工具按钮插件接口 |
||||
*/ |
||||
public interface ToolBarHandler extends Mutable { |
||||
|
||||
String MARK_STRING = "ToolBarHandler"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
|
||||
int LAST = -1; |
||||
int HIDE =-2; |
||||
|
||||
String MULTI_TEMPLATE = "multi_template"; |
||||
|
||||
/** |
||||
* 插入工具按钮的位置 |
||||
* |
||||
* @param total 插入的位置 |
||||
* @return 插入位置,如果想放到最后,则返回-1 |
||||
*/ |
||||
int insertPosition(int total); |
||||
|
||||
/** |
||||
* 是否在插入的工具按钮前插入一个分割符 |
||||
* |
||||
* @return 是否插入分隔符 |
||||
*/ |
||||
boolean insertSeparatorBefore(); |
||||
|
||||
/** |
||||
* 是否在插入的工具按钮后插入一个分割符 |
||||
* |
||||
* @return 是否插入分隔符 |
||||
*/ |
||||
boolean insertSeparatorAfter(); |
||||
|
||||
/** |
||||
* 所属的工具按钮分类 |
||||
* |
||||
* @return 分类工具按钮名 |
||||
*/ |
||||
String category(); |
||||
|
||||
/** |
||||
* 具体的工具按钮项内容 |
||||
* |
||||
* @return 工具按钮项内容 |
||||
*/ |
||||
ShortCut shortcut(); |
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.fr.design.actions.toolbar.multitemplate; |
||||
|
||||
import com.fine.theme.icon.LazyIcon; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.mainframe.JWorkBook; |
||||
|
||||
import javax.swing.Icon; |
||||
import java.awt.event.ActionEvent; |
||||
|
||||
/** |
||||
* @author lemon |
||||
* @since |
||||
* Created on |
||||
* 新建报表文件 |
||||
*/ |
||||
public class NewWorkBookToolBarAction extends UpdateAction { |
||||
public NewWorkBookToolBarAction() { |
||||
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_New_WorkBook")); |
||||
this.setSmallIcon(icon()); |
||||
} |
||||
|
||||
protected Icon icon() { |
||||
return new LazyIcon("add_worksheet"); |
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
DesignerContext.getDesignerFrame().addAndActivateJTemplate(new JWorkBook()); |
||||
} |
||||
} |
Loading…
Reference in new issue