|
|
@ -76,6 +76,7 @@ import java.net.MalformedURLException; |
|
|
|
import java.net.URL; |
|
|
|
import java.net.URL; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
|
|
public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
private static final int TEXT = 0; |
|
|
|
private static final int TEXT = 0; |
|
|
@ -217,6 +218,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ActionListener testConnectionListener = new ActionListener() { |
|
|
|
private ActionListener testConnectionListener = new ActionListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent arg0) { |
|
|
|
public void actionPerformed(ActionEvent arg0) { |
|
|
|
String uri = ParameterHelper.analyze4Templatee(urlText.getText(), params); |
|
|
|
String uri = ParameterHelper.analyze4Templatee(urlText.getText(), params); |
|
|
|
if (!checkURL(uri)) { |
|
|
|
if (!checkURL(uri)) { |
|
|
@ -249,6 +251,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
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() { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
preview(); |
|
|
|
preview(); |
|
|
|
} |
|
|
|
} |
|
|
@ -264,7 +267,6 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
JPanel northTopPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
JPanel northTopPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
JPanel southPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
JPanel southPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
JPanel southTopPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
JPanel southTopPane = new JPanel(new BorderLayout(8, 8)); |
|
|
|
JPanel westPane = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
controlPane.setLayout(new BorderLayout(8, 8)); |
|
|
|
controlPane.setLayout(new BorderLayout(8, 8)); |
|
|
|
controlPane.setPreferredSize(new Dimension(width, height)); |
|
|
|
controlPane.setPreferredSize(new Dimension(width, height)); |
|
|
|
JPanel comboboxPanel = new JPanel(new BorderLayout(8, 8)); |
|
|
|
JPanel comboboxPanel = new JPanel(new BorderLayout(8, 8)); |
|
|
@ -321,6 +323,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
* |
|
|
|
* |
|
|
|
* @throws Exception |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
public void checkValid() throws Exception { |
|
|
|
public void checkValid() throws Exception { |
|
|
|
if (urlFileRadioButton.isSelected()) { |
|
|
|
if (urlFileRadioButton.isSelected()) { |
|
|
|
String url = urlText.getText().trim(); |
|
|
|
String url = urlText.getText().trim(); |
|
|
@ -356,8 +359,8 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
private void addToNorthPane(JPanel northPane) { |
|
|
|
private void addToNorthPane(JPanel northPane) { |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double columnSize[] = {f, p, p}; |
|
|
|
double[] columnSize = {f, p, p}; |
|
|
|
double rowSize[] = {B, B, B, B, B, B, B}; |
|
|
|
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); |
|
|
|
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") + ":"); |
|
|
|
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); |
|
|
@ -402,6 +405,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ActionListener radioActionListener = new ActionListener() { |
|
|
|
private ActionListener radioActionListener = new ActionListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
if (localFileRadioButton.isSelected()) { |
|
|
|
if (localFileRadioButton.isSelected()) { |
|
|
|
localRadioSelectAction(); |
|
|
|
localRadioSelectAction(); |
|
|
@ -456,8 +460,8 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
|
|
|
|
|
|
|
|
private String[] getFileSuffix() { |
|
|
|
private String[] getFileSuffix() { |
|
|
|
List<String> suffixList = new ArrayList<String>(); |
|
|
|
List<String> suffixList = new ArrayList<String>(); |
|
|
|
String suffix = fileTypeComboBox.getSelectedItem().toString().toLowerCase(); |
|
|
|
String suffix = Objects.requireNonNull(fileTypeComboBox.getSelectedItem()).toString().toLowerCase(); |
|
|
|
if (suffix.equalsIgnoreCase("excel")) { |
|
|
|
if ("excel".equalsIgnoreCase(suffix)) { |
|
|
|
suffixList.add("xls"); |
|
|
|
suffixList.add("xls"); |
|
|
|
suffixList.add("xlsx"); |
|
|
|
suffixList.add("xlsx"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -467,8 +471,8 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getFileSuffixToString() { |
|
|
|
private String getFileSuffixToString() { |
|
|
|
String suffixToString = fileTypeComboBox.getSelectedItem().toString().toLowerCase(); |
|
|
|
String suffixToString = Objects.requireNonNull(fileTypeComboBox.getSelectedItem()).toString().toLowerCase(); |
|
|
|
if (suffixToString.equalsIgnoreCase("excel")) { |
|
|
|
if ("excel".equalsIgnoreCase(suffixToString)) { |
|
|
|
suffixToString = "xls"; |
|
|
|
suffixToString = "xls"; |
|
|
|
} |
|
|
|
} |
|
|
|
return suffixToString; |
|
|
|
return suffixToString; |
|
|
@ -476,6 +480,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
|
|
|
|
|
|
|
|
private ActionListener getFileTypeListener(final JPanel setPanel, final int width, final int height) { |
|
|
|
private ActionListener getFileTypeListener(final JPanel setPanel, final int width, final int height) { |
|
|
|
ActionListener fileTypeListener = new ActionListener() { |
|
|
|
ActionListener fileTypeListener = new ActionListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
setPanel.removeAll(); |
|
|
|
setPanel.removeAll(); |
|
|
|
localText.setText(""); |
|
|
|
localText.setText(""); |
|
|
@ -503,6 +508,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); |
|
|
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
String[] paramTexts = new String[1]; |
|
|
|
String[] paramTexts = new String[1]; |
|
|
|
paramTexts[0] = getFilePathFromUrlOrLocal(); |
|
|
|
paramTexts[0] = getFilePathFromUrlOrLocal(); |
|
|
@ -817,6 +823,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); |
|
|
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
xmlNodeTree.waitRefresh(); |
|
|
|
xmlNodeTree.waitRefresh(); |
|
|
|
xmlNodeTree.refreshData(); |
|
|
|
xmlNodeTree.refreshData(); |
|
|
@ -845,6 +852,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private MouseListener treeMouseListener = new MouseAdapter() { |
|
|
|
private MouseListener treeMouseListener = new MouseAdapter() { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
if (XMLNodeTree.this.getModel() != treeModel) { |
|
|
|
if (XMLNodeTree.this.getModel() != treeModel) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -941,6 +949,10 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
loadedTreeModel(); |
|
|
|
loadedTreeModel(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (treeModel == null) { |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().info("The file is wrong or bad, can not create the XMLReader."); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
if (treeModel.getChildCount(treeModel.getRoot()) == 1) { |
|
|
|
if (treeModel.getChildCount(treeModel.getRoot()) == 1) { |
|
|
|
treeModel = new DefaultTreeModel((ExpandMutableTreeNode) treeModel.getChild(treeModel.getRoot(), 0)); |
|
|
|
treeModel = new DefaultTreeModel((ExpandMutableTreeNode) treeModel.getChild(treeModel.getRoot(), 0)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -986,6 +998,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> { |
|
|
|
this.layer = layer; |
|
|
|
this.layer = layer; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void readXML(XMLableReader reader) { |
|
|
|
public void readXML(XMLableReader reader) { |
|
|
|
String nodeName; |
|
|
|
String nodeName; |
|
|
|
if (this.layer < 0) { |
|
|
|
if (this.layer < 0) { |
|
|
|