📄 accountfeaturebar.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.//// $Id: AccountFeatureBar.java,v 1.1 2003/11/09 15:47:32 per_nyfelt Exp $package org.ozoneDB.adminGui.feature.account;import org.ozoneDB.DxLib.DxCollection;import org.ozoneDB.adminGui.res.Images;import org.ozoneDB.adminGui.main.AdminGui;import org.ozoneDB.adminGui.feature.ActionBar;import org.ozoneDB.adminGui.feature.InfoPanel;import org.ozoneDB.adminGui.feature.account.groups.GroupPanel;import org.ozoneDB.adminGui.feature.account.groups.GroupAccount;import javax.swing.*;import java.awt.*;import java.awt.event.ActionListener;import java.awt.event.ActionEvent;/** * @author Per Nyfelt */class AccountFeatureBar extends ActionBar { private InfoPanel userInfoPanel; public AccountFeatureBar(UserInfoPanel userInfoPanel) { this.userInfoPanel = userInfoPanel; addComponents(); } protected void addComponents() { this.removeAll(); //gbc.gridx = GridBagConstraints.REMAINDER; gbc.insets = new Insets(1, 5, 1, 5); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridy = 0; // Add label //gbc.anchor = GridBagConstraints.SOUTHWEST; //gbc.weighty = .3; add(new ActionButton("Users", Images.ACCOUNTS_SHOW_USERS, new UserLister(userInfoPanel), "list users"), gbc); gbc.gridy++; add(new ActionButton("new account", Images.ACCOUNTS_CREATE_USER, new AddUserLister(), "create a new account"), gbc); gbc.gridy++; add(new ActionButton("Groups", Images.ACCOUNTS_SHOW_GROUPS, new GroupLister(), "list groups"), gbc); // Add component //gbc.anchor = GridBagConstraints.NORTHWEST; //gbc.weighty = 0; //JTextField textField = new JTextField(10); //add(textField, gbc); // Add components to componentMap //components.put(propName, textField); } private class AddUserLister implements ActionListener { public void actionPerformed(ActionEvent e) { AddUserDialog dialog = new AddUserDialog(AdminGui.instance(), "Add account"); if (dialog.isInputOK()) { try { String userName = dialog.getUserName(); int userId = dialog.getUserId(); AdminGui.instance().getAdmin().newUser(userName, userId); } catch (Exception e1) { userInfoPanel.setDisplay(new JTextArea("Unable to add account: " + e1)); } } } } private class GroupLister implements ActionListener { public void actionPerformed(ActionEvent event) { System.out.println("list all groups"); userInfoPanel.setDisplay(new GroupPanel()); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -