Browse Source

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

newui
kerry 2 years ago
parent
commit
78027aae0e
  1. 48
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java

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

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