/* | |
* Copyright (c) Robert Bosch GmbH. All rights reserved. | |
*/ | |
package org.eclipse.blockchain.ui.property.testers; | |
import org.eclipse.blockchain.core.BlockchainCore; | |
import org.eclipse.blockchain.core.EthereumProjectNature; | |
import org.eclipse.blockchain.ui.Activator; | |
import org.eclipse.core.expressions.PropertyTester; | |
import org.eclipse.core.resources.IProject; | |
import org.eclipse.core.runtime.CoreException; | |
/** | |
* @author ADG5COB | |
*/ | |
public class EthereumProjectPropertyTester extends PropertyTester { | |
/** | |
* {@inheritDoc} | |
*/ | |
@Override | |
public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) { | |
try { | |
if ((receiver instanceof IProject) && ((IProject) receiver).getProject().getDescription().getNatureIds()[0] | |
.equals(EthereumProjectNature.ETHEREUM_NATURE)) { | |
return true; | |
} | |
} | |
catch (CoreException e) { | |
BlockchainCore.getInstance().logException(Activator.PLUGIN_ID, e.getMessage(), e); | |
} | |
return false; | |
} | |
} |