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

Examples of com.dci.intellij.dbn.data.model.DataModelCell


    public SortableDataModelCell(SortableDataModelRow row, Object userValue, int index) {
        super(userValue, row, index);
    }

    public int compareTo(@NotNull Object o) {
        DataModelCell cell = (DataModelCell) o;
        Comparable local = (Comparable) getUserValue();
        Comparable remote = (Comparable) cell.getUserValue();

        if (local == null && remote == null) return 0;
        if (local == null) return -1;
        if (remote == null) return 1;
        // local class may differ from remote class for
        // columns with data conversion error
        if (local.getClass().equals(remote.getClass())) {
            return local.compareTo(remote);
        } else {
            Class typeClass = cell.getColumnInfo().getDataType().getTypeClass();
            return local.getClass().equals(typeClass) ? 1 :
                   remote.getClass().equals(typeClass) ? -1 : 0;
        }
    }
View Full Code Here


        updateSelection(table, oldSelection, selection);
    }

    private void updateSelection(BasicTable table, DataSearchResultMatch oldSelection, DataSearchResultMatch selection) {
        if (oldSelection != null) {
            DataModelCell cell = oldSelection.getCell();
            Rectangle cellRectangle = table.getCellRect(cell);
            table.repaint(cellRectangle);
        }

        if (selection != null) {
            DataModelCell cell = selection.getCell();
            Rectangle cellRectangle = table.getCellRect(cell);
            table.repaint(cellRectangle);
            cellRectangle.grow(100, 100);
            table.scrollRectToVisible(cellRectangle);
        }
View Full Code Here

                for (Object r : dataModel.getRows()) {
                    searchResult.checkTimestamp(updateTimestamp);
                    DataModelRow row = (DataModelRow) r;
                    for (Object c : row.getCells()) {
                        searchResult.checkTimestamp(updateTimestamp);
                        DataModelCell cell = (DataModelCell) c;
                        String userValue = cell.getFormattedUserValue();
                        if (userValue != null) {
                            int findOffset = 0;
                            while (true) {
                                FindResult findResult = findManager.findString(userValue, findOffset, findModel);
                                searchResult.checkTimestamp(updateTimestamp);
View Full Code Here

        boolean isCaretRow = table.getCellSelectionEnabled() && table.getSelectedRow() == rowIndex && table.getSelectedRowCount() == 1;



        DataModelCell cell = (DataModelCell) value;
        if (cell != null && !cell.isDisposed()) {
            boolean isLazyValue = cell.getUserValue() instanceof LazyLoadedValue;

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

View Full Code Here

            if (isReadonly && getSelectedColumnCount() == 1 && getSelectedRowCount() == 1) {
                int rowIndex = getSelectedRows()[0];
                int columnIndex = getSelectedColumns()[0];
                if (!canDisplayCompleteValue(rowIndex, columnIndex)) {
                    Rectangle cellRect = getCellRect(rowIndex, columnIndex, true);
                    DataModelCell cell = (DataModelCell) getValueAt(rowIndex, columnIndex);
                    TableColumn column = getColumnModel().getColumn(columnIndex);

                    int preferredWidth = column.getWidth();
                    LargeValuePreviewPopup viewer = new LargeValuePreviewPopup(this, cell, preferredWidth);
                    initLargeValuePopup(viewer);
View Full Code Here

    protected boolean isLargeValuePopupActive() {
        return true;
    }

    private boolean canDisplayCompleteValue(int rowIndex, int columnIndex) {
        DataModelCell cell = (DataModelCell) getValueAt(rowIndex, columnIndex);
        if (cell != null) {
            Object value = cell.getUserValue();
            if (value instanceof LazyLoadedValue) {
                return false;
            }
            if (value != null) {
                TableCellRenderer renderer = getCellRenderer(rowIndex, columnIndex);
View Full Code Here

        return 30;
    }

    @Override
    public String getToolTipText(@NotNull MouseEvent event) {
        DataModelCell cell = getCellAtLocation(event.getPoint());
        if (cell instanceof DatasetEditorModelCell) {
            DatasetEditorModelCell editorTableCell = (DatasetEditorModelCell) cell;
/*            if (event.isControlDown() && isNavigableCellAtMousePosition()) {
                DBColumn column = editorTableCell.getColumnInfo().getColumn();
                DBColumn foreignKeyColumn = column.getForeignKeyColumn();
View Full Code Here

        }
    }

    public void updateDataFromRow(DataModelRow oldRow) throws SQLException {
        for (int i=0; i<getCells().size(); i++) {
            DataModelCell oldCell = oldRow.getCellAtIndex(i);
            DatasetEditorModelCell newCell = getCellAtIndex(i);
            newCell.updateUserValue(oldCell.getUserValue(), false);
        }
    }
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.data.model.DataModelCell

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.