// Path: src/main/java/de/konnekting/suite/events/EventParameterChanged.java
// public class EventParameterChanged {
//     private final DeviceConfigContainer device;
// 
//     public EventParameterChanged(DeviceConfigContainer device) {
//         this.device = device;
//     }
// 
//     public EventParameterChanged() {
//         device=null;
//     }
// 
//     /**
//      * Returns the selected device, null if no device is selected
//      * @return 
//      */
//     public DeviceConfigContainer getDeviceConfig() {
//         return device;
//     }
//     
// }
// 
// Path: src/main/java/de/konnekting/suite/events/StickyDeviceSelected.java
// public class StickyDeviceSelected {
//     private final DeviceConfigContainer device;
// 
//     public StickyDeviceSelected(DeviceConfigContainer device) {
//         this.device = device;
//     }
// 
//     public StickyDeviceSelected() {
//         device=null;
//     }
// 
//     /**
//      * Returns the selected device, null if no device is selected
//      * @return 
//      */
//     public DeviceConfigContainer getDeviceConfig() {
//         return device;
//     }
//     
// }
// 
// Path: src/main/java/de/konnekting/suite/uicomponents/GroupAddressTextField.java
// public class GroupAddressTextField extends ValidateableTextField {
// 
//     private String validationError;
//     
//     @Override
//     public String getValidationErrorMessage() {
//         return validationError;
//     }
// 
//     @Override
//     public boolean isInputValid() {
//         if (Helper.checkValidGa(getText()) || getText().isEmpty()) {
//             validationError = "";
//             return true;
//         } else {
//             validationError = "Invalid group address. Format [0..15]/[0..7]/[0..255] required";
//             return false;
//         }
//     }
// 
//     @Override
//     public Object getValue() {
//         return getText();
//     }
// 
// }


import de.konnekting.deviceconfig.DeviceConfigContainer;
import de.konnekting.deviceconfig.utils.Helper;
import de.konnekting.suite.events.EventParameterChanged;
import de.konnekting.suite.events.StickyDeviceSelected;
import de.konnekting.suite.uicomponents.GroupAddressTextField;
import de.konnekting.xml.konnektingdevice.v0.CommObjectConfiguration;
import de.root1.rooteventbus.RootEventBus;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.List;
import javax.swing.AbstractCellEditor;
import javax.swing.DefaultCellEditor;
import javax.swing.InputVerifier;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.table.TableCellEditor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
 * Copyright (C) 2016 Alexander Christian <alex(at)root1.de>. All rights reserved.
 * 
 * This file is part of KONNEKTING Suite.
 *
 *   KONNEKTING Suite is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   KONNEKTING Suite is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with KONNEKTING DeviceConfig.  If not, see <http://www.gnu.org/licenses/>.
 */
package de.konnekting.suite;


/**
 *
 * @author achristian
 */
public class CommObjectTable extends javax.swing.JPanel {

    private final Logger log = LoggerFactory.getLogger(getClass());

    class GaEditor extends AbstractCellEditor implements TableCellEditor {

        @Override
        public Object getCellEditorValue() {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }

        @Override
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }

    }

    private final TableCellEditor gaEditor = new GaEditor() {

// Path: src/main/java/de/konnekting/suite/events/EventParameterChanged.java
// public class EventParameterChanged {
//     private final DeviceConfigContainer device;
// 
//     public EventParameterChanged(DeviceConfigContainer device) {
//         this.device = device;
//     }
// 
//     public EventParameterChanged() {
//         device=null;
//     }
// 
//     /**
//      * Returns the selected device, null if no device is selected
//      * @return 
//      */
//     public DeviceConfigContainer getDeviceConfig() {
//         return device;
//     }
//     
// }
// 
// Path: src/main/java/de/konnekting/suite/events/StickyDeviceSelected.java
// public class StickyDeviceSelected {
//     private final DeviceConfigContainer device;
// 
//     public StickyDeviceSelected(DeviceConfigContainer device) {
//         this.device = device;
//     }
// 
//     public StickyDeviceSelected() {
//         device=null;
//     }
// 
//     /**
//      * Returns the selected device, null if no device is selected
//      * @return 
//      */
//     public DeviceConfigContainer getDeviceConfig() {
//         return device;
//     }
//     
// }
// 
// Path: src/main/java/de/konnekting/suite/uicomponents/GroupAddressTextField.java
// public class GroupAddressTextField extends ValidateableTextField {
// 
//     private String validationError;
//     
//     @Override
//     public String getValidationErrorMessage() {
//         return validationError;
//     }
// 
//     @Override
//     public boolean isInputValid() {
//         if (Helper.checkValidGa(getText()) || getText().isEmpty()) {
//             validationError = "";
//             return true;
//         } else {
//             validationError = "Invalid group address. Format [0..15]/[0..7]/[0..255] required";
//             return false;
//         }
//     }
// 
//     @Override
//     public Object getValue() {
//         return getText();
//     }
// 
// }


// Path: src/main/java/de/konnekting/suite/CommObjectTable.java
import de.konnekting.deviceconfig.DeviceConfigContainer;
import de.konnekting.deviceconfig.utils.Helper;
import de.konnekting.suite.events.EventParameterChanged;
import de.konnekting.suite.events.StickyDeviceSelected;
import de.konnekting.suite.uicomponents.GroupAddressTextField;
import de.konnekting.xml.konnektingdevice.v0.CommObjectConfiguration;
import de.root1.rooteventbus.RootEventBus;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.List;
import javax.swing.AbstractCellEditor;
import javax.swing.DefaultCellEditor;
import javax.swing.InputVerifier;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.table.TableCellEditor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/*
 * Copyright (C) 2016 Alexander Christian <alex(at)root1.de>. All rights reserved.
 * 
 * This file is part of KONNEKTING Suite.
 *
 *   KONNEKTING Suite is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   KONNEKTING Suite is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with KONNEKTING DeviceConfig.  If not, see <http://www.gnu.org/licenses/>.
 */
package de.konnekting.suite;


/**
 *
 * @author achristian
 */
public class CommObjectTable extends javax.swing.JPanel {

    private final Logger log = LoggerFactory.getLogger(getClass());

    class GaEditor extends AbstractCellEditor implements TableCellEditor {

        @Override
        public Object getCellEditorValue() {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }

        @Override
        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }

    }

    private final TableCellEditor gaEditor = new GaEditor() {

        JLabel label = new JLabel();