use of org.talend.mdm.repository.models.FolderRepositoryObject in project tmdm-studio-se by Talend.
the class WaitToDeployDialog method createDialogArea.
/**
* Create contents of the dialog.
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
Label lblNewLabel = new Label(container, SWT.WRAP);
lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
lblNewLabel.setText(Messages.WaitToDeployDialog_message);
treeViewer = new TreeViewer(container, SWT.BORDER);
Tree tree = treeViewer.getTree();
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
treeViewer.setLabelProvider(new ViewerLabelProvider());
treeViewer.setContentProvider(new TreeContentProvider());
treeViewer.addFilter(new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof IRepositoryViewObject) {
if (element instanceof FolderRepositoryObject) {
return needShowDialog(((FolderRepositoryObject) element).getChildren());
} else {
return needShowObject((IRepositoryViewObject) element);
}
}
return false;
}
});
treeViewer.setInput(viewObjs);
treeViewer.expandAll();
return container;
}
use of org.talend.mdm.repository.models.FolderRepositoryObject in project tmdm-studio-se by Talend.
the class AbstractContentProvider method getChildren.
public Object[] getChildren(Object element) {
Item item = RepositoryResourceUtil.getItemFromRepViewObj(element);
if (item != null && item instanceof ContainerItem) {
ContainerItem containerItem = (ContainerItem) item;
// recycle
if (RepositoryResourceUtil.isDeletedFolder(item, ((IRepositoryViewObject) element).getRepositoryObjectType())) {
AbstractContentProvider recycleContentProvider = (AbstractContentProvider) RepositoryNodeConfigurationManager.getRecycleBinNodeConfiguration().getContentProvider();
return recycleContentProvider.getChildren(element);
}
//
FolderType containerType = containerItem.getType();
List<IRepositoryViewObject> children = ((FolderRepositoryObject) element).getChildren();
if (containerType == FolderType.SYSTEM_FOLDER_LITERAL) {
List<IRepositoryViewObject> viewObjects = getViewObjFromSystemFolder(containerItem);
if (viewObjects != null) {
children.clear();
children.addAll(viewObjects);
return viewObjects.toArray();
}
}
if (containerType == FolderType.FOLDER_LITERAL || containerType == FolderType.STABLE_SYSTEM_FOLDER_LITERAL) {
List<IRepositoryViewObject> viewObjects = getViewObjFromFolder(containerItem);
if (viewObjects != null) {
children.clear();
children.addAll(viewObjects);
return viewObjects.toArray();
}
}
// if (containerType == FolderType.STABLE_SYSTEM_FOLDER_LITERAL) {
// List<IRepositoryViewObject> children = ((ContainerRepositoryObject) element).getChildren();
// if (children != null) {
// return children.toArray();
// }
// }
}
return new Object[0];
}
use of org.talend.mdm.repository.models.FolderRepositoryObject in project tmdm-studio-se by Talend.
the class RecycleBinContentProvider method addToMap.
private void addToMap(FolderRepositoryObject viewObj, String path) {
ERepositoryObjectType repObjType = viewObj.getRepositoryObjectType();
Map<String, FolderRepositoryObject> map = containerMap.get(repObjType);
if (map == null) {
map = new HashMap<String, FolderRepositoryObject>();
containerMap.put(repObjType, map);
}
map.put(path, viewObj);
}
use of org.talend.mdm.repository.models.FolderRepositoryObject in project tmdm-studio-se by Talend.
the class RecycleBinContentProvider method getChildren.
@Override
public Object[] getChildren(Object element) {
IRepositoryViewObject viewObj = (IRepositoryViewObject) element;
ERepositoryObjectType type = viewObj.getRepositoryObjectType();
if (viewObj instanceof FolderRepositoryObject) {
FolderRepositoryObject containerObj = (FolderRepositoryObject) viewObj;
if (type == IServerObjectRepositoryType.TYPE_RECYCLE_BIN) {
buildAllDeletedFolders(containerObj);
buildAllDeletedObjects(containerObj);
}
return containerObj.getChildren().toArray();
}
return new Object[0];
}
use of org.talend.mdm.repository.models.FolderRepositoryObject in project tmdm-studio-se by Talend.
the class RemoveFromRepositoryAction method removeFolderObject.
private void removeFolderObject(IRepositoryViewObject viewObj) {
if (removed.contains(viewObj.getId())) {
return;
}
for (IRepositoryViewObject childObj : viewObj.getChildren()) {
if (childObj instanceof FolderRepositoryObject) {
removeFolderObject(childObj);
} else {
removeServerObject(childObj);
}
}
removed.add(viewObj.getId());
//
ContainerItem containerItem = (ContainerItem) viewObj.getProperty().getItem();
String path = containerItem.getState().getPath();
ERepositoryObjectType repObjType = containerItem.getRepObjType();
ContainerCacheService.removeContainer(repObjType, path);
FolderItem folderItem = factory.getFolderItem(ProjectManager.getInstance().getCurrentProject(), repObjType, new Path(path));
folderItem.getState().setDeleted(true);
}
Aggregations