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

(-)a/editor.macros/src/org/netbeans/modules/editor/macros/storage/ui/MacrosPanel.java (-1 / +6 lines)
Lines 464-470 Link Here
464
464
465
        if (DialogDisplayer.getDefault().notify(descriptor)==DialogDescriptor.OK_OPTION) {
465
        if (DialogDisplayer.getDefault().notify(descriptor)==DialogDescriptor.OK_OPTION) {
466
            String macroName = panel.getNameValue().trim();
466
            String macroName = panel.getNameValue().trim();
467
            return model.createMacro(MimePath.EMPTY, macroName);
467
	    final Macro macro = model.createMacro(MimePath.EMPTY, macroName);
468
	    sorter.resortAfterModelChange();
469
            int sel = sorter.viewIndex(model.getAllMacros().size() - 1);
470
            tMacros.getSelectionModel().setSelectionInterval(sel, sel);
471
            tMacros.scrollRectToVisible(tMacros.getCellRect(sel, 0, true));
472
            return macro;
468
        }
473
        }
469
        return null;
474
        return null;
470
    }
475
    }
(-)a/editor.macros/src/org/netbeans/modules/editor/macros/storage/ui/TableSorter.java (+11 lines)
Lines 176-181 Link Here
176
            tableHeader.repaint();
176
            tableHeader.repaint();
177
        }
177
        }
178
    }
178
    }
179
    /**
180
     * Sorts the table after the model has changed. The current sort column and
181
     * direction is used.
182
     */
183
    public final void resortAfterModelChange() {
184
	sortingStatusChanged();
185
    }
179
186
180
    public void setSortingStatus(int column, int status) {
187
    public void setSortingStatus(int column, int status) {
181
        Directive directive = getDirective(column);
188
        Directive directive = getDirective(column);
Lines 242-247 Link Here
242
    public int modelIndex(int viewIndex) {
249
    public int modelIndex(int viewIndex) {
243
        return getViewToModel()[viewIndex].modelIndex;
250
        return getViewToModel()[viewIndex].modelIndex;
244
    }
251
    }
252
    
253
    public int viewIndex(int modelIndex) {
254
        return getModelToView()[modelIndex];
255
    }
245
256
246
    private int[] getModelToView() {
257
    private int[] getModelToView() {
247
        if (modelToView == null) {
258
        if (modelToView == null) {

Return to bug 123946