Search in sources :

Example 6 with ConfEditInput

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();
    }
}
Also used : ConfEditInput(com.cubrid.cubridmanager.ui.host.action.ConfEditInput) ImportConfigDialog(com.cubrid.cubridmanager.ui.host.dialog.ImportConfigDialog) IEditorInput(org.eclipse.ui.IEditorInput)

Example 7 with ConfEditInput

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);
    }
}
Also used : ExportConfigDialog(com.cubrid.cubridmanager.ui.host.dialog.ExportConfigDialog) ConfEditInput(com.cubrid.cubridmanager.ui.host.action.ConfEditInput) IEditorInput(org.eclipse.ui.IEditorInput)

Aggregations

ConfEditInput (com.cubrid.cubridmanager.ui.host.action.ConfEditInput)7 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)4 IEditorInput (org.eclipse.ui.IEditorInput)2 ExportConfigDialog (com.cubrid.cubridmanager.ui.host.dialog.ExportConfigDialog)1 ImportConfigDialog (com.cubrid.cubridmanager.ui.host.dialog.ImportConfigDialog)1