diff --git a/build.gradle b/build.gradle index 3580cbae0..617b9d0fa 100644 --- a/build.gradle +++ b/build.gradle @@ -72,7 +72,9 @@ allprojects { implementation 'com.fr.datasource:fine-datasource:' + frVersion implementation 'com.fr.decision:fine-decision:' + frVersion implementation 'com.fr.schedule:fine-schedule:' + frVersion - implementation 'com.fr.report:fine-report-engine:' + frDevVersion + implementation 'com.fr.report:engine-report:' + frDevVersion + implementation 'com.fr.report:engine-chart:' + frDevVersion + implementation 'com.fr.report:engine-i18n:' + frDevVersion implementation 'com.fr.design:design-i18n:' + frDevVersion testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1' diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index c6488d330..791d679b3 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -240,7 +240,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { String installHome = StableUtils.getInstallHome(); //这里不判断路径是.的情况,放在checkValid方法里面,重新选 if (installHome != null) { - String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); + String name = Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); String envPath = designerEnvManager.getDefaultenvPath(installHome); designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); designerEnvManager.setCurEnvName(name); @@ -304,8 +304,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH); String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log"); - if (!new java.io.File(fileName).exists()) { - StableUtils.makesureFileExist(new java.io.File(fileName)); + if (!new File(fileName).exists()) { + StableUtils.makesureFileExist(new File(fileName)); } Handler handler = new FileHandler(fileName, true); @@ -529,7 +529,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { return env; } } - String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); + String name = Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); LocalDesignerWorkspaceInfo newDefaultEnv = LocalDesignerWorkspaceInfo.create(name, defaultenvPath); this.putEnv(name, newDefaultEnv); return newDefaultEnv; @@ -552,7 +552,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } } } - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); + return Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); } @@ -1643,7 +1643,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) { // marks:兼容6.1的 // marks:设置默认的目录. - String curReportServerName = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"); + String curReportServerName = Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"); LocalDesignerWorkspaceInfo reportServer = LocalDesignerWorkspaceInfo.create(curReportServerName, tmpVal); this.putEnv(curReportServerName, reportServer); diff --git a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java index 6ca4ed680..5d6ee4e5a 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java @@ -14,10 +14,10 @@ import javax.swing.BoxLayout; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JScrollPane; -import java.awt.Dimension; import java.util.Iterator; -import java.util.Map; import java.util.LinkedHashMap; +import java.util.Map; +import java.awt.Dimension; @Open public abstract class ConditionAttributesPane extends BasicBeanPane { @@ -69,7 +69,12 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { selectedItemScrollPane.setViewportView(selectedItemPane); selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT)); + dealScrollPane(selectedItemScrollPane); propertyChangePane.add(selectedItemScrollPane); + } + + protected void dealScrollPane(JScrollPane scrollPane){ + } public void updateBean(T ob) { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index fc666f15f..f6bfdd29a 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -3,6 +3,7 @@ */ package com.fr.design.data.datapane.connect; +import com.fr.data.impl.Connection; import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.operator.DataOperator; @@ -10,6 +11,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.utils.gui.GUICoreUtils; @@ -19,12 +21,24 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.UIManager; +import java.awt.BorderLayout; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ExecutionException; /** * Database Connection pane. @@ -48,9 +62,9 @@ public abstract class DatabaseConnectionPane connectionThread = new SwingWorker() { + @Override + protected Boolean doInBackground() throws Exception { + Connection database = DatabaseConnectionPane.this.updateBean(); + // 返回连接结果 + return DataOperator.getInstance().testConnection(database); + } + + @Override + protected void done() { try { - com.fr.data.impl.Connection database = DatabaseConnectionPane.this.updateBean(); - boolean connect = DataOperator.getInstance().testConnection(database); + boolean connect = get(); okButton.setEnabled(true); - message.setText(database.connectMessage(connect)); if (connect) { uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon")); - message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Connection_Successfully")); + message.setText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Connection_Successfully")); }else{ uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); - message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Failed")); + message.setText(Toolkit.i18nText("Fine-Design_Basic_Connection_Failed")); } - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } - return null; } }; @@ -158,18 +177,18 @@ public abstract class DatabaseConnectionPane imp protected Void doInBackground() throws Exception { DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); sp.setCalculating(true); - sp.creatDataModel(Calculator.createCalculator()); + ProcedureDataModel[] dataModels = DesignTableDataManager.createLazyDataModel(sp, false); + sp.refreshDataModelListAndResultNames(dataModels); return null; } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java index 82022bea6..be993fa68 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java @@ -35,18 +35,18 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 获取数据集的所有列名list - * + * * @return 数据集的所有列名list - * + * * * @date 2014-11-24-下午3:51:41 - * + * */ public List calculateColumnNameList() { if(columnNameList != null){ return columnNameList; } - + DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); TableDataSource tds = adapter == null ? null : adapter.getBook(); String[] colNames = tabledata.getColumnNames(tds); @@ -56,13 +56,13 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { } else if (ArrayUtils.isNotEmpty(colNamesInCache)) { return toColumnNameList(colNamesInCache); } - + EmbeddedTableData embeddedTableData = null; try { embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tds, tabledata, TableData.RESULT_NOT_NEED, false); } catch (Exception e) { if (e.getMessage()!=null) { - DesignUtils.errorMessage(e.getMessage()); + DesignUtils.errorMessage(e.getMessage()); } } columnNameList = DesignTableDataManager.getColumnNamesByTableData(embeddedTableData); @@ -78,12 +78,12 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 生成子节点 - * + * * @return 生成子节点 - * + * * * @date 2014-11-24-下午3:51:17 - * + * */ public ExpandMutableTreeNode[] load() { List namelist = calculateColumnNameList(); @@ -97,10 +97,10 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 预览数据集 - * + * * * @date 2014-11-24-下午3:50:20 - * + * */ public void previewData() { PreviewTablePane.previewTableData(tabledata); @@ -108,30 +108,30 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 预览数据集,带有显示值和实际值的标记结果 - * + * * @param keyIndex 实际值 * @param valueIndex 显示值 - * + * * * @date 2014-11-24-下午3:50:20 - * + * */ public void previewData(final int keyIndex,final int valueIndex){ PreviewTablePane.previewTableData(tabledata, keyIndex, valueIndex); } @Override public String getTableDataName(){ - return name; + return name; } /** * 获取数据集的面板 - * + * * @return 数据集面板 - * + * * * @date 2014-11-24-下午3:50:00 - * + * */ public AbstractTableDataPane creatTableDataPane() { return TableDataFactory.creatTableDataPane(tabledata, name); @@ -143,4 +143,4 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { && ComparatorUtils.equals(this.tabledata, ((AbstractTableDataWrapper) obj).getTableData()); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java index f9de1cfa4..96069b435 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java @@ -25,13 +25,19 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { private static final String HOST_NAME = "127.0.0.1"; private static final String LOCAL_HOTS_NAME = "localhost"; private static final String QUOTATION = ":"; - private static final String PORT = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); + private static String port = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); static { - FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + PORT + PATH); - FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + PORT + PATH); - FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); - FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); + initFilerSet(port); + } + + private static void initFilerSet(String newPort) { + FILTER_SET.clear(); + FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + newPort + PATH); + FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + newPort + PATH); + FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH); + FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH); + port = newPort; } private String name; @@ -164,6 +170,11 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { @Override public boolean checkValid() { boolean result = false; + String newPort = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); + if (!ComparatorUtils.equals(port, newPort)) { + // 使用过程中 更改了内置服务器端口 重新初始化下 + initFilerSet(newPort); + } if (FILTER_SET.contains(connection.getUrl())) { FineLoggerFactory.getLogger().error("url is same with local designer"); return result; diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 54ed4d18a..f3f45768f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -1,12 +1,10 @@ package com.fr.design.gui.icontainer; -import com.fr.base.BaseUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.DesignerContext; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.stable.collections.utils.MathUtils; import javax.swing.*; import java.awt.*; @@ -159,8 +157,7 @@ public class UIResizableContainer extends JPanel { } /** - * 设置关闭设计器前最后一次上下子面板的高度 - * + * 设置关闭设计器前最新的上子面板的高度比例 * @param toolPaneY */ public void setLastToolPaneY(int toolPaneY) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/App.java b/designer-base/src/main/java/com/fr/design/mainframe/App.java index 3cae10f6b..c941df8af 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/App.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/App.java @@ -41,4 +41,15 @@ public interface App extends Mutable, Aftermath { * @return 报表 */ T asIOFile(FILE tplFile); + + + /** + * 输出workbook等对象 + * @param tplFile 文件 + * @param needCheck 是否需要check + * @return + */ + default T asIOFile(FILE tplFile, boolean needCheck) { + return asIOFile(tplFile); + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 73d5d0bb1..6c6de287e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -136,9 +136,9 @@ public abstract class JTemplate> this.editingFILE = file; this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder()); + designModel = createDesignModel(); addCenterPane(); this.undoState = createUndoState(); - designModel = createDesignModel(); consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); initAndStartPlugin(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java index 8019cc178..678b9bf84 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java @@ -56,7 +56,7 @@ public final class JTemplateFactory { String[] defaultAppExtensions = app.defaultExtensions(); for (String defaultAppExtension : defaultAppExtensions) { if (defaultAppExtension.equalsIgnoreCase(fileExtension)) { - BaseBook bb = app.asIOFile(file); + BaseBook bb = app.asIOFile(file, false); if (bb != null) { return (T) bb; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java index 23c642dbd..004fbd55a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java @@ -32,11 +32,11 @@ public class WestRegionContainerPane extends UIResizableContainer { public WestRegionContainerPane() { super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT); - + setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); - + GeneralContext.listenPluginRunningChanged(new PluginEventListener(TableDataTreePane.PLUGIN_LISTENER_PRIORITY - 1) { - + @Override public void on(PluginEvent event) { @@ -47,15 +47,15 @@ public class WestRegionContainerPane extends UIResizableContainer { } } }, new PluginFilter() { - + @Override public boolean accept(PluginContext context) { - + return context.contain(PluginModule.ExtraDesign); } }); - + setContainerWidth(165); setBackground(UIConstants.TREE_BACKGROUND); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java index 6dc2da5e9..ae8cbeb3a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java @@ -44,6 +44,7 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane 标准 + if (custom.getSelectedIndex() == 0) { + customTempStyle = getCustomMobileTemplateStyle(); + } + // 标准 -> 自定义 + if (custom.getSelectedIndex() == 1 && customTempStyle != null) { + populateBean(customTempStyle); + } boolean isCustom = custom.getSelectedIndex() == 1; centerPane.setVisible(isCustom); updatePreviewPane(); @@ -182,8 +191,24 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane implement public boolean accept(Object ob) { return ob instanceof DictPresent; } - + public void addTabChangeListener(ItemListener l){ dictionaryPane.addTabChangeListener(l); } @@ -55,4 +55,4 @@ public class DictPresentPane extends FurtherBasicBeanPane implement public void registerDSChangeListener() { dictionaryPane.registerDSChangeListener(); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java index e50ed86b9..3f42732f1 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java @@ -24,6 +24,13 @@ import java.util.List; public class DictionaryPane extends UIComboBoxPane implements DataCreatorUI, Prepare4DataSourceChange { private TableDataDictPane tableDataDictPane; + public DictionaryPane() { + } + + public DictionaryPane(boolean needTableDataChange) { + this.tableDataDictPane.setNeedTableDataChange(needTableDataChange); + } + @Override protected void initLayout() { this.setLayout(new BorderLayout(0, 4)); diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index 3c08c1c9d..5eb6c2873 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -31,17 +31,20 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; - +import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ExecutionException; /** * 数据字典的数据查询面板 @@ -60,6 +63,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane private DoubleDeckValueEditorPane valueDictPane; private ItemListener itemListener; private UIObserverListener uiObserverListener; + private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); + private boolean needTableDataChange = true; public TableDataDictPane() { initBasicComponets(); @@ -67,6 +72,14 @@ public class TableDataDictPane extends FurtherBasicBeanPane iniListener(); } + /** + * 设置为true后,一旦触发TableDataComboBox的itemChange,就会通过数据连接,更换当前数据字典的列名List + * @param needTableDataChange + */ + public void setNeedTableDataChange(boolean needTableDataChange) { + this.needTableDataChange = needTableDataChange; + } + public static void main(String[] args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -80,11 +93,9 @@ public class TableDataDictPane extends FurtherBasicBeanPane private void initBasicComponets() { tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); - tableDataNameComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == ItemEvent.SELECTED) { - tdChange(e); - } + tableDataNameComboBox.addItemListener(e -> { + if (e.getStateChange() == ItemEvent.SELECTED) { + tdChange(e); } }); // keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); @@ -158,39 +169,58 @@ public class TableDataDictPane extends FurtherBasicBeanPane if (tableDataWrappe == null) { return; } - - List namelist = tableDataWrappe.calculateColumnNameList(); - String[] columnNames = null; - if (!namelist.isEmpty()) { - columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); - } else { - columnNames = new String[]{""}; + if (itemListener != null) { + itemListener.itemStateChanged(e); + localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e)); + } + if (isNeedTableDataChange()) { + changeColumnsName(); } - ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); - columnNameEditor1.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor1.addItemListener(itemListener); - keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + } - FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); - formulaEditor.setEnabled(true); - formulaEditor.addChangeListener(new ChangeListener() { + private void changeColumnsName() { + TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); + SwingWorker, Object> worker = new SwingWorker, Object>() { + @Override + protected List doInBackground() { + if (tableDataWrappe == null) { + return new ArrayList<>(); + } + return tableDataWrappe.calculateColumnNameList(); + } @Override - public void stateChanged(ChangeEvent ee) { - if (itemListener != null) { - itemListener.itemStateChanged(e); + protected void done() { + try { + List namelist = get(); + String[] columnNames = null; + if (!namelist.isEmpty()) { + columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); + } else { + columnNames = new String[]{StringUtils.EMPTY}; + } + // 实际值列名 + ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames); + actualColumnNameEditor.addItemListener(itemListener); + // 实际值列序号 + ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length); + actualColumnIndexEditor.addItemListener(itemListener); + keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]); + + localFormulaEditor.setEnabled(true); + // 显示值列名 + ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames); + displayColumnNameEditor.addItemListener(itemListener); + // 显示值列序号 + ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length); + displayColumnIndexEditor.addItemListener(itemListener); + valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, localFormulaEditor}, columnNames[0]); + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - }); - ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); - columnNameEditor2.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor2.addItemListener(itemListener); - valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, formulaEditor}, columnNames[0]); - if (itemListener != null) { - itemListener.itemStateChanged(e); - } + }; + worker.execute(); } @Override @@ -374,4 +404,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane public void registerDSChangeListener() { tableDataNameComboBox.registerGlobalDSChangeListener(); } + + public boolean isNeedTableDataChange() { + return needTableDataChange; + } } diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 9f5c7fbaa..e6b276437 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -298,7 +298,11 @@ public final class GUICoreUtils { * @param win the current window august:现在要考虑左边日志模板的影响 */ public static void centerWindow(Window win) { - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + // Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小 + // getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标 + Rectangle rectangle = win.getGraphicsConfiguration().getBounds(); + + Dimension screenSize = rectangle.getSize(); Dimension winSize = win.getSize(); @@ -308,7 +312,7 @@ public final class GUICoreUtils { if (winSize.width > screenSize.width) { winSize.width = screenSize.width; } - win.setLocation((screenSize.width - winSize.width) / 2, (screenSize.height - winSize.height) / 2 - WINDOW_GAP); + win.setLocation(rectangle.x + (screenSize.width - winSize.width) / 2, rectangle.y + (screenSize.height - winSize.height) / 2 - WINDOW_GAP); } /** diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png b/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png new file mode 100644 index 000000000..adc5428a7 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png differ diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java index 90982ded5..aa8c9e46c 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java @@ -15,9 +15,10 @@ import com.fr.log.FineLoggerFactory; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.JScrollPane; +import java.util.Iterator; import java.awt.BorderLayout; import java.awt.Dimension; -import java.util.Iterator; /** * Created by IntelliJ IDEA. @@ -27,6 +28,9 @@ import java.util.Iterator; * Time : 上午9:16 */ public class DataSeriesConditionPane extends ConditionAttributesPane { + + private static final int SCROLL_BAR_UNIT_INCREMENT = 16; + protected Plot plot; public DataSeriesConditionPane(Plot plot) { @@ -43,6 +47,10 @@ public class DataSeriesConditionPane extends ConditionAttributesPane getAlignNamesAndValues() { - String[] names = new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow"), Toolkit.i18nText("Fine-Design_Chart_Align_Left"), Toolkit.i18nText("Fine-Design_Chart_Align_Right")}; - Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.RIGHT}; + String[] names = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Follow"), + Toolkit.i18nText("Fine-Design_Chart_Align_Left"), + Toolkit.i18nText("Fine-Design_Chart_StyleAlignment_Center"), + Toolkit.i18nText("Fine-Design_Chart_Align_Right") + }; + + Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.CENTER, Constants.RIGHT}; return new TwoTuple<>(names, values); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 3047e608f..546648963 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -122,8 +122,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return new Component[][]{ new Component[]{dataLabelContentPane, null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, - new Component[]{createLabelBorderPane(), null}, - new Component[]{createLabelBackgroundPane(), null} + new Component[]{createBorderAndBackgroundPane(), null}, }; } @@ -138,6 +137,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { }; } + private JPanel createBorderAndBackgroundPane() { + JPanel jPanel = new JPanel(); + jPanel.setLayout(new BorderLayout(0, 5)); + jPanel.add(createLabelBorderPane(), BorderLayout.NORTH); + jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER); + return jPanel; + } + private JPanel createLabelBorderPane() { borderPane = new VanChartBorderWithShapePane(); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); @@ -334,7 +341,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { checkPositionEnabled(); } - private void checkOrientation() { + protected void checkOrientation() { if (orientation != null && borderPaneWithTitle != null && backgroundPaneWithTitle != null) { boolean horizontal = orientation.getSelectedIndex() == HORIZONTAL_INDEX; diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java index 5045e1387..85a328032 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java @@ -4,6 +4,7 @@ import com.fr.design.beans.location.Absorptionline; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.HoverPainter; import com.fr.design.designer.beans.LayoutAdapter; +import com.fr.design.designer.beans.adapters.layout.FRParameterLayoutAdapter; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Location; @@ -136,6 +137,14 @@ public class StateModel { private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) { LayoutAdapter adapter = container.getLayoutAdapter(); Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container); + // 判断是否能把控件从表单布局中拖拽到参数面板中 + if (adapter instanceof FRParameterLayoutAdapter) { + for (XCreator xCreator : selectionModel.getSelection().getSelectedCreators()) { + if (!xCreator.canEnterIntoParaPane()) { + return false; + } + } + } if (selectionModel.getSelection().size() == 1) { return adapter.addBean(selectionModel.getSelection().getSelectedCreator(), mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index c002bceb3..a6a29339e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -14,6 +14,7 @@ import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.CoverReportPane; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.HelpDialogManager; @@ -267,6 +268,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator { if (this != (XCreator) designer.getRootComponent()) { ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); + if (isEditing) { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); + } } } HelpDialogManager.getInstance().setPane(coverPanel); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index 1c335efa6..18bab5528 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -160,6 +160,7 @@ public class XCardSwitchButton extends XButton { return; } deleteCard(this, index); + selectionModel.setSelectedCreator(designer.getRootComponent()); designer.fireTargetModified(); LayoutUtils.layoutRootContainer(designer.getRootComponent()); FormHierarchyTreePane.getInstance().refreshRoot(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 62c89b9ca..1d4fad8e3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.Parameter; import com.fr.base.ScreenResolution; import com.fr.base.vcs.DesignerMode; +import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; @@ -204,7 +205,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection */ public void populateParameterPropertyPane() { //参数 - setParameterArray(getNoRepeatParas(getTarget().getParameters())); + setParameterArray(DesignModelAdapter.getCurrentModelAdapter().getParameters()); refreshParameter(); //容器 ParameterPropertyPane.getInstance().populateBean(this); @@ -728,7 +729,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { FormDesigner.this.fireTargetModified(); if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { - setParameterArray(getNoRepeatParas(getTarget().getParameters())); + setParameterArray(getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters())); refreshParameter(); } } else { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java b/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java index abe0c97e8..efc7ff2b0 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java @@ -36,10 +36,10 @@ public class FormModelAdapter extends DesignModelAdapter> * 参数改变. */ public void parameterChanged() { - //实时更新参数 - jTemplate.populateParameter(); // 更新缓存的参数 updateCachedParameter(); + //实时更新参数 + jTemplate.populateParameter(); } /** diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java index 19a61a631..022afc610 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java @@ -29,9 +29,9 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane 0) { modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest"))); @@ -86,9 +86,13 @@ public class RecentSearchManager implements AlphaFineSearchProvider { public SearchResult getMoreSearchResult(String searchText) { return new SearchResult(); } - - private synchronized SearchResult getRecentModelList(String searchText) { - return searchBySort(searchText); + + /** + * 将单次遍历的关键词的搜索结果添加到结果集中 + * @param searchText + */ + private synchronized void addToRecentModelList(String searchText) { + searchBySort(searchText); } public List getRecentModelList() { @@ -161,7 +165,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { * 按序搜索 */ private synchronized SearchResult searchBySort(String key) { - recentModelList = new SearchResult(); try { initReader(); @@ -175,7 +178,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { Query query = new TermQuery(term); TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey); ScoreDoc[] scores = docs.scoreDocs; - this.recentModelList = new SearchResult(); //遍历结果 for (ScoreDoc scoreDoc : scores) { Document document = searcher.doc(scoreDoc.doc); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java index cb6fb8d3e..adadab36d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java @@ -42,7 +42,11 @@ class CptApp extends AbstractWorkBookApp { @Override public WorkBook asIOFile(FILE file) { + return asIOFile(file, true); + } + @Override + public WorkBook asIOFile(FILE file, boolean needCheck) { if (XMLEncryptUtils.isCptEncoded() && !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { if (!new DecodeDialog(file).isPwdRight()) { @@ -67,7 +71,9 @@ class CptApp extends AbstractWorkBookApp { } catch (Exception exp) { FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp); } - checkNameStyle(namestyle); + if (needCheck) { + checkNameStyle(namestyle); + } return tpl; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java index 77f370d9d..21a46c2b5 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java @@ -126,9 +126,9 @@ public abstract class AbstractSendDataToCloud implements XMLable { } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - return; + } finally { + fileEntityBuilder.deleteFileAndZipFile(file, pathName); } - fileEntityBuilder.deleteFileAndZipFile(file, pathName); } diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index af41fd088..049761417 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -275,7 +275,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus paraDesignEditor.populate(parameterUI); - parameterArray = getNoRepeatParas(getTargetParameter(workBook)); + parameterArray = getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()); refreshParameter(); allParameters = reportParameterAttr.getParameters(); diff --git a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java index f6803a90f..316e86c28 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java @@ -40,6 +40,10 @@ public class PolyBlockProperPane extends DockingView { polyBlockProperTable.populate(designer); } + public void update(){ + polyBlockProperTable.update(); + } + @Override public String getViewTitle() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Property_Table"); diff --git a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java index 452b4d7f6..cd98e6622 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java @@ -1,17 +1,24 @@ package com.fr.poly; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.widget.BasicPropertyPane; import com.fr.design.widget.WidgetBoundsPaneFactory; +import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.poly.group.PolyBoundsGroup; import com.fr.report.poly.TemplateBlock; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Container; +import javax.swing.BorderFactory; +import javax.swing.JPanel; -import javax.swing.*; -import java.awt.*; public class PolyBlockProperTable extends JPanel { private PolyDesigner designer; @@ -104,7 +111,12 @@ public class PolyBlockProperTable extends JPanel { if (isPopulating || block == null) { return; } - block.setBlockName(blockPropertyPane.getWidgetNameField().getText()); + if (blockPropertyPane.getWidgetNameField() != null) { + String toSetWidgetName = blockPropertyPane.getWidgetNameField().getText(); + if (isBlockNameValid(toSetWidgetName, block.getBlockName())) { + block.setBlockName(toSetWidgetName); + } + } PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); boundsgroup.setValue(x.getValue(), 0, 1); boundsgroup.setValue(y.getValue(), 1, 1); @@ -112,4 +124,23 @@ public class PolyBlockProperTable extends JPanel { boundsgroup.setValue(height.getValue(), 3, 1); firePropertyEdit(); } + + /** + *校验一下要设置的名称,不能为空,不能重名 + * + */ + private boolean isBlockNameValid(String toSetWidgetName, String currentWidgetName) { + if (toSetWidgetName == null || toSetWidgetName.isEmpty()) { + blockPropertyPane.getWidgetNameField().setText(currentWidgetName); + return false; + } + for (int i = 0; i < this.designer.getTarget().getBlockCount(); i++) { + if (!ComparatorUtils.equals(currentWidgetName, toSetWidgetName) && ComparatorUtils.equals(toSetWidgetName, this.designer.getTarget().getBlock(i).getBlockName())) { + blockPropertyPane.getWidgetNameField().setText(currentWidgetName); + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), FineJOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png")); + return false; + } + } + return true; + } } diff --git a/designer-realize/src/main/java/com/fr/poly/PolyDesigner.java b/designer-realize/src/main/java/com/fr/poly/PolyDesigner.java index 99d9b77b4..437cb8ea1 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyDesigner.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyDesigner.java @@ -623,6 +623,9 @@ public class PolyDesigner extends ReportComponent