/** Creates the UI from the EditPlugins the inspection of the edited object found out. */ private void createUI() { try { panel.removeAll(); Set<GSMethod> set = this.methods.keySet(); Map<GSMethod, EditPlugin> localMethods = new HashMap<GSMethod, EditPlugin>(); Iterator<GSMethod> iter = set.iterator(); List<GSMethod> sortedMethods = new ArrayList<GSMethod>(); while (iter.hasNext()) { GSMethod meth = iter.next(); EditPlugin plugin = this.methods.get(meth); localMethods.put(meth, plugin); } set = localMethods.keySet(); int size = set.size(); for (int i = 0; i < size; i++) { set = localMethods.keySet(); iter = set.iterator(); GSMethod minMethod = null; while (iter.hasNext()) { GSMethod method = iter.next(); if (minMethod == null) minMethod = method; if (method.methodId <= minMethod.methodId) minMethod = method; } localMethods.remove(minMethod); sortedMethods.add(minMethod); } iter = sortedMethods.iterator(); while (iter.hasNext()) { GSMethod method = iter.next(); EditPlugin plugin = methods.get(method); panel.add(plugin.getView()); } } catch (Exception e) { JOptionPane.showMessageDialog( null, "Error: " + e.toString(), "Error!", JOptionPane.ERROR_MESSAGE); } }