Esempio n. 1
0
 /* enables or disables fields depending on whether a sub category is being added */
 protected void setSubCatAddMode(boolean adding) {
   showSubCatAddFields(adding);
   disableInputFields(adding);
   lbxItems.setDisabled(adding);
   lbxSubCatItems.setDisabled(adding);
   //        btnAddSubCat.setDisabled(adding);
   //        btnRemoveSubCat.setDisabled(adding || subCatUnremovable());
 }
Esempio n. 2
0
 /* enable or disable fields depending on whether we are in browse/edit or add mode */
 public void setAddMode(boolean adding, String selectedTab) {
   lbxItems.setDisabled(adding);
   if (selectedTab.equals("tabCategories")) {
     lbxSubCatItems.setDisabled(adding);
     btnAddSubCat.setDisabled(adding);
     btnRemoveSubCat.setDisabled(adding);
     disableInputFields(!adding);
     disableSubCatButtons(adding);
     _sb.setCategoryMembers(null);
   }
   if (adding) clearTextFields();
   txtName.setText("");
   lblMembers.setText("Members (0)");
 }
Esempio n. 3
0
 /* returns the value of the first item in the listbox, if any */
 private String getFirstListboxItem() {
   Option[] items = (Option[]) lbxItems.getItems();
   if ((items != null) && items.length > 0) {
     Option item = items[0];
     if (item != null) return (String) item.getValue();
   }
   return null;
 }
Esempio n. 4
0
 protected void populateGUI(String id, nonHumanMgt.SelType type) {
   switch (type) {
     case resource:
       populateGUI(_sb.getSelectedNonHumanResource(), id);
       break;
     case category:
       populateGUI(_orgDataSet.getNonHumanCategory(id));
       break;
   }
   lbxItems.setSelected(id);
 }
Esempio n. 5
0
  /* sets or hides fields depending on which tab is shown */
  public void setVisibleComponents(nonHumanMgt.SelType sType) {
    boolean catTab = (sType == nonHumanMgt.SelType.category);

    // these only appear on the resources tab
    cbbCategory.setVisible(!catTab);
    lblSubCategory.setVisible(!catTab);
    cbbSubCategory.setVisible(!catTab);

    // these only appear on the categories tab
    lblMembers.setVisible(catTab);
    cbbMembers.setVisible(catTab);
    lbxSubCatItems.setVisible(catTab);
    btnAddSubCat.setVisible(catTab);
    btnRemoveSubCat.setVisible(catTab);

    // nullify lists
    if (catTab) {
      cbbCategory.setItems(null);
      cbbSubCategory.setItems(null);
    } else lbxSubCatItems.setItems(null);
  }
Esempio n. 6
0
 public void clearFieldsAfterRemove() {
   clearTextFields();
   lbxItems.setSelected(getFirstListboxItem());
 }