Revision 5232
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/registerWorkspace/VCSGisJRegisterWorkspaceImpl.java | ||
---|---|---|
7 | 7 |
|
8 | 8 |
import java.awt.Cursor; |
9 | 9 |
import java.awt.event.ActionEvent; |
10 |
import java.util.ArrayList; |
|
11 |
import java.util.Collections; |
|
12 |
import java.util.Comparator; |
|
13 |
import java.util.List; |
|
10 | 14 |
import java.util.Map; |
11 | 15 |
import javax.swing.DefaultListCellRenderer; |
12 | 16 |
import javax.swing.DefaultListModel; |
... | ... | |
15 | 19 |
import javax.swing.JOptionPane; |
16 | 20 |
import javax.swing.ListSelectionModel; |
17 | 21 |
import javax.swing.event.ListSelectionEvent; |
22 |
import org.apache.commons.collections.ComparatorUtils; |
|
23 |
import org.apache.commons.lang3.StringUtils; |
|
18 | 24 |
import org.gvsig.fmap.dal.DALLocator; |
19 | 25 |
import org.gvsig.fmap.dal.DataServerExplorer; |
20 | 26 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
... | ... | |
28 | 34 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
29 | 35 |
import org.gvsig.tools.swing.api.ToolsSwingUtils; |
30 | 36 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
37 |
import org.gvsig.tools.util.CompareUtils; |
|
38 |
import org.gvsig.tools.util.CompareUtils.NullSafeComparator; |
|
31 | 39 |
import org.gvsig.vcsgis.lib.VCSGisLocator; |
32 | 40 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
33 | 41 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspaceDescriptor; |
... | ... | |
153 | 161 |
doUpdateEnableComponents(); |
154 | 162 |
}); |
155 | 163 |
|
164 |
Map<String, VCSGisWorkspaceDescriptor> workspaces_map = VCSGisLocator.getVCSGisManager().getWorkspaces(); |
|
165 |
List<VCSGisWorkspaceDescriptor> workspaces = new ArrayList<>(workspaces_map.values()); |
|
166 |
Collections.sort(workspaces, CompareUtils.EQUALS_IGNORECASE_COMPARATOR); |
|
156 | 167 |
DefaultListModel<VCSGisWorkspaceDescriptor> model = new DefaultListModel<>(); |
157 |
Map<String, VCSGisWorkspaceDescriptor> workspaces = VCSGisLocator.getVCSGisManager().getWorkspaces(); |
|
158 |
workspaces.entrySet().forEach(entry -> { |
|
159 |
model.addElement(entry.getValue()); |
|
160 |
}); |
|
168 |
for (VCSGisWorkspaceDescriptor workspace : workspaces) { |
|
169 |
model.addElement(workspace); |
|
170 |
} |
|
161 | 171 |
lstWorkspaces.setModel(model); |
162 | 172 |
lstWorkspaces.setCellRenderer(new DefaultListCellRenderer()); |
163 | 173 |
} |
Also available in: Unified diff