Skip to content

Commit

Permalink
[2034] Simplify MetricAction#updateSelection(IStructuredSelection)
Browse files Browse the repository at this point in the history
Bug 2034

Change-Id: I2b45e62b1669c2b52295adaf3370850225b983bb
Signed-off-by: Ali Akar <ali.akar82@gmail.com>
  • Loading branch information
aliakar82 committed Jul 3, 2018
1 parent b8ab879 commit 605a7e9
Showing 1 changed file with 2 additions and 6 deletions.
Expand Up @@ -36,7 +36,7 @@
import org.polarsys.capella.core.data.capellamodeller.ModelRoot;
import org.polarsys.capella.core.data.capellamodeller.Project;
import org.polarsys.capella.core.data.capellamodeller.SystemEngineering;
import org.polarsys.capella.core.data.cs.CsPackage;
import org.polarsys.capella.core.data.cs.BlockArchitecture;
import org.polarsys.capella.core.data.fa.FunctionalExchange;
import org.polarsys.capella.core.data.oa.OaFactory;
import org.polarsys.capella.core.data.oa.OperationalActivity;
Expand Down Expand Up @@ -270,11 +270,7 @@ protected boolean updateSelection(IStructuredSelection selection) {
Session session = SessionHelper.getSession((IFile) selectedObj);
return (null != session && session.isOpen());
} else if (selectedObj instanceof EObject) {
EObject eObject = (EObject) selectedObj;
EClass eclass = eObject.eClass();
if (CapellamodellerPackage.Literals.SYSTEM_ENGINEERING.isSuperTypeOf(eclass) || CsPackage.Literals.BLOCK_ARCHITECTURE.isSuperTypeOf(eclass)) {
return true;
}
return selectedObj instanceof SystemEngineering || selectedObj instanceof BlockArchitecture;
}
}
return false;
Expand Down

0 comments on commit 605a7e9

Please sign in to comment.