Examples of DatasetEditorTable


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

            }
        }
    }

    public void cancelInsert(boolean notifyListeners) {
        DatasetEditorTable editorTable = getEditorTable();
        if (editorTable != null) {
            try {
                editorTable.fireEditingCancel();
                DatasetEditorModelRow insertRow = getInsertRow();
                int rowIndex = insertRow.getIndex();
                removeRowAtIndex(rowIndex);
                resultSet.moveToCurrentRow();
                isInserting = false;
View Full Code Here

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

        DatasetEditorModelCell cell = getCellAt(rowIndex, columnIndex);
        cell.updateUserValue(value, errorMessage);
    }

    public boolean isCellEditable(int rowIndex, int columnIndex) {
        DatasetEditorTable editorTable = getEditorTable();
        if (editorTable != null) {
            if (!isReadonly() && !getState().isReadonly() && getConnectionHandler().isConnected()) {
                if (!editorTable.isLoading() && editorTable.getSelectedColumnCount() <= 1 && editorTable.getSelectedRowCount() <= 1) {
                    DatasetEditorModelRow row = getRowAtIndex(rowIndex);
                    return row != null && !(isInserting && !row.isInsert()) && !row.isDeleted();
                }
            }
        }
View Full Code Here

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

            presentation.setVisible(!datasetEditor.isReadonlyData());
            presentation.setEnabled(true);
            if (datasetEditor.isInserting() || datasetEditor.isLoading() || datasetEditor.isReadonly()) {
                presentation.setEnabled(false);
            } else {
                DatasetEditorTable editorTable = datasetEditor.getEditorTable();
                if (editorTable != null && editorTable.getSelectedRows() != null && editorTable.getSelectedRows().length > 0) {
                    for (int selectedRow : editorTable.getSelectedRows()) {
                        if (selectedRow < editorTable.getModel().getRowCount()) {
                            DatasetEditorModelRow row = editorTable.getModel().getRowAtIndex(selectedRow);
                            if (!row.isDeleted()) {
                                presentation.setEnabled(true);
                                return;
                            }
                        }
View Full Code Here

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

    }

    protected void customizeCellRenderer(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int columnIndex) {
        acquireState(table, isSelected, false, rowIndex, columnIndex);
        DatasetEditorModelCell cell = (DatasetEditorModelCell) value;
        DatasetEditorTable datasetEditorTable = (DatasetEditorTable) table;

        if (cell != null && !cell.isDisposed()) {
            DatasetEditorModelRow row = cell.getRow();
            DatasetEditorColumnInfo columnInfo = cell.getColumnInfo();
            boolean isLoading = datasetEditorTable.isLoading();
            boolean isInserting = datasetEditorTable.isInserting();

            boolean isDeletedRow = row.isDeleted();
            boolean isInsertRow = row.isInsert();
            boolean isCaretRow = !isInsertRow && table.getCellSelectionEnabled() && table.getSelectedRow() == rowIndex && table.getSelectedRowCount() == 1;
            boolean isModified = cell.isModified();

            DataGridTextAttributes attributes = getAttributes();
            SimpleTextAttributes textAttributes = attributes.getPlainData(isModified, isCaretRow);

            if (isSelected) {
                textAttributes = attributes.getSelection();
            } else if (isLoading || !datasetEditorTable.getDatasetEditor().getConnectionHandler().isConnected()) {
                textAttributes = attributes.getLoadingData(isCaretRow);
            } else if (isDeletedRow) {
                textAttributes = attributes.getDeletedData();
            } else if ((isInserting && !isInsertRow)) {
                textAttributes = attributes.getReadonlyData(isModified, isCaretRow);
View Full Code Here

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

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        BasicTableGutter tableGutter = (BasicTableGutter) list;
        DatasetEditorModel model = (DatasetEditorModel) list.getModel();
        DatasetEditorModelRow row = model.getRowAtIndex(index);
        DatasetEditorTable table = (DatasetEditorTable) tableGutter.getTable();
        if (row != null) {
            Icon icon =
                    row.isNew() ? Icons.DATA_EDITOR_ROW_NEW :
                            row.isInsert() ? Icons.DATA_EDITOR_ROW_INSERT :
                                    row.isDeleted() ? Icons.DATA_EDITOR_ROW_DELETED :
                                            row.isModified() ? Icons.DATA_EDITOR_ROW_MODIFIED :
                                                    table.getModel().isModified() ? Icons.DATA_EDITOR_ROW_DEFAULT : null;

            textLabel.setText(Integer.toString(row.getIndex() + 1));
            if (imageLabel.getIcon() != icon) {
                imageLabel.setIcon(icon);
            }
        }
        //lText.setFont(isSelected ? BOLD_FONT : REGULAR_FONT);

        boolean isCaretRow = table.getCellSelectionEnabled() && table.getSelectedRow() == index && table.getSelectedRowCount() == 1;
        Color background = isSelected ?
                BasicTableGutterCellRenderer.Colors.SELECTION_BACKGROUND_COLOR :
                isCaretRow ?
                        BasicTableGutterCellRenderer.Colors.CARET_ROW_COLOR :
                        PANEL_BACKGROUND;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.