コード例 #1
0
 public void clearAllFieldsAndLists() {
   clearTextFields();
   clearCombos();
   _sb.setNhResourcesCategoryItems(null);
   _sb.setNhResourcesSubcategoryItems(null); // resource tab combo box
   _sb.setNhResourcesSubcategoryList(null); // category tab list box
   lblMembers.setText("Members (0)");
 }
コード例 #2
0
 /* fills ui with the selected category's values */
 private void populateGUI(NonHumanCategory category) {
   if (category != null) {
     populateSimpleFields(category);
     _sb.setNhResourcesSubcategoryList(getSubCategoryList(category));
     int membership = _sb.setCategoryMembers(category);
     lblMembers.setText("Members (" + membership + ")");
   }
   _sb.setNhResourcesSubcategoryItems(null); // empty the resource tab combo box
 }
コード例 #3
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);
  }
コード例 #4
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)");
 }