Changeset 5577
- Timestamp:
- 08/22/08 13:59:18 (3 months ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola/agents
- Files:
-
- 4 modified
-
metadata/editor/EditorModel.java (modified) (1 diff)
-
metadata/editor/TextualAnnotationsUI.java (modified) (1 diff)
-
metadata/editor/UserProfile.java (modified) (5 diffs)
-
util/EditorUtil.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorModel.java
r5564 r5577 610 610 Map<Long, List> getTextualAnnotationByOwner() 611 611 { 612 if (textualAnnotationsByUsers != null) 612 if (textualAnnotationsByUsers != null 613 && textualAnnotationsByUsers.size() > 0) 613 614 return textualAnnotationsByUsers; 614 615 textualAnnotationsByUsers = new HashMap<Long, List>(); -
trunk/SRC/org/openmicroscopy/shoola/agents/metadata/editor/TextualAnnotationsUI.java
r5472 r5577 401 401 removeAll(); 402 402 setAreaText(""); 403 originalText = null; 403 404 setComponentTitle(); 404 405 add(buildAreaPane()); -
trunk/SRC/org/openmicroscopy/shoola/agents/metadata/editor/UserProfile.java
r5382 r5577 117 117 /** The user's details. */ 118 118 private Map details; 119 120 private GroupData[] groupData; 119 121 120 122 /** Modifies the existing password. */ … … 179 181 validGroups.add(g); 180 182 } 181 GroupData[] objects= new GroupData[validGroups.size()];183 groupData = new GroupData[validGroups.size()]; 182 184 int selectedIndex = 0; 183 185 int index = 0; … … 185 187 while (i.hasNext()) { 186 188 g = (GroupData) i.next(); 187 objects[index] = g;189 groupData[index] = g; 188 190 if (g.getId() == groupID) originalIndex = index; 189 191 index++; … … 191 193 selectedIndex = originalIndex; 192 194 //sort by name 193 groups = new JComboBox( objects);195 groups = new JComboBox(groupData); 194 196 groups.setRenderer(new GroupsRenderer()); 195 if ( objects.length != 0)197 if (groupData.length != 0) 196 198 groups.setSelectedIndex(selectedIndex); 197 199 if (isOwner) { … … 407 409 newOne.setFirstName(v.trim()); 408 410 newOne.setId(original.getId()); 411 //set the groups 412 if (selectedIndex != originalIndex) { 413 GroupData g = groupData[selectedIndex]; 414 ExperimenterData user = (ExperimenterData) model.getRefObject(); 415 List userGroups = user.getGroups(); 416 List<GroupData> newGroups = new ArrayList<GroupData>(); 417 newGroups.add(g); 418 Iterator i = userGroups.iterator(); 419 GroupData group; 420 while (i.hasNext()) { 421 group = (GroupData) i.next(); 422 if (group.getId() != g.getId()) 423 newGroups.add(group); 424 } 425 newOne.setGroups(newGroups); 426 } 409 427 return newOne; 410 428 } -
trunk/SRC/org/openmicroscopy/shoola/agents/util/EditorUtil.java
r5538 r5577 74 74 75 75 /** Identifies the <code>Default group</code>. */ 76 public static final String DEFAULT_GROUP = " DefaultGroup";76 public static final String DEFAULT_GROUP = "Main Group"; 77 77 78 78 /** Symbols indicating the mandatory values. */
