use of com.cubrid.cubridmanager.ui.replication.editor.dialog.wizard.SetMasterDbInfoWizard in project cubrid-manager by CUBRID.
the class EditAction method run.
/**
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IWorkbenchPart workbenchPart = this.getWorkbenchPart();
if (!(workbenchPart instanceof ReplicationEditor) || !isEnabled()) {
return;
}
ReplicationEditor replEditor = (ReplicationEditor) workbenchPart;
Shell shell = replEditor.getSite().getShell();
NodePart nodePart = (NodePart) getSelectedObjects().get(0);
if (nodePart.getModel() instanceof MasterNode) {
SetMasterDbInfoWizard wizard = new SetMasterDbInfoWizard((MasterNode) nodePart.getModel());
wizard.setEditable(replEditor.isEditable());
CMWizardDialog dialog = new CMWizardDialog(shell, wizard);
dialog.setPageSize(560, 300);
dialog.open();
} else if (nodePart.getModel() instanceof DistributorNode) {
SetDistributorDbInfoDialog dialog = new SetDistributorDbInfoDialog(shell);
dialog.setDistributor((DistributorNode) nodePart.getModel());
dialog.setEditable(replEditor.isEditable());
dialog.open();
} else if (nodePart.getModel() instanceof SlaveNode) {
SetSlaveDbInfoDialog dialog = new SetSlaveDbInfoDialog(shell);
dialog.setSlave((SlaveNode) nodePart.getModel());
dialog.setEditable(replEditor.isEditable());
dialog.open();
} else if (nodePart.getModel() instanceof HostNode) {
SetHostInfoDialog dialog = new SetHostInfoDialog(shell);
dialog.setHostInfo((HostNode) nodePart.getModel());
dialog.setEditable(replEditor.isEditable());
dialog.open();
}
}
use of com.cubrid.cubridmanager.ui.replication.editor.dialog.wizard.SetMasterDbInfoWizard in project cubrid-manager by CUBRID.
the class LeafNodePart method performRequest.
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#performRequest(org.eclipse.gef.Request)
* @param req the request to be performed
*/
public void performRequest(Request req) {
Shell shell = replEditor.getSite().getShell();
if (req.getType() == RequestConstants.REQ_OPEN) {
if (getModel() instanceof MasterNode) {
SetMasterDbInfoWizard wizard = new SetMasterDbInfoWizard((MasterNode) getModel());
wizard.setEditable(replEditor.isEditable());
CMWizardDialog dialog = new CMWizardDialog(shell, wizard);
dialog.setPageSize(560, 300);
dialog.open();
} else if (getModel() instanceof DistributorNode) {
SetDistributorDbInfoDialog dialog = new SetDistributorDbInfoDialog(shell);
dialog.setDistributor((DistributorNode) getModel());
dialog.setEditable(replEditor.isEditable());
dialog.open();
} else if (getModel() instanceof SlaveNode) {
SetSlaveDbInfoDialog dialog = new SetSlaveDbInfoDialog(shell);
dialog.setSlave((SlaveNode) getModel());
dialog.setEditable(replEditor.isEditable());
dialog.open();
}
}
}
Aggregations