Browse Source

Pull request #12110: REPORT-95401 && REPORT-95218【FVS支持多开】打开多个fvs之后打开frm,再次打开fvs,tab栏自适应异常【FVS支持多开】禁用插件,强制保存fvs模板,可以取消勾选

Merge in DESIGN/design from ~KERRY/design_10.0:release/11.0 to release/11.0

* commit '47164404ad526fff6f629237ad0d42f45873c050':
  修改代码行数
  往前遍历要到0
  REPORT-95401 && REPORT-95218【FVS支持多开】打开多个fvs之后打开frm,再次打开fvs,tab栏自适应异常【FVS支持多开】禁用插件,强制保存fvs模板,可以取消勾选
release/11.0
kerry-王周勇 2 years ago
parent
commit
a9348258f5
  1. 52
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java

52
designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java

@ -757,6 +757,58 @@ public class MultiTemplateTabPane extends JComponent {
minPaintIndex = 0;
maxPaintIndex = openedTemplate.size() - 1;
}
//需要根据每个tab的宽度重新check下实际的maxPaintIndex和minPaintIndex
checkActualPaintIndex();
}
/**
* 先计算出需要补充的tab个数
* @return
*/
private int calTabCountComplemented(){
int a = 0;
for (int i = minPaintIndex; i <= maxPaintIndex; i++) {
JTemplate template = openedTemplate.get(i);
if (!showJTemplateTab(template)) {
a++;
}
}
return a;
}
/**
* 由于可能存在宽度为0的tab所以这边需要重新check下先往后补再往前补
*/
private void checkActualPaintIndex(){
int tabCount = calTabCountComplemented();
if (tabCount == 0){
return;
}
if (maxPaintIndex < openedTemplate.size() - 1) {
for (int i = maxPaintIndex + 1; i < openedTemplate.size(); i++) {
JTemplate template = openedTemplate.get(i);
if (showJTemplateTab(template)) {
tabCount--;
}
maxPaintIndex++;
if (tabCount == 0){
return;
}
}
}
if (minPaintIndex > 0){
for (int i = minPaintIndex - 1; i >= 0; i--) {
JTemplate template = openedTemplate.get(i);
if (showJTemplateTab(template)) {
tabCount--;
}
minPaintIndex--;
if (tabCount == 0){
return;
}
}
}
}

4
designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java

@ -124,8 +124,10 @@ public class SaveSomeTemplatePane extends BasicPane {
if (index < 0) {
return;
}
boolean mustSaveBeforeSwitchEnv = judgeJTemplateMustSave
&& unSavedTemplate.get(index).needSaveBeforeSwitchEnv();
UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(index);
checkBox.setSelected(!checkBox.isSelected());
checkBox.setSelected(mustSaveBeforeSwitchEnv ||!checkBox.isSelected());
//根据templateCheckBoxes中的选择情况来更新全选框的状态
int selectedCount = calculateSelectedNum();

Loading…
Cancel
Save