Browse Source
* commit 'ca6353415495a5f98f7fe4347c7673efd7e41afe': (42 commits) REPORT-94629 更新注释 REPORT-94629 优化代码 REPORT-94629 设计器tab组件操作异常 REPORT-95367 fix:关闭icon模糊 修改代码行数 往前遍历要到0 REPORT-95401 && REPORT-95218【FVS支持多开】打开多个fvs之后打开frm,再次打开fvs,tab栏自适应异常【FVS支持多开】禁用插件,强制保存fvs模板,可以取消勾选 REPORT-95362 fix:tab上的toolTip被截断 添加注释 代码修改 REPORT-95197 && REPORT-95194 打开远程工作目录面板,选择远程目录点确定,没有强制要求保存fvs模板 REPORT-95068【FVS支持多开】兼容问题》release-jar+旧插件,连续打开两张fvs模板,关闭后异常 REPORT-94999 frm-tab栏与fvs-tab栏切换时,会出现跳到其他模式 REPORT-94114 11.0.15.1维护版本,同步到persist 改一下方法名称 REPORT-94510 决策报表-tab块组件大小设置0-样式设置"菜单式"-预览模板空白 REPORT-91253 FR源码中存在密钥硬编码 REPORT-94504 关闭所有模板,当前模板是否有未保存内容没有校验,模板内容有丢失风险 添加注释 REPORT-94400【FVS支持多开】来回切换fvs模板,tab栏会晃动 ...newui
zheng-郑潇
2 years ago
30 changed files with 600 additions and 182 deletions
@ -1 +1,2 @@ |
|||||||
Fine-Designer_Login=i7hP48WAcuTrmxfN |
Fine-Designer_Login=i7hP48WAcuTrmxfN |
||||||
|
Fine-Designer_Reu_Share_CERTIFICATE_PUBLIC_KEY=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtsz62CPSWXZE/IYZRiAuTSZkw1WOwer8+JFktK0uKLAUuQoBr+UjAMFtRA8W7JgKMDwZy/2liEAiXEOSPU/hrdV8DtT541LnGi1X/hXiRwuttPWYN3L2GYm/d5blU+FBNwghBIrdAxXTzYBc6P4KL/oYXnMdTIrkz8tYkG3QoFQIDAQAB |
@ -0,0 +1,126 @@ |
|||||||
|
package com.fr.design.widget.ui.btn; |
||||||
|
|
||||||
|
import com.fr.design.ExtraDesignClassManager; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.fun.WidgetAdvancedPaneProvider; |
||||||
|
import com.fr.design.gui.icombobox.DictionaryComboBox; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane; |
||||||
|
import com.fr.form.ui.Button; |
||||||
|
import com.fr.general.GeneralContext; |
||||||
|
import com.fr.plugin.observer.PluginEvent; |
||||||
|
import com.fr.plugin.observer.PluginEventListener; |
||||||
|
import org.jetbrains.annotations.Nullable; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.Component; |
||||||
|
import java.util.Set; |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 用来处理额外的按钮属性 |
||||||
|
* |
||||||
|
* @author John.Ying |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/4/19 |
||||||
|
*/ |
||||||
|
public abstract class AbstractExtraButtonPane<T extends Button> extends ButtonWithHotkeysDetailPane<T> { |
||||||
|
protected JPanel extraPane; |
||||||
|
protected boolean containsExtraPane; |
||||||
|
protected static double F = TableLayout.FILL; |
||||||
|
protected static double P = TableLayout.PREFERRED; |
||||||
|
|
||||||
|
protected void initExtraPane() { |
||||||
|
initPluginListener(); |
||||||
|
refreshExtraAdvancedPane(classType()); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 根据按钮类别判断需要返回什么类型的属性界面 |
||||||
|
*/ |
||||||
|
protected void refreshExtraAdvancedPane(Class cls) { |
||||||
|
extraPaneList.clear(); |
||||||
|
boolean containsExtraPane = false; |
||||||
|
Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); |
||||||
|
for (WidgetAdvancedPaneProvider<T> provider : providers) { |
||||||
|
if (!provider.accept(cls)) { |
||||||
|
continue; |
||||||
|
} |
||||||
|
insertShortCut(provider.getInsertPosition(extraPaneList.size()), provider.createExtraAdvancedPane()); |
||||||
|
containsExtraPane = true; |
||||||
|
} |
||||||
|
if (containsExtraPane) { |
||||||
|
extraPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); |
||||||
|
for (BasicBeanPane<T> pane : extraPaneList) { |
||||||
|
extraPane.add(pane); |
||||||
|
} |
||||||
|
} |
||||||
|
this.containsExtraPane = containsExtraPane; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
protected void initPluginListener() { |
||||||
|
GeneralContext.listenPluginRunningChanged(new PluginEventListener() { |
||||||
|
@Override |
||||||
|
public void on(PluginEvent event) { |
||||||
|
refreshExtraAdvancedPane(classType()); |
||||||
|
} |
||||||
|
}, pluginContext -> pluginContext.getRuntime().contain(WidgetAdvancedPaneProvider.XML_TAG)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 插入配置项面板 |
||||||
|
* |
||||||
|
* @param index 插入的位置 |
||||||
|
* @param pane 配置项面板 |
||||||
|
*/ |
||||||
|
protected void insertShortCut(int index, BasicBeanPane<T> pane) { |
||||||
|
int size = extraPaneList.size(); |
||||||
|
index = Math.min(index, size); |
||||||
|
extraPaneList.add(index, pane); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populate(T button) { |
||||||
|
super.populate(button); |
||||||
|
for (BasicBeanPane<T> pane : extraPaneList) { |
||||||
|
pane.populateBean(button); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public T update() { |
||||||
|
T button = super.update(); |
||||||
|
for (BasicBeanPane<T> pane : extraPaneList) { |
||||||
|
pane.updateBean(button); |
||||||
|
} |
||||||
|
return button; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
@Override |
||||||
|
protected DictionaryComboBox createCustomButtonTypeComboBox() { |
||||||
|
return createButtonTypeComboBox(containsExtraPane); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 生成额外的属性界面 |
||||||
|
*/ |
||||||
|
protected Component createExtraPane(@Nullable BasicPane pane) { |
||||||
|
initExtraPane(); |
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{pane, null}, |
||||||
|
new Component[]{extraPane, null} |
||||||
|
}; |
||||||
|
double[] rowSize = {P, P}; |
||||||
|
double[] columnSize = {P, F}; |
||||||
|
int[][] rowCount = {{1, 1},{1, 1}}; |
||||||
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue