Package com.dci.intellij.dbn.editor.data.model

Examples of com.dci.intellij.dbn.editor.data.model.DatasetEditorModel


        return datasetEditor.getProject();
    }


    private static DatasetEditorModel createModel(DatasetEditor datasetEditor) throws SQLException {
        return new DatasetEditorModel(datasetEditor);
    }
View Full Code Here


    /**********************************************************
     *                  ListSelectionListener                 *
     **********************************************************/
    public void valueChanged(ListSelectionEvent e) {
        super.valueChanged(e);
        DatasetEditorModel model = getModel();

        if (model.isInserting() && !e.getValueIsAdjusting()) {
            int insertRowIndex = getModel().getInsertRowIndex();
            if (insertRowIndex != -1 && (insertRowIndex == e.getFirstIndex() || insertRowIndex == e.getLastIndex()) && getSelectedRow() != insertRowIndex) {
                try {
                    model.postInsertRecord(false, true);
                } catch (SQLException e1) {
                    MessageUtil.showErrorDialog("Could not create row in " + getDataset().getQualifiedNameWithType() + ".", e1);
                }
            }
        }
View Full Code Here

            editorState = (DatasetEditorState) fileEditorState;
        }
    }

    public boolean isModified() {
        DatasetEditorModel model = getTableModel();
        return model != null && model.isModified();
    }
View Full Code Here

     * Model operations                  *
     * ******************************************************
     */
    public void fetchNextRecords(int records) {
        try {
            DatasetEditorModel model = getTableModel();
            if (model != null) {
                model.fetchNextRecords(records, false);
            }
            dataLoadError = null;
        } catch (SQLException e) {
            dataLoadError = e.getMessage();
/*
 
View Full Code Here

                        if (!isDisposed()) {
                            editorForm.showLoadingHint();
                            editorForm.getEditorTable().cancelEditing();
                            DatasetEditorTable oldEditorTable = instructions.isRebuild() ? editorForm.beforeRebuild() : null;
                            try {
                                DatasetEditorModel tableModel = getTableModel();
                                if (tableModel != null) {
                                    tableModel.load(instructions.isUseCurrentFilter(), instructions.isKeepChanges());
                                    getEditorTable().clearSelection();
                                }
                            } finally {
                                if (!isDisposed()) {
                                    editorForm.afterRebuild(oldEditorTable);
View Full Code Here

    }

    public void deleteRecords() {
        DatasetEditorTable editorTable = getEditorTable();
        DatasetEditorModel model = getTableModel();

        if (editorTable != null && model != null) {
            int[] indexes = editorTable.getSelectedRows();
            model.deleteRecords(indexes);
        }
    }
View Full Code Here

        }
    }

    public void insertRecord() {
        DatasetEditorTable editorTable = getEditorTable();
        DatasetEditorModel model = getTableModel();

        if (editorTable != null && model != null) {
            int[] indexes = editorTable.getSelectedRows();

            int rowIndex = indexes.length > 0 && indexes[0] < model.getSize() ? indexes[0] : 0;
            model.insertRecord(rowIndex);
        }
    }
View Full Code Here

        }
    }

    public void duplicateRecord() {
        DatasetEditorTable editorTable = getEditorTable();
        DatasetEditorModel model = getTableModel();
        if (editorTable != null && model != null) {
            int[] indexes = editorTable.getSelectedRows();
            if (indexes.length == 1) {
                model.duplicateRecord(indexes[0]);
            }
        }
    }
View Full Code Here

        }
    }

    public void openRecordEditor() {
        DatasetEditorTable editorTable = getEditorTable();
        DatasetEditorModel model = getTableModel();

        if (editorTable != null && model != null) {
            int index = editorTable.getSelectedRow();
            if (index == -1) index = 0;
            DatasetEditorModelRow row = model.getRowAtIndex(index);
            editorTable.stopCellEditing();
            editorTable.selectRow(row.getIndex());
            DatasetRecordEditorDialog editorDialog = new DatasetRecordEditorDialog(row);
            editorDialog.show();
        }
View Full Code Here

        }
    }

    public void openRecordEditor(int index) {
        DatasetEditorTable editorTable = getEditorTable();
        DatasetEditorModel model = getTableModel();

        if (editorTable != null && model != null) {
            DatasetEditorModelRow row = model.getRowAtIndex(index);
            DatasetRecordEditorDialog editorDialog = new DatasetRecordEditorDialog(row);
            editorDialog.show();
        }
    }
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.editor.data.model.DatasetEditorModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.