'Setup DataFrameEditor:
return False if data is not supported, True otherwise.
Supported types for data are DataFrame, Series and DatetimeIndex.'

def setup_and_check(self, data, title=''):

    self.layout = QGridLayout()
    self.setLayout(self.layout)
    self.setWindowIcon(ima.icon('arredit'))
    if title:
        title = (to_text_string(title) + ('    -    %s' % data.__class__.__name__))
    else:
        title = (_('%s    editor') % data.__class__.__name__)
    if isinstance(data, Series):
        self.is_series = True
        data = data.to_frame()
    elif isinstance(data, DatetimeIndex):
        data = DataFrame(data)
    self.setWindowTitle(title)
    self.resize(600, 500)
    self.dataModel = DataFrameModel(data, parent=self)
    self.dataTable = DataFrameView(self, self.dataModel)
    self.layout.addWidget(self.dataTable)
    self.setLayout(self.layout)
    self.setMinimumSize(400, 300)
    self.setWindowFlags(Qt.Window)
    btn_layout = QHBoxLayout()
    btn = QPushButton(_('Format'))
    btn_layout.addWidget(btn)
    btn.clicked.connect(self.change_format)
    btn = QPushButton(_('Resize'))
    btn_layout.addWidget(btn)
    btn.clicked.connect(self.resize_to_contents)
    bgcolor = QCheckBox(_('Background    color'))
    bgcolor.setChecked(self.dataModel.bgcolor_enabled)
    bgcolor.setEnabled(self.dataModel.bgcolor_enabled)
    bgcolor.stateChanged.connect(self.change_bgcolor_enable)
    btn_layout.addWidget(bgcolor)
    self.bgcolor_global = QCheckBox(_('Column    min/max'))
    self.bgcolor_global.setChecked(self.dataModel.colum_avg_enabled)
    self.bgcolor_global.setEnabled(((not self.is_series) and self.dataModel.bgcolor_enabled))
    self.bgcolor_global.stateChanged.connect(self.dataModel.colum_avg)
    btn_layout.addWidget(self.bgcolor_global)
    btn_layout.addStretch()
    bbox = QDialogButtonBox((QDialogButtonBox.Ok | QDialogButtonBox.Cancel))
    bbox.accepted.connect(self.accept)
    bbox.rejected.connect(self.reject)
    btn_layout.addWidget(bbox)
    self.layout.addLayout(btn_layout, 2, 0)
    return True
