fix(TUP-20126):[SVN] Can't open testcase after update context. (#1666)

* fix(TUP-20126):[SVN] Can't open testcase after update context.

* fix(TUP-20126):backport missing fix.
This commit is contained in:
zwxue
2018-05-17 10:58:34 +08:00
committed by nrousseau
parent a4913cb348
commit 0da1530407
2 changed files with 13 additions and 0 deletions

View File

@@ -168,6 +168,7 @@ import org.talend.repository.localprovider.exceptions.IncorrectFileException;
import org.talend.repository.localprovider.i18n.Messages;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.RepositoryConstants;
import orgomg.cwm.foundation.businessinformation.BusinessinformationPackage;
/**
@@ -639,6 +640,9 @@ public class LocalRepositoryFactory extends AbstractEMFRepositoryFactory impleme
// no log anymore here since we add the log.error, it should be enough
}
if (property != null) {
if (property.eResource() != null && property.eResource().getResourceSet() == null) {
property = reload(property);
}
if (property.getItem() == null || property.getItem().getState() == null) {
if (type != null) {
log.error("try to load wrong item:" + property.getLabel() + " / " + type);

View File

@@ -412,6 +412,10 @@ public class RepoDoubleClickAction extends Action {
&& obj.getContentType().equals(ERepositoryObjectType.PROCESS_ROUTE) && isDITestCaseEditOrReadAction(current)) {
// TESB-17272: Cannot open route test case editor by double click
continue;
} else if (nodeType != null && obj.getContentType() != null
&& !obj.getContentType().equals(ERepositoryObjectType.PROCESS_ROUTE)
&& isRouteTestCaseEditOrReadAction(current)) {
continue;
} else if (obj.getObject() != null
&& current.getClassForDoubleClick().getSimpleName()
.equals(obj.getObject().getProperty().getItem().eClass().getName())) {
@@ -452,6 +456,11 @@ public class RepoDoubleClickAction extends Action {
|| "org.talend.testcontainer.core.ui.actions.ReadTestContainer".equals(action.getId());
}
private boolean isRouteTestCaseEditOrReadAction(ITreeContextualAction action) {
return "org.talend.camel.testcontainer.ui.actions.EditRouteTestContainer".equals(action.getId())
|| "org.talend.camel.testcontainer.ui.actions.ReadRouteTestContainer".equals(action.getId());
}
// protected ISelection getSelection() {
// IRepositoryView view = getViewPart();
// if (view != null) {