当前位置: 首页>>代码示例>>Java>>正文


Java PasswordStore类代码示例

本文整理汇总了Java中org.jdesktop.swingx.auth.PasswordStore的典型用法代码示例。如果您正苦于以下问题:Java PasswordStore类的具体用法?Java PasswordStore怎么用?Java PasswordStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PasswordStore类属于org.jdesktop.swingx.auth包,在下文中一共展示了PasswordStore类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JXLoginPane

import org.jdesktop.swingx.auth.PasswordStore; //导入依赖的package包/类
/**
 * Create a {@code JXLoginPane} with the specified {@code LoginService},
 * {@code PasswordStore}, {@code UserNameStore}, and server list.
 * <p>
 * If you do not want to store passwords or user ids, those parameters can
 * be {@code null}. {@code SaveMode} is autoconfigured from passed in store
 * parameters.
 * <p>
 * Setting the server list to {@code null} will unset all of the servers.
 * The server list is guaranteed to be non-{@code null}.
 *
 * @param service
 *            the {@code LoginService} to use for logging in
 * @param passwordStore
 *            the {@code PasswordStore} to use for storing password
 *            information
 * @param userStore
 *            the {@code UserNameStore} to use for storing user information
 * @param servers
 *            a list of servers to authenticate against
 */
public JXLoginPane(LoginService service, PasswordStore passwordStore, UserNameStore userStore, List<String> servers) {
    setLoginService(service);
    setPasswordStore(passwordStore);
    setUserNameStore(userStore);
    setServers(servers);


    //create the login and cancel actions, and add them to the action map
    getActionMap().put(LOGIN_ACTION_COMMAND, createLoginAction());
    getActionMap().put(CANCEL_LOGIN_ACTION_COMMAND, createCancelAction());

    //initialize the save mode
    if (passwordStore != null && userStore != null) {
        saveMode = SaveMode.BOTH;
    } else if (passwordStore != null) {
        saveMode = SaveMode.PASSWORD;
    } else if (userStore != null) {
        saveMode = SaveMode.USER_NAME;
    } else {
        saveMode = SaveMode.NONE;
    }

    // #732 set all internal components opacity to false in order to allow top level (frame's content pane) background painter to have any effect.
    setOpaque(false);
    CapsLockSupport.getInstance().addPropertyChangeListener("capsLockEnabled", new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (capsOn != null) {
                if (Boolean.TRUE.equals(evt.getNewValue())) {
                    capsOn.setText(UIManagerExt.getString(CLASS_NAME + ".capsOnWarning", getLocale()));
                } else {
                    capsOn.setText(" ");
                }
            }
        }
    });
    initComponents();
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:60,代码来源:JXLoginPane.java

示例2: setPasswordStore

import org.jdesktop.swingx.auth.PasswordStore; //导入依赖的package包/类
/**
 * Sets the <strong>PasswordStore</strong> for this panel.
 *
 * @param store PasswordStore
 */
public void setPasswordStore(PasswordStore store) {
    PasswordStore oldStore = getPasswordStore();
    PasswordStore newStore = store == null ? new NullPasswordStore() : store;

    //newStore is guaranteed to be nonnull
    if (!newStore.equals(oldStore)) {
        passwordStore = newStore;

        firePropertyChange("passwordStore", oldStore, getPasswordStore());
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:17,代码来源:JXLoginPane.java

示例3: JXLoginDialog

import org.jdesktop.swingx.auth.PasswordStore; //导入依赖的package包/类
/**
 * @param service the LoginService to use
 * @param ps the PasswordStore to use
 * @param us the UserNameStore to use
 */
public JXLoginDialog(LoginService service, PasswordStore ps, UserNameStore us) {
    super();
    setTitle(UIManagerExt.getString(
            JXLoginPane.class.getCanonicalName() + ".loginString", getLocale())); 
    setPanel(new JXLoginPane(service, ps, us));
    JXLoginPane.initWindow(this, getPanel());
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:13,代码来源:JXLoginDialog.java

示例4: SimpleNamePanel

import org.jdesktop.swingx.auth.PasswordStore; //导入依赖的package包/类
public SimpleNamePanel(final PasswordStore passwordStore, final JPasswordField passwordField) {
    super("", 15);

    // listen to text input, and offer password suggestion based on current
    // text
    if (passwordStore != null && passwordField!=null) {
	addKeyListener(new KeyAdapter() {
	    @Override
	    public void keyReleased(KeyEvent e) {
		updatePassword(getText(), passwordStore, passwordField);
	    }
	});
    }
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:15,代码来源:JXLoginPane.java

示例5: updatePassword

import org.jdesktop.swingx.auth.PasswordStore; //导入依赖的package包/类
private void updatePassword(final String username, final PasswordStore passwordStore, final JPasswordField passwordField) {
    String password = "";
    if (username != null) {
	char[] pw = passwordStore.get(username, null);
	password = pw == null ? "" : new String(pw);
    }
    
    passwordField.setText(password);
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:10,代码来源:JXLoginPane.java

示例6: showLoginDialog

import org.jdesktop.swingx.auth.PasswordStore; //导入依赖的package包/类
/**
 * Shows a login dialog. This method blocks.
 * @return The status of the login operation
 */
public static Status showLoginDialog(Component parent, LoginService svc, PasswordStore ps, UserNameStore us, List<String> servers) {
    JXLoginPane panel = new JXLoginPane(svc, ps, us, servers);
    return showLoginDialog(parent, panel);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:9,代码来源:JXLoginPane.java

示例7: showLoginFrame

import org.jdesktop.swingx.auth.PasswordStore; //导入依赖的package包/类
/**
 */
public static JXLoginFrame showLoginFrame(LoginService svc, PasswordStore ps, UserNameStore us) {
    return showLoginFrame(svc, ps, us, null);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:6,代码来源:JXLoginPane.java

示例8: JXLoginPane

import org.jdesktop.swingx.auth.PasswordStore; //导入依赖的package包/类
/**
 * Create a {@code JXLoginPane} with the specified {@code LoginService},
 * {@code PasswordStore}, {@code UserNameStore}, and server list.
 * <p>
 * If you do not want to store passwords or user ids, those parameters can
 * be {@code null}. {@code SaveMode} is autoconfigured from passed in store
 * parameters.
 * <p>
 * Setting the server list to {@code null} will unset all of the servers.
 * The server list is guaranteed to be non-{@code null}.
 *
 * @param service
 *            the {@code LoginService} to use for logging in
 * @param passwordStore
 *            the {@code PasswordStore} to use for storing password
 *            information
 * @param userStore
 *            the {@code UserNameStore} to use for storing user information
 * @param servers
 *            a list of servers to authenticate against
 */
public JXLoginPane(LoginService service, PasswordStore passwordStore, UserNameStore userStore, List<String> servers) {
    //init capslock detection support
    if (Boolean.parseBoolean(System.getProperty("swingx.enableCapslockTesting"))) {
        capsOnTest = new CapsOnTest();
        capsOnListener = new KeyEventDispatcher() {
            public boolean dispatchKeyEvent(KeyEvent e) {
                if (e.getID() != KeyEvent.KEY_PRESSED) {
                    return false;
                }
                if (e.getKeyCode() == 20) {
                    setCapsLock(!isCapsLockOn());
                }
                return false;
            }};
        capsOnWinListener = new CapsOnWinListener(capsOnTest);
    } else {
        capsOnTest = null;
        capsOnListener = null;
        capsOnWinListener = null;
        capsLockSupport = false;
    }
    setLoginService(service);
    setPasswordStore(passwordStore);
    setUserNameStore(userStore);
    setServers(servers);


    //create the login and cancel actions, and add them to the action map
    getActionMap().put(LOGIN_ACTION_COMMAND, createLoginAction());
    getActionMap().put(CANCEL_LOGIN_ACTION_COMMAND, createCancelAction());

    //initialize the save mode
    if (passwordStore != null && userStore != null) {
        saveMode = SaveMode.BOTH;
    } else if (passwordStore != null) {
        saveMode = SaveMode.PASSWORD;
    } else if (userStore != null) {
        saveMode = SaveMode.USER_NAME;
    } else {
        saveMode = SaveMode.NONE;
    }

    // #732 set all internal components opacity to false in order to allow top level (frame's content pane) background painter to have any effect.
    setOpaque(false);
    initComponents();
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:68,代码来源:JXLoginPane.java

示例9: getPasswordStore

import org.jdesktop.swingx.auth.PasswordStore; //导入依赖的package包/类
/**
 * Gets the <strong>PasswordStore</strong> for this panel.
 *
 * @return store PasswordStore
 */
public PasswordStore getPasswordStore() {
    return passwordStore;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:9,代码来源:JXLoginPane.java


注:本文中的org.jdesktop.swingx.auth.PasswordStore类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。