<commit_before>/*****************************************************************************
 * Copyright (c) 2010 Communication & Systems
 * 
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors : <NAME> (CS) - initial API and implementation
 * 
 *****************************************************************************/
package org.topcased.requirement.merge.testers;

import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.resources.IFile;
import org.topcased.modeler.utils.Utils;

/**
 * A simple property tester to check if the current IFile selected is a ".di" file,
 * And also check that no currentModeler is opened (prevent problems when modifying requirement file while opened)
 * 
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 *
 */
public class CanMergePropertyTester extends PropertyTester
{

    /**
     * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
     */
    public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
    {
        if (Utils.getCurrentModeler() == null)
        {
            if (receiver instanceof IFile)
            {
                IFile file = (IFile) receiver;
                return file != null && file.getFileExtension() != null && file.getFileExtension().endsWith("di"); //$NON-NLS-1$
            }
        }
        return false;
    }

}<commit_msg>format code<commit_after>/*****************************************************************************
 * Copyright (c) 2010 Communication & Systems
 * 
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors : <NAME> (CS) - initial API and implementation
 * 
 *****************************************************************************/
package org.topcased.requirement.merge.testers;

import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.resources.IFile;
import org.topcased.modeler.utils.Utils;

/**
 * A simple property tester to check if the current IFile selected is a ".di" file, And also check that no
 * currentModeler is opened (prevent problems when modifying requirement file while opened)
 * 
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * 
 */
public class CanMergePropertyTester extends PropertyTester
{
    /**
     * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[],
     *      java.lang.Object)
     */
    public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
    {
        if (Utils.getCurrentModeler() == null)
        {
            if (receiver instanceof IFile)
            {
                IFile file = (IFile) receiver;
                return file != null && file.getFileExtension() != null && file.getFileExtension().endsWith("di"); //$NON-NLS-1$
            }
        }
        return false;
    }
}
{'fraction_non_alphanumeric': 0.193499849533554, 'fraction_numerical': 0.005416792055371652, 'mean_word_length': 3.455764075067024, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '265507', 'n_tokens_mistral': 895, 'n_tokens_neox': 845, 'n_words': 251}