Browse Source

Merge branch 'feature/10.0' of https://cloud.finedevelop.com/scm/~wim.zhai/Xdesign into feature/10.0

research/11.0
Wim.Zhai 5 years ago
parent
commit
720b9a7eba
  1. 8
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java
  2. 3
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  3. 25
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/CustomDictModel.java
  4. 21
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  5. 5
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java
  6. 11
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  7. 2
      designer-base/src/main/java/com/fr/design/dcm/UniversalDatabaseDialog.java
  8. 1
      designer-base/src/main/java/com/fr/design/designer/EditingState.java
  9. 4
      designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java
  10. 1
      designer-base/src/main/java/com/fr/design/dialog/JWizardDialog.java
  11. 19
      designer-base/src/main/java/com/fr/design/editor/editor/WidgetNameEditor.java
  12. 2
      designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java
  13. 1
      designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java
  14. 4
      designer-base/src/main/java/com/fr/design/extra/AppStoreBuilder.java
  15. 12
      designer-base/src/main/java/com/fr/design/gui/ilable/ActionLabel.java
  16. 6
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxUtilities.java
  17. 1
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/FormulaTokenMaker.java

8
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java

@ -38,6 +38,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
this.setDefaultEditor(ParameterTableModel.ParameterEditor.class, new ParameterTableModel().new ParameterEditor());
this.setDefaultRenderer(StoreProcedureParameterValueEditor.class, new ProcedureParameterValueRenderer());
}
@Override
public boolean isCellEditable(int row, int col) {
if (ComparatorUtils.equals(getValueAt(row, col -1), "OUT")) {
return false;
@ -48,6 +49,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
return false;
}
@Override
public boolean shouldResponseDoubleClickAction () {
return false;
}
@ -77,15 +79,16 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
}, 100);
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
//do nothing
}
});
this.addCellEditorListener(new CellEditorListener() {
@Override
public void editingCanceled(ChangeEvent e) {
//do nothing
}
@Override
@ -147,6 +150,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
editor = ValueEditorPaneFactory.createStoreProcedValueEditorPane();
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
editor.setCurrentEditor(0);
editor.populate(value);

3
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java

@ -124,6 +124,7 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
java.util.List<ParameterProvider> oldParas = editorPane.update();
oldParas.add(new Parameter());
@ -132,6 +133,7 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
@Override
public void checkEnabled() {
//do nothing
}
}
private class RemoveParaAction extends UITableEditAction {
@ -149,6 +151,7 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
@Override
public void checkEnabled() {
//do nothing
}
}

25
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/CustomDictModel.java

@ -1,22 +1,21 @@
package com.fr.design.data.tabledata.tabledatapane;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import com.fr.design.gui.itableeditorpane.ActionStyle;
import com.fr.design.gui.itableeditorpane.UIArrayTableModel;
import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableModelAdapter;
import com.fr.design.gui.itextfield.UITextField;
import javax.swing.AbstractCellEditor;
import javax.swing.JTable;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.table.TableCellEditor;
import com.fr.design.gui.itableeditorpane.ActionStyle;
import com.fr.design.gui.itableeditorpane.UIArrayTableModel;
import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableModelAdapter;
import com.fr.design.gui.itextfield.UITextField;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
public class CustomDictModel extends UITableModelAdapter<Object[]> implements ActionStyle {
/**
@ -34,11 +33,13 @@ public class CustomDictModel extends UITableModelAdapter<Object[]> implements Ac
this.setDefaultEditor(ParameterEditor.class, new ParameterEditor());
}
@Override
public Object getValueAt(int row, int column) {
Object[] os = this.getList().get(row);
return os[column];
}
@Override
public void setValueAt(Object value, int row, int column) {
Object[] os = this.getList().get(row);
os[column] = value;
@ -104,7 +105,7 @@ public class CustomDictModel extends UITableModelAdapter<Object[]> implements Ac
@Override
public void editingCanceled(ChangeEvent e) {
//do nothing
}
@Override

21
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -521,6 +521,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
@Override
public void checkEnabled() {
//do nothing
}
}
@ -832,7 +833,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
private class XMLNodeTree extends JTree {
private DefaultTreeModel treeModel;
private DefaultTreeModel xmlTreeModel;
private DefaultTreeModel waitTreeModel = null;
@ -854,7 +855,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private MouseListener treeMouseListener = new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (XMLNodeTree.this.getModel() != treeModel) {
if (XMLNodeTree.this.getModel() != xmlTreeModel) {
return;
}
int selRow = XMLNodeTree.this.getRowForLocation(e.getX(), e.getY());
@ -891,7 +892,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
public DefaultTreeModel getTreeModel() {
return treeModel;
return xmlTreeModel;
}
//防止界面卡死。
@ -908,7 +909,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
//wikky:为满足706设计时对不合法的xml文件(有多个根节点)的处理,把拿到的InputStream强制在最外层添加<XML></XML>作为唯一根节点而将文件转换为合法的xml。
private void initData() {
params = getEditorPaneParameter(); // 生成tree结构放哪儿呢?放这里感觉不对撒
treeModel = null;
xmlTreeModel = null;
selectedNode = null;
xmlColumnsList.clear();
DataSource dataSource = null;
@ -949,17 +950,17 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
loadedTreeModel();
}
if (treeModel == null) {
if (xmlTreeModel == null) {
FineLoggerFactory.getLogger().info("The file is wrong or bad, can not create the XMLReader.");
return;
}
if (treeModel.getChildCount(treeModel.getRoot()) == 1) {
treeModel = new DefaultTreeModel((ExpandMutableTreeNode) treeModel.getChild(treeModel.getRoot(), 0));
if (xmlTreeModel.getChildCount(xmlTreeModel.getRoot()) == 1) {
xmlTreeModel = new DefaultTreeModel((ExpandMutableTreeNode) xmlTreeModel.getChild(xmlTreeModel.getRoot(), 0));
} else {
ExpandMutableTreeNode root = (ExpandMutableTreeNode) treeModel.getRoot();
ExpandMutableTreeNode root = (ExpandMutableTreeNode) xmlTreeModel.getRoot();
root.setUserObject(StringUtils.EMPTY);
}
this.setModel(treeModel);
this.setModel(xmlTreeModel);
}
private void loadedTreeModel() {
@ -1011,7 +1012,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
currentNode = new ExpandMutableTreeNode(nodeName);
if (layer == 0) {
treeModel = new DefaultTreeModel(currentNode);
xmlTreeModel = new DefaultTreeModel(currentNode);
} else {
boolean conflict = false;
for (int i = 0; i < parentNode.getChildCount(); i++) {

5
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java

@ -144,12 +144,14 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
refresh();
}
@Override
public void checkEnabled() {
//do nothing
}
}
@ -259,14 +261,17 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
private UIButton formulaButton;
private DocumentListener documentListener = new DocumentListener() {
@Override
public void changedUpdate(DocumentEvent e) {
updateFormula(formulaContentTextField.getText());
}
@Override
public void insertUpdate(DocumentEvent e) {
updateFormula(formulaContentTextField.getText());
}
@Override
public void removeUpdate(DocumentEvent e) {
updateFormula(formulaContentTextField.getText());
}

11
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -187,6 +187,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
}
populateWorker = new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
try {
storeProcedureContext.setText(StringUtils.EMPTY);
@ -204,6 +205,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
return null;
}
@Override
public void done() {
editorPane.populate(storeprocedure.getParameters());
}
@ -218,6 +220,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
*
* @param listener 监听器
*/
@Override
public void addStoreProcedureWorkerListener(StoreProcedureWorkerListener listener) {
this.storeProcedureWorkerListener = listener;
@ -227,6 +230,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
/**
* 去除存储过程监听器
*/
@Override
public void removeStoreProcedureWorkerListener() {
this.storeProcedureWorkerListener = null;
@ -264,6 +268,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
}
updateWorker = new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
sp.setCalculating(true);
@ -271,6 +276,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
return null;
}
@Override
public void done() {
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
sp.setCalculating(false);
@ -328,6 +334,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
/**
* 响应数据集改变
*/
@Override
public void fireDSChanged() {
fireDSChanged(new HashMap<String, String>());
}
@ -337,6 +344,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
*
* @param map 改变的map
*/
@Override
public void fireDSChanged(Map<String, String> map) {
DesignTableDataManager.fireDSChanged(map);
}
@ -348,6 +356,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/preview.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
StoreProcedure sp = updateBeanWithOutExecute();
StoreProcedureDataWrapper storeProcedureDataWrappe = new StoreProcedureDataWrapper(sp, StringUtils.EMPTY, queryText.getText());
@ -361,12 +370,14 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
refresh();
}
@Override
public void checkEnabled() {
//do nothing
}
}
}

2
designer-base/src/main/java/com/fr/design/dcm/UniversalDatabaseDialog.java

@ -27,6 +27,6 @@ public class UniversalDatabaseDialog extends UIDialog {
@Override
public void checkValid() throws Exception {
//do nothing
}
}

1
designer-base/src/main/java/com/fr/design/designer/EditingState.java

@ -7,6 +7,7 @@ public interface EditingState {
@Override
public void revert() {
//do nothing
}
};

4
designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java

@ -121,12 +121,12 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
@Override
public void addLayoutComponent(String name, Component comp) {
//do nothing
}
@Override
public void removeLayoutComponent(Component comp) {
//do nothing
}
@Override

1
designer-base/src/main/java/com/fr/design/dialog/JWizardDialog.java

@ -363,5 +363,6 @@ public class JWizardDialog extends BasicDialog {
@Override
public void checkValid() throws Exception {
//do nothing
}
}

19
designer-base/src/main/java/com/fr/design/editor/editor/WidgetNameEditor.java

@ -1,18 +1,17 @@
package com.fr.design.editor.editor;
import java.awt.BorderLayout;
import java.awt.Component;
import javax.swing.JList;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import com.fr.design.DesignModelAdapter;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.icombobox.FilterComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.js.WidgetName;
import javax.swing.JList;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* the editor to edit WidgetName
*
@ -43,12 +42,12 @@ public class WidgetNameEditor extends Editor<WidgetName> {
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
//do nothing
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
//do nothing
}
@Override

2
designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java vendored

@ -64,7 +64,9 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
writer.attr("path", path);
}
@Override
@SuppressWarnings("squid:S2975")
public Object clone() throws CloneNotSupportedException {
LocalDesignerWorkspaceInfo object = (LocalDesignerWorkspaceInfo)super.clone();

1
designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java vendored

@ -79,6 +79,7 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
}
@Override
@SuppressWarnings("squid:S2975")
public Object clone() throws CloneNotSupportedException {
RemoteDesignerWorkspaceInfo object = (RemoteDesignerWorkspaceInfo) super.clone();

4
designer-base/src/main/java/com/fr/design/extra/AppStoreBuilder.java

@ -10,10 +10,10 @@ package com.fr.design.extra;
public class AppStoreBuilder {
public void checkStoreJavaSciptVersion() {
//do nothing
}
public void updateStoreJavaScript() {
//do nothing
}
}

12
designer-base/src/main/java/com/fr/design/gui/ilable/ActionLabel.java

@ -1,5 +1,6 @@
package com.fr.design.gui.ilable;
import javax.swing.event.MouseInputAdapter;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Graphics;
@ -7,9 +8,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.MouseInputAdapter;
/**
* Action label
*/
@ -31,6 +29,7 @@ public class ActionLabel extends UILabel {
/**
* Repaints the text.
*/
@Override
public void paintComponent(Graphics _gfx) {
super.paintComponent(_gfx);
@ -39,12 +38,17 @@ public class ActionLabel extends UILabel {
}
private MouseInputAdapter mouseInputAdapter = new MouseInputAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
//do nothing
}
@Override
public void mousePressed(MouseEvent e) {
//do nothing
}
@Override
public void mouseReleased(MouseEvent evt) {
Object source = evt.getSource();
@ -65,6 +69,7 @@ public class ActionLabel extends UILabel {
}
}
@Override
public void mouseExited(MouseEvent evt) {
Object source = evt.getSource();
@ -73,6 +78,7 @@ public class ActionLabel extends UILabel {
}
}
@Override
public void mouseDragged(MouseEvent e) {
}

6
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxUtilities.java

@ -518,6 +518,8 @@ public class RSyntaxUtilities implements SwingConstants {
}
numEmbedded--;
}
} else {
//do nothing
}
} // End of for (int i=segOffset; i<segOffset+charSegment.count; i++).
@ -584,6 +586,8 @@ public class RSyntaxUtilities implements SwingConstants {
}
numEmbedded--;
}
} else {
//do nothing
}
}
@ -961,6 +965,8 @@ public class RSyntaxUtilities implements SwingConstants {
i--;
}
offs = lineStart + i;
} else {
//do nothing
}
}

1
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/FormulaTokenMaker.java

@ -18,6 +18,7 @@ import java.io.IOException;
* on 9/18/19 6:12 PM from the specification file
* <tt>/Users/3dot141/Downloads/FolxDownload/App/jflex-1.4.1/bin/FormulaTokenMaker.flex</tt>
*/
@SuppressWarnings("squid:S1192")
public class FormulaTokenMaker extends AbstractJFlexCTokenMaker {
/** This character denotes the end of file */

Loading…
Cancel
Save