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

Examples of com.dci.intellij.dbn.data.editor.color.DataGridTextAttributes


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

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


            if (isSelected) {
                textAttributes = attributes.getSelection();
            } else if (isLoading) {
                textAttributes = attributes.getLoadingData(isCaretRow);
            } else if (isLazyValue) {
                textAttributes = attributes.getReadonlyData(false, isCaretRow);
            }

            Color background = CommonUtil.nvl(textAttributes.getBgColor(), table.getBackground());
            Color foreground = CommonUtil.nvl(textAttributes.getFgColor(), table.getForeground());
            Border border = getLineBorder(background);
View Full Code Here


    protected RegionalSettings regionalSettings;

    public BasicTable(Project project, BasicDataModel dataModel) {
        super(project, dataModel, true);
        cellRenderer = createCellRenderer(project);
        DataGridTextAttributes displayAttributes = cellRenderer.getAttributes();
        setSelectionForeground(displayAttributes.getSelection().getFgColor());
        setSelectionBackground(displayAttributes.getSelection().getBgColor());
        EditorColorsManager.getInstance().addEditorColorsListener(this);
        Color bgColor = displayAttributes.getPlainData(false, false).getBgColor();
        setBackground(bgColor == null ? UIUtil.getTableBackground() : bgColor);
    }
View Full Code Here

        final JBViewport viewport = UIUtil.getParentOfType(JBViewport.class, this);
        if (viewport != null) {
            new ConditionalLaterInvocator() {
                @Override
                public void execute() {
                    DataGridTextAttributes attributes = cellRenderer.getAttributes();
                    Color background = readonly ?
                            attributes.getLoadingData(false).getBgColor() :
                            attributes.getPlainData(false, false).getBgColor();
                    viewport.setBackground(background);
                    viewport.repaint();
                }
            }.start();
        }
View Full Code Here

            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);
            } else if (columnInfo.isPrimaryKey()) {
                textAttributes = attributes.getPrimaryKey(isModified, isCaretRow);
            } else if (columnInfo.isForeignKey()) {
                textAttributes = attributes.getForeignKey(isModified, isCaretRow);
            } else if (cell.isLobValue()) {
                textAttributes = attributes.getReadonlyData(isModified, isCaretRow);
            }

            Color background = CommonUtil.nvl(textAttributes.getBgColor(), table.getBackground());
            Color foreground = CommonUtil.nvl(textAttributes.getFgColor(), table.getForeground());


            Border border = getLineBorder(background);

            if (cell.hasError()) {
                border = getLineBorder(SimpleTextAttributes.ERROR_ATTRIBUTES.getFgColor());
                SimpleTextAttributes errorData = attributes.getErrorData();
                background = errorData.getBgColor();
                foreground = errorData.getFgColor();
                textAttributes = textAttributes.derive(errorData.getStyle(), foreground, background, null);
            }
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.data.editor.color.DataGridTextAttributes

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.