use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.
the class MultiHostConnectionDialog method initTask.
public void initTask() {
if (container == null)
return;
for (ConnectionTaskContainer con : container) {
ServerInfo info = con.getServerInfo();
TableItem item = new TableItem(table, SWT.NONE);
item.setText(1, info.getServerName());
TableEditor editor = new TableEditor(table);
editor.grabHorizontal = editor.grabVertical = true;
ProgressBar bar = new ProgressBar(table, SWT.NONE);
editor.setEditor(bar, item, 2);
con.setItem(item);
item.setData(KEY_BAR, bar);
item.setData(KEY_CONNECTION, con);
}
}
use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.
the class MultiHostEditDialog method cloneMultiEditHostInfo.
/**
* cloneMultiEditHostInfo
* @param cubridServer
* @return
*/
public CubridServer cloneMultiEditHostInfo(CubridServer cubridServer) {
CubridServer newCubridServer = new CubridServer(cubridServer.getId(), cubridServer.getLabel(), null, null);
ServerInfo newServerInfo = new ServerInfo();
ServerInfo oldCubridServer = cubridServer.getServerInfo();
newCubridServer.setAutoSavePassword(cubridServer.isAutoSavePassword());
newServerInfo.setServerName(oldCubridServer.getServerName());
newServerInfo.setHostAddress(cubridServer.getHostAddress());
newServerInfo.setHostMonPort(oldCubridServer.getHostMonPort());
newServerInfo.setJdbcDriverVersion(oldCubridServer.getJdbcDriverVersion());
newServerInfo.setUserName(oldCubridServer.getUserName());
if (cubridServer.isAutoSavePassword()) {
newServerInfo.setUserPassword(oldCubridServer.getUserPassword());
}
newCubridServer.setServerInfo(newServerInfo);
return newCubridServer;
}
use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.
the class NewMultiHostConnectionDialog method editHost.
public void editHost(FailedHostServerInfo multiHostConnectionFailedServerInfo) {
// get selected dbdata
if (multiHostConnectionFailedServerInfo == null || multiHostConnectionFailedServerInfo.getCubridServer().isConnected()) {
return;
}
HostDialog dialog = new HostDialog(getShell(), false, false);
ServerInfo oldServerInfo = multiHostConnectionFailedServerInfo.getCubridServer().getServerInfo();
dialog.setServer(multiHostConnectionFailedServerInfo.getCubridServer());
if (dialog.open() != HostDialog.CONNECT_ID) {
return;
}
ServerInfo serverInfo = dialog.getServerInfo();
if (!serverInfo.getServerName().equals(multiHostConnectionFailedServerInfo.getCubridServer().getLabel())) {
QueryOptions.removePref(multiHostConnectionFailedServerInfo.getCubridServer().getServerInfo());
BrokerIntervalSettingManager.getInstance().removeAllBrokerIntervalSettingInServer(multiHostConnectionFailedServerInfo.getCubridServer().getLabel());
}
if (oldServerInfo.isConnected() && !oldServerInfo.equals(serverInfo)) {
HostUtils.processHostDisconnected(multiHostConnectionFailedServerInfo.getCubridServer());
}
multiHostConnectionFailedServerInfo.getCubridServer().setId(serverInfo.getServerName());
multiHostConnectionFailedServerInfo.getCubridServer().setLabel(serverInfo.getServerName());
multiHostConnectionFailedServerInfo.getCubridServer().setServerInfo(serverInfo);
multiHostConnectionFailedServerInfo.getCubridServer().setAutoSavePassword(dialog.isSavePassword());
CMHostNodePersistManager.getInstance().addServer(serverInfo.getHostAddress(), serverInfo.getHostMonPort(), serverInfo.getUserName(), serverInfo);
CubridNodeManager.getInstance().fireCubridNodeChanged(new CubridNodeChangedEvent(multiHostConnectionFailedServerInfo.getCubridServer(), CubridNodeChangedEventType.SERVER_CONNECTED));
multiHostConnectionFailedServerInfo.getCubridServer().getLoader().setLoaded(false);
CubridNavigatorView view = CubridNavigatorView.getNavigatorView(CubridHostNavigatorView.ID);
TreeViewer treeViewer = view.getViewer();
treeViewer.refresh(multiHostConnectionFailedServerInfo.getCubridServer(), true);
treeViewer.expandToLevel(multiHostConnectionFailedServerInfo.getCubridServer(), 1);
ActionManager.getInstance().fireSelectionChanged(treeViewer.getSelection());
LayoutManager.getInstance().fireSelectionChanged(treeViewer.getSelection());
multiHostConnectionFailedServerInfo.setErrConnectionMsg("");
serverTable.refresh();
}
use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.
the class EditBrokerConfigEditor method init.
/**
* @see com.cubrid.common.ui.spi.part.CubridEditorPart#init(org.eclipse.ui.IEditorSite,
* org.eclipse.ui.IEditorInput)
* @param site the editor site
* @param input the editor input
* @exception PartInitException if this editor was not initialized
* successfully
*/
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
if (input instanceof ConfEditInput) {
editorInput = (ConfEditInput) input;
ServerInfo serverInfo = editorInput.getServerInfo();
contents = ConfigParaHelp.performGetBrokerConf(serverInfo);
}
}
use of com.cubrid.cubridmanager.core.common.model.ServerInfo in project cubrid-manager by CUBRID.
the class EditCmConfigEditor method init.
/**
* @see com.cubrid.common.ui.spi.part.CubridEditorPart#init(org.eclipse.ui.IEditorSite,
* org.eclipse.ui.IEditorInput)
* @param site the editor site
* @param input the editor input
* @exception PartInitException if this editor was not initialized
* successfully
*/
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
if (input instanceof ConfEditInput) {
editorInput = (ConfEditInput) input;
ServerInfo serverInfo = editorInput.getServerInfo();
contents = ConfigParaHelp.performGetCmConf(serverInfo);
}
}
Aggregations