use of org.talend.designer.camel.resource.core.model.ResourceDependencyModel in project tesb-studio-se by Talend.
the class ResourcesItemRelationshipHandler method collect.
@Override
protected Set<Relation> collect(Item baseItem) {
if (baseItem.eClass() != CamelPropertiesPackage.Literals.CAMEL_PROCESS_ITEM && baseItem.eClass() != CamelPropertiesPackage.Literals.ROUTELET_PROCESS_ITEM) {
return Collections.emptySet();
}
final Set<Relation> relationSet = new HashSet<Relation>();
for (ResourceDependencyModel depModel : RouteResourceUtil.getResourceDependencies((ProcessItem) baseItem)) {
final Relation addedRelation = new Relation();
addedRelation.setId(depModel.getItem().getProperty().getId());
addedRelation.setType(RelationshipItemBuilder.RESOURCE_RELATION);
addedRelation.setVersion(RelationshipItemBuilder.LATEST_VERSION);
relationSet.add(addedRelation);
}
return relationSet;
}
use of org.talend.designer.camel.resource.core.model.ResourceDependencyModel in project tesb-studio-se by Talend.
the class ManageRouteResourcePanel method deleteData.
protected void deleteData() {
ResourceDependencyModel item = getSelectedItem();
if (item != null) {
getInput().remove(item);
resourcesTV.refresh();
fireDependenciesChangedListener();
}
}
use of org.talend.designer.camel.resource.core.model.ResourceDependencyModel in project tesb-studio-se by Talend.
the class ManageRouteResourcePanel method copyPath.
/**
* Copy class path
*/
protected void copyPath() {
final ResourceDependencyModel item = getSelectedItem();
if (item != null) {
Clipboard clipboard = new Clipboard(getDisplay());
clipboard.setContents(new String[] { item.getClassPathUrl() }, new Transfer[] { TextTransfer.getInstance() });
MessageDialog.openInformation(getShell(), Messages.ManageRouteResourceDialog_copyTitle, MessageFormat.format(Messages.ManageRouteResourceDialog_copyMsg, item.getClassPathUrl()));
}
}
use of org.talend.designer.camel.resource.core.model.ResourceDependencyModel in project tesb-studio-se by Talend.
the class ManageRouteResourcePanel method addData.
protected void addData() {
RouteResourceSelectionDialog dialog = new RouteResourceSelectionDialog(getShell());
if (Dialog.OK == dialog.open()) {
Item item = dialog.getResult().getObject().getProperty().getItem();
if (item instanceof RouteResourceItem) {
for (ResourceDependencyModel rsmodel : getInput()) {
if (rsmodel.getItem().getProperty().getId().equals(item.getProperty().getId())) {
resourcesTV.setSelection(new StructuredSelection(rsmodel));
return;
}
}
ResourceDependencyModel model = new ResourceDependencyModel((RouteResourceItem) item);
getInput().add(model);
resourcesTV.refresh();
resourcesTV.setSelection(new StructuredSelection(model));
fireDependenciesChangedListener();
}
}
}
use of org.talend.designer.camel.resource.core.model.ResourceDependencyModel in project tesb-studio-se by Talend.
the class CheckRouteResourceDeleteReference method collect.
private Collection<ItemReferenceBean> collect(IProxyRepositoryFactory factory, IRepositoryViewObject object, ERepositoryObjectType type) {
final Item nodeItem = object.getProperty().getItem();
final Set<ItemReferenceBean> list = new HashSet<ItemReferenceBean>();
try {
for (IRepositoryViewObject obj : factory.getAll(type)) {
final Property property = obj.getProperty();
final Item routeItem = property.getItem();
for (ResourceDependencyModel model : RouteResourceUtil.getResourceDependencies((ProcessItem) routeItem)) {
if (nodeItem.getProperty().getId().equals(model.getItem().getProperty().getId())) {
final ItemReferenceBean bean = new ItemReferenceBean();
bean.setItemName(object.getProperty().getLabel());
bean.setItemVersion(model.getSelectedVersion());
bean.setItemType(CamelRepositoryNodeType.repositoryRouteResourceType);
bean.setItemDeleted(object.isDeleted());
bean.setReferenceItemName(property.getLabel());
bean.setReferenceItemVersion(property.getVersion());
bean.setReferenceItemType(type);
bean.setReferenceItemPath(routeItem.getState().getPath());
bean.setReferenceProjectName(obj.getProjectLabel());
bean.setReferenceItemDeleted(obj.isDeleted());
if (!list.add(bean)) {
for (ItemReferenceBean b : list) {
if (b.equals(bean)) {
b.addNodeNum();
break;
}
}
}
}
}
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
return list;
}
Aggregations