use of org.talend.camel.core.model.camelProperties.RouteResourceItem in project tesb-studio-se by Talend.
the class CreateRouteResourceAction method doRun.
@Override
protected void doRun() {
IRepositoryNode node = null;
NewRouteResourceWizard wizard = null;
ISelection selection = getSelection();
if (selection == null) {
return;
}
Object obj = ((IStructuredSelection) selection).getFirstElement();
node = (IRepositoryNode) obj;
IRepositoryService service = DesignerPlugin.getDefault().getRepositoryService();
IPath path = service.getRepositoryPath(node);
if (RepositoryConstants.isSystemFolder(path.toString())) {
// Not allowed to create in system folder.
return;
}
wizard = new NewRouteResourceWizard(path);
WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
int open = dlg.open();
if (open == Window.OK) {
RouteResourceItem item = wizard.getItem();
IWorkbenchPage page = getActivePage();
RouteResourceEditorUtil.openEditor(page, null, item);
}
}
use of org.talend.camel.core.model.camelProperties.RouteResourceItem in project tesb-studio-se by Talend.
the class EditRouteResourceAction method openOrBindEditor.
/**
* Open or bind RouteResourceEditor
*
* @param node
*/
private void openOrBindEditor(IRepositoryNode node) {
final Property property = node.getObject().getProperty();
if (property != null) {
Assert.isTrue(property.getItem() instanceof RouteResourceItem);
final RouteResourceItem item = (RouteResourceItem) property.getItem();
RouteResourceEditorUtil.openEditor(getActivePage(), node, item);
}
}
Aggregations