Search in sources :

Example 1 with EnablementExpressionContext

use of org.eclipse.jst.common.project.facet.core.libprov.EnablementExpressionContext in project liferay-ide by liferay.

the class LiferayRuntimePropertyTester method test.

public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
    boolean retval = false;
    try {
        EnablementExpressionContext ctx = (EnablementExpressionContext) receiver;
        IFacetedProjectBase projectBase = ctx.getFacetedProject();
        IRuntime serverRuntime = FacetUtil.getRuntime(projectBase.getPrimaryRuntime());
        String runtimeId = serverRuntime.getRuntimeType().getId();
        if (runtimeId.startsWith("com.liferay.")) {
            retval = true;
        }
    } catch (Throwable t) {
    // don't log error just means test returns false;
    }
    return retval;
}
Also used : EnablementExpressionContext(org.eclipse.jst.common.project.facet.core.libprov.EnablementExpressionContext) IFacetedProjectBase(org.eclipse.wst.common.project.facet.core.IFacetedProjectBase) IRuntime(org.eclipse.wst.server.core.IRuntime)

Aggregations

EnablementExpressionContext (org.eclipse.jst.common.project.facet.core.libprov.EnablementExpressionContext)1 IFacetedProjectBase (org.eclipse.wst.common.project.facet.core.IFacetedProjectBase)1 IRuntime (org.eclipse.wst.server.core.IRuntime)1