use of com.cubrid.common.ui.spi.dialog.CMWizardDialog 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();
}
}
}
use of com.cubrid.common.ui.spi.dialog.CMWizardDialog in project cubrid-manager by CUBRID.
the class AddShardAction method run.
/**
* Open a dialog to add a shard.
*/
public void run() {
Object[] obj = this.getSelectedObj();
if (obj != null && obj.length > 0) {
if (!isSupported(obj[0])) {
this.setEnabled(false);
return;
}
node = (ICubridNode) obj[0];
server = node.getServer();
}
CMWizardDialog dialog = new CMWizardDialog(getShell(), new AddShardWizard(server)) {
/**
* Overwrite the method. Auto add IPageChangingListener(s);
*
* @param parent
* of the control.
* @return Control
*/
protected Control createContents(Composite parent) {
Control result = super.createContents(parent);
IWizardPage[] pages = this.getWizard().getPages();
for (IWizardPage page : pages) {
if (page instanceof IPageChangingListener) {
this.addPageChangingListener((IPageChangingListener) page);
}
if (page instanceof IPageChangedListener) {
this.addPageChangedListener((IPageChangedListener) page);
}
}
return result;
}
};
dialog.setPageSize(660, 450);
dialog.open();
}
use of com.cubrid.common.ui.spi.dialog.CMWizardDialog in project cubrid-manager by CUBRID.
the class AddBrokerMonitorAction method run.
/**
* open add broker monitor dialog.
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
Object[] objArr = this.getSelectedObj();
if (objArr == null || objArr.length <= 0 || !isSupported(objArr[0])) {
setEnabled(false);
return;
}
HostMonitorPart hostMonPart = (HostMonitorPart) objArr[0];
HostNode hostNode = (HostNode) hostMonPart.getModel();
Dashboard dashboard = (Dashboard) hostMonPart.getParent().getModel();
if (hostNode != null && dashboard != null) {
AddHostAndDbWizard wizard = new AddHostAndDbWizard(hostNode, dashboard.getHostNodeList(), 2);
CMWizardDialog dialog = new CMWizardDialog(getShell(), wizard);
dialog.setPageSize(660, 380);
int returnCode = dialog.open();
if (returnCode == IDialogConstants.OK_ID) {
List<HostNode> addedHostNodeList = wizard.getAddedHostNodeList();
HAUtil.mergeHostNode(dashboard, addedHostNodeList);
HAUtil.calcLocation(dashboard.getHostNodeList());
}
}
}
use of com.cubrid.common.ui.spi.dialog.CMWizardDialog in project cubrid-manager by CUBRID.
the class AddHostMonitorAction method run.
/**
* Open add host monitor dialog.
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
Object[] objArr = this.getSelectedObj();
if (objArr == null || objArr.length <= 0 || !isSupported(objArr[0])) {
setEnabled(false);
return;
}
DashboardPart dp = (DashboardPart) objArr[0];
Dashboard dashboard = (Dashboard) dp.getModel();
if (dashboard != null) {
AddHostAndDbWizard wizard = new AddHostAndDbWizard(null, dashboard.getHostNodeList(), 0);
CMWizardDialog dialog = new CMWizardDialog(getShell(), wizard);
dialog.setPageSize(660, 380);
int returnCode = dialog.open();
if (returnCode == IDialogConstants.OK_ID) {
List<HostNode> addedHostNodeList = wizard.getAddedHostNodeList();
HAUtil.mergeHostNode(dashboard, addedHostNodeList);
HAUtil.calcLocation(dashboard.getHostNodeList());
}
}
}
Aggregations