<commit_before>package gov.nasa.jpl.mbee;

import gov.nasa.jpl.mbee.actions.ems.CloseAutoSyncAction;
import gov.nasa.jpl.mbee.actions.ems.EMSLoginAction;
import gov.nasa.jpl.mbee.actions.ems.EMSLogoutAction;
import gov.nasa.jpl.mbee.actions.ems.SendProjectVersionAction;
import gov.nasa.jpl.mbee.actions.ems.StartAutoSyncAction;
import gov.nasa.jpl.mbee.actions.ems.UpdateFromJMS;
import gov.nasa.jpl.mbee.actions.ems.UpdateWorkspacesAction;
import gov.nasa.jpl.mbee.actions.ems.ValidateMountStructureAction;
import gov.nasa.jpl.mbee.lib.MDUtils;

import com.nomagic.actions.ActionsCategory;
import com.nomagic.actions.ActionsManager;
import com.nomagic.actions.NMAction;
import com.nomagic.magicdraw.actions.MDActionsCategory;
import com.nomagic.magicdraw.actions.BrowserContextAMConfigurator;
import com.nomagic.magicdraw.ui.browser.Tree;

public class SRConfigurator implements BrowserContextAMConfigurator {

    @Override
    public int getPriority() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public void configure(ActionsManager manager, Tree tree) {
        NMAction category = (ActionsCategory)manager.getActionFor("SRMain");
        if (category == null) {
            category = new MDActionsCategory("SRMain", "Reason Systemer");
            ((ActionsCategory)category).setNested(true);
            manager.addCategory((ActionsCategory)category);
//            EMSLogoutAction logout = new EMSLogoutAction();
//            EMSLoginAction login = new EMSLoginAction();
//            login.setLogoutAction(logout);
//            logout.setLoginAction(login);
//            category.addAction(logout);
//            category.addAction(login);
//            category.addAction(new ValidateMountStructureAction());
//            category.addAction(new StartAutoSyncAction());
//            category.addAction(new CloseAutoSyncAction());
//            category.addAction(new UpdateFromJMS(false));
//            category.addAction(new UpdateFromJMS(true));
//            category.addAction(new SendProjectVersionAction());
//            if (MDUtils.isDeveloperMode()) {
//                category.addAction(new UpdateWorkspacesAction());
//            }
        }
    }
}<commit_msg>fixed ordering in the right click menu<commit_after>package gov.nasa.jpl.mbee;

import java.util.ArrayList;

import gov.nasa.jpl.mbee.actions.ems.CloseAutoSyncAction;
import gov.nasa.jpl.mbee.actions.ems.EMSLoginAction;
import gov.nasa.jpl.mbee.actions.ems.EMSLogoutAction;
import gov.nasa.jpl.mbee.actions.ems.SendProjectVersionAction;
import gov.nasa.jpl.mbee.actions.ems.StartAutoSyncAction;
import gov.nasa.jpl.mbee.actions.ems.UpdateFromJMS;
import gov.nasa.jpl.mbee.actions.ems.UpdateWorkspacesAction;
import gov.nasa.jpl.mbee.actions.ems.ValidateMountStructureAction;
import gov.nasa.jpl.mbee.actions.systemsreasoner.SpecializeAction;
import gov.nasa.jpl.mbee.lib.MDUtils;

import com.nomagic.actions.ActionsCategory;
import com.nomagic.actions.ActionsManager;
import com.nomagic.actions.NMAction;
import com.nomagic.magicdraw.actions.BrowserContextAMConfigurator;
import com.nomagic.magicdraw.actions.ConfiguratorWithPriority;
import com.nomagic.magicdraw.actions.DiagramContextAMConfigurator;
import com.nomagic.magicdraw.actions.MDAction;
import com.nomagic.magicdraw.actions.MDActionsCategory;
import com.nomagic.magicdraw.core.Application;
import com.nomagic.magicdraw.core.Project;
import com.nomagic.magicdraw.ui.browser.Node;
import com.nomagic.magicdraw.ui.browser.Tree;
import com.nomagic.magicdraw.uml.symbols.DiagramPresentationElement;
import com.nomagic.magicdraw.uml.symbols.PresentationElement;
import com.nomagic.uml2.ext.jmi.helpers.StereotypesHelper;
import com.nomagic.uml2.ext.magicdraw.activities.mdfundamentalactivities.Activity;
import com.nomagic.uml2.ext.magicdraw.auxiliaryconstructs.mdmodels.Model;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Class;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Classifier;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Package;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement;
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Property;
import com.nomagic.uml2.ext.magicdraw.mdprofiles.Stereotype;

public class SRConfigurator implements BrowserContextAMConfigurator {

    @Override
    public int getPriority() {
        // TODO Auto-generated method stub
        return 0; //medium
    }

    @Override
    public void configure(ActionsManager manager, Tree tree) {
    	if (tree.getSelectedNodes().length > 1)
    		return;
    	Node no = tree.getSelectedNode();
    	if (no == null)
    		return;
    	Object o = no.getUserObject();
    	if(!(o instanceof Element))
    		return;
    	Element target = (Element) o;
        ActionsCategory category = (ActionsCategory)manager.getActionFor("SRMain");
        if (category == null) {
            category = new MDActionsCategory("SRMain", "Reasons Systemer");
            category.setNested(true);
            manager.addCategory(0, category);
        }
        if (target instanceof Class) {
        	category.addAction(new SpecializeAction(target));
        }
        if (category.isEmpty()) {
        	System.out.println("Empty thing");
        }
    }
}
{'fraction_non_alphanumeric': 0.11104858375539299, 'fraction_numerical': 0.0026261489401613208, 'mean_word_length': 3.838475499092559, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2885785', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1672, 'n_words': 242}