use of com.cubrid.cubridmanager.ui.host.action.ConfEditInput in project cubrid-manager by CUBRID.
the class EditConfigEditor method doImport.
/**
* Perform the import based upon the given ConfigType.
*
* @param configType the ConfigType
*/
protected void doImport(ConfigType configType) {
IEditorInput input = this.getEditorInput();
if (!(input instanceof ConfEditInput)) {
return;
}
ImportConfigDialog dialog = new ImportConfigDialog(this.getSite().getShell(), configType, true);
if (defaultImportFileName != null && !"".equals(defaultImportFileName)) {
dialog.setDefaultFileName(defaultImportFileName);
}
if (defaultImportFileCharset != null && !"".equals(defaultImportFileCharset)) {
dialog.setDefaultCharset(defaultImportFileCharset);
}
if (dialog.open() == Dialog.OK) {
defaultImportFileName = dialog.getDefaultFileName();
defaultImportFileCharset = dialog.getDefaultCharset();
contents = dialog.getImportFileContent();
createContent();
}
}
use of com.cubrid.cubridmanager.ui.host.action.ConfEditInput in project cubrid-manager by CUBRID.
the class EditConfigEditor method doExport.
/**
* Perform the export based upon the given ConfigType.
*
* @param configType the ConfigType
*/
protected void doExport(ConfigType configType) {
IEditorInput input = this.getEditorInput();
if (!(input instanceof ConfEditInput)) {
return;
}
ExportConfigDialog dialog = new ExportConfigDialog(this.getSite().getShell(), configType, true);
if (defaultExportFilePath != null && !"".equals(defaultExportFilePath)) {
dialog.setDefaultFilePath(defaultExportFilePath);
}
if (defaultExportFileName != null && !"".equals(defaultExportFileName)) {
dialog.setDefaultFileName(defaultExportFileName);
}
if (defaultExportFileExtName != null && !"".equals(defaultExportFileExtName)) {
dialog.setDefaultFileExtName(defaultExportFileExtName);
}
if (defaultExportFileCharset != null && !"".equals(defaultExportFileCharset)) {
dialog.setOutputFileCharset(defaultExportFileCharset);
}
if (dialog.open() == Dialog.OK) {
defaultExportFilePath = dialog.getDefaultFilePath();
defaultExportFileName = dialog.getDefaultFileName();
defaultExportFileExtName = dialog.getDefaultFileExtName();
String fileFullName = dialog.getOutputFileFullName();
defaultExportFileCharset = dialog.getOutputFileCharset();
ConfigParaHelp.exportConf(contents, fileFullName, defaultExportFileCharset);
}
}
Aggregations