use of org.talend.commons.exception.SystemException 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);
}
}
}
use of org.talend.commons.exception.SystemException in project tesb-studio-se by Talend.
the class EditCamelBean method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
if (repositoryNode == null) {
repositoryNode = (RepositoryNode) ((IStructuredSelection) getSelection()).getFirstElement();
}
BeanItem beanItem = (BeanItem) repositoryNode.getObject().getProperty().getItem();
try {
openBeanEditor(beanItem, false);
refresh(repositoryNode);
CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<ModuleNeeded>(), null);
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
use of org.talend.commons.exception.SystemException in project tdi-studio-se by Talend.
the class ReadSqlpatternAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
protected void doRun() {
RepositoryNode node = (RepositoryNode) ((IStructuredSelection) getSelection()).getFirstElement();
Property property = (Property) node.getObject().getProperty();
Property updatedProperty = null;
try {
updatedProperty = ProxyRepositoryFactory.getInstance().getLastVersion(new Project(ProjectManager.getInstance().getProject(property.getItem())), property.getId()).getProperty();
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
// update the property of the node repository object
// node.getObject().setProperty(updatedProperty);
SQLPatternItem sqlpatternItem = (SQLPatternItem) node.getObject().getProperty().getItem();
try {
openSQLPatternEditor(sqlpatternItem, true);
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
use of org.talend.commons.exception.SystemException in project tdi-studio-se by Talend.
the class CreateRoutineAction 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 routineNode = getCurrentRepositoryNode();
if (isToolbar()) {
if (routineNode != null && routineNode.getContentType() != ERepositoryObjectType.ROUTINES) {
routineNode = null;
}
if (routineNode == null) {
routineNode = getRepositoryNodeForDefault(ERepositoryObjectType.ROUTINES);
}
}
RepositoryNode node = null;
IPath path = null;
if (!isToolbar()) {
ISelection selection = getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
node = (RepositoryNode) obj;
path = RepositoryNodeUtilities.getPath(node);
}
NewRoutineWizard routineWizard = new NewRoutineWizard(path);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), routineWizard);
if (dlg.open() == Window.OK) {
try {
openRoutineEditor(routineWizard.getRoutine(), false);
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
}
Aggregations