<commit_before>package gov.nih.nci.cagrid.introduce.portal.modification.services;

import gov.nih.nci.cagrid.common.portal.PortalUtils;
import gov.nih.nci.cagrid.introduce.beans.resource.ResourcePropertiesListType;
import gov.nih.nci.cagrid.introduce.common.SpecificServiceInformation;
import gov.nih.nci.cagrid.introduce.portal.common.IntroduceLookAndFeel;
import gov.nih.nci.cagrid.introduce.portal.modification.services.methods.MethodsPopUpMenu;
import gov.nih.nci.cagrid.introduce.portal.modification.services.methods.MethodsTypeTreeNode;
import gov.nih.nci.cagrid.introduce.portal.modification.services.resourceproperties.ResourcePropertiesPopUpMenu;
import gov.nih.nci.cagrid.introduce.portal.modification.services.resourceproperties.ResourcePropertiesTypeTreeNode;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;

import org.projectmobius.portal.PortalResourceManager;


public class ServiceButtonPanel extends ServiceContextsOptionsPanel {

    private JButton modifyServiceButton = null;
    private JButton addMethodButton = null;
    private JButton modifyResourcesButton = null;


    public ServiceButtonPanel(ServicesJTree tree) {
        super(tree);
        initialize();
    }


    /**
     * This method initializes this
     */
    private void initialize() {
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints2.insets = new java.awt.Insets(2, 2, 2, 2);
        gridBagConstraints2.gridy = 2;
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        gridBagConstraints1.gridx = 0;
        gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
        gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints1.gridy = 1;
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.gridy = 0;
        this.setLayout(new GridBagLayout());
        this.add(getModifyServiceButton(), gridBagConstraints);
        this.add(getAddMethodButton(), gridBagConstraints1);
        this.add(getModifyResourcesButton(), gridBagConstraints2);
    }


    /**
     * This method initializes modifyServiceButton
     * 
     * @return javax.swing.JButton
     */
    private JButton getModifyServiceButton() {
        if (this.modifyServiceButton == null) {
            this.modifyServiceButton = new JButton();
            this.modifyServiceButton.setText("Modify Service");
            this.modifyServiceButton.setIcon(IntroduceLookAndFeel.getModifyServiceIcon());
            this.modifyServiceButton.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {

                    DefaultMutableTreeNode tnode = ServiceButtonPanel.this.getTree().getCurrentNode();
                    if (tnode instanceof ServiceTypeTreeNode) {
                        ServiceTypeTreeNode node = (ServiceTypeTreeNode) tnode;
                        ModifyService comp = new ModifyService(node, new SpecificServiceInformation(node.getInfo(),
                            node.getServiceType()), false);
                        comp.pack();
                        PortalUtils.centerComponent(comp);
                        PortalResourceManager.getInstance().getGridPortal().add(comp);
                        comp.setVisible(true);
                    }
                }

            });
        }
        return this.modifyServiceButton;
    }


    /**
     * This method initializes addMethodButton
     * 
     * @return javax.swing.JButton
     */
    private JButton getAddMethodButton() {
        if (this.addMethodButton == null) {
            this.addMethodButton = new JButton();
            this.addMethodButton.setText("Add Method");
            this.addMethodButton.setIcon(IntroduceLookAndFeel.getAddMethodIcon());
            this.addMethodButton.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    DefaultMutableTreeNode tnode = ServiceButtonPanel.this.getTree().getCurrentNode();
                    tnode = (DefaultMutableTreeNode) tnode.getChildAt(0);
                    if (tnode instanceof MethodsTypeTreeNode) {<commit_msg>*** empty log message ***<commit_after>package gov.nih.nci.cagrid.introduce.portal.modification.services;

import gov.nih.nci.cagrid.common.portal.PortalUtils;
import gov.nih.nci.cagrid.introduce.beans.resource.ResourcePropertiesListType;
import gov.nih.nci.cagrid.introduce.common.SpecificServiceInformation;
import gov.nih.nci.cagrid.introduce.portal.common.IntroduceLookAndFeel;
import gov.nih.nci.cagrid.introduce.portal.modification.services.methods.MethodsPopUpMenu;
import gov.nih.nci.cagrid.introduce.portal.modification.services.methods.MethodsTypeTreeNode;
import gov.nih.nci.cagrid.introduce.portal.modification.services.resourceproperties.ResourcePropertiesPopUpMenu;
import gov.nih.nci.cagrid.introduce.portal.modification.services.resourceproperties.ResourcePropertiesTypeTreeNode;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;

import org.projectmobius.portal.PortalResourceManager;


public class ServiceButtonPanel extends ServiceContextsOptionsPanel {

    private JButton modifyServiceButton = null;
    private JButton addMethodButton = null;
    private JButton modifyResourcesButton = null;


    public ServiceButtonPanel(ServicesJTree tree) {
        super(tree);
        initialize();
    }


    /**
     * This method initializes this
     */
    private void initialize() {
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints2.insets = new java.awt.Insets(2, 2, 2, 2);
        gridBagConstraints2.gridy = 2;
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        gridBagConstraints1.gridx = 0;
        gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
        gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints1.gridy = 1;
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.gridy = 0;
        this.setLayout(new GridBagLayout());
        this.add(getModifyServiceButton(), gridBagConstraints);
        this.add(getAddMethodButton(), gridBagConstraints1);
        this.add(getModifyResourcesButton(), gridBagConstraints2);
    }


    /**
     * This method initializes modifyServiceButton
     * 
     * @return javax.swing.JButton
     */
    private JButton getModifyServiceButton() {
        if (this.modifyServiceButton == null) {
            this.modifyServiceButton = new JButton();
            this.modifyServiceButton.setText("Modify Service");
            this.modifyServiceButton.setIcon(IntroduceLookAndFeel.getModifyServiceIcon());
            this.modifyServiceButton.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {

                    DefaultMutableTreeNode tnode = ServiceButtonPanel.this.getTree().getCurrentNode();
                    if (tnode instanceof ServiceTypeTreeNode) {
                        ServiceTypeTreeNode node = (ServiceTypeTreeNode) tnode;
                        ModifyService comp = new ModifyService(node, new SpecificServiceInformation(node.getInfo(),
                            node.getServiceType()), false);
                        comp.pack();
                        PortalUtils.centerComponent(comp);
                        comp.setVisible(true);
                    }
                }

            });
        }
        return this.modifyServiceButton;
    }


    /**
     * This method initializes addMethodButton
     * 
     * @return javax.swing.JButton
     */
    private JButton getAddMethodButton() {
        if (this.addMethodButton == null) {
            this.addMethodButton = new JButton();
            this.addMethodButton.setText("Add Method");
            this.addMethodButton.setIcon(IntroduceLookAndFeel.getAddMethodIcon());
            this.addMethodButton.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    DefaultMutableTreeNode tnode = ServiceButtonPanel.this.getTree().getCurrentNode();
                    tnode = (DefaultMutableTreeNode) tnode.getChildAt(0);
                    if (tnode instanceof MethodsTypeTreeNode) {
{'fraction_non_alphanumeric': 0.0898274198735127, 'fraction_numerical': 0.006645942759138171, 'mean_word_length': 2.9350485027414592, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3879412', 'n_tokens_mistral': 2599, 'n_tokens_neox': 2496, 'n_words': 407}