use of com.cubrid.cubridmanager.ui.shard.control.AddShardWizard 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();
}
Aggregations