Search in sources :

Example 6 with DbUnloadInfo

use of com.cubrid.cubridmanager.core.cubrid.database.model.DbUnloadInfo in project cubrid-manager by CUBRID.

the class LoadDatabaseDialog method initial.

/**
	 * 
	 * Initial data
	 * 
	 */
private void initial() {
    IDialogSettings dialogSettings = CubridManagerUIPlugin.getPluginDialogSettings();
    filteredFilePath = dialogSettings.get(KEY_LOAD_SCHEMA_FILE + database.getId());
    if (filteredFilePath == null || filteredFilePath.trim().length() == 0) {
        filteredFilePath = database.getDatabaseInfo().getDbDir();
    }
    databaseNameText.setText(database.getLabel());
    userNameText.setText(database.getUserName());
    dbDir = database.getDatabaseInfo().getDbDir();
    if (dbUnloadInfoList == null || dbUnloadInfoList.isEmpty()) {
        selectLoadFileFromListButton.setSelection(false);
        databaseCombo.setEnabled(false);
        selectUnloadFileFromSysButton.setSelection(true);
    } else {
        int index = 0;
        for (int i = 0; i < dbUnloadInfoList.size(); i++) {
            DbUnloadInfo dbUnloadInfo = dbUnloadInfoList.get(i);
            databaseCombo.add(dbUnloadInfo.getDbName());
            if (dbUnloadInfo.getDbName().equals(database.getLabel())) {
                index = i;
            }
        }
        databaseCombo.select(index);
        setTableModel(databaseCombo.getText());
        selectUnloadFileFromSysButton.setSelection(false);
        selectLoadFileFromListButton.setSelection(true);
        setBtnStatusInList(true);
        setBtnStatusInSys(false);
    }
}
Also used : IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) DbUnloadInfo(com.cubrid.cubridmanager.core.cubrid.database.model.DbUnloadInfo)

Aggregations

DbUnloadInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DbUnloadInfo)6 TreeNode (com.cubrid.cubridmanager.core.common.socket.TreeNode)2 ArrayList (java.util.ArrayList)2 ITask (com.cubrid.common.core.task.ITask)1 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)1 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)1 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)1 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)1 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)1 GetDbUnloadInfoTask (com.cubrid.cubridmanager.core.cubrid.database.task.GetDbUnloadInfoTask)1 LoadDatabaseDialog (com.cubrid.cubridmanager.ui.cubrid.database.dialog.LoadDatabaseDialog)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)1 Shell (org.eclipse.swt.widgets.Shell)1