📄 importexportexcelpanel.java
字号:
* @return the table name */ public String getTableName() { return secondPanel.getSelectedTables()[0]; } /** <p>Retrieves the column names for this process. * * @return the column names */ public Vector getSelectedColumns() { return secondPanel.getSelectedColumns(); } /** <p>Returns a <code>Vector</code> of <code> * DataTransferObject</code> objects containing * all relevant data for the process. * * @return a <code>Vector</code> of * <code>DataTransferObject</code> objects */ public Vector getDataFileVector() { return thirdPanel.getDataFileVector(); } public String[][] getSheetNameValues() { return fourthPanel.getSheetNameValues(); } public boolean mapDataTypesToCells() { return fourthPanel.mapDataTypesToCells(); } /** * Returns whether to include column names as the * first row of a delimited export process. * * @return true | false */ public boolean includeColumnNames() { return fourthPanel.includeColumnNamesRowOne(); } /** * Returns whether to trim whitespace on column data values. * * @return true | false */ public boolean trimWhitespace() { return false; } // returns single or multiple table export public int getTableTransferType() { return firstPanel.getTableTransferType(); } /** <p>Returns the type of multiple table * transfer - single or multiple file. * * @return the type of multiple table transfer */ public int getMutlipleTableTransferType() { return firstPanel.getMutlipleTableTransferType(); } /** <p>Indicates whether the process (import only) * should be run as a batch process. * * @return whether to run as a batch process */ public boolean runAsBatchProcess() { return fifthPanel.runAsBatchProcess(); } public int getXMLFormat() { return -1; } private boolean doNext() { JPanel nextPanel = null; int index = model.getSelectedIndex(); switch (index) { case 0: DatabaseConnection dc = getDatabaseConnection(); if (dc != null) { metaData.setDatabaseConnection(dc); } if (secondPanel == null) { secondPanel = new ImportExportPanel_2(this); } nextPanel = secondPanel; secondPanel.setListData(getTableTransferType()); break; case 1: if (!secondPanel.hasSelections()) { if (getTableTransferType() == ImportExportProcess.MULTIPLE_TABLE) { GUIUtilities.displayErrorMessage( "You must select at least one table"); } else if (getTableTransferType() == ImportExportProcess.SINGLE_TABLE) { GUIUtilities.displayErrorMessage( "You must select at least one column"); } return false; } if (thirdPanel == null) { thirdPanel = new ImportExportPanel_3(this); } else { thirdPanel.buildTable(); } nextPanel = thirdPanel; break; case 2: if (!thirdPanel.transferObjectsComplete()) { return false; } if (fourthPanel == null) { fourthPanel = new ImportExportExcelPanel_4(this); } nextPanel = fourthPanel; fourthPanel.reset(getSelectedTables()); break; case 3: if (!fourthPanel.entriesComplete()) { GUIUtilities.displayErrorMessage( "Please ensure all required fields been entered correctly."); return false; } if (fifthPanel == null) { fifthPanel = new ImportExportExcelPanel_5(this); } nextPanel = fifthPanel; break; case 4: if (progressPanel == null) { progressPanel = new ImportExportProgressPanel(this); } processing = true; model.addPanel(progressPanel); if (transferType == EXPORT) { doExport(); } else if (transferType == IMPORT) { doImport(); } setButtonsEnabled(false); return true; } model.addPanel(nextPanel); return true; } /** * Defines the action for the BACK button. */ private boolean doPrevious() { // make sure the cancel button says cancel setCancelButtonText("Cancel"); return true; } /** * Stops the current process. */ public void stopTransfer() { setButtonsEnabled(true); if (processing) { worker.cancelTransfer(); setBackButtonEnabled(true); processCancelled = true; } } /** * Defines the action for the CANCEL button. */ public void cancel() { setButtonsEnabled(true); if (processing) { worker.cancelTransfer(); setBackButtonEnabled(true); processCancelled = true; } else { worker = null; parent.finished(); } } /** * Returns the selected database connection properties object. * * @return the connection properties object */ public DatabaseConnection getDatabaseConnection() { return firstPanel.getDatabaseConnection(); } public Dimension getChildDimension() { return childDim; } public MetaDataValues getMetaDataUtility() { return metaData; } private class TransferExcelWizardModel extends DefaultWizardProcessModel { public TransferExcelWizardModel() { int type = getTransferType(); String firstTitle = "Database Connection and Export Type"; String lastTitle = "Exporting Data..."; if (type == ImportExportProcess.IMPORT) { firstTitle = "Database Connection and Import Type"; lastTitle = "Importing Data..."; } String[] titles = {firstTitle, "Table Selection", "Data File Selection", "Spreadsheet Options", "Options", lastTitle}; setTitles(titles); String[] steps = {"Select database connection and transfer type", "Select the tables/columns", type == ImportExportProcess.IMPORT ? "Select the data file(s) to import from" : "Select the data file(s) to export to", "Set any spreadsheet specific options", "Set any further transfer options", type == ImportExportProcess.IMPORT ? "Import the data" : "Export the data"}; setSteps(steps); } public boolean previous() { if (doPrevious()) { return super.previous(); } return false; } public boolean next() { if (doNext()) { return super.next(); } return false; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -