Package nz.govt.natlib.meta.config

Examples of nz.govt.natlib.meta.config.User


  void userSelect_itemStateChanged(ItemEvent e) {
    Object user = userSelect.getSelectedItem();
    if ((user != null) && (user instanceof User)
        && (e.getStateChange() == ItemEvent.SELECTED)) {
      User usr = (User) user;
      Config.getInstance().setDefaultUser(usr);
      LogManager.getInstance().logMessage(LogMessage.WORTHLESS_CHATTER,
          "Current user set to :" + usr.getName());
    }
  }
View Full Code Here


  private void addNewUser() {
    NewUserDlg dlg = new NewUserDlg();
    if (dlg.showDialog()) {
      String userName = dlg.getUserName();
      if (userName.length() > 0) {
        User user = new User(userName);
        LogManager.getInstance().logMessage(LogMessage.INFO,
            "Adding user " + userName);
        DefaultListModel newListModel = getNewDefaultModel();
        if (!newListModel.contains(user)) {
          newListModel.addElement(user);
          userList.setModel(newListModel);
          listModel = newListModel;
          userList.setSelectedIndex(listModel.getSize() - 1);
          Config.getEditInstance().addUser(
              new User(dlg.getUserName()));
        } else {
          LogManager.getInstance().logMessage(LogMessage.INFO,
              "User " + userName + " already exists!");
          JOptionPane.showMessageDialog(parent,
              "User already exists", "User not added",
View Full Code Here

    }
  }

  private void delUser() {
    int idx = userList.getSelectedIndex();
    User user = (User) userList.getSelectedValue();
    if (idx > -1) {
      if (JOptionPane.showConfirmDialog(this,
          "Are you sure you wish to delete " + user.getName(),
          "Remove User?", JOptionPane.YES_NO_OPTION,
          JOptionPane.WARNING_MESSAGE, delPic) == JOptionPane.NO_OPTION) {
        return;
      }
      LogManager.getInstance().logMessage(LogMessage.INFO,
          "Removing user " + user.getName());
      Config.getEditInstance().removeUser(user);
      DefaultListModel newListModel = getNewDefaultModel();
      userList.setModel(newListModel);
      newListModel.removeElementAt(idx);
      int newSize = newListModel.getSize();
View Full Code Here

    this.inputDir.setText(Config.getEditInstance().getBaseHarvestDir());
    refreshing = false;
  }

  public void userAdded(User user) {
    User oldUser = (User) configCmb.getSelectedItem();
    configCmb.setModel(new DefaultComboBoxModel(Config.getEditInstance()
        .getUsers()));
    configCmb.setSelectedItem(oldUser);
  }
View Full Code Here

        .getUsers()));
    configCmb.setSelectedItem(oldUser);
  }

  public void userRemoved(User user) {
    User oldUser = (User) configCmb.getSelectedItem();
    configCmb.setModel(new DefaultComboBoxModel(Config.getEditInstance()
        .getUsers()));
    if (!oldUser.equals(user) && configCmb.getModel().getSize() > 0) {
      configCmb.setSelectedIndex(0);
    } else {
      configCmb.setSelectedItem(oldUser);
    }
  }
View Full Code Here

TOP

Related Classes of nz.govt.natlib.meta.config.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.