forked from fanruan/design
Browse Source
* commit 'b68a8d948eedfb1571edcce47b3355ec02666b17': REPORT-11590 环境切换执行完毕后关闭选择对话框,启动时环境切换和9保持一致 REPORT-11586 不同语言环境超链选项展示问题 CHART-3073 字段下拉框包含无这个选项 && CHART-3060 中文无和英文nonemaster
yaoh.wu
6 years ago
17 changed files with 362 additions and 206 deletions
@ -1,59 +0,0 @@ |
|||||||
package com.fr.design.gui; |
|
||||||
|
|
||||||
import com.fr.design.file.HistoryTemplateListPane; |
|
||||||
import com.fr.design.mainframe.BaseJForm; |
|
||||||
import com.fr.design.mainframe.JTemplate; |
|
||||||
import com.fr.general.ComparatorUtils; |
|
||||||
|
|
||||||
|
|
||||||
/** |
|
||||||
* Created by mengao on 2017/9/22. |
|
||||||
* 单元格超链、图表超链在不同类型模版中,下拉选项不同 |
|
||||||
*/ |
|
||||||
public class HyperlinkFilterHelper { |
|
||||||
|
|
||||||
public static boolean whetherAddHyperlink4cell(String itemName) { |
|
||||||
JTemplate jTemplate = getCurrentEditingTemplate(); |
|
||||||
if (jTemplate == null) { |
|
||||||
return false; |
|
||||||
} |
|
||||||
//先屏蔽掉这个,之后还有别的
|
|
||||||
String[] names = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ Hyperlink_Chart_Float")}; |
|
||||||
for (String name : names) { |
|
||||||
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) { |
|
||||||
return false; |
|
||||||
} |
|
||||||
} |
|
||||||
return whetherAddFormLink(jTemplate, itemName); |
|
||||||
} |
|
||||||
|
|
||||||
public static boolean whetherAddHyperlink4Chart(String itemName) { |
|
||||||
JTemplate jTemplate = getCurrentEditingTemplate(); |
|
||||||
if (jTemplate == null) { |
|
||||||
return false; |
|
||||||
} |
|
||||||
//先屏蔽掉这个,之后还有别的
|
|
||||||
String[] names = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ Hyperlink_Chart_Float"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Chart_Cell")}; |
|
||||||
for (String name : names) { |
|
||||||
if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) { |
|
||||||
if (jTemplate.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB && ComparatorUtils.equals(itemName, names[0])) { |
|
||||||
//表单报表块中图表悬浮元素超链,只屏蔽联动悬浮元素
|
|
||||||
return false; |
|
||||||
} else if (jTemplate.getEditingReportIndex() == BaseJForm.FORM_TAB) { |
|
||||||
//表单图表超链屏蔽掉联动悬浮元素和联动单元格
|
|
||||||
return false; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
return whetherAddFormLink(jTemplate, itemName); |
|
||||||
} |
|
||||||
|
|
||||||
private static JTemplate getCurrentEditingTemplate() { |
|
||||||
return HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
||||||
} |
|
||||||
|
|
||||||
private static boolean whetherAddFormLink(JTemplate jTemplate, String itemName) { |
|
||||||
String formName = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Form_Link"); |
|
||||||
return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName)); |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,22 @@ |
|||||||
|
package com.fr.design.gui.frpane; |
||||||
|
|
||||||
|
import com.fr.js.JavaScript; |
||||||
|
|
||||||
|
public interface HyperLinkGroupFilter { |
||||||
|
|
||||||
|
/** |
||||||
|
* @param clazz clazz |
||||||
|
* @return 是否可用,返回true表示可用,返回false表示不可用 |
||||||
|
*/ |
||||||
|
boolean filter(Class<? extends JavaScript> clazz); |
||||||
|
|
||||||
|
/** |
||||||
|
* 兼容老图表 |
||||||
|
* |
||||||
|
* @param object object |
||||||
|
* @return 是否可用,返回true表示可用,返回false表示不可用 |
||||||
|
* @see HyperLinkGroupFilter#filter(Class) |
||||||
|
*/ |
||||||
|
boolean filter(Object object); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,44 @@ |
|||||||
|
package com.fr.extended.chart; |
||||||
|
|
||||||
|
import com.fr.design.gui.icombobox.UIComboBox; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by shine on 2018/9/27. |
||||||
|
*/ |
||||||
|
public class UIComboBoxWithNone extends UIComboBox { |
||||||
|
|
||||||
|
private static String getNoneLocaleString() { |
||||||
|
return Toolkit.i18nText("Fine-Design_Chart_Use_None"); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void refreshBoxItems(List list) { |
||||||
|
super.refreshBoxItems(list); |
||||||
|
addNoneItem(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void clearBoxItems() { |
||||||
|
super.clearBoxItems(); |
||||||
|
addNoneItem(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
private void addNoneItem() { |
||||||
|
addItem(getNoneLocaleString()); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void setSelectedItem(Object anObject) { |
||||||
|
super.setSelectedItem(anObject); |
||||||
|
|
||||||
|
if (getSelectedIndex() == -1) {//找不到的都选中无。中文的无 英文下是none。
|
||||||
|
super.setSelectedItem(getNoneLocaleString()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue