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 173691
Collapse All | Expand All

(-)xml.schema.completion/src/org/netbeans/modules/xml/schema/completion/CompletionResultItem.java (-3 / +10 lines)
Lines 1-7 Link Here
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
3
 *
4
 * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
4
 * Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved.
5
 *
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
7
 * General Public License Version 2 only ("GPL") or the Common
Lines 286-293 Link Here
286
286
287
    @Override
287
    @Override
288
    public void defaultAction(JTextComponent component) {
288
    public void defaultAction(JTextComponent component) {
289
        int charsToRemove = (typedChars==null)?0:typedChars.length();
289
        int substOffset;
290
        int substOffset = component.getCaretPosition() - charsToRemove;
290
        int charsToRemove;
291
        if (component.getSelectedText() == null) {
292
            charsToRemove = (typedChars == null) ? 0 : typedChars.length();
293
            substOffset = component.getCaretPosition() - charsToRemove;
294
        } else {
295
            charsToRemove = component.getSelectedText().length();
296
            substOffset = component.getSelectionStart();
297
        }
291
        if(!shift) Completion.get().hideAll();
298
        if(!shift) Completion.get().hideAll();
292
        if(getReplacementText().equals(typedChars))
299
        if(getReplacementText().equals(typedChars))
293
            return;
300
            return;

Return to bug 173691