|
|
@ -384,7 +384,8 @@ public class MultiTemplateTabPane extends JComponent { |
|
|
|
* 关闭所有指定模板tab操作类型的模板 |
|
|
|
* 关闭所有指定模板tab操作类型的模板 |
|
|
|
* @param operatorType |
|
|
|
* @param operatorType |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void closeAllByOperatorType(String operatorType){ |
|
|
|
public void closeOtherByOperatorType(String operatorType){ |
|
|
|
|
|
|
|
JTemplate<?, ?> currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(false); |
|
|
|
SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(false); |
|
|
|
if (saveSomeTempaltePane.showSavePane()) { |
|
|
|
if (saveSomeTempaltePane.showSavePane()) { |
|
|
|
List<JTemplate<?, ?>> openedTemplate = HistoryTemplateListCache.getInstance().getHistoryList(); |
|
|
|
List<JTemplate<?, ?>> openedTemplate = HistoryTemplateListCache.getInstance().getHistoryList(); |
|
|
@ -393,26 +394,24 @@ public class MultiTemplateTabPane extends JComponent { |
|
|
|
for (int i = 0; i < openedTemplate.size(); i++) { |
|
|
|
for (int i = 0; i < openedTemplate.size(); i++) { |
|
|
|
templates[i] = openedTemplate.get(i); |
|
|
|
templates[i] = openedTemplate.get(i); |
|
|
|
} |
|
|
|
} |
|
|
|
closeTemplate(templates, operatorType); |
|
|
|
closeTemplate(templates, currentEditingTemplate, operatorType); |
|
|
|
|
|
|
|
|
|
|
|
if (openedTemplate.size() == 0) { |
|
|
|
DesignerContext.getDesignerFrame().activateJTemplate(currentEditingTemplate); |
|
|
|
DesignerContext.getDesignerFrame().addAndActivateJTemplate(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
DesignerContext.getDesignerFrame().activateJTemplate(openedTemplate.get(0)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
MultiTemplateTabPane.getInstance().repaint(); |
|
|
|
MultiTemplateTabPane.getInstance().repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 关闭指定模板 |
|
|
|
* 关闭指定的非当前编辑模板 |
|
|
|
* @param templates |
|
|
|
* @param templates |
|
|
|
* @param operatorType |
|
|
|
* @param operatorType |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static void closeTemplate(JTemplate<?, ?>[] templates, String operatorType) { |
|
|
|
private static void closeTemplate(JTemplate<?, ?>[] templates, JTemplate<?, ?> currentEditingTemplate, String operatorType) { |
|
|
|
for (int i = 0; i < templates.length; i++) { |
|
|
|
for (int i = 0; i < templates.length; i++) { |
|
|
|
JTemplate<?, ?> jTemplate = templates[i]; |
|
|
|
JTemplate<?, ?> jTemplate = templates[i]; |
|
|
|
if (!ComparatorUtils.equals(operatorType, jTemplate.getTemplateTabOperatorType())){ |
|
|
|
boolean needClose = ComparatorUtils.equals(operatorType, jTemplate.getTemplateTabOperatorType()) |
|
|
|
|
|
|
|
&& jTemplate != currentEditingTemplate; |
|
|
|
|
|
|
|
if (!needClose) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
MultiTemplateTabPane.getInstance().closeFormat(jTemplate); |
|
|
|
MultiTemplateTabPane.getInstance().closeFormat(jTemplate); |
|
|
|