Search in sources :

Example 6 with ExportConfigDialog

use of com.cubrid.cubridmanager.ui.host.dialog.ExportConfigDialog 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

ExportConfigDialog (com.cubrid.cubridmanager.ui.host.dialog.ExportConfigDialog)6 CubridServer (com.cubrid.common.ui.spi.model.CubridServer)4 BrokerConfigEditComposite (com.cubrid.common.ui.common.control.BrokerConfigEditComposite)1 BrokerConfig (com.cubrid.common.ui.spi.model.BrokerConfig)1 ConfEditInput (com.cubrid.cubridmanager.ui.host.action.ConfEditInput)1 ImportConfigDialog (com.cubrid.cubridmanager.ui.host.dialog.ImportConfigDialog)1 File (java.io.File)1 List (java.util.List)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 ToolBar (org.eclipse.swt.widgets.ToolBar)1 ToolItem (org.eclipse.swt.widgets.ToolItem)1 IEditorInput (org.eclipse.ui.IEditorInput)1 PartInitException (org.eclipse.ui.PartInitException)1