|
|
|
@ -116,7 +116,6 @@ public class MultiTemplateTabPane extends Row {
|
|
|
|
|
private boolean hoverMoreAction = false; |
|
|
|
|
private Icon clodeIcon = new LazyIcon("clear"); |
|
|
|
|
private boolean isShowList = false; |
|
|
|
|
private JButton leadingActionButton; |
|
|
|
|
private final UIToolbar leadingToolBar = new UIToolbar(); |
|
|
|
|
|
|
|
|
|
//自动新建的模板B若没有进行任何编辑,切换到其他
|
|
|
|
@ -203,17 +202,6 @@ public class MultiTemplateTabPane extends Row {
|
|
|
|
|
updateLeadingToolBar(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 为前导动作添加监听 |
|
|
|
|
* |
|
|
|
|
* @param l 监听器 |
|
|
|
|
*/ |
|
|
|
|
public void addLeadingAction(ActionListener l) { |
|
|
|
|
newTemplateAction = l; |
|
|
|
|
leadingActionButton.removeActionListener(newTemplateAction); |
|
|
|
|
leadingActionButton.addActionListener(newTemplateAction); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setToolBarEnable(boolean enable) { |
|
|
|
|
leadingToolBar.setEnabled(enable); |
|
|
|
|
} |
|
|
|
@ -787,7 +775,9 @@ public class MultiTemplateTabPane extends Row {
|
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
|
// 双击添加模板
|
|
|
|
|
if (e.getClickCount() == DOUBLE_CLICK |
|
|
|
|
&& isOverBlank(e.getX())) { |
|
|
|
|
&& isOverBlank(e.getX()) |
|
|
|
|
&& newTemplateAction != null |
|
|
|
|
) { |
|
|
|
|
newTemplateAction.actionPerformed(null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1003,6 +993,7 @@ public class MultiTemplateTabPane extends Row {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 创建新建模板的前导区工具按钮 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private ToolBarDef createLeadingToolBarDef() { |
|
|
|
@ -1013,17 +1004,21 @@ public class MultiTemplateTabPane extends Row {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 创建新建文件的按钮数组 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public ShortCut[] createNewTemplateShortCuts() { |
|
|
|
|
ArrayList<ShortCut> shortCuts = new ArrayList<ShortCut>(); |
|
|
|
|
shortCuts.add(new NewWorkBookToolButtonAction()); |
|
|
|
|
NewWorkBookToolButtonAction action = new NewWorkBookToolButtonAction(); |
|
|
|
|
shortCuts.add(action); |
|
|
|
|
newTemplateAction = action; |
|
|
|
|
return shortCuts.toArray(new ShortCut[0]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 插入插件中的按钮 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
protected void insertLeadingToolButton(ToolBarDef toolBarDef, String anchor) { |
|
|
|
|