|
|
@ -1,6 +1,9 @@ |
|
|
|
package com.fr.design.data.tabledata.tabledatapane; |
|
|
|
package com.fr.design.data.tabledata.tabledatapane; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
|
|
|
import com.formdev.flatlaf.ui.FlatUIUtils; |
|
|
|
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
import com.fr.base.Parameter; |
|
|
|
import com.fr.base.Parameter; |
|
|
|
import com.fr.base.ParameterHelper; |
|
|
|
import com.fr.base.ParameterHelper; |
|
|
|
import com.fr.base.Utils; |
|
|
|
import com.fr.base.Utils; |
|
|
@ -12,6 +15,7 @@ import com.fr.data.impl.FileTableData; |
|
|
|
import com.fr.data.impl.TextTableData; |
|
|
|
import com.fr.data.impl.TextTableData; |
|
|
|
import com.fr.data.impl.XMLTableData; |
|
|
|
import com.fr.data.impl.XMLTableData; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewTablePane; |
|
|
|
import com.fr.design.data.datapane.preview.PreviewTablePane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
@ -27,9 +31,6 @@ import com.fr.design.gui.itextfield.UITextField; |
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; |
|
|
|
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.menu.ToolBarDef; |
|
|
|
import com.fr.design.menu.ToolBarDef; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
@ -47,7 +48,6 @@ import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.xml.XMLReadable; |
|
|
|
import com.fr.stable.xml.XMLReadable; |
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
import javax.swing.ButtonGroup; |
|
|
|
import javax.swing.ButtonGroup; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
@ -62,9 +62,7 @@ import javax.swing.tree.TreePath; |
|
|
|
import javax.swing.tree.TreeSelectionModel; |
|
|
|
import javax.swing.tree.TreeSelectionModel; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.GridLayout; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
import java.awt.event.MouseAdapter; |
|
|
@ -80,6 +78,12 @@ import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.flex; |
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
|
|
|
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle; |
|
|
|
|
|
|
|
|
|
|
|
public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
private static final int TEXT = 0; |
|
|
|
private static final int TEXT = 0; |
|
|
|
private static final int EXCEL = 1; |
|
|
|
private static final int EXCEL = 1; |
|
|
@ -104,8 +108,6 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
private UIButton testConnection; |
|
|
|
private UIButton testConnection; |
|
|
|
private XMLNodeTree xmlNodeTree; |
|
|
|
private XMLNodeTree xmlNodeTree; |
|
|
|
private Parameter[] params; |
|
|
|
private Parameter[] params; |
|
|
|
private JPanel filePath; |
|
|
|
|
|
|
|
private XMLNodeTreePane nodeTreePane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UICheckBox needColumnNameCheckBox;// 第一行是否作为标题
|
|
|
|
private UICheckBox needColumnNameCheckBox;// 第一行是否作为标题
|
|
|
|
private UIRadioButton tableDismemberRadioButton;// 制表符
|
|
|
|
private UIRadioButton tableDismemberRadioButton;// 制表符
|
|
|
@ -116,41 +118,32 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
private UICheckBox ignoreOneMoreDelimiterCheckBox;// 连续分隔符是否作为单一
|
|
|
|
private UICheckBox ignoreOneMoreDelimiterCheckBox;// 连续分隔符是否作为单一
|
|
|
|
private UIComboBox charsetComboBox; |
|
|
|
private UIComboBox charsetComboBox; |
|
|
|
private UILabel encodeLabel; |
|
|
|
private UILabel encodeLabel; |
|
|
|
private UILabel dismenberLabel; |
|
|
|
|
|
|
|
private UILabel keyPointLaber; |
|
|
|
private UILabel keyPointLaber; |
|
|
|
private ExpandMutableTreeNode selectedNode = null; |
|
|
|
private ExpandMutableTreeNode selectedNode = null; |
|
|
|
private ExpandMutableTreeNode finalSelectedNode = null; |
|
|
|
private ExpandMutableTreeNode finalSelectedNode = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ArrayList<String> xmlColumnsList = new ArrayList<String>(); |
|
|
|
private ArrayList<String> xmlColumnsList = new ArrayList<String>(); |
|
|
|
private static final int SETPANELWIDTH = 337; |
|
|
|
private static final double LOCAL_WIDTH_RATIO = 0.62; |
|
|
|
private static final int WIDTH = 317; |
|
|
|
private static final double URL_WIDTH_RATIO = 0.56; |
|
|
|
private static final int HEIGHT = 453; |
|
|
|
|
|
|
|
private static final int GAP = 23; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public FileTableDataPane() { |
|
|
|
public FileTableDataPane() { |
|
|
|
this(SETPANELWIDTH, WIDTH, HEIGHT, GAP); |
|
|
|
this(LOCAL_WIDTH_RATIO, URL_WIDTH_RATIO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FileTableDataPane(int setPanelWidth, int width, int height, int gap) { |
|
|
|
public FileTableDataPane(double localWidthRatio, double urlWidthRatio) { |
|
|
|
this.setLayout(new BorderLayout(gap, 0)); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
JPanel northPanel = new JPanel(new BorderLayout()); |
|
|
|
this.setBorder(new ScaledEmptyBorder(10,10,10,10)); |
|
|
|
JPanel type = new JPanel(); |
|
|
|
//文件类型
|
|
|
|
type.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_File_Type") + ":")); |
|
|
|
JPanel fileType = new JPanel(new BorderLayout()); |
|
|
|
String[] item = {"TXT", "Excel", "XML"}; |
|
|
|
String[] item = {"TXT", "Excel", "XML"}; |
|
|
|
fileTypeComboBox = new UIComboBox(item); |
|
|
|
fileTypeComboBox = new UIComboBox(item); |
|
|
|
fileTypeComboBox.setPreferredSize(new Dimension(100, 20)); |
|
|
|
fileType.add(row(LayoutConstants.HGAP_LARGE, |
|
|
|
type.add(fileTypeComboBox); |
|
|
|
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_File_Type"))).weight(0.12), |
|
|
|
northPanel.add(type, BorderLayout.WEST); |
|
|
|
cell(fileTypeComboBox).weight(0.18), |
|
|
|
|
|
|
|
flex(0.7) |
|
|
|
|
|
|
|
).getComponent()); |
|
|
|
|
|
|
|
|
|
|
|
// 最上面的pane,文件选择
|
|
|
|
//参数面板
|
|
|
|
JPanel centerPanel = new JPanel(); |
|
|
|
|
|
|
|
centerPanel.setPreferredSize(new Dimension(522, 200)); |
|
|
|
|
|
|
|
centerPanel.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File_Address"))); |
|
|
|
|
|
|
|
addToCenterPanel(centerPanel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 下面的pane,参数面板
|
|
|
|
|
|
|
|
ParameterTableModel model = new ParameterTableModel() { |
|
|
|
ParameterTableModel model = new ParameterTableModel() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public UITableEditAction[] createAction() { |
|
|
|
public UITableEditAction[] createAction() { |
|
|
@ -158,65 +151,75 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
editorPane = new UITableEditorPane<ParameterProvider>(model); |
|
|
|
editorPane = new UITableEditorPane<ParameterProvider>(model); |
|
|
|
editorPane.setPreferredSize(new Dimension(355, 130)); |
|
|
|
editorPane.setBorder(new ScaledEmptyBorder(0,0,0,10)); |
|
|
|
centerPanel.add(editorPane, BorderLayout.SOUTH); |
|
|
|
editorPane.setPreferredSize(FineUIScale.scale(new Dimension(-1, 150))); |
|
|
|
|
|
|
|
|
|
|
|
JPanel southPanel = new JPanel(new BorderLayout()); |
|
|
|
//左侧文件地址pane
|
|
|
|
JPanel setPanel = new JPanel(); |
|
|
|
JPanel leftPanel = new JPanel(new BorderLayout()); |
|
|
|
southPanel.add(setPanel, BorderLayout.CENTER); |
|
|
|
leftPanel.add(column( |
|
|
|
setPanel.setPreferredSize(new Dimension(setPanelWidth, 460)); |
|
|
|
LayoutConstants.VERTICAL_GAP, |
|
|
|
setPanel.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set"))); |
|
|
|
cell(getCenterPanel(localWidthRatio, urlWidthRatio)), |
|
|
|
JPanel controlPane = textSetPanel(width, height); |
|
|
|
cell(editorPane) |
|
|
|
setPanel.add(controlPane, BorderLayout.NORTH); |
|
|
|
).getComponent()); |
|
|
|
fileTypeComboBox.addActionListener(getFileTypeListener(setPanel, width, height)); |
|
|
|
//右侧设定pane
|
|
|
|
|
|
|
|
JPanel rightPanel = new JPanel(new BorderLayout()); |
|
|
|
this.add(northPanel, BorderLayout.NORTH); |
|
|
|
rightPanel.setBorder(new ScaledEmptyBorder(0,0,0,10)); |
|
|
|
this.add(centerPanel, BorderLayout.CENTER); |
|
|
|
rightPanel.add(getTextSetPanel()); |
|
|
|
this.add(southPanel, BorderLayout.EAST); |
|
|
|
fileTypeComboBox.addActionListener(getFileTypeListener(rightPanel)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//文件数据集整体布局,服务器数据集/模板数据集下的文件数据集,创建文件数据集,三处面板通用布局
|
|
|
|
private void addToCenterPanel(JPanel centerPanel) { |
|
|
|
this.add(column(LayoutConstants.VERTICAL_GAP, |
|
|
|
localFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Local_File") + ":", true); |
|
|
|
cell(fileType), |
|
|
|
urlFileRadioButton = new UIRadioButton("URL:", false); |
|
|
|
row(20, |
|
|
|
|
|
|
|
cell(wrapComponentWithTitle(leftPanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File_Address"))).weight(0.5), |
|
|
|
|
|
|
|
cell(wrapComponentWithTitle(rightPanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set"))).weight(0.5) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
).getComponent()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 文件地址上方的面板-文件选择 |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private JPanel getCenterPanel(double localWidthRatio, double urlWidthRatio) { |
|
|
|
|
|
|
|
// 本地文件/URL
|
|
|
|
|
|
|
|
localFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Local_File"), true); |
|
|
|
|
|
|
|
urlFileRadioButton = new UIRadioButton("URL", false); |
|
|
|
ButtonGroup bg = new ButtonGroup(); |
|
|
|
ButtonGroup bg = new ButtonGroup(); |
|
|
|
bg.add(localFileRadioButton); |
|
|
|
bg.add(localFileRadioButton); |
|
|
|
bg.add(urlFileRadioButton); |
|
|
|
bg.add(urlFileRadioButton); |
|
|
|
localFileRadioButton.addActionListener(radioActionListener); |
|
|
|
localFileRadioButton.addActionListener(radioActionListener); |
|
|
|
urlFileRadioButton.addActionListener(radioActionListener); |
|
|
|
urlFileRadioButton.addActionListener(radioActionListener); |
|
|
|
urlFileRadioButton.setForeground(new Color(143, 142, 139)); |
|
|
|
|
|
|
|
localFileRadioButton.setForeground(Color.black); |
|
|
|
|
|
|
|
localText = new UITextField(); |
|
|
|
localText = new UITextField(); |
|
|
|
localText.setPreferredSize(new Dimension(195, 20)); |
|
|
|
|
|
|
|
urlText = new UITextField(); |
|
|
|
urlText = new UITextField(); |
|
|
|
urlText.setPreferredSize(new Dimension(195, 20)); |
|
|
|
|
|
|
|
urlText.setEditable(false); |
|
|
|
urlText.setEditable(false); |
|
|
|
|
|
|
|
// 选择按钮
|
|
|
|
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Selection")); |
|
|
|
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Selection")); |
|
|
|
chooseFile.addActionListener(chooseFileListener); |
|
|
|
chooseFile.addActionListener(chooseFileListener); |
|
|
|
|
|
|
|
// 测试连接按钮
|
|
|
|
testConnection = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection")); |
|
|
|
testConnection = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection")); |
|
|
|
testConnection.setEnabled(false); |
|
|
|
testConnection.setEnabled(false); |
|
|
|
testConnection.addActionListener(testConnectionListener);// 测试连接按钮
|
|
|
|
testConnection.addActionListener(testConnectionListener); |
|
|
|
|
|
|
|
// 提示信息
|
|
|
|
JPanel textPanel = new JPanel(new GridLayout(2, 1, 15, 15)); |
|
|
|
|
|
|
|
JPanel textFieldPanel = new JPanel(new GridLayout(2, 1, 15, 15)); |
|
|
|
|
|
|
|
JPanel buttonPanel = new JPanel(new GridLayout(2, 1, 15, 15)); |
|
|
|
|
|
|
|
textPanel.add(localFileRadioButton); |
|
|
|
|
|
|
|
textPanel.add(urlFileRadioButton); |
|
|
|
|
|
|
|
textFieldPanel.add(localText); |
|
|
|
|
|
|
|
textFieldPanel.add(urlText); |
|
|
|
|
|
|
|
buttonPanel.add(chooseFile); |
|
|
|
|
|
|
|
buttonPanel.add(testConnection); |
|
|
|
|
|
|
|
filePath = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
|
|
|
filePath.add(textPanel, BorderLayout.WEST); |
|
|
|
|
|
|
|
filePath.add(textFieldPanel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
filePath.add(buttonPanel, BorderLayout.EAST); |
|
|
|
|
|
|
|
centerPanel.add(filePath, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 中间的pane,提示信息
|
|
|
|
|
|
|
|
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + "txt" + "<br>" |
|
|
|
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + "txt" + "<br>" |
|
|
|
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + " </body> </html> "; |
|
|
|
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + " </body> </html> "; |
|
|
|
tips = new UILabel(tipContent); |
|
|
|
tips = new UILabel(tipContent); |
|
|
|
centerPanel.add(tips, BorderLayout.CENTER); |
|
|
|
return column( |
|
|
|
|
|
|
|
LayoutConstants.VERTICAL_GAP, |
|
|
|
|
|
|
|
row( |
|
|
|
|
|
|
|
LayoutConstants.HGAP_LARGE, |
|
|
|
|
|
|
|
cell(localFileRadioButton).weight(0.25), |
|
|
|
|
|
|
|
cell(localText).weight(localWidthRatio), |
|
|
|
|
|
|
|
cell(chooseFile).weight(0.75 - localWidthRatio) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
row( |
|
|
|
|
|
|
|
LayoutConstants.HGAP_LARGE, |
|
|
|
|
|
|
|
cell(urlFileRadioButton).weight(0.25), |
|
|
|
|
|
|
|
cell(urlText).weight(urlWidthRatio), |
|
|
|
|
|
|
|
cell(testConnection).weight(0.75 - urlWidthRatio) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
cell(tips).weight(1) |
|
|
|
|
|
|
|
).with(it -> it.setBorder(new ScaledEmptyBorder(0,0,0,10))).getComponent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ActionListener testConnectionListener = new ActionListener() { |
|
|
|
private ActionListener testConnectionListener = new ActionListener() { |
|
|
@ -249,7 +252,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private void previewPanel(JPanel jPanel) { |
|
|
|
private JPanel getPreviewPanel() { |
|
|
|
JPanel previewPanel = new JPanel(new BorderLayout()); |
|
|
|
JPanel previewPanel = new JPanel(new BorderLayout()); |
|
|
|
UIButton preview = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); |
|
|
|
UIButton preview = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); |
|
|
|
preview.addActionListener(new ActionListener() { |
|
|
|
preview.addActionListener(new ActionListener() { |
|
|
@ -259,56 +262,33 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
previewPanel.add(preview, BorderLayout.EAST); |
|
|
|
previewPanel.add(preview, BorderLayout.EAST); |
|
|
|
jPanel.add(previewPanel, BorderLayout.SOUTH); |
|
|
|
return previewPanel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel xmlSetPanel(int width, int height) { |
|
|
|
/** |
|
|
|
|
|
|
|
* XML设定Pane |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private JPanel getXmlSetPanel() { |
|
|
|
// xml设置pane
|
|
|
|
// xml设置pane
|
|
|
|
JPanel controlPane = new JPanel(); |
|
|
|
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type")); |
|
|
|
JPanel northPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
|
|
|
|
JPanel northTopPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
|
|
|
|
JPanel southPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
|
|
|
|
JPanel southTopPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
|
|
|
|
controlPane.setLayout(new BorderLayout(8, 8)); |
|
|
|
|
|
|
|
controlPane.setPreferredSize(new Dimension(width, height)); |
|
|
|
|
|
|
|
JPanel comboboxPanel = new JPanel(new BorderLayout(8, 8)); |
|
|
|
|
|
|
|
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type") + ":"); |
|
|
|
|
|
|
|
encodingComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); |
|
|
|
encodingComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); |
|
|
|
encodingComboBox.setSelectedIndex(4); |
|
|
|
encodingComboBox.setSelectedIndex(4); |
|
|
|
encodingComboBox.setPreferredSize(new Dimension(90, 20)); |
|
|
|
return column( |
|
|
|
|
|
|
|
LayoutConstants.VGAP_MEDIUM, |
|
|
|
JPanel treeContainerPane = new JPanel(); |
|
|
|
row(LayoutConstants.HORIZONTAL_GAP, cell(encodeLabel).weight(0.2), cell(encodingComboBox).weight(0.8)), |
|
|
|
treeContainerPane.setLayout(new BorderLayout(8, 8)); |
|
|
|
cell(new XMLNodeTreePane()), |
|
|
|
nodeTreePane = new XMLNodeTreePane(); |
|
|
|
cell(getPreviewPanel()) |
|
|
|
treeContainerPane.add(nodeTreePane, BorderLayout.CENTER); |
|
|
|
).getComponent(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
comboboxPanel.add(encodeLabel, BorderLayout.WEST); |
|
|
|
/** |
|
|
|
comboboxPanel.add(encodingComboBox, BorderLayout.CENTER); |
|
|
|
* Excel设定Pane |
|
|
|
|
|
|
|
* @return |
|
|
|
northPane.add(comboboxPanel, BorderLayout.EAST); |
|
|
|
*/ |
|
|
|
northTopPane.add(northPane, BorderLayout.WEST); |
|
|
|
private JPanel getExcelSetPanel() { |
|
|
|
southTopPane.add(southPane, BorderLayout.WEST); |
|
|
|
|
|
|
|
southTopPane.add(treeContainerPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
controlPane.add(northTopPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
controlPane.add(southTopPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
previewPanel(controlPane); |
|
|
|
|
|
|
|
return controlPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel excelSetPanel(int width, int height) { |
|
|
|
|
|
|
|
// excel设置pane
|
|
|
|
|
|
|
|
int checkBoxWidth = width - EIGHT; |
|
|
|
|
|
|
|
JPanel controlPane = new JPanel(); |
|
|
|
|
|
|
|
JPanel northPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
|
|
|
|
controlPane.setLayout(new BorderLayout()); |
|
|
|
|
|
|
|
controlPane.setPreferredSize(new Dimension(width, height)); |
|
|
|
|
|
|
|
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), false); |
|
|
|
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), false); |
|
|
|
needColumnNameCheckBox.setPreferredSize(new Dimension(checkBoxWidth, 20)); |
|
|
|
return column(cell(needColumnNameCheckBox), cell(getPreviewPanel())).getComponent(); |
|
|
|
northPane.add(needColumnNameCheckBox, BorderLayout.EAST); |
|
|
|
|
|
|
|
controlPane.add(northPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
previewPanel(controlPane); |
|
|
|
|
|
|
|
return controlPane; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getFilePathFromUrlOrLocal() { |
|
|
|
private String getFilePathFromUrlOrLocal() { |
|
|
@ -346,34 +326,31 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
// return (uri.matches("https*://.+|\\$\\{.+\\}.*"));
|
|
|
|
// return (uri.matches("https*://.+|\\$\\{.+\\}.*"));
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel textSetPanel(int width, int height) { |
|
|
|
/** |
|
|
|
// text设置pane
|
|
|
|
* TXT设定Pane |
|
|
|
JPanel controlPane = new JPanel(); |
|
|
|
* @return |
|
|
|
controlPane.setLayout(new BorderLayout()); |
|
|
|
*/ |
|
|
|
controlPane.setPreferredSize(new Dimension(width, height)); |
|
|
|
private JPanel getTextSetPanel() { |
|
|
|
JPanel northPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
initRatioButton(); |
|
|
|
addToNorthPane(northPane); |
|
|
|
//编码类型
|
|
|
|
controlPane.add(northPane, BorderLayout.WEST); |
|
|
|
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type")); |
|
|
|
previewPanel(controlPane); |
|
|
|
charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); |
|
|
|
return controlPane; |
|
|
|
return column(cell(getTxtCenterPane()), cell(getPreviewPanel())).getComponent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addToNorthPane(JPanel northPane) { |
|
|
|
/** |
|
|
|
double f = TableLayout.FILL; |
|
|
|
* 初始化Button |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
*/ |
|
|
|
double[] columnSize = {f, p, p}; |
|
|
|
private void initRatioButton(){ |
|
|
|
double[] rowSize = {B, B, B, B, B, B, B}; |
|
|
|
|
|
|
|
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), true); |
|
|
|
|
|
|
|
dismenberLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dismenber") + ":"); |
|
|
|
|
|
|
|
tableDismemberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Dismember"), false); |
|
|
|
tableDismemberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Dismember"), false); |
|
|
|
tableDismemberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Dismember")); |
|
|
|
tableDismemberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Dismember")); |
|
|
|
spaceDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Space"), true); |
|
|
|
spaceDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Space"), true); |
|
|
|
spaceDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Space")); |
|
|
|
spaceDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Space")); |
|
|
|
commaDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Comma_Dismenber"), false); |
|
|
|
commaDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Comma_Dismenber"), false); |
|
|
|
commaDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Comma_Dismenber")); |
|
|
|
commaDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Comma_Dismenber")); |
|
|
|
otherDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other") + ":", false); |
|
|
|
otherDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"), false); |
|
|
|
otherDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other")); |
|
|
|
otherDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other")); |
|
|
|
otherDismenberTextField = new UITextField(8); |
|
|
|
otherDismenberTextField = new UITextField(); |
|
|
|
otherDismenberTextField.setEditable(false); |
|
|
|
otherDismenberTextField.setEditable(false); |
|
|
|
otherDismenberRadioButton.addChangeListener(new ChangeListener() { |
|
|
|
otherDismenberRadioButton.addChangeListener(new ChangeListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -385,6 +362,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), true); |
|
|
|
ButtonGroup bg2 = new ButtonGroup(); |
|
|
|
ButtonGroup bg2 = new ButtonGroup(); |
|
|
|
bg2.add(tableDismemberRadioButton); |
|
|
|
bg2.add(tableDismemberRadioButton); |
|
|
|
bg2.add(spaceDismenberRadioButton); |
|
|
|
bg2.add(spaceDismenberRadioButton); |
|
|
@ -392,18 +370,38 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
bg2.add(otherDismenberRadioButton); |
|
|
|
bg2.add(otherDismenberRadioButton); |
|
|
|
ignoreOneMoreDelimiterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Series_Dismenber_As_Single"), true); |
|
|
|
ignoreOneMoreDelimiterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Series_Dismenber_As_Single"), true); |
|
|
|
UIComponentUtils.setLineWrap(ignoreOneMoreDelimiterCheckBox); |
|
|
|
UIComponentUtils.setLineWrap(ignoreOneMoreDelimiterCheckBox); |
|
|
|
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type") + ":"); |
|
|
|
} |
|
|
|
charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); |
|
|
|
|
|
|
|
Component[][] comps = { |
|
|
|
|
|
|
|
{encodeLabel, charsetComboBox, null}, |
|
|
|
/** |
|
|
|
{needColumnNameCheckBox, null, null}, |
|
|
|
* 获取TXT中心Pane |
|
|
|
{dismenberLabel, tableDismemberRadioButton, null}, |
|
|
|
* @return |
|
|
|
{null, spaceDismenberRadioButton, null}, |
|
|
|
*/ |
|
|
|
{null, commaDismenberRadioButton, null}, |
|
|
|
private JPanel getTxtCenterPane(){ |
|
|
|
{null, otherDismenberRadioButton, otherDismenberTextField}, |
|
|
|
//分隔符选项
|
|
|
|
{ignoreOneMoreDelimiterCheckBox, null, null} |
|
|
|
JPanel separatorOptionsPanel = column( |
|
|
|
}; |
|
|
|
LayoutConstants.VERTICAL_GAP, |
|
|
|
northPane.add(TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.EAST); |
|
|
|
cell(tableDismemberRadioButton), |
|
|
|
|
|
|
|
cell(spaceDismenberRadioButton), |
|
|
|
|
|
|
|
cell(commaDismenberRadioButton), |
|
|
|
|
|
|
|
row(cell(otherDismenberRadioButton).weight(0.2), cell(otherDismenberTextField).weight(0.8)) |
|
|
|
|
|
|
|
).getComponent(); |
|
|
|
|
|
|
|
//TXT设定主要面板
|
|
|
|
|
|
|
|
return column( |
|
|
|
|
|
|
|
LayoutConstants.VERTICAL_GAP, |
|
|
|
|
|
|
|
row(10, cell(encodeLabel).weight(0.2), cell(charsetComboBox).weight(0.8)), |
|
|
|
|
|
|
|
cell(needColumnNameCheckBox), |
|
|
|
|
|
|
|
row(10, |
|
|
|
|
|
|
|
cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dismenber"))).weight(0.2), |
|
|
|
|
|
|
|
cell(separatorOptionsPanel).weight(0.8) |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
cell(ignoreOneMoreDelimiterCheckBox) |
|
|
|
|
|
|
|
).getComponent(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel getTopAlignLabelPane(String labelText) { |
|
|
|
|
|
|
|
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText))) |
|
|
|
|
|
|
|
.with(it-> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ActionListener radioActionListener = new ActionListener() { |
|
|
|
private ActionListener radioActionListener = new ActionListener() { |
|
|
@ -480,24 +478,24 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
return suffixToString; |
|
|
|
return suffixToString; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ActionListener getFileTypeListener(final JPanel setPanel, final int width, final int height) { |
|
|
|
private ActionListener getFileTypeListener(final JPanel rightPanel) { |
|
|
|
ActionListener fileTypeListener = new ActionListener() { |
|
|
|
ActionListener fileTypeListener = new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
setPanel.removeAll(); |
|
|
|
rightPanel.removeAll(); |
|
|
|
localText.setText(""); |
|
|
|
localText.setText(""); |
|
|
|
urlText.setText(""); |
|
|
|
urlText.setText(""); |
|
|
|
if (fileTypeComboBox.getSelectedIndex() == XML) { |
|
|
|
if (fileTypeComboBox.getSelectedIndex() == XML) { |
|
|
|
setPanel.add(xmlSetPanel(width, height), BorderLayout.NORTH); |
|
|
|
rightPanel.add(getXmlSetPanel()); |
|
|
|
} else if (fileTypeComboBox.getSelectedIndex() == EXCEL) { |
|
|
|
} else if (fileTypeComboBox.getSelectedIndex() == EXCEL) { |
|
|
|
setPanel.add(excelSetPanel(width, height), BorderLayout.NORTH); |
|
|
|
rightPanel.add(getExcelSetPanel()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setPanel.add(textSetPanel(width, height), BorderLayout.NORTH); |
|
|
|
rightPanel.add(getTextSetPanel()); |
|
|
|
} |
|
|
|
} |
|
|
|
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "<br>" |
|
|
|
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "<br>" |
|
|
|
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + " </body> </html> "; |
|
|
|
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + " </body> </html> "; |
|
|
|
tips.setText(tipContent); |
|
|
|
tips.setText(tipContent); |
|
|
|
setPanel.revalidate(); |
|
|
|
rightPanel.revalidate(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -507,7 +505,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
private class RefreshAction extends UITableEditAction { |
|
|
|
private class RefreshAction extends UITableEditAction { |
|
|
|
public RefreshAction() { |
|
|
|
public RefreshAction() { |
|
|
|
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh")); |
|
|
|
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh")); |
|
|
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); |
|
|
|
this.setSmallIcon(new LazyIcon("refresh")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -818,9 +816,10 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
JPanel toolbarPanel = new JPanel(new BorderLayout()); |
|
|
|
JPanel toolbarPanel = new JPanel(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
xmlNodeTree = new XMLNodeTree(); |
|
|
|
xmlNodeTree = new XMLNodeTree(); |
|
|
|
|
|
|
|
xmlNodeTree.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE)); |
|
|
|
this.add(new JScrollPane(xmlNodeTree)); |
|
|
|
this.add(new JScrollPane(xmlNodeTree)); |
|
|
|
|
|
|
|
|
|
|
|
keyPointLaber = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Key_Point") + ":"); |
|
|
|
keyPointLaber = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Key_Point")); |
|
|
|
refreshAction = new RefreshParameterAction(); |
|
|
|
refreshAction = new RefreshParameterAction(); |
|
|
|
ToolBarDef toolbarDef = new ToolBarDef(); |
|
|
|
ToolBarDef toolbarDef = new ToolBarDef(); |
|
|
|
toolbarDef.addShortCut(refreshAction); |
|
|
|
toolbarDef.addShortCut(refreshAction); |
|
|
@ -840,7 +839,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
public RefreshParameterAction() { |
|
|
|
public RefreshParameterAction() { |
|
|
|
this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh")); |
|
|
|
this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh")); |
|
|
|
this.setMnemonic('r'); |
|
|
|
this.setMnemonic('r'); |
|
|
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); |
|
|
|
this.setSmallIcon(new LazyIcon("refresh")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|