made server gui work and auto generate xml imports
This commit is contained in:
parent
01b3b5cc54
commit
c259e28e44
69 changed files with 1669 additions and 1230 deletions
|
|
@ -66,7 +66,8 @@ import net.forwardfire.vasc.core.VascEntryField;
|
|||
import net.forwardfire.vasc.core.VascEntryListOption;
|
||||
import net.forwardfire.vasc.core.actions.GlobalVascAction;
|
||||
import net.forwardfire.vasc.core.actions.RowVascAction;
|
||||
import net.forwardfire.vasc.core.entry.VascEntryExporter;
|
||||
import net.forwardfire.vasc.core.entry.VascEntryExport;
|
||||
import net.forwardfire.vasc.core.entry.VascEntryExportWriter;
|
||||
import net.forwardfire.vasc.core.ui.VascOptionValueModelListener;
|
||||
import net.forwardfire.vasc.core.ui.VascUIComponent;
|
||||
import net.forwardfire.vasc.core.ui.VascValueModel;
|
||||
|
|
@ -215,40 +216,40 @@ public class SwingVascFrontend extends AbstractVascFrontend {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.VascViewRenderer#renderExport(net.forwardfire.vasc.core.VascEntry, net.forwardfire.vasc.core.VascDataExporter)
|
||||
*/
|
||||
public void renderExport(VascEntryExporter exporter) throws VascFrontendException {
|
||||
public void renderExport(VascEntryExport exporter) throws VascFrontendException {
|
||||
|
||||
String fileName = null;
|
||||
JFileChooser c = new JFileChooser();
|
||||
int rVal = c.showSaveDialog(null);
|
||||
if (rVal == JFileChooser.APPROVE_OPTION) {
|
||||
fileName = c.getSelectedFile().getAbsolutePath();
|
||||
// filename.setText(c.getSelectedFile().getName());
|
||||
//dir.setText(c.getCurrentDirectory().toString());
|
||||
}
|
||||
if (rVal == JFileChooser.CANCEL_OPTION) {
|
||||
return;
|
||||
}
|
||||
int rVal = c.showSaveDialog(null);
|
||||
if (rVal == JFileChooser.APPROVE_OPTION) {
|
||||
fileName = c.getSelectedFile().getAbsolutePath();
|
||||
}
|
||||
if (rVal == JFileChooser.CANCEL_OPTION) {
|
||||
return;
|
||||
}
|
||||
|
||||
logger.fine("FileName: "+fileName);
|
||||
if (fileName == null) {
|
||||
return;
|
||||
}
|
||||
OutputStream out = null;
|
||||
try {
|
||||
out = new FileOutputStream(fileName);
|
||||
exporter.doExport(out, entry);
|
||||
} catch (VascException e) {
|
||||
throw new VascFrontendException(e);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new VascFrontendException(e);
|
||||
logger.fine("Export fileName: "+fileName);
|
||||
if (fileName == null) {
|
||||
return;
|
||||
}
|
||||
OutputStream out = null;
|
||||
try {
|
||||
VascEntryExportWriter veew = exporter.createExportWriter();
|
||||
veew.doInit(exporter, entry);
|
||||
out = new FileOutputStream(fileName);
|
||||
veew.doExport(out);
|
||||
} catch (VascException e) {
|
||||
throw new VascFrontendException(e);
|
||||
} catch (IOException e) {
|
||||
throw new VascFrontendException(e);
|
||||
} finally {
|
||||
if (out!=null) {
|
||||
try {
|
||||
if (out!=null) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue