diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index b7df52c30f..8661324bd6 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java @@ -102,6 +102,14 @@ public class AlphaFineConfigManager implements XMLable { * */ private boolean showTemplateShop = true; + + /** + * tab页排序 + * 默认排序:动态,模板商城,帮助文档,插件中心,功能,我的模板 + * */ + private String[] tabOrder; + public static final String COMMA = ","; + private Map actionSearchTextCache = new HashMap<>(8); private String cacheBuildNO; @@ -158,6 +166,7 @@ public class AlphaFineConfigManager implements XMLable { this.setShortcuts(reader.getAttrAsString("shortcuts", getDefaultShortCuts())); this.setNeedRemind(reader.getAttrAsBoolean("isNeedRemind", true)); this.setOperateCount(reader.getAttrAsInt("operateCount", 0)); + this.setTabOrder(reader.getAttrAsString("tabOrder", getDefaultTabOrder()).split(",")); } else if (reader.isChildNode()) { if (ComparatorUtils.equals(reader.getTagName(), "ActionSearchTextCache")) { readActionSearchTextCacheXML(reader); @@ -254,7 +263,8 @@ public class AlphaFineConfigManager implements XMLable { .attr("operateCount", this.getOperateCount()) .attr("needSegmentationCheckbox", this.isNeedSegmentationCheckbox()) .attr("needIntelligentCustomerService", this.isNeedIntelligentCustomerService()) - .attr("productDynamics", this.isProductDynamics()); + .attr("productDynamics", this.isProductDynamics()) + .attr("tabOrder", this.getTabOrderString()); writeActionSearchTextCacheXML(writer); writeSearchHistory(writer); writeReadSet(writer); @@ -317,6 +327,13 @@ public class AlphaFineConfigManager implements XMLable { return OperatingSystem.isMacOS() ? "meta + D" : "ctrl + D"; } + /** + * 返回默认排序 + * */ + private String getDefaultTabOrder() { + return AlphaFineConstants.PRODUCT_NEWS + COMMA + AlphaFineConstants.TEMPLATE_SHOP + COMMA + AlphaFineConstants.HELP + COMMA + AlphaFineConstants.PLUGIN + COMMA + AlphaFineConstants.FUNCTION + COMMA + AlphaFineConstants.MY_TEMPLATES; + } + public boolean isContainAction() { return containAction; } @@ -472,4 +489,29 @@ public class AlphaFineConfigManager implements XMLable { public void setProductDynamics(boolean productDynamics) { this.productDynamics = productDynamics; } + + /** + * 返回tab显示顺序 + * */ + public String[] getTabOrder() { + if (tabOrder == null) { + tabOrder = getDefaultTabOrder().split(COMMA); + } + return tabOrder; + } + + /** + * getTabOrder的tostring + * */ + public String getTabOrderString() { + StringBuilder sb = new StringBuilder(); + for (String s : getTabOrder()) { + sb.append(s + COMMA); + } + return sb.toString(); + } + + public void setTabOrder(String[] tabOrder) { + this.tabOrder = tabOrder; + } } diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java index fa0f4a8f0a..7919465f4c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java @@ -3,8 +3,11 @@ package com.fr.design.actions.help.alphafine; import com.fr.base.FRContext; import com.fr.base.svg.IconUtils; import com.fr.design.DesignerEnvManager; +import com.fr.design.actions.help.alphafine.component.CustomSortPane; +import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.itextfield.UITextField; @@ -17,6 +20,7 @@ import com.fr.log.FineLoggerFactory; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.KeyStroke; import java.awt.BorderLayout; import java.awt.Color; @@ -30,6 +34,8 @@ import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; /** * Created by XiaXiang on 2017/4/6. @@ -39,14 +45,24 @@ public class AlphaFineConfigPane extends BasicPane { private static final String DISPLAY_TYPE = "+"; private static final Color LABEL_TEXT = new Color(0x919193); + private static final int SEARCH_CONFIG_PANE_HEIGHT = 70; + private static final int SEARCH_CONFIG_PANE_WIDTH = 87; private static final double COLUMN_WIDTH = 150; private static final double ROW_HEIGHT = 25; private KeyStroke shortCutKeyStore = null; private UICheckBox enabledCheckbox, searchOnlineCheckbox, needSegmentationCheckbox; private UICheckBox productDynamicsCheckbox, containTemplateShopCheckbox, containDocumentCheckbox, containPluginCheckbox, containActionCheckbox, containMyTemplateCheckbox; + // 自定义排序按钮 + private ActionLabel customSortLabel; private UITextField shortcutsField; + + + // 当前tab排序。点击确定后会保存到配置文件中 + private String[] currentOrder; + + // 搜索范围-我的模板,相关组件 private JPanel containMyTemplatePane; private JButton myTemplateSearchConfigButton; @@ -79,7 +95,8 @@ public class AlphaFineConfigPane extends BasicPane { double[] rowSize = {ROW_HEIGHT, ROW_HEIGHT, ROW_HEIGHT}; double[] columnSize = {COLUMN_WIDTH, COLUMN_WIDTH, COLUMN_WIDTH}; - JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Range")); + JPanel searchConfigWrapperPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Range")); + // 搜索选项 productDynamicsCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Product_News")); containActionCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Function")); containPluginCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon")); @@ -89,10 +106,37 @@ public class AlphaFineConfigPane extends BasicPane { containTemplateShopCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Shop")); containMyTemplateCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_My_Templates")); JPanel searchConfigPane = TableLayoutHelper.createTableLayoutPane(initSearchRangeComponents(), rowSize, columnSize); - northPane.add(searchConfigPane); - contentPane.add(northPane); + + // 自定义排序 + JPanel customSortWrapperPane = new JPanel(); + customSortWrapperPane.setPreferredSize(new Dimension(SEARCH_CONFIG_PANE_HEIGHT, SEARCH_CONFIG_PANE_WIDTH)); + customSortWrapperPane.setAlignmentY(JPanel.TOP_ALIGNMENT); + customSortLabel = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Config_Custom_Sort"), false); + customSortLabel.setForeground(UIConstants.NORMAL_BLUE); + customSortLabel.addActionListener((event)->{ + openCustomSortMenu(); + }); + customSortWrapperPane.add(customSortLabel); + if (!hasSelectedSearchRangeCheckBox()) { + customSortLabel.setEnabled(false); + } + + searchConfigWrapperPane.add(searchConfigPane); + searchConfigWrapperPane.add(customSortWrapperPane); + contentPane.add(searchConfigWrapperPane); + } + + /** + * 打开自定义排序面板 + * */ + private void openCustomSortMenu() { + CustomSortPane customSortPane = new CustomSortPane(getSelectedSearchRangeCheckBox(), this); + JPopupMenu popupMenu = new JPopupMenu(); + popupMenu.add(customSortPane); + GUICoreUtils.showPopupMenu(popupMenu, customSortLabel, 0, customSortLabel.getHeight()); } + private Component[][] initSearchRangeComponents() { // 我的模板checkbox设置,点击后 initMyTemplateSearchPane(); @@ -102,12 +146,16 @@ public class AlphaFineConfigPane extends BasicPane { new Component[]{containPluginCheckbox, containActionCheckbox, containMyTemplatePane}, }; - for (int i = 0; i < components.length; i++) { - for (int j = 0; j < components[i].length; j++) { - if (components[i][j] instanceof UICheckBox) { - UICheckBox box = (UICheckBox) components[i][j]; + // 添加选项点事件,无选中选项时自定排序按钮置灰 + UICheckBox[] checkBoxes = new UICheckBox[]{productDynamicsCheckbox, containTemplateShopCheckbox, containDocumentCheckbox, containPluginCheckbox, containActionCheckbox, containMyTemplateCheckbox}; + for (UICheckBox box : checkBoxes) { + box.addActionListener((e)->{ + if (!hasSelectedSearchRangeCheckBox()) { + customSortLabel.setEnabled(false); + } else { + customSortLabel.setEnabled(true); } - } + }); } return components; } @@ -120,6 +168,20 @@ public class AlphaFineConfigPane extends BasicPane { || containPluginCheckbox.isSelected() || containActionCheckbox.isSelected() || containMyTemplateCheckbox.isSelected(); } + /** + * 获取当前选中的搜索范围选项 + * */ + private List getSelectedSearchRangeCheckBox() { + List res = new ArrayList<>(); + UICheckBox[] checkBoxes = new UICheckBox[]{productDynamicsCheckbox, containTemplateShopCheckbox, containDocumentCheckbox, containPluginCheckbox, containActionCheckbox, containMyTemplateCheckbox}; + for (UICheckBox c : checkBoxes) { + if (c.isSelected()) { + res.add(c); + } + } + return res; + } + // 搜索范围-我的模板 private void initMyTemplateSearchPane() { containMyTemplatePane = new JPanel(new FlowLayout(FlowLayout.LEFT,4,5)); @@ -280,6 +342,14 @@ public class AlphaFineConfigPane extends BasicPane { this.needSegmentationCheckbox.setSelected(alphaFineConfigManager.isNeedSegmentationCheckbox()); shortCutKeyStore = convert2KeyStroke(alphaFineConfigManager.getShortcuts()); + + this.currentOrder = alphaFineConfigManager.getTabOrder().clone(); + + if (!hasSelectedSearchRangeCheckBox()) { + customSortLabel.setEnabled(false); + } else { + customSortLabel.setEnabled(true); + } } public void update() { @@ -296,6 +366,9 @@ public class AlphaFineConfigPane extends BasicPane { alphaFineConfigManager.setContainFileContent(this.containFileContentSearchCheckbox.isSelected()); alphaFineConfigManager.setNeedSegmentationCheckbox(this.needSegmentationCheckbox.isSelected()); alphaFineConfigManager.setShortcuts(shortCutKeyStore != null ? shortCutKeyStore.toString().replace(TYPE, DISPLAY_TYPE) : this.shortcutsField.getText()); + alphaFineConfigManager.setTabOrder(currentOrder); + + designerEnvManager.setAlphaFineConfigManager(alphaFineConfigManager); try { DesignerEnvManager.loadLogSetting(); @@ -327,4 +400,12 @@ public class AlphaFineConfigPane extends BasicPane { public void setIsContainFileContentCheckbox(UICheckBox isContainFileContentCheckbox) { this.containFileContentSearchCheckbox = isContainFileContentCheckbox; } + + public String[] getCurrentOrder() { + return currentOrder; + } + + public void setCurrentOrder(String[] currentOrder) { + this.currentOrder = currentOrder; + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java similarity index 91% rename from designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java rename to designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java index 935d2d0e35..946c99f3f1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.alphafine; +package com.fr.design.actions.help.alphafine; import com.fr.base.extension.FileExtension; import com.fr.base.svg.IconUtils; @@ -22,6 +22,19 @@ import java.util.Set; */ public class AlphaFineConstants { + + public static final String FUNCTION = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Function"); + + public static final String MY_TEMPLATES = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_My_Templates"); + + public static final String PRODUCT_NEWS = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Product_News"); + + public static final String HELP = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"); + + public static final String PLUGIN = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"); + + public static final String TEMPLATE_SHOP = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Shop"); + public static final int SHOW_SIZE = 5; public static final int MAX_FILE_SIZE = 1000; @@ -40,7 +53,7 @@ public class AlphaFineConstants { public static final int CONTENT_HEIGHT = 405; - public static final int CELL_HEIGHT = 32; + public static final int CELL_HEIGHT = 29; public static final int CELL_TITLE_HEIGHT = 24; @@ -115,6 +128,8 @@ public class AlphaFineConstants { public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); + public static final String SEARCH_ALL_PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.all.searchAPI"); + public static final String PLUGIN_URL = CloudCenter.getInstance().acquireUrlByKind("af.pluginInfo"); public static final String REUSE_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo"); diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java new file mode 100644 index 0000000000..e483482edb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java @@ -0,0 +1,174 @@ +package com.fr.design.actions.help.alphafine.component; + +import com.fr.base.svg.IconUtils; +import com.fr.design.actions.help.alphafine.AlphaFineConfigPane; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.plaf.PanelUI; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +/** + * @version 11.0 + * @author: Link + * @date: 2022/9/9 + * @Description: alphafine设置 - 搜索范围 - 自定义排序 - 弹出面板 + */ +public class CustomSortPane extends JPanel { + + + private static final int WIDTH = 147; + private static final int ITEM_HEIGHT = 23; + private static final int GAP = 1; + private static final Color BACKGROUND_COLOR = new Color(0xdadadd); + + private UIButton top; + private UIButton bottom; + private UIButton up; + private UIButton down; + private JPanel toolbarPane; + private MenuLabelPane sortItemPane; + private List sortItems; + private MenuLabel selectedLabel; + private AlphaFineConfigPane parentPane; + + public CustomSortPane(List items, AlphaFineConfigPane parentPane) { + this.sortItems = items; + this.parentPane = parentPane; + setLayout(new BorderLayout(GAP, GAP)); + int height = (sortItems.size() + 1) * (ITEM_HEIGHT + GAP) + GAP; + setPreferredSize(new Dimension(WIDTH, height)); + initComponent(); + add(toolbarPane, BorderLayout.NORTH); + add(sortItemPane, BorderLayout.CENTER); + revalidate(); + this.setVisible(true); + } + + @Override + public void setUI(PanelUI ui) { + super.setUI(ui); + setBackground(BACKGROUND_COLOR); + + } + + private void initComponent() { + createToolbarPane(); + createSortItemPane(); + } + + private void createToolbarPane() { + top = new UIButton(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/top.svg")); + bottom = new UIButton(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/bottom.svg")); + up = new UIButton(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/up.svg")); + down = new UIButton(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/down.svg")); + top.addActionListener(e -> { + SwingUtilities.invokeLater(()->{ + sortItemPane.setComponentZOrder(selectedLabel, 0); + CustomSortPane.this.revalidate(); + CustomSortPane.this.repaint(); + refreshCurrentOrder(); + }); + + }); + bottom.addActionListener(e -> { + SwingUtilities.invokeLater(()->{ + sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentCount() - 1); + CustomSortPane.this.revalidate(); + CustomSortPane.this.repaint(); + refreshCurrentOrder(); + }); + + }); + up.addActionListener(e -> { + SwingUtilities.invokeLater(()->{ + sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) - 1); + CustomSortPane.this.revalidate(); + CustomSortPane.this.repaint(); + refreshCurrentOrder(); + }); + + }); + down.addActionListener(e -> { + SwingUtilities.invokeLater(()->{ + sortItemPane.setComponentZOrder(selectedLabel, sortItemPane.getComponentZOrder(selectedLabel) + 1); + CustomSortPane.this.revalidate(); + CustomSortPane.this.repaint(); + refreshCurrentOrder(); + }); + + }); + toolbarPane = new JPanel(new FlowLayout(FlowLayout.TRAILING, GAP, GAP)); + toolbarPane.setBorder(BorderFactory.createEmptyBorder()); + toolbarPane.add(top); + toolbarPane.add(bottom); + toolbarPane.add(up); + toolbarPane.add(down); + } + + private void createSortItemPane() { + String[] currentTabOrder = parentPane.getCurrentOrder(); + Map sortMap = new HashMap<>(); + for (int i = 0; i < currentTabOrder.length; i++) { + sortMap.put(currentTabOrder[i], i); + } + List sortLabels = new ArrayList<>(); + for (UICheckBox item : sortItems) { + MenuLabel label = new MenuLabel(item.getText(), (Function) o -> { + selectedLabel = o; + return null; + }); + sortLabels.add(label); + } + sortLabels.sort(Comparator.comparingInt(tab -> sortMap.get(tab.getText()))); + sortItemPane = new MenuLabelPane(sortLabels); + } + + + private void refreshCurrentOrder() { + String[] currentTabOrder = parentPane.getCurrentOrder(); + HashSet selectedTab = new HashSet<>(); + for (UICheckBox item : sortItems) { + selectedTab.add(item.getText()); + } + + // 未选中的tab,保持原排序不变 + Map exTab = new HashMap<>(); + for (int i = 0; i < currentTabOrder.length; i++) { + if (!selectedTab.contains(currentTabOrder[i])) { + exTab.put(currentTabOrder[i], i); + } + } + + // 计算当前排序 + String[] newOrder = new String[currentTabOrder.length]; + Component[] components =sortItemPane.getComponents(); + for (String s : exTab.keySet()) { + newOrder[exTab.get(s)] = s; + } + + int t = 0; + for (int i = 0; i < newOrder.length; i++) { + if (StringUtils.isEmpty(newOrder[i])) { + newOrder[i] = ((MenuLabel)components[t++]).getText(); + } + } + parentPane.setCurrentOrder(newOrder); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabel.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabel.java new file mode 100644 index 0000000000..2342f6da7a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabel.java @@ -0,0 +1,95 @@ +package com.fr.design.actions.help.alphafine.component; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.utils.DesignUtils; + +import javax.swing.BorderFactory; +import javax.swing.plaf.LabelUI; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.function.Function; + +/** + * @version 11.0 + * @author: Link + * @date: 2022/9/12 + * @Description: 菜单label + */ +public class MenuLabel extends UILabel { + + private static final Color BACKGROUND_COLOR = Color.white; + private static final Color SELECTED_COLOR = new Color(0x419BF9); + private static final Color HOVERED_COLOR = new Color(0xd9ebfe); + private static final int HEIGHT = 23; + private static final int WIDTH = 147; + + private MenuLabelPane parentMenu; + private Function function; + private boolean isSelected; + + public MenuLabel(String text, Function function) { + super(text); + this.function = function; + setOpaque(true); + addMouseListener(createMouseListener()); + } + + public void setParentMenu(MenuLabelPane menu) { + this.parentMenu = menu; + } + + + @Override + public void setUI(LabelUI ui) { + super.setUI(ui); + this.setBackground(BACKGROUND_COLOR); + this.setBorder(BorderFactory.createEmptyBorder(2,10,1,10)); + this.setPreferredSize(new Dimension(WIDTH, HEIGHT)); + this.setFont(DesignUtils.getDefaultGUIFont().applySize(12)); + } + + public void setSelected(boolean selected) { + if (selected) { + parentMenu.setNoneSelected(); + setBackground(SELECTED_COLOR); + function.apply(this); + isSelected = true; + } else { + setBackground(BACKGROUND_COLOR); + isSelected = false; + } + } + + public boolean isSelected() { + return isSelected; + } + + MouseListener createMouseListener() { + return new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + setSelected(true); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + if (!isSelected) { + setBackground(HOVERED_COLOR); + } + } + + @Override + public void mouseExited(MouseEvent e) { + super.mouseExited(e); + if (!isSelected) { + setBackground(BACKGROUND_COLOR); + } + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabelPane.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabelPane.java new file mode 100644 index 0000000000..74877f9bbf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabelPane.java @@ -0,0 +1,33 @@ +package com.fr.design.actions.help.alphafine.component; + +import javax.swing.JPanel; +import java.awt.FlowLayout; +import java.util.List; + +/** + * @version 11.0 + * @author: Link + * @date: 2022/9/12 + * @Description: 简单菜单面板 + */ +public class MenuLabelPane extends JPanel { + + private static final int GAP = 1; + + private List labels; + + public MenuLabelPane(List labels) { + this.labels = labels; + setLayout(new FlowLayout(FlowLayout.CENTER, GAP, GAP)); + for (MenuLabel label : labels) { + label.setParentMenu(this); + add(label); + } + } + + public void setNoneSelected() { + for (MenuLabel label : labels) { + label.setSelected(false); + } + } +} diff --git a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java index cb0442abd8..b7b949aa5d 100644 --- a/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java +++ b/designer-base/src/main/java/com/fr/startup/ui/StartupPageWindow.java @@ -161,6 +161,7 @@ public class StartupPageWindow extends JFrame { revalidate(); setFullScreen(); + } private void setFullScreen() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java index 5648ab98d6..bdc1d18d79 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineUtil.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine; import com.fr.design.DesignerEnvManager; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java index 4a7375f74e..cd73709c90 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java @@ -72,7 +72,7 @@ public class StartUseAction implements ActionListener { File fileNeedOpen = new File(fileName); if (fileName.endsWith(FineMarketConstants.ZIP)) { File[] files = fileNeedOpen.getParentFile().listFiles(); - fileNeedOpen = getFirstCptOrFrm(files); + fileNeedOpen = getFirstTemplate(files); } else if (fileName.endsWith(FineMarketConstants.RAR)) { // rar资源没有解压,所以不用打开模板 return; @@ -88,9 +88,11 @@ public class StartUseAction implements ActionListener { } - private File getFirstCptOrFrm(File[] files) { + private File getFirstTemplate(File[] files) { for (File f : files) { - if (f.getName().endsWith(FineMarketConstants.CPT) || f.getName().endsWith(FineMarketConstants.FRM)) { + if (f.getName().endsWith(FineMarketConstants.CPT) || + f.getName().endsWith(FineMarketConstants.FRM) || + f.getName().endsWith(FineMarketConstants.FVS)) { return f; } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java index 503a4f413d..dcc193e19c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/BottomModel.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.cell.model; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.json.JSONException; import com.fr.json.JSONObject; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java index 7456daffce..89ffaa6334 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.cell.model; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index 570538cad1..3ea91ad548 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.cell.model; import com.fr.design.extra.WebViewDlgHelper; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.json.JSONObject; import com.fr.stable.StringUtils; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java index d504b9d859..eeb3499d82 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.cell.model; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONException; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java index 43aca2cae8..3a22d8cad7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.cell.render; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.cell.model.BottomModel; import javax.swing.*; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java index 4f57b92b28..07661ac4fb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java @@ -2,7 +2,7 @@ package com.fr.design.mainframe.alphafine.cell.render; import com.bulenkov.iconloader.IconLoader; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.BottomModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java index 8d1d5a5f9b..4a1fee43fb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.cell.render; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import javax.swing.*; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index e6e9245706..774735d4b1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -7,7 +7,7 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.cell.CellModelHelper; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java index 339643efc9..8e9a4d3cdd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java @@ -4,16 +4,18 @@ import com.fr.base.svg.IconUtils; import com.fr.base.svg.SVGLoader; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.actions.help.alphafine.AlphaFineShortCutUtil; import com.fr.design.constants.UIConstants; import com.fr.design.gui.borders.UITextFieldBorder; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.model.ProductNews; +import com.fr.design.mainframe.alphafine.preview.DefaultContentPane; +import com.fr.design.mainframe.alphafine.preview.DefaultPluginContentPane; import com.fr.design.mainframe.alphafine.preview.DefaultProductNewsPane; import com.fr.design.mainframe.alphafine.preview.HelpDocumentNoResultPane; import com.fr.design.mainframe.alphafine.preview.LoadingRightSearchResultPane; @@ -72,7 +74,10 @@ import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -102,8 +107,6 @@ public class AlphaFineFrame extends JFrame { private static final String PLACE_HOLDER = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine"); - private static final String FUNCTION = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Function"); - private static final String NO_RESULT = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_No_Result"); private static final String SKILLS = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Skills"); @@ -114,20 +117,10 @@ public class AlphaFineFrame extends JFrame { private static final String GO_FORUM = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Go_Forum"); - private static final String MY_TEMPLATES = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_My_Templates"); - - public static final String PRODUCT_NEWS = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Product_News"); - - private static final String HELP = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"); - - private static final String PLUGIN = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"); - private static final String ONE_CLICK_READ = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_One_Click_Read"); private static final String NO_SEARCH_RESULT = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_NO_Result"); - private static final String TEMPLATE_SHOP = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Shop"); - private static final Image SEARCH_IMAGE = SVGLoader.load("/com/fr/design/mainframe/alphafine/images/search.svg"); private static final Color BORDER_COLOR = new Color(232, 232, 233); @@ -425,9 +418,9 @@ public class AlphaFineFrame extends JFrame { // 内容区,card layout resultPane.add(new DefaultProductNewsPane(), CellType.PRODUCT_NEWS.getFlagStr4None()); resultPane.add(new NoResultWithLinkPane(GO_FORUM, AlphaFineConstants.NO_RESULT_ICON), CellType.NO_RESULT.getFlagStr4None()); - resultPane.add(new NoResultPane(SEARCH_TERM, AlphaFineConstants.NO_RESULT_ICON), CellType.ACTION.getFlagStr4None()); - resultPane.add(new NoResultPane(SEARCH_TERM, AlphaFineConstants.NO_RESULT_ICON), CellType.FILE.getFlagStr4None()); - resultPane.add(new NoResultPane(SEARCH_TERM, AlphaFineConstants.NO_RESULT_ICON), CellType.PLUGIN.getFlagStr4None()); + resultPane.add(new DefaultContentPane(CellType.ACTION, this), CellType.ACTION.getFlagStr4None()); + resultPane.add(new DefaultContentPane(CellType.FILE, this), CellType.FILE.getFlagStr4None()); + resultPane.add(new DefaultPluginContentPane(CellType.PLUGIN, this), CellType.PLUGIN.getFlagStr4None()); resultPane.add(new HelpDocumentNoResultPane(SEARCH_TERM, AlphaFineConstants.NO_RESULT_ICON), CellType.DOCUMENT.getFlagStr4None()); resultPane.add(TemplateShopPane.getInstance(), CellType.TEMPLATE_SHOP.getFlagStr4None()); resultPane.add(new NetWorkFailedPane(this::reSearch), AlphaFineConstants.NETWORK_ERROR); @@ -438,7 +431,7 @@ public class AlphaFineFrame extends JFrame { labelPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); labelPane.setBackground(Color.WHITE); labelContentPane = new JPanel(new BorderLayout()); - tabLabel = createTabLabel(PRODUCT_NEWS); + tabLabel = createTabLabel(AlphaFineConstants.PRODUCT_NEWS); labelWestPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); labelWestPane.add(tabLabel); labelContentPane.add(labelWestPane, BorderLayout.WEST); @@ -518,8 +511,8 @@ public class AlphaFineFrame extends JFrame { AlphaFineFrame.this.selectedTab = selectedLabel; // 处理产品动态 tab与下方文字展示不一致 - if (ComparatorUtils.equals(selectedLabel.getText().trim(), PRODUCT_NEWS)) { - tabLabel.setText(PRODUCT_NEWS); + if (ComparatorUtils.equals(selectedLabel.getText().trim(), AlphaFineConstants.PRODUCT_NEWS)) { + tabLabel.setText(AlphaFineConstants.PRODUCT_NEWS); } else { tabLabel.setText(selectedLabel.getText()); } @@ -600,25 +593,27 @@ public class AlphaFineFrame extends JFrame { List selectedLabelList = new ArrayList<>(); AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); if (alphaFineConfigManager.isProductDynamics()) { - selectedLabelList.add(new SelectedLabel(PRODUCT_NEWS, CellType.PRODUCT_NEWS)); + selectedLabelList.add(new SelectedLabel(AlphaFineConstants.PRODUCT_NEWS, CellType.PRODUCT_NEWS)); } if (alphaFineConfigManager.hasTemplateShop()) { - selectedLabelList.add(new SelectedLabel(TEMPLATE_SHOP, CellType.TEMPLATE_SHOP)); + selectedLabelList.add(new SelectedLabel(AlphaFineConstants.TEMPLATE_SHOP, CellType.TEMPLATE_SHOP)); } if (alphaFineConfigManager.isContainDocument()) { - selectedLabelList.add(new SelectedLabel(HELP, CellType.DOCUMENT)); + selectedLabelList.add(new SelectedLabel(AlphaFineConstants.HELP, CellType.DOCUMENT)); } if (alphaFineConfigManager.isContainPlugin()) { - selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN)); + selectedLabelList.add(new SelectedLabel(AlphaFineConstants.PLUGIN, CellType.PLUGIN)); } if (alphaFineConfigManager.isContainAction()) { - selectedLabelList.add(new SelectedLabel(FUNCTION, CellType.ACTION)); + selectedLabelList.add(new SelectedLabel(AlphaFineConstants.FUNCTION, CellType.ACTION)); } if (alphaFineConfigManager.isContainMyTemplate()) { - selectedLabelList.add(new SelectedLabel(MY_TEMPLATES, CellType.FILE)); + selectedLabelList.add(new SelectedLabel(AlphaFineConstants.MY_TEMPLATES, CellType.FILE)); } + // 根据设置排序 + sortList(selectedLabelList); // 默认选中第一个tab if (!selectedLabelList.isEmpty()) { selectedLabelList.get(0).setSelected(true); @@ -627,6 +622,19 @@ public class AlphaFineFrame extends JFrame { return selectedLabelList; } + /** + * 根据用户自定义的顺序排序 + * */ + private void sortList(List list) { + AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); + String[] tabOrder = alphaFineConfigManager.getTabOrder(); + Map orderMap = new HashMap<>(); + for (int i = 0; i < tabOrder.length; i++) { + orderMap.put(tabOrder[i], i); + } + list.sort(Comparator.comparingInt(tab -> orderMap.get(tab.getText()))); + } + private void fireOneClickRead() { List productNewsList = ProductNewsSearchManager.getInstance().getCachedProductNewsList(); Set readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java index f4ffe50e39..6cad0e2e26 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineList.java @@ -1,15 +1,16 @@ package com.fr.design.mainframe.alphafine.component; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.DocumentModel; import com.fr.design.mainframe.alphafine.preview.ResultShowPane; + +import javax.swing.JList; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JList; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineTextField.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineTextField.java index b745b0de96..ccf6e6d5f0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineTextField.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineTextField.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.component; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineToolTipContentCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineToolTipContentCellRender.java index 1b439f1a83..395dec800f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineToolTipContentCellRender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineToolTipContentCellRender.java @@ -1,20 +1,21 @@ package com.fr.design.mainframe.alphafine.component; import com.fr.base.svg.IconUtils; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; + import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.ListCellRenderer; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineToolTipList.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineToolTipList.java index 3d33337724..7f9edfaffc 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineToolTipList.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineToolTipList.java @@ -1,13 +1,14 @@ package com.fr.design.mainframe.alphafine.component; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.general.ComparatorUtils; + +import javax.swing.JList; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import javax.swing.JList; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaSearchTooltipPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaSearchTooltipPane.java index b07d506b8d..6682618766 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaSearchTooltipPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaSearchTooltipPane.java @@ -1,14 +1,14 @@ package com.fr.design.mainframe.alphafine.component; import com.fr.design.DesignerEnvManager; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; -import com.fr.stable.StringUtils; + +import javax.swing.DefaultListModel; +import javax.swing.JPanel; import java.awt.Color; import java.awt.Dimension; import java.util.Stack; -import javax.swing.DefaultListModel; -import javax.swing.JPanel; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java index c6b5983d68..a8f51641c6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsContentCellRender.java @@ -1,21 +1,22 @@ package com.fr.design.mainframe.alphafine.component; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.mainframe.alphafine.model.ProductNews; import com.fr.design.utils.DesignUtils; + +import javax.swing.BorderFactory; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.ListCellRenderer; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Graphics; import java.text.SimpleDateFormat; -import javax.swing.BorderFactory; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.ListCellRenderer; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsList.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsList.java index 48dfa4b865..10921ff114 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsList.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsList.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.component; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.ProductNews; import com.fr.design.utils.BrowseUtils; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsSearchResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsSearchResultPane.java index b3fd4dc958..5e29eed073 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsSearchResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsSearchResultPane.java @@ -1,13 +1,12 @@ package com.fr.design.mainframe.alphafine.component; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java new file mode 100644 index 0000000000..3830b6db0d --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java @@ -0,0 +1,53 @@ +package com.fr.design.mainframe.alphafine.component; + +import com.fr.design.mainframe.alphafine.AlphaFineHelper; +import org.jetbrains.annotations.NotNull; + +import javax.swing.JLabel; +import javax.swing.JPanel; +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.List; + +/** + * @author Link + * @version 11.0 + * Created by Link on 2022/9/19 + * alphaFine - 推荐搜索词标签 + */ +public class RecommendSearchLabel extends JPanel { + + private static final Color RECOMMEND_SEARCH_KEY_BLUE = new Color(0x419bf9); + + public RecommendSearchLabel(String title, @NotNull List tips) { + this.setLayout(new FlowLayout(FlowLayout.LEFT)); + this.setBackground(Color.WHITE); + JLabel recommend = new JLabel(title); + this.add(recommend); + + for (String key : tips) { + JLabel keyLabel = new SearchKeyLabel(key); + this.add(keyLabel); + } + } + + + public class SearchKeyLabel extends JLabel { + String searchKey; + + SearchKeyLabel(String searchKey) { + this.searchKey = searchKey; + setText(searchKey); + setBackground(Color.WHITE); + setForeground(RECOMMEND_SEARCH_KEY_BLUE); + addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + AlphaFineHelper.getAlphaFineDialog().fireSearch(searchKey); + } + }); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchPane.java index 41d4881605..8082d8e762 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchPane.java @@ -1,23 +1,16 @@ package com.fr.design.mainframe.alphafine.component; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.TemplateResource; import javax.swing.BorderFactory; -import javax.swing.JLabel; -import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Color; -import java.awt.FlowLayout; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; import java.util.List; public class RecommendSearchPane extends TemplateResourcePanel { private static final Color BORDER_WHITE = new Color(0xe8e8e9); - private static final Color RECOMMEND_SEARCH_KEY_BLUE = new Color(0x419bf9); public RecommendSearchPane(TemplateResource templateResource) { super(); @@ -37,37 +30,11 @@ public class RecommendSearchPane extends TemplateResourcePanel { private void createCenterPane() { - setCenterPane(new JPanel(new FlowLayout(FlowLayout.LEFT))); - JPanel centerPane = getCenterPane(); - centerPane.setBackground(Color.WHITE); - JLabel recommend = new JLabel(Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Resource_Recommend_For_You")); - centerPane.add(recommend); + String recommend = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Resource_Recommend_For_You"); List searchKeys = getTemplateResource().getRecommendSearchKey(); - for (String key : searchKeys) { - JLabel keyLabel = new SearchKeyLabel(key); - centerPane.add(keyLabel); - } - } - - - class SearchKeyLabel extends JLabel { - String searchKey; - - SearchKeyLabel(String searchKey) { - this.searchKey = searchKey; - setText(searchKey); - setBackground(Color.WHITE); - setForeground(RECOMMEND_SEARCH_KEY_BLUE); - addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - AlphaFineHelper.getAlphaFineDialog().fireSearch(searchKey); - } - }); - } - + setCenterPane(new RecommendSearchLabel(recommend, searchKeys)); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java new file mode 100644 index 0000000000..6207be8427 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java @@ -0,0 +1,76 @@ +package com.fr.design.mainframe.alphafine.component; + +import com.fr.base.svg.IconUtils; +import com.fr.common.util.Collections; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.utils.DesignUtils; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Link + * @version 11.0 + * Created by Link on 2022/9/18 + * alphafine - 搜索提示面板 + */ +public class SearchHintPane extends JPanel { + + private static final String TITLE = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Search_Title"); + private static final String RECOMMEND = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend_Search"); + private static final Icon icon = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/search_hint.svg"); + private static final int HEIGHT = 305; + private static final int WIDTH = 300; + private static final int TITLE_FONT_SIZE = 14; + + public SearchHintPane() { + this(new ArrayList<>()); + } + + public SearchHintPane(List hints) { + this(hints, icon, TITLE); + } + + public SearchHintPane(List hints, Icon icon, String title) { + setLayout(new BorderLayout()); + setBackground(Color.white); + setPreferredSize(new Dimension(WIDTH, HEIGHT)); + setAlignmentY(SwingConstants.CENTER); + UILabel image = new UILabel(); + image.setPreferredSize(new Dimension(150, 111)); + image.setHorizontalAlignment(SwingConstants.CENTER); + image.setIcon(icon); + image.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + add(image, BorderLayout.NORTH); + add(generateDescription(title), BorderLayout.CENTER); + add(generateHintsLabel(hints), BorderLayout.SOUTH); + } + + protected Component generateDescription(String title) { + JLabel description = new JLabel(title); + description.setForeground(AlphaFineConstants.MEDIUM_GRAY); + description.setFont(DesignUtils.getDefaultGUIFont().applySize(TITLE_FONT_SIZE)); + description.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + description.setHorizontalAlignment(SwingConstants.CENTER); + return description; + } + + private Component generateHintsLabel(List hints) { + if (Collections.isEmpty(hints)) { + return new JLabel(); + } + return new RecommendSearchLabel(RECOMMEND, hints); + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultContentCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultContentCellRender.java index dd65d36a2f..b3fe2dc5b7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultContentCellRender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultContentCellRender.java @@ -1,19 +1,20 @@ package com.fr.design.mainframe.alphafine.component; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.general.IOUtils; import com.fr.stable.StringUtils; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dimension; + import javax.swing.BorderFactory; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.ListCellRenderer; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultPane.java index d4f6c18027..642a0da2b2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchResultPane.java @@ -1,13 +1,14 @@ package com.fr.design.mainframe.alphafine.component; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.preview.ResultShowPane; + +import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; -import javax.swing.JPanel; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SelectedLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SelectedLabel.java index 9bf151adc9..4bc59fd935 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SelectedLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SelectedLabel.java @@ -2,7 +2,7 @@ package com.fr.design.mainframe.alphafine.component; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.mainframe.alphafine.CellType; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePanel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePanel.java index 967f0a41ff..31652c405d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePanel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePanel.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.alphafine.component; +import com.fr.common.util.Strings; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.alphafine.model.TemplateResource; import com.fr.design.mainframe.alphafine.preview.TemplateShopPane; @@ -93,11 +94,8 @@ public class TemplateResourcePanel extends JPanel { } private void createCenterPane() { - JLabel nameLabel = new JLabel(templateResource.getName()); - nameLabel.setFont(RESOURCE_NAME_FONT); - nameLabel.setForeground(RESOURCE_NAME_COLOR); - nameLabel.setBackground(Color.WHITE); - nameLabel.setBorder(BorderFactory.createEmptyBorder()); + JLabel nameLabel = createHtmlNameLabel(); + JLabel demoLabel = new JLabel(); if (templateResource.hasDemoUrl()) { @@ -121,6 +119,26 @@ public class TemplateResourcePanel extends JPanel { centerPane.add(demoLabel, BorderLayout.EAST); } + + private static final String SEARCH_WORD_FORMAT = "%s"; + private static final String HTML_JLABEL_FORMAT = "%s"; + + private JLabel createHtmlNameLabel() { + JLabel label = new JLabel(); + String htmlText = templateResource.getName(); + String searchWord = templateResource.getSearchWord(); + if (!Strings.isEmpty(searchWord) && htmlText.contains(searchWord)) { + htmlText = htmlText.replace(searchWord, String.format(SEARCH_WORD_FORMAT, searchWord)); + } + htmlText = String.format(HTML_JLABEL_FORMAT, htmlText); + label.setText(htmlText); + label.setFont(RESOURCE_NAME_FONT); + label.setForeground(RESOURCE_NAME_COLOR); + label.setBackground(Color.WHITE); + label.setBorder(BorderFactory.createEmptyBorder()); + return label; + } + @Override public Dimension getPreferredSize() { return new Dimension(180, 90); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketConstants.java index f17095b093..f9d80238b5 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketConstants.java @@ -7,4 +7,5 @@ public class FineMarketConstants { public static final String RAR = ".rar"; public static final String CPT = ".cpt"; public static final String FRM = ".frm"; + public static final String FVS = ".fvs"; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java index c95ee8bde8..29172f94ef 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/download/FineMarketDownloadManager.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.download; import com.fr.base.svg.IconUtils; import com.fr.common.util.Strings; +import com.fr.decision.webservice.v10.log.download.utils.LogZipUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.extra.Process; import com.fr.design.i18n.Toolkit; @@ -11,8 +12,9 @@ import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.TemplateResource; import com.fr.design.mainframe.alphafine.search.helper.FineMarketClientHelper; import com.fr.design.mainframe.toast.SimpleToast; +import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; -import com.fr.third.jodd.io.ZipUtil; +import com.fr.stable.pinyin.ChineseHelper; import javax.swing.SwingUtilities; import javax.swing.filechooser.FileSystemView; @@ -80,7 +82,11 @@ public class FineMarketDownloadManager { if (fileName.endsWith(FineMarketConstants.ZIP)) { File file = new File(fileName); File parentDir = file.getParentFile(); - ZipUtil.unzip(file, parentDir); + if (ChineseHelper.containChinese(fileName)) { + IOUtils.unzip(file, parentDir.getAbsolutePath(), LogZipUtils.GBK); + } else { + IOUtils.unzip(file, parentDir.getAbsolutePath()); + } } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResource.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResource.java index b7ace8a3fc..9d55feb892 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResource.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResource.java @@ -65,6 +65,12 @@ public class TemplateResource { private List recommendSearchKey; private boolean embed; + + + /// 其他属性 + // 当前搜索词 + private String searchWord; + public static List createByJson(JSONArray jsonArray) { List list = new ArrayList<>(); if (jsonArray != null) { @@ -219,4 +225,12 @@ public class TemplateResource { this.uuid = uuid; return this; } + + public String getSearchWord() { + return searchWord; + } + + public void setSearchWord(String searchWord) { + this.searchWord = searchWord; + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java new file mode 100644 index 0000000000..91a79f66cc --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java @@ -0,0 +1,48 @@ +package com.fr.design.mainframe.alphafine.preview; + +import com.fr.design.actions.help.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.CellType; +import com.fr.design.mainframe.alphafine.component.AlphaFineFrame; +import com.fr.design.mainframe.alphafine.component.SearchHintPane; +import com.fr.design.mainframe.alphafine.search.SearchWorkerManager; +import com.fr.design.mainframe.alphafine.search.manager.SearchProviderRegistry; + +import javax.swing.JPanel; +import java.awt.BorderLayout; + +/** + * @version 11.0 + * @author: Link + * @date: 2022/9/16 + * @Description: alphaFine - 默认展示页面 + */ +public class DefaultContentPane extends JPanel { + + // 左边展示内容,右边展示搜索提示 + private SearchWorkerManager searchWorkerManager; + private CellType cellType; + + public DefaultContentPane(CellType cellType, AlphaFineFrame parentWindow) { + this.setLayout(new BorderLayout()); + this.setPreferredSize(AlphaFineConstants.PREVIEW_SIZE); + this.searchWorkerManager = new SearchWorkerManager( + cellType, + searchTextBean -> SearchProviderRegistry.getSearchProvider(cellType).getDefaultResult(), + parentWindow, + new SimpleRightSearchResultPane(new SearchHintPane()) + ); + this.searchWorkerManager.showDefault(this); + } + + public DefaultContentPane() { + + } + + public CellType getCellType() { + return cellType; + } + + public void setCellType(CellType cellType) { + this.cellType = cellType; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java new file mode 100644 index 0000000000..87deed7a8c --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultPluginContentPane.java @@ -0,0 +1,80 @@ +package com.fr.design.mainframe.alphafine.preview; + +import com.fr.design.actions.help.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.AlphaFineHelper; +import com.fr.design.mainframe.alphafine.CellType; +import com.fr.design.mainframe.alphafine.component.AlphaFineFrame; +import com.fr.design.mainframe.alphafine.component.SearchHintPane; +import com.fr.design.mainframe.alphafine.search.SearchWorkerManager; +import com.fr.design.mainframe.alphafine.search.manager.SearchProviderRegistry; +import com.fr.general.CloudCenter; +import com.fr.log.FineLoggerFactory; + +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Link + * @version 11.0 + * Created by Link on 2022/9/18 + * alphafine插件默认页 + */ +public class DefaultPluginContentPane extends DefaultContentPane { + + // 左边展示内容,右边展示搜索提示 + private SearchWorkerManager searchWorkerManager; + private CellType cellType; + + private static final String[] HINTS = CloudCenter.getInstance().acquireConf("alphafine.plugin.recommend", "JS,API,JSON").split(","); + + public DefaultPluginContentPane(CellType cellType, AlphaFineFrame parentWindow) { + super(); + this.setLayout(new BorderLayout()); + this.setPreferredSize(AlphaFineConstants.PREVIEW_SIZE); + new SwingWorker(){ + @Override + protected Boolean doInBackground() throws Exception { + add(new SearchLoadingPane()); + return AlphaFineHelper.isNetworkOk(); + } + + @Override + protected void done() { + super.done(); + try { + boolean networkOk = get(); + removeAll(); + if (!networkOk) { + add(new NetWorkFailedPane()); + } else { + List searchKeys = new ArrayList<>(); + for (String s : HINTS) { + searchKeys.add(s); + } + searchWorkerManager = new SearchWorkerManager( + cellType, + searchTextBean -> SearchProviderRegistry.getSearchProvider(cellType).getDefaultResult(), + parentWindow, + new SimpleRightSearchResultPane(new SearchHintPane(searchKeys)) + ); + searchWorkerManager.showDefault(DefaultPluginContentPane.this); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); + } + + } + }.execute(); + + } + + public CellType getCellType() { + return cellType; + } + + public void setCellType(CellType cellType) { + this.cellType = cellType; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultProductNewsPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultProductNewsPane.java index d70e37ec04..e32e6dd249 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultProductNewsPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultProductNewsPane.java @@ -1,9 +1,9 @@ package com.fr.design.mainframe.alphafine.preview; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.component.ProductNewsContentCellRender; import com.fr.design.mainframe.alphafine.component.ProductNewsList; @@ -12,14 +12,15 @@ import com.fr.design.mainframe.alphafine.model.ProductNews; import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchManager; import com.fr.design.utils.DesignUtils; import com.fr.log.FineLoggerFactory; -import java.awt.BorderLayout; -import java.awt.Color; -import java.util.List; + import javax.swing.BorderFactory; import javax.swing.DefaultListModel; import javax.swing.ImageIcon; import javax.swing.JPanel; import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.Color; +import java.util.List; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DocumentPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DocumentPreviewPane.java index 6aa46f1a63..70e69f57f2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DocumentPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DocumentPreviewPane.java @@ -2,7 +2,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.itextarea.UITextArea; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import javax.swing.*; import java.awt.*; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java index 1ba7a5b915..1548aeb7b9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/FilePreviewPane.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import javax.swing.*; import java.awt.*; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java index 961d490e58..e3eac4d968 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java @@ -1,9 +1,9 @@ package com.fr.design.mainframe.alphafine.preview; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.DesignUtils; @@ -13,6 +13,12 @@ import com.fr.json.JSONFactory; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.SwingConstants; +import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Cursor; @@ -22,12 +28,6 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.LinkedHashMap; import java.util.Map; -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import javax.swing.SwingConstants; -import javax.swing.SwingWorker; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/LoadingRightSearchResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/LoadingRightSearchResultPane.java index 6201c25e58..916c7307a6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/LoadingRightSearchResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/LoadingRightSearchResultPane.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.preview; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.FileModel; @@ -11,6 +11,11 @@ import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; import com.fr.workspace.server.exporter.LocalExportOperator; import com.fr.workspace.server.exporter.TemplateExportOperator; + +import javax.imageio.ImageIO; +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; @@ -18,10 +23,6 @@ import java.awt.image.BufferedImage; import java.io.IOException; import java.net.URL; import java.util.concurrent.ExecutionException; -import javax.imageio.ImageIO; -import javax.swing.BorderFactory; -import javax.swing.ImageIcon; -import javax.swing.SwingWorker; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NetWorkFailedPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NetWorkFailedPane.java index eb4c107c46..1dda65942c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NetWorkFailedPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NetWorkFailedPane.java @@ -3,7 +3,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.general.IOUtils; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java index db92821186..33fb600f1a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultPane.java @@ -1,17 +1,16 @@ package com.fr.design.mainframe.alphafine.preview; -import com.bulenkov.iconloader.IconLoader; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.utils.DesignUtils; -import java.awt.Component; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java index 3dc4a44b2a..8b490a0929 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java @@ -1,15 +1,16 @@ package com.fr.design.mainframe.alphafine.preview; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.dialog.link.MessageWithLink; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.DesignUtils; -import java.awt.Color; -import java.awt.Component; + import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; +import java.awt.Color; +import java.awt.Component; /** * 带跳转链接的无结果面板 diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/PluginPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/PluginPreviewPane.java index 6f659055e4..dbe3126647 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/PluginPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/PluginPreviewPane.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index f6a9f70767..5baa790648 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -3,7 +3,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextarea.UITextArea; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.RobotModel; import com.fr.log.FineLoggerFactory; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/SearchLoadingPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/SearchLoadingPane.java index e694708e88..17c2289794 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/SearchLoadingPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/SearchLoadingPane.java @@ -1,13 +1,12 @@ package com.fr.design.mainframe.alphafine.preview; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; import javax.swing.ImageIcon; import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/SimpleRightSearchResultPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/SimpleRightSearchResultPane.java index 6d94bd9ed8..656e80b6ec 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/SimpleRightSearchResultPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/SimpleRightSearchResultPane.java @@ -1,11 +1,12 @@ package com.fr.design.mainframe.alphafine.preview; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; + +import javax.swing.JPanel; import java.awt.Color; import java.awt.Dimension; -import javax.swing.JPanel; /** * @author hades diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateResourceDetailPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateResourceDetailPane.java index f43d16e63c..a4b47dd8ee 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateResourceDetailPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateResourceDetailPane.java @@ -1,10 +1,10 @@ package com.fr.design.mainframe.alphafine.preview; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.action.StartUseAction; import com.fr.design.mainframe.alphafine.component.TemplateResourceImagePanel; import com.fr.design.mainframe.alphafine.model.TemplateResourceDetail; @@ -70,8 +70,8 @@ public class TemplateResourceDetailPane extends JPanel { private static final Font HTML_FONT = DesignUtils.getDefaultGUIFont().applySize(12); private static final Color HTML_COLOR = new Color(0x5c5c5d); - private static final String HTML_FORMAT = "%s"; - private static final String DETAIL_INFO_HTML_FORMAT = "

" + DETAIL_INFO + "

%s"; + private static final String HTML_FORMAT = "%s"; + private static final String DETAIL_INFO_HTML_FORMAT = "

" + DETAIL_INFO + "

%s"; private static final String HTML_P_TAG_FORMAT = "

%s

"; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateShopPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateShopPane.java index 00e7c4495c..3ce5f8caf8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateShopPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateShopPane.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.component.TemplateResourcePageGridPane; import com.fr.design.mainframe.alphafine.model.TemplateResource; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/ProductNewsSearchWorkerManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/ProductNewsSearchWorkerManager.java index 40161e9baa..a1631603dd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/ProductNewsSearchWorkerManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/ProductNewsSearchWorkerManager.java @@ -1,16 +1,18 @@ package com.fr.design.mainframe.alphafine.search; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.component.AlphaFineFrame; import com.fr.design.mainframe.alphafine.component.ProductNewsSearchResultPane; import com.fr.design.mainframe.alphafine.model.ProductNews; +import com.fr.design.mainframe.alphafine.preview.DefaultContentPane; import com.fr.log.FineLoggerFactory; -import java.util.List; -import java.util.function.Function; + import javax.swing.DefaultListModel; import javax.swing.SwingWorker; +import java.util.List; +import java.util.function.Function; /** * @author hades @@ -99,6 +101,11 @@ public class ProductNewsSearchWorkerManager implements SearchManager { this.searchWorker.execute(); } + @Override + public void showDefault(DefaultContentPane defaultContentPane) { + + } + public ProductNewsSearchResultPane getSearchResultPane() { return searchResultPane; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchManager.java index f9f7893955..079f1b7105 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchManager.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe.alphafine.search; +import com.fr.design.mainframe.alphafine.preview.DefaultContentPane; + /** * @author hades * @version 11.0 @@ -7,7 +9,12 @@ package com.fr.design.mainframe.alphafine.search; */ public interface SearchManager { - void doSearch(SearchTextBean searchTextBean); + void doSearch(SearchTextBean searchTextBean); + + /** + * 展示默认内容 + * */ + void showDefault(DefaultContentPane defaultContentPane); boolean hasSearchResult(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchTextBean.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchTextBean.java index f7148363c2..25fb64f9c6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchTextBean.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchTextBean.java @@ -7,6 +7,8 @@ package com.fr.design.mainframe.alphafine.search; */ public class SearchTextBean { + public static SearchTextBean EMPTY = new SearchTextBean("", new String[0]); + private String searchText; /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java index 0b25c3ca1e..bca8904a13 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.search; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; @@ -9,12 +9,15 @@ import com.fr.design.mainframe.alphafine.component.AlphaFineList; import com.fr.design.mainframe.alphafine.component.SearchListModel; import com.fr.design.mainframe.alphafine.component.SearchResultPane; import com.fr.design.mainframe.alphafine.model.SearchResult; +import com.fr.design.mainframe.alphafine.preview.DefaultContentPane; import com.fr.design.mainframe.alphafine.preview.ResultShowPane; import com.fr.log.FineLoggerFactory; -import java.util.function.Function; -import javax.swing.SwingWorker; import org.jetbrains.annotations.Nullable; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import java.util.function.Function; + /** * @author hades * @version 11.0 @@ -120,6 +123,22 @@ public class SearchWorkerManager implements SearchManager { this.searchWorker.execute(); } + @Override + public void showDefault(DefaultContentPane defaultContentPane) { + searchResultPane = new SearchResultPane(SearchTextBean.EMPTY.getSegmentation(), resultShowPane); + SearchListModel searchListModel = new SearchListModel(new SearchResult(), searchResultPane.getSearchResultList(), searchResultPane.getLeftSearchResultPane()); + SearchResult searchResult = searchResultFunction.apply(SearchTextBean.EMPTY); + for (AlphaCellModel object : searchResult) { + AlphaFineHelper.checkCancel(); + searchListModel.addElement(object); + } + searchResultPane.getSearchResultList().setModel(searchListModel); + searchResultPane.getSearchResultList().setSelectedIndex(0); + searchResultPane.getSearchResultList().requestFocus(); + defaultContentPane.add(searchResultPane); + SwingUtilities.invokeLater(()->defaultContentPane.repaint()); + } + @Override public boolean hasSearchResult() { return hasSearchResult; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/TemplateResourceSearchWorkerManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/TemplateResourceSearchWorkerManager.java index 613f0f57a8..6dd1a8adfc 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/TemplateResourceSearchWorkerManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/TemplateResourceSearchWorkerManager.java @@ -1,10 +1,11 @@ package com.fr.design.mainframe.alphafine.search; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.component.AlphaFineFrame; import com.fr.design.mainframe.alphafine.model.TemplateResource; +import com.fr.design.mainframe.alphafine.preview.DefaultContentPane; import com.fr.design.mainframe.alphafine.preview.TemplateShopPane; import com.fr.log.FineLoggerFactory; @@ -68,6 +69,11 @@ public class TemplateResourceSearchWorkerManager implements SearchManager { this.searchWorker.execute(); } + @Override + public void showDefault(DefaultContentPane defaultContentPane) { + + } + void showResult(List list) { if (networkError && !searchResult) { alphaFineFrame.showResult(AlphaFineConstants.NETWORK_ERROR); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/SearchProviderRegistry.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/SearchProviderRegistry.java new file mode 100644 index 0000000000..0cf7abae95 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/SearchProviderRegistry.java @@ -0,0 +1,34 @@ +package com.fr.design.mainframe.alphafine.search.manager; + +import com.fr.design.mainframe.alphafine.CellType; +import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; +import com.fr.design.mainframe.alphafine.search.manager.impl.ActionSearchManager; +import com.fr.design.mainframe.alphafine.search.manager.impl.FileSearchManager; +import com.fr.design.mainframe.alphafine.search.manager.impl.PluginSearchManager; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Link + * @version 11.0 + * Created by Link on 2022/9/18 + * alphafine搜索提供者注册到这里 + */ +public class SearchProviderRegistry { + private static Map map; + + static { + map = new HashMap<>(); + map.put(CellType.PLUGIN, PluginSearchManager.getInstance()); + map.put(CellType.ACTION, ActionSearchManager.getInstance()); + map.put(CellType.FILE, FileSearchManager.getInstance()); + } + + /** + * 根据celltype获得对应searchProvider + * */ + public static AlphaFineSearchProvider getSearchProvider(CellType cellType) { + return map.get(cellType); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java index 631fce88ea..420762b87a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java @@ -22,6 +22,12 @@ public interface AlphaFineSearchProvider { */ SearchResult getMoreSearchResult(String searchText); + /** + * 不搜索的情况下,获取显示结果 + * */ + default SearchResult getDefaultResult() { + return new SearchResult(); + } /** * 获取所有搜索结果 取决于具体实现 diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java index 54d6d14025..c6b02160f8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.ActionModel; @@ -29,6 +29,7 @@ public class ActionSearchManager implements AlphaFineSearchProvider { private SearchResult filterModelList; private SearchResult lessModelList; private SearchResult moreModelList; + private SearchResult defaultModelList; public static ActionSearchManager getInstance() { if (instance == null) { @@ -41,6 +42,17 @@ public class ActionSearchManager implements AlphaFineSearchProvider { return instance; } + /** + * 初始化的时候初始化默认功能列表 + * */ + private ActionSearchManager() { + defaultModelList = new SearchResult(); + List updateActions = UpdateActionManager.getUpdateActionManager().getUpdateActions(); + for (UpdateActionModel updateActionModel : updateActions) { + defaultModelList.add(new ActionModel(updateActionModel.getActionName(), updateActionModel.getParentName(), updateActionModel.getAction())); + } + } + /** * 根据类名获取对象 * @@ -115,4 +127,12 @@ public class ActionSearchManager implements AlphaFineSearchProvider { getLessSearchResult(searchTextBean.getSegmentation()); return filterModelList; } + + @Override + public SearchResult getDefaultResult() { + return defaultModelList; + } + + + } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index aa3690cb68..38bc6b8e96 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.general.http.HttpToolbox; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index 3ea1f2db2f..30416749e5 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.DocumentModel; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index 744b5a8399..7508f3a6c7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -3,7 +3,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.base.FRContext; import com.fr.base.extension.FileExtension; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.FileModel; @@ -21,6 +21,8 @@ import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; +import java.util.List; + /** * Created by XiaXiang on 2017/3/27. @@ -33,9 +35,11 @@ public class FileSearchManager implements AlphaFineSearchProvider { private static volatile FileSearchManager instance; private SearchResult filterModelList; private SearchResult lessModelList; + private SearchResult defaultModelList; private SearchResult moreModelList; private String searchText; private FileNode[] fileNodes = null; + private static final int defaultListSize = 10; //停止搜索 //隐藏的搜索功能,可根据特殊的字符标记判断搜索分类 @@ -137,6 +141,19 @@ public class FileSearchManager implements AlphaFineSearchProvider { } } + @Override + public SearchResult getDefaultResult() { + List list = DesignerEnvManager.getEnvManager().getRecentOpenedFilePathList(); + defaultModelList = new SearchResult(); + for (int i = 0; i < Math.min(defaultListSize, list.size()); i++) { + String name = list.get(i).toLowerCase(); + name = name.replaceAll(StringUtils.BLANK, StringUtils.EMPTY); + FileModel model = new FileModel(name, name); + defaultModelList.add(model); + } + return defaultModelList; + } + /** * 搜索模板内容 * diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java index 749a0a611f..3fad289a0e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.RobotModel; @@ -11,16 +11,15 @@ import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONFactory; import com.fr.json.JSONObject; -import com.fr.json.JSONUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.jetbrains.annotations.Nullable; /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 56f7078b41..5627f89952 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -1,7 +1,8 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; +import com.fr.common.util.Collections; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; @@ -15,13 +16,19 @@ import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.basic.version.Version; -import com.fr.plugin.basic.version.VersionIntervalType; import com.fr.plugin.basic.version.VersionIntervalFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.function.ToLongFunction; /** * Created by XiaXiang on 2017/3/27. @@ -30,6 +37,12 @@ public class PluginSearchManager implements AlphaFineSearchProvider { private SearchResult lessModelList; private SearchResult moreModelList; private SearchResult searchResult; + private SearchResult defaultModelList; + + private static final int defaultListSize = 10; + private static final String timeFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; + + private static final String UPLOAD_TIME = "uploadTime"; private PluginSearchManager() { @@ -155,4 +168,60 @@ public class PluginSearchManager implements AlphaFineSearchProvider { getLessSearchResult(searchTextBean.getSegmentation()); return searchResult; } + + @Override + public SearchResult getDefaultResult() { + this.defaultModelList = new SearchResult(); + try { + String url = AlphaFineConstants.SEARCH_ALL_PLUGIN_URL; + String result = HttpToolbox.get(url); + AlphaFineHelper.checkCancel(); + JSONObject jsonObject = new JSONObject(result); + JSONArray jsonArray = jsonObject.optJSONArray("result"); + List plugins = jsonArray.getList(); + + List pluginModels = new ArrayList<>(); + pluginModels.addAll(parseDefaultPluginModel(plugins)); + + pluginModels.forEach(m->this.defaultModelList.add(m)); + + } catch (Exception e) { + FineLoggerFactory.getLogger().error("plugin search error :" + e.getMessage()); + } + + return this.defaultModelList; + } + + + /** + * 将jsonobject转化为PluginModel + * 并按照更新时间排序,取最新的10个 + * */ + List parseDefaultPluginModel(List jsonObjects) { + List pluginModels = new ArrayList<>(); + if (!Collections.isEmpty(jsonObjects)) { + SimpleDateFormat format = new SimpleDateFormat(timeFormat); + try { + jsonObjects.sort(Comparator.comparingLong(new ToLongFunction() { + @Override + public long applyAsLong(Map value) { + Long time = 0l; + try { + time = format.parse((String) value.get(UPLOAD_TIME)).getTime(); + } catch (ParseException e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); + } + return time; + } + })); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); + } + for (int i = 0; i < defaultListSize; i++) { + pluginModels.add(getPluginModel(new JSONObject(jsonObjects.get(i)), false)); + } + } + return pluginModels; + } + } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java index 9611217589..0dda19c933 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ProductNewsSearchManager.java @@ -2,7 +2,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.ProductNews; import com.fr.general.http.HttpToolbox; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index d9b93fb556..992b429406 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.actions.UpdateAction; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.CellModelHelper; import com.fr.design.mainframe.alphafine.cell.model.ActionModel; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index ce0d987767..39ea82503c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.CellModelHelper; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java index a953b70fe6..9e3d4bb679 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.stable.StringUtils; import com.fr.third.ibm.icu.text.BreakIterator; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java index f353573b49..fbdd5a90f9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManager.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java index 61dceaa008..c7b4babec1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java @@ -29,7 +29,19 @@ public class TemplateResourceSearchManager { public List getSearchResult(String searchText) { List resourceList = new ArrayList<>(); - // 联网搜索 + resourceList.addAll(searchOnline(searchText)); + resourceList.addAll(searchLocal(searchText)); + + resourceList.stream().forEach(resource -> {resource.setSearchWord(searchText);}); + + return resourceList; + } + + /** + * 联网搜索 + * */ + private List searchOnline(String searchText) { + List resourceList = new ArrayList<>(); try { JSONArray jsonArray = helper.getTemplateInfoByName(searchText); if (jsonArray != null && !jsonArray.isEmpty()) { @@ -38,8 +50,14 @@ public class TemplateResourceSearchManager { } catch (Exception e) { } + return resourceList; + } - // 本地搜索 + /** + * 本地搜索 + * */ + private List searchLocal(String searchText) { + List resourceList = new ArrayList<>(); if (resourceList.isEmpty()) { List localResource = getEmbedResourceList(); localResource.stream().forEach(resource->{ diff --git a/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/search_hint.svg b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/search_hint.svg new file mode 100644 index 0000000000..767729dad5 --- /dev/null +++ b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/search_hint.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java index 5d32b85bbd..af378b5d4d 100644 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.alphafine.cell.model; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.actions.help.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.json.JSONException; import com.fr.json.JSONObject;