<commit_before>package net.sourceforge.javydreamercsw.client.ui.nodes.actions;

import com.validation.manager.core.db.Requirement;
import net.sourceforge.javydreamercsw.client.ui.components.requirement.edit.EditRequirementWindowTopComponent;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import org.openide.util.Utilities;

/**
 *
 * @author <NAME> <<EMAIL>>
 */
public class EditRequirementAction extends AbstractAction {

    private final EditRequirementWindowTopComponent component = 
            new EditRequirementWindowTopComponent();

    public EditRequirementAction() {
        super("Edit Requirement",
                new ImageIcon("com/validation/manager/resources/icons/Papermart/Text-Edit.png"));
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        /* Create and display the dialog */
        component.setEdit(true);
        component.setRequirement(Utilities.actionsGlobalContext().lookup(Requirement.class));
        component.open();
        component.requestActive();
    }
}<commit_msg>Initialize only once.<commit_after>package net.sourceforge.javydreamercsw.client.ui.nodes.actions;

import com.validation.manager.core.db.Requirement;
import net.sourceforge.javydreamercsw.client.ui.components.requirement.edit.EditRequirementWindowTopComponent;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import org.openide.util.Utilities;

/**
 *
 * @author <NAME> <<EMAIL>>
 */
public class EditRequirementAction extends AbstractAction {

    private static EditRequirementWindowTopComponent component
            = new EditRequirementWindowTopComponent();

    public EditRequirementAction() {
        super("Edit Requirement",
                new ImageIcon("com/validation/manager/resources/icons/Papermart/Text-Edit.png"));
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (component == null) {
            component = new EditRequirementWindowTopComponent();
        }
        /* Create and display the dialog */
        component.setEdit(true);
        component.setRequirement(Utilities.actionsGlobalContext().lookup(Requirement.class));
        component.open();
        component.requestActive();
    }
}
{'fraction_non_alphanumeric': 0.10349344978165939, 'fraction_numerical': 0.0, 'mean_word_length': 3.823157894736842, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6895113', 'n_tokens_mistral': 614, 'n_tokens_neox': 600, 'n_words': 104}