@@ -0,0 +1,2460 @@
+/*%0A * Copyright 2016 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.github.alexfalappa.nbspringboot.navigator;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.List;%0Aimport javax.swing.table.AbstractTableModel;%0A%0A/**%0A * A super simple table model for the navigator UI.%0A *%0A * @author Michael J. Simons, 2016-09-16%0A */%0Apublic class MappedElementsModel extends AbstractTableModel %7B%0A%0A    private static final long serialVersionUID = 5870247061989235811L;%0A%0A    private final List%3CMappedElement%3E data = Collections.synchronizedList(new ArrayList%3CMappedElement%3E());%0A%0A    @Override%0A    public String getColumnName(int column) %7B%0A        String rv;%0A        switch (column) %7B%0A            case 0:%0A                rv = %22Resource URL%22;%0A                break;%0A            case 1:%0A                rv = %22Request Method%22;%0A                break;%0A            case 2:%0A                rv = %22Handler Method%22;%0A                break;%0A            default:%0A                rv = null;%0A        %7D%0A        return rv;%0A    %7D%0A%0A    @Override%0A    public int getRowCount() %7B%0A        return this.data.size();%0A    %7D%0A%0A    @Override%0A    public int getColumnCount() %7B%0A        return 3;%0A    %7D%0A%0A    @Override%0A    public Object getValueAt(int rowIndex, int columnIndex) %7B%0A        final MappedElement mappedElement = this.data.get(rowIndex);%0A        Object rv;%0A        switch (columnIndex) %7B%0A            case 0:%0A                rv = mappedElement.getUrl();%0A                break;%0A            case 1:%0A                rv = mappedElement.getMethod();%0A                break;%0A            case 2:%0A                rv = mappedElement.getElement().toString();%0A                break;%0A            default:%0A                rv = null;%0A        %7D%0A%0A        return rv;%0A    %7D%0A%0A    void refresh(final List%3CMappedElement%3E newData) %7B%0A        this.data.clear();%0A        this.data.addAll(newData);%0A        this.fireTableDataChanged();%0A    %7D%0A%7D%0A

Add table model for mapped elements