forked from fanruan/design
Browse Source
* commit '297205f8a6934f1a482bb1a934d5c7c52b5f646b': (37 commits) REPORT-11335 设计器数据库会显示上一个的记录=>验收问题=>调整代码 REPORT-11335 设计器数据库会显示上一个的记录=>验收问题 REPORT-10699 屏蔽表单里面的上传事件 无JIRA任务 不知道啥问题 REPORT-11473 REPORT-11473 CHART-3043 REPORT-11473 CHART-3043 暂无JIRA任务,修复区间配置最下面颜色被遮挡的问题 revert code 无JIRA任务 改一部分findbugs 无JIRA任务 修改严重findbugs CHART-3122 流向地球不支持超链 无JIRA任务,复用原有代码 REPORT-11590 环境切换执行完毕后关闭选择对话框,启动时环境切换和9保持一致 REPORT-11257 revert code CHART-3044 新增构造器,初始化自定义颜色 REPORT-11586 不同语言环境超链选项展示问题 ...final/10.0
zack
6 years ago
50 changed files with 1238 additions and 864 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)); |
||||
} |
||||
} |
@ -1,18 +1,37 @@
|
||||
package com.fr.design.gui.frpane; |
||||
|
||||
import com.fr.design.gui.controlpane.NameableCreator; |
||||
import com.fr.js.JavaScript; |
||||
import com.fr.stable.Filter; |
||||
|
||||
/** |
||||
* 超级链接 支持的类型 种类. |
||||
* 超级链接 支持的类型 种类. |
||||
* |
||||
* @author kunsnat E-mail:kunsnat@gmail.com |
||||
* @version 创建时间:2013-6-26 下午04:41:55 |
||||
*/ |
||||
public interface HyperlinkGroupType { |
||||
|
||||
/** |
||||
* 返回支持的超级链接类型 |
||||
* @return NameableCreator[] |
||||
*/ |
||||
public NameableCreator[] getHyperlinkCreators(); |
||||
|
||||
/** |
||||
* 返回支持的超级链接类型 |
||||
* |
||||
* @return NameableCreator[] |
||||
*/ |
||||
NameableCreator[] getHyperlinkCreators(); |
||||
|
||||
|
||||
/** |
||||
* 图表超链过滤 |
||||
* |
||||
* @return 图表超链过滤 |
||||
*/ |
||||
Filter<Class<? extends JavaScript>> getFilter(); |
||||
|
||||
/** |
||||
* 老图表超链的过滤 |
||||
* |
||||
* @return 老图表超链的过滤 |
||||
*/ |
||||
Filter<Object> getOldFilter(); |
||||
|
||||
} |
@ -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()); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,94 @@
|
||||
package com.fr.design.mainframe.alphafine.cell.model; |
||||
|
||||
import com.fr.design.mainframe.alphafine.AlphaFineConstants; |
||||
import com.fr.design.mainframe.alphafine.CellType; |
||||
import com.fr.json.JSONException; |
||||
import com.fr.json.JSONObject; |
||||
import org.junit.Assert; |
||||
import org.junit.Test; |
||||
|
||||
public class ModelTest { |
||||
@Test |
||||
public void documentModelTest() { |
||||
DocumentModel documentModel = new DocumentModel("name", "content", 1); |
||||
Assert.assertEquals("name", documentModel.getName()); |
||||
Assert.assertEquals("content", documentModel.getContent()); |
||||
Assert.assertEquals(1, documentModel.getDocumentId()); |
||||
Assert.assertEquals(AlphaFineConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); |
||||
Assert.assertEquals(AlphaFineConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); |
||||
Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl()); |
||||
Assert.assertEquals(CellType.DOCUMENT, documentModel.getType()); |
||||
Assert.assertEquals(true, documentModel.hasAction()); |
||||
Assert.assertEquals(true, documentModel.isNeedToSendToServer()); |
||||
|
||||
documentModel.setDescription("test"); |
||||
Assert.assertEquals("test", documentModel.getDescription()); |
||||
|
||||
DocumentModel another = new DocumentModel("another", "another", 1); |
||||
documentModel.doAction(); |
||||
Assert.assertTrue(another.equals(documentModel)); |
||||
Assert.assertNotNull(documentModel.modelToJson()); |
||||
} |
||||
|
||||
@Test |
||||
public void bottomModelTest() { |
||||
BottomModel bottomModel = new BottomModel(); |
||||
Assert.assertEquals(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Internet_Forum"), bottomModel.getGoToWeb()); |
||||
Assert.assertEquals(CellType.BOTTOM, bottomModel.getType()); |
||||
try { |
||||
Assert.assertEquals(JSONObject.EMPTY, bottomModel.modelToJson()); |
||||
} catch (JSONException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
Assert.assertEquals(true, bottomModel.hasAction()); |
||||
bottomModel.doAction(); |
||||
|
||||
} |
||||
|
||||
@Test |
||||
public void fileModelTest() { |
||||
FileModel fileModel = new FileModel("name", "test\\\\"); |
||||
Assert.assertEquals(CellType.FILE, fileModel.getType()); |
||||
Assert.assertNotNull(fileModel.modelToJson()); |
||||
FileModel anotherFileModel = new FileModel("anotherFileModel", "test\\\\"); |
||||
Assert.assertTrue(anotherFileModel.equals(fileModel)); |
||||
} |
||||
|
||||
@Test |
||||
public void moreModelTest() { |
||||
MoreModel moreModel = new MoreModel("name"); |
||||
Assert.assertTrue(!moreModel.hasAction()); |
||||
Assert.assertTrue(!moreModel.isNeedToSendToServer()); |
||||
Assert.assertEquals(CellType.MORE, moreModel.getType()); |
||||
} |
||||
|
||||
@Test |
||||
public void noResultModelTest() { |
||||
NoResultModel noResultModel = new NoResultModel("test"); |
||||
Assert.assertTrue(!noResultModel.hasAction()); |
||||
Assert.assertTrue(!noResultModel.isNeedToSendToServer()); |
||||
Assert.assertEquals(CellType.NO_RESULT, noResultModel.getType()); |
||||
} |
||||
|
||||
@Test |
||||
public void pluginModelTest() { |
||||
PluginModel pluginModel = new PluginModel("name", "content", "url", "version", "jartime", "link", "pluginId", CellType.PLUGIN, 10000, 1); |
||||
Assert.assertTrue(pluginModel.hasAction()); |
||||
Assert.assertTrue(pluginModel.isNeedToSendToServer()); |
||||
Assert.assertEquals(CellType.PLUGIN, pluginModel.getType()); |
||||
Assert.assertNotNull(pluginModel.modelToJson()); |
||||
} |
||||
|
||||
@Test |
||||
public void robotModelTest(){ |
||||
RobotModel robotModel = new RobotModel("title","content"); |
||||
Assert.assertTrue(robotModel.hasAction()); |
||||
Assert.assertTrue(robotModel.isNeedToSendToServer()); |
||||
Assert.assertEquals(CellType.ROBOT, robotModel.getType()); |
||||
try { |
||||
Assert.assertNotNull(robotModel.modelToJson()); |
||||
} catch (JSONException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,80 @@
|
||||
package com.fr.design.mainframe.alphafine.search.manager.impl; |
||||
|
||||
import com.fr.design.mainframe.alphafine.AlphaFineHelper; |
||||
import com.fr.design.mainframe.alphafine.CellType; |
||||
import com.fr.design.mainframe.alphafine.model.SearchResult; |
||||
import com.fr.json.JSONObject; |
||||
import org.junit.Assert; |
||||
import org.junit.Before; |
||||
import org.junit.Test; |
||||
|
||||
public class SearchManegerTest { |
||||
SimilarSearchManeger similarSearchManeger; |
||||
ComplementAdviceManager complementAdviceManager; |
||||
DocumentSearchManager documentSearchManager; |
||||
PluginSearchManager pluginSearchManager; |
||||
RecommendSearchManager recommendSearchManager; |
||||
RecentSearchManager recentSearchManager; |
||||
ActionSearchManager actionSearchManager; |
||||
FileSearchManager fileSearchManager; |
||||
SegmentationManager segmentationManager; |
||||
|
||||
@Before |
||||
public void setUp() { |
||||
recentSearchManager = RecentSearchManager.getInstance(); |
||||
recommendSearchManager = RecommendSearchManager.getInstance(); |
||||
similarSearchManeger = SimilarSearchManeger.getInstance(); |
||||
complementAdviceManager = ComplementAdviceManager.getInstance(); |
||||
documentSearchManager = DocumentSearchManager.getInstance(); |
||||
pluginSearchManager = PluginSearchManager.getInstance(); |
||||
actionSearchManager = ActionSearchManager.getInstance(); |
||||
fileSearchManager = FileSearchManager.getInstance(); |
||||
segmentationManager = SegmentationManager.getInstance(); |
||||
} |
||||
|
||||
@Test |
||||
public void getSearchResultTest() { |
||||
|
||||
//检测网络情况
|
||||
Assert.assertTrue(AlphaFineHelper.isNetworkOk()); |
||||
|
||||
//正常搜索情况
|
||||
SearchResult lessModelList; |
||||
lessModelList = recentSearchManager.getLessSearchResult(new String[]{"数据集"}); |
||||
Assert.assertNotNull(lessModelList); |
||||
|
||||
lessModelList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"}); |
||||
Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); |
||||
|
||||
lessModelList = complementAdviceManager.getAllSearchResult(new String[]{"数据集"}); |
||||
Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); |
||||
|
||||
//返回MoreSearchResult
|
||||
SearchResult moreModelList; |
||||
moreModelList = similarSearchManeger.getMoreSearchResult("数据集"); |
||||
Assert.assertNotNull(moreModelList); |
||||
|
||||
moreModelList = recommendSearchManager.getMoreSearchResult("数据集"); |
||||
Assert.assertNotNull(moreModelList); |
||||
} |
||||
|
||||
@Test |
||||
public void getModelFromCloudTest() { |
||||
Assert.assertNotNull(SimilarSearchManeger.getModelFromCloud(new JSONObject())); |
||||
Assert.assertNotNull(DocumentSearchManager.getModelFromCloud(new JSONObject())); |
||||
Assert.assertNotNull(PluginSearchManager.getModelFromCloud(new JSONObject())); |
||||
} |
||||
|
||||
@Test |
||||
public void isNeedSegmentationTest() { |
||||
Assert.assertEquals(segmentationManager.isNeedSegmentation("多维数据集"), true); |
||||
} |
||||
|
||||
@Test |
||||
public void startSegmentationTest() { |
||||
String[] result = {"结果报表", "结果", "报表"}; |
||||
Assert.assertEquals(segmentationManager.startSegmentation("结果报表"), result); |
||||
|
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue