List<RefactoringInfo> links = new ArrayList<RefactoringInfo>();
// iterate over runtimes and check for affected dirlinks
Map<String, WGARuntime> allRuntimes = WGADesignerPlugin.getAllRuntimes();
Iterator<String> itRT = allRuntimes.keySet().iterator();
while (itRT.hasNext()) {
WGARuntime currentRuntime = allRuntimes.get(itRT.next());
IFolder[] designs = currentRuntime.getDesignsAsFolder(false);
for (IFolder folder : designs) {
if (WGADesignStructureHelper.isDirlinkFolder(folder)) {
File target = WGUtils.resolveDirLink(folder.getLocation().toFile());
IPath targetPath;
targetPath = new Path(target.getCanonicalPath());
// check if targetpath is effected by change
if (container.getLocation().isPrefixOf(targetPath)) {
DirlinkRefactoringInformation info = new DirlinkRefactoringInformation(container, arguments);
info.setFile(folder.getFile(WGUtils.DIRLINK_FILE));
links.add(info);
}
}
}
IFolder[] plugins = currentRuntime.getPluginsAsFolder(false);
for (IFolder folder : plugins) {
if (WGADesignStructureHelper.isDirlinkFolder(folder)) {
File target = WGUtils.resolveDirLink(folder.getLocation().toFile());
IPath targetPath;
targetPath = new Path(target.getCanonicalPath());
// check if targetpath is effected by change
if (container.getLocation().isPrefixOf(targetPath)) {
DirlinkRefactoringInformation info = new DirlinkRefactoringInformation(container, arguments);
info.setFile(folder.getFile(WGUtils.DIRLINK_FILE));
links.add(info);
}
}
}
// iterate over contentstores and check design references
Iterator<ContentStore> itCS = currentRuntime.retrieveWGAConfig(false).getContentStores().iterator();
while (itCS.hasNext()) {
ContentStore currentContentStore = itCS.next();
Design currentDesign = currentContentStore.getDesign();
if (currentDesign != null && currentDesign.getSource() != null && currentDesign.getSource().equals(Constants.DESIGNCOL_FILESYSTEM)) {
//IPath designPath = currentRuntime.getDesignRoot().getFullPath().append(currentDesign.getName());
if (container.getParent() != null && container.getParent().equals(currentRuntime.getDesignRoot()) && container.getName().equals(currentDesign.getName())) {
ContentStoreRefactoringInfo info = new ContentStoreRefactoringInfo(container, arguments);
info.setRuntime(currentRuntime);
info.setContentStoreUID(currentContentStore.getUid());
links.add(info);
}