Commit 69996000 authored by Romain Bioteau's avatar Romain Bioteau Committed by GitHub

explorer refresh (#1495)

parent 19d9fb0f
......@@ -685,7 +685,7 @@ public class Repository implements IRepository, IJavaContainer, IRenamable {
return getRepositoryStoreByName(storeName)
.filter(repositoryStore -> belongToRepositoryStore(repositoryStore, file))
.map(repositoryStore -> repositoryStore
.getChild(file.getName()))
.createRepositoryFileStore(file.getName()))
.orElse(null);
}
}
......
......@@ -20,6 +20,7 @@ import java.util.Set;
import org.bonitasoft.studio.designer.UIDesignerPlugin;
import org.bonitasoft.studio.designer.i18n.Messages;
import org.bonitasoft.studio.pics.Pics;
import org.eclipse.core.resources.IFolder;
import org.eclipse.swt.graphics.Image;
/**
......@@ -58,6 +59,10 @@ public class WebFragmentRepositoryStore extends WebArtifactRepositoryStore<WebFr
@Override
public WebFragmentFileStore createRepositoryFileStore(final String fileName) {
IFolder folder = getResource().getFolder(fileName);
if (folder.exists()) {
return folder.getFile(fileName + ".json").exists() ? new WebFragmentFileStore(fileName, this) : null;
}
return new WebFragmentFileStore(fileName, this);
}
......
......@@ -30,6 +30,7 @@ import org.bonitasoft.studio.designer.core.UIDesignerServerManager;
import org.bonitasoft.studio.designer.core.bos.WebFormBOSArchiveFileStoreProvider;
import org.bonitasoft.studio.designer.i18n.Messages;
import org.bonitasoft.studio.pics.Pics;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.edapt.migration.MigrationException;
......@@ -79,7 +80,17 @@ public class WebPageRepositoryStore extends WebArtifactRepositoryStore<WebPageFi
@Override
public WebPageFileStore createRepositoryFileStore(final String fileName) {
final WebPageFileStore webPageFileStore = new WebPageFileStore(fileName, this);
WebPageFileStore webPageFileStore = null;
IFolder folder = getResource().getFolder(fileName);
if (folder.exists()) {
webPageFileStore = folder.getFile(fileName + ".json").exists() ? new WebPageFileStore(fileName, this) : null;
if (webPageFileStore == null) {
return null;
}
webPageFileStore.setWebFormBOSArchiveFileStoreProvider(filseStoreProvider);
return webPageFileStore;
}
webPageFileStore = new WebPageFileStore(fileName, this);
webPageFileStore.setWebFormBOSArchiveFileStoreProvider(filseStoreProvider);
return webPageFileStore;
}
......
......@@ -17,6 +17,7 @@ package org.bonitasoft.studio.designer.core.repository;
import org.bonitasoft.studio.designer.UIDesignerPlugin;
import org.bonitasoft.studio.designer.i18n.Messages;
import org.bonitasoft.studio.pics.Pics;
import org.eclipse.core.resources.IFolder;
import org.eclipse.swt.graphics.Image;
/**
......@@ -44,6 +45,11 @@ public class WebWidgetRepositoryStore extends WebArtifactRepositoryStore<WebWidg
@Override
public WebWidgetFileStore createRepositoryFileStore(final String widgetFolderName) {
IFolder folder = getResource().getFolder(widgetFolderName);
if (folder.exists()) {
return folder.getFile(widgetFolderName + ".json").exists() ? new WebWidgetFileStore(widgetFolderName, this)
: null;
}
return new WebWidgetFileStore(widgetFolderName, this);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment