Exemplo n.º 1
0
  /**
   * Get the image group from the gui.
   *
   * @return The iamge group.
   */
  protected String getGroup() {
    Object selected = groupSelector.getSelectedItem();
    if (selected == null) {
      return null;
    }
    if (selected instanceof AddeServer.Group) {
      AddeServer.Group group = (AddeServer.Group) selected;
      return group.getName();
    }

    String groupName = selected.toString().trim();
    if ((groupName.length() > 0)) {
      // Force the get in case they typed a server name
      getServer();
      AddeServer server = getAddeServer();
      if (server != null) {
        AddeServer.Group group =
            getIdv().getIdvChooserManager().addAddeServerGroup(server, groupName, getGroupType());
        if (!group.getActive()) {
          getIdv().getIdvChooserManager().activateAddeServerGroup(server, group);
        }
        // Now put the list of groups back in to the selector
        setGroups();
        groupSelector.setSelectedItem(group);
      }
    }

    return groupName;
  }
Exemplo n.º 2
0
 /**
  * Remove the group from the global list
  *
  * @param group the group
  */
 public void removeGroup(AddeServer.Group group) {
   AddeServer server = getAddeServer();
   if (server == null) {
     return;
   }
   if (!MARK_AS_INACTIVE && !group.getIsLocal()) {
     return;
   }
   getIdv().getIdvChooserManager().removeAddeServerGroup(server, group, MARK_AS_INACTIVE);
   setGroups();
 }