use of org.talend.camel.designer.ui.wizards.CamelNewBeanWizard in project tesb-studio-se by Talend.
the class CreateCamelBean method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
// RepositoryNode codeNode = getViewPart().getRoot().getChildren().get(4);
// RepositoryNode routineNode = codeNode.getChildren().get(0);
RepositoryNode beanNode = getCurrentRepositoryNode();
if (isToolbar()) {
if (beanNode != null && beanNode.getContentType() != CamelRepositoryNodeType.repositoryBeansType) {
beanNode = null;
}
if (beanNode == null) {
beanNode = getRepositoryNodeForDefault(CamelRepositoryNodeType.repositoryBeansType);
}
}
RepositoryNode node = null;
IPath path = null;
if (!isToolbar()) {
ISelection selection = getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
node = (RepositoryNode) obj;
path = RepositoryNodeUtilities.getPath(node);
}
CamelNewBeanWizard beanWizard = new CamelNewBeanWizard(path);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), beanWizard);
if (dlg.open() == Window.OK) {
try {
openBeanEditor(beanWizard.getBean(), false);
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
}
Aggregations