Package com.dci.intellij.dbn.editor.data.ui.table

Examples of com.dci.intellij.dbn.editor.data.ui.table.DatasetEditorTable


        private HideColumnAction() {
            super("Hide column");
        }

        public void actionPerformed(AnActionEvent e) {
            DatasetEditorTable editorTable = datasetEditor.getEditorTable();
            if (editorTable != null) {
                int columnIndex = columnInfo.getColumnIndex();
                editorTable.hideColumn(columnIndex);
            }
        }
View Full Code Here


        private SortAscendingAction() {
            super("Sort ascending");
        }

        public void actionPerformed(AnActionEvent e) {
            DatasetEditorTable editorTable = datasetEditor.getEditorTable();
            int modelColumnIndex = columnInfo.getColumnIndex();
            if (editorTable != null) {
                int tableColumnIndex = editorTable.convertColumnIndexToView(modelColumnIndex);
                editorTable.sort(tableColumnIndex, SortDirection.ASCENDING, false);
            }
        }
View Full Code Here

        private SortDescendingAction() {
            super("Sort descending");
        }

        public void actionPerformed(AnActionEvent e) {
            DatasetEditorTable editorTable = datasetEditor.getEditorTable();
            int modelColumnIndex = columnInfo.getColumnIndex();
            if (editorTable != null) {
                int tableColumnIndex = editorTable.convertColumnIndexToView(modelColumnIndex);
                editorTable.sort(tableColumnIndex, SortDirection.DESCENDING, false);
            }
        }
View Full Code Here

    public DatasetEditorForm(DatasetEditor datasetEditor) {
        this.datasetEditor = datasetEditor;
        DBDataset dataset = getDataset();
        try {
            datasetEditorTable = new DatasetEditorTable(datasetEditor);
            datasetTableScrollPane.setViewportView(datasetEditorTable);
            datasetTableScrollPane.setRowHeaderView(datasetEditorTable.getTableGutter());


            JPanel panel = new JPanel();
View Full Code Here

            autoCommitLabel.setConnectionHandler(connectionHandler);
        }
    }

    public DatasetEditorTable beforeRebuild() throws SQLException {
        DatasetEditorTable oldEditorTable = datasetEditorTable;
        datasetEditorTable = new DatasetEditorTable(datasetEditor);
        Disposer.register(this, datasetEditorTable);

        List<TableColumn> hiddenColumns = new ArrayList<TableColumn>();
        for (DatasetColumnState columnState : datasetEditor.getState().getColumnSetup().getColumnStates()) {
            if (!columnState.isVisible()) {
View Full Code Here

    /****************************************************************
     *                        Editor actions                        *
     ****************************************************************/
    public void deleteRecords(int[] rowIndexes) {
        DatasetEditorTable editorTable = getEditorTable();
        if (editorTable != null) {
            editorTable.fireEditingCancel();
            for (int index : rowIndexes) {
                DatasetEditorModelRow row = getRowAtIndex(index);
                if (!row.isDeleted()) {
                    int rsRowIndex = row.getResultSetRowIndex();
                    row.delete();
View Full Code Here

            }
        }
    }

    public void insertRecord(int rowIndex) {
        DatasetEditorTable editorTable = getEditorTable();
        if (editorTable != null) {
            DBDataset dataset = getDataset();
            try {
                editorTable.stopCellEditing();
                resultSet.moveToInsertRow();
                DatasetEditorModelRow newRow = createRow(getRowCount()+1);
                newRow.setInsert(true);
                addRowAtIndex(rowIndex, newRow);
                notifyRowsInserted(rowIndex, rowIndex);

                editorTable.selectCell(rowIndex, editorTable.getSelectedColumn() == -1 ? 0 : editorTable.getSelectedColumn());
                isInserting = true;
                if (dataset != null) {
                    getConnectionHandler().notifyChanges(dataset.getVirtualFile());
                }
            } catch (SQLException e) {
View Full Code Here

        ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(mainPanel, mainPanel);
        popup = popupBuilder.createPopup();
    }

    public void show() {
        DatasetEditorTable table = cell.getRow().getModel().getEditorTable();
        Rectangle rectangle = table.getCellRect(cell.getRow().getIndex(), cell.getIndex(), false);

        if (table.isShowing()) {
            Point tableLocation = table.getLocationOnScreen();
            int x = (int) (tableLocation.getX() + rectangle.getLocation().getX() + 4);
            int y = (int) (tableLocation.getY() + rectangle.getLocation().getY() + 20);
            Point cellLocation = new Point(x, y);
            popup.showInScreenCoordinates(table, cellLocation);
        }
View Full Code Here

            }
        }
    }

    public void duplicateRecord(int rowIndex) {
        DatasetEditorTable editorTable = getEditorTable();
        if (editorTable != null) {
            DBDataset dataset = getDataset();
            try {
                editorTable.stopCellEditing();
                int insertIndex = rowIndex + 1;
                resultSet.moveToInsertRow();
                DatasetEditorModelRow oldRow = getRowAtIndex(rowIndex);
                DatasetEditorModelRow newRow = createRow(getRowCount() + 1);
                newRow.setInsert(true);
                newRow.updateDataFromRow(oldRow);
                addRowAtIndex(insertIndex, newRow);
                notifyRowsInserted(insertIndex, insertIndex);

                editorTable.selectCell(insertIndex, editorTable.getSelectedColumn());
                isInserting = true;
                if (dataset != null) {
                    getConnectionHandler().notifyChanges(dataset.getVirtualFile());
                }
            } catch (SQLException e) {
View Full Code Here

            }
        }
    }

    public void postInsertRecord(boolean propagateError, boolean rebuild) throws SQLException {
        DatasetEditorTable editorTable = getEditorTable();
        if (editorTable != null) {
            DatasetEditorModelRow row = getInsertRow();
            try {
                editorTable.stopCellEditing();
                resultSet.insertRow();
                resultSet.moveToCurrentRow();
                row.setInsert(false);
                row.setNew(true);
                isModified = true;
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.editor.data.ui.table.DatasetEditorTable

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.