This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 163595
Collapse All | Expand All

(-)db.sql.editor/nbproject/project.xml (-1 / +1 lines)
Lines 81-87 Link Here
81
                    <compile-dependency/>
81
                    <compile-dependency/>
82
                    <run-dependency>
82
                    <run-dependency>
83
                        <release-version>0-1</release-version>
83
                        <release-version>0-1</release-version>
84
                        <specification-version>0.8</specification-version>
84
                        <specification-version>1.2</specification-version>
85
                    </run-dependency>
85
                    </run-dependency>
86
                </dependency>
86
                </dependency>
87
                <dependency>
87
                <dependency>
(-)db.sql.editor/src/org/netbeans/modules/db/sql/editor/completion/SQLCompletionItem.java (-5 / +29 lines)
Lines 108-115 Link Here
108
    }
108
    }
109
109
110
    // view - bit ugly but can be easily refactored
110
    // view - bit ugly but can be easily refactored
111
    public static SQLCompletionItem column(boolean view, QualIdent tupleName, String columnName, String substText, int substOffset, SubstitutionHandler substHandler) {
111
    public static SQLCompletionItem column(boolean view, 
112
        return new Column(view, tupleName, columnName, substText, substOffset, substHandler);
112
            QualIdent tupleName,
113
            String columnName, 
114
            String dataType,
115
            String substText, 
116
            int substOffset, 
117
            SubstitutionHandler substHandler) {
118
        return new Column(view, tupleName, columnName, dataType, substText, substOffset, substHandler);
113
    }
119
    }
114
120
115
    public static SQLCompletionItem keyword(String keyword, int substOffset, SubstitutionHandler substHandler) {
121
    public static SQLCompletionItem keyword(String keyword, int substOffset, SubstitutionHandler substHandler) {
Lines 132-138 Link Here
132
    }
138
    }
133
139
134
    public int getPreferredWidth(Graphics g, Font defaultFont) {
140
    public int getPreferredWidth(Graphics g, Font defaultFont) {
135
        return CompletionUtilities.getPreferredWidth(getLeftHtmlText(), getRightHtmlText(), g, defaultFont);
141
        int width = CompletionUtilities.getPreferredWidth(getLeftHtmlText(), getRightHtmlText(), g, defaultFont);
142
        width += 20; // give some more room for visible seperation
143
        return width;
136
    }
144
    }
137
145
138
    public void render(Graphics g, Font defaultFont, Color defaultColor, Color backgroundColor, int width, int height, boolean selected) {
146
    public void render(Graphics g, Font defaultFont, Color defaultColor, Color backgroundColor, int width, int height, boolean selected) {
Lines 375-386 Link Here
375
        private final String columnName;
383
        private final String columnName;
376
        private String leftText;
384
        private String leftText;
377
        private String rightText;
385
        private String rightText;
386
        private String dataType;
378
387
379
        public Column(boolean view, QualIdent tableName, String columnName, String substText, int substOffset, SubstitutionHandler substHandler) {
388
        public Column(boolean view,
389
                QualIdent tableName,
390
                String columnName,
391
                String dataType,
392
                String substText,
393
                int substOffset,
394
                SubstitutionHandler substHandler) {
380
            super(substText, substOffset, substHandler);
395
            super(substText, substOffset, substHandler);
381
            this.view = view;
396
            this.view = view;
382
            this.tableName = tableName;
397
            this.tableName = tableName;
383
            this.columnName = columnName;
398
            this.columnName = columnName;
399
            this.dataType = dataType;
384
        }
400
        }
385
401
386
        protected String getColumnName() {
402
        protected String getColumnName() {
Lines 412-419 Link Here
412
                sb.append(TABLE_COLOR);
428
                sb.append(TABLE_COLOR);
413
                sb.append(tableName.toString());
429
                sb.append(tableName.toString());
414
                sb.append(COLOR_END);
430
                sb.append(COLOR_END);
415
                rightText = MessageFormat.format(NbBundle.getMessage(SQLCompletionItem.class, view ? "MSG_View" : "MSG_Table"), sb.toString());
431
                rightText = MessageFormat.format(
432
                        NbBundle.getMessage(SQLCompletionItem.class, view ? "MSG_View" : "MSG_Table"), sb.toString());
433
                sb.setLength(0);
434
                if (dataType != null && (! dataType.trim().isEmpty())) {
435
                    sb.append(" (");
436
                    sb.append(dataType.trim());
437
                    sb.append(")");
438
                    rightText += sb.toString();
416
            }
439
            }
440
            }
417
            return rightText;
441
            return rightText;
418
        }
442
        }
419
443
(-)db.sql.editor/src/org/netbeans/modules/db/sql/editor/completion/SQLCompletionItems.java (+1 lines)
Lines 213-218 Link Here
213
                        tuple instanceof View,
213
                        tuple instanceof View,
214
                        qualTableName,
214
                        qualTableName,
215
                        columnName,
215
                        columnName,
216
                        column.getTypeName(),
216
                        doQuote(columnName, quote),
217
                        doQuote(columnName, quote),
217
                        ownOffset,
218
                        ownOffset,
218
                        ownHandler ?
219
                        ownHandler ?

Return to bug 163595