Search in sources :

Example 6 with ImportConfigDialog

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

Aggregations

ImportConfigDialog (com.cubrid.cubridmanager.ui.host.dialog.ImportConfigDialog)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 ExportConfigDialog (com.cubrid.cubridmanager.ui.host.dialog.ExportConfigDialog)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