• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LoginService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setLoginService

import org.jdesktop.swingx.auth.LoginService; //导入依赖的package包/类
/**
 * Sets the {@code LoginService} for this panel. Setting the login service
 * to {@code null} will actually set the service to use
 * {@code NullLoginService}.
 *
 * @param service
 *            the service to set. If {@code service == null}, then a
 *            {@code NullLoginService} is used.
 */
public void setLoginService(LoginService service) {
    LoginService oldService = getLoginService();
    LoginService newService = service == null ? new NullLoginService() : service;

    //newService is guaranteed to be nonnull
    if (!newService.equals(oldService)) {
        if (oldService != null) {
            oldService.removeLoginListener(getDefaultLoginListener());
        }

        loginService = newService;
        this.loginService.addLoginListener(getDefaultLoginListener());

        firePropertyChange("loginService", oldService, getLoginService());
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:JXLoginPane.java


示例2: interactiveError

import org.jdesktop.swingx.auth.LoginService; //导入依赖的package包/类
/**
 * Issue #636-swingx Unexpected resize on long exception message.
 *
 */
public void interactiveError() {
    JComponent.setDefaultLocale(Locale.FRANCE);
    final JXLoginPane panel = new JXLoginPane(new LoginService() {

                    @Override
                    public boolean authenticate(String name, char[] password,
                                    String server) throws Exception {
                                    throw new Exception("Ex.");
                    }});
    final JXLoginFrame frame = JXLoginPane.showLoginFrame(panel);
    // if uncommented dialog will disappear immediately due to invocation of login action
    //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setJMenuBar(createAndFillMenuBar(panel));
    panel.setErrorMessage("TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO Unexpected resize on long exception message. Unexpected resize on long exception message.");

    panel.setSaveMode(SaveMode.BOTH);

    frame.pack();
    frame.setVisible(true);
    SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                            evaluateChildren(frame.getContentPane().getComponents());
                    }});

}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:30,代码来源:JXLoginPaneVisualCheck.java


示例3: onPreStartup

import org.jdesktop.swingx.auth.LoginService; //导入依赖的package包/类
@Override
 public void onPreStartup()
{
    jxLoginDialog = new JXLoginDialog(new LoginService()
    {
        @Override
        public boolean authenticate(String name, char[] password, String server) throws Exception
        {
            Thread.sleep(2000);
            return true;
        }
    }, null, null);
    jxLoginDialog.getPanel().setServers(Arrays.asList("Server1", "Server2"));
    jxLoginDialog.setModal(true);
    jxLoginDialog.setVisible(true);
    if(jxLoginDialog.getStatus() != JXLoginPane.Status.SUCCEEDED)
    {
        System.exit(1);
    }
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:21,代码来源:DataEditorApplicationLifecycleAdvisor.java


示例4: actionPerformed

import org.jdesktop.swingx.auth.LoginService; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent arg0) {
	// einloggen
	if (officeCtrl.getUser() == null) {
		JXLoginPane loginPanel = new JXLoginPane(new LoginService() {
			@Override
			public boolean authenticate(String user, char[] password,
					String server) throws Exception {
				return officeCtrl.login(user, new String(password));
			}
		});
		JXLoginPane.Status status = JXLoginPane.showLoginDialog(
				MainFrame.this, loginPanel);

		if (status == JXLoginPane.Status.SUCCEEDED) {
			doLogin(true);
		}
		// ausloggen
	} else {
		officeCtrl.logout();
		doLogin(false);
	}

}
 
开发者ID:Qwby,项目名称:YADBA,代码行数:25,代码来源:MainFrame.java


示例5: JXLoginPane

import org.jdesktop.swingx.auth.LoginService; //导入依赖的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


示例6: interactiveBackground

import org.jdesktop.swingx.auth.LoginService; //导入依赖的package包/类
/**
 * Issue #636-swingx Unexpected resize on long exception message.
 *
 */
public void interactiveBackground() {
    JComponent.setDefaultLocale(Locale.FRANCE);
    final JXLoginPane panel = new JXLoginPane(new LoginService() {

                    @Override
                    public boolean authenticate(String name, char[] password,
                                    String server) throws Exception {
                                    throw new Exception("Ex.");
                    }});
    final JXLoginFrame frame = JXLoginPane.showLoginFrame(panel);
    // if uncomented dialog will disappear immediatelly dou to invocation of login action
    //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setJMenuBar(createAndFillMenuBar(panel));
    panel.setErrorMessage("TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO Unexpected resize on long exception message. Unexpected resize on long exception message.");

    panel.setSaveMode(SaveMode.BOTH);
    frame.getContentPane().setBackgroundPainter(new MattePainter(
            new GradientPaint(0, 0, Color.BLUE, 1, 0, Color.YELLOW), true));

    frame.pack();
    frame.setVisible(true);
    SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                            evaluateChildren(frame.getContentPane().getComponents());
                    }});

}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:32,代码来源:JXLoginPaneVisualCheck.java


示例7: interactiveProgress

import org.jdesktop.swingx.auth.LoginService; //导入依赖的package包/类
/**
  * Progress message test.
  */
 public void interactiveProgress() {
     final JXLoginPane panel = new JXLoginPane();
     final JFrame frame = JXLoginPane.showLoginFrame(panel);
     panel.setLoginService(new LoginService() {

@Override
         public boolean authenticate(String name, char[] password,
		String server) throws Exception {
	panel.startLogin();
	Thread.sleep(5000);
	return true;
}});

     frame.setJMenuBar(createAndFillMenuBar(panel));

     panel.setSaveMode(SaveMode.BOTH);

     frame.pack();
     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     frame.setVisible(true);
     SwingUtilities.invokeLater(new Runnable() {
public void run() {
	evaluateChildren(frame.getContentPane().getComponents());
}});

 }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:30,代码来源:JXLoginPaneVisualCheck.java


示例8: JXLoginDialog

import org.jdesktop.swingx.auth.LoginService; //导入依赖的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


示例9: showLoginDialog

import org.jdesktop.swingx.auth.LoginService; //导入依赖的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


示例10: showLoginFrame

import org.jdesktop.swingx.auth.LoginService; //导入依赖的package包/类
/**
 * Shows a login frame. A JFrame is not modal, and thus does not block
 */
public static JXLoginFrame showLoginFrame(LoginService svc) {
    return showLoginFrame(svc, null, null);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:7,代码来源:JXLoginPane.java


示例11: JXLoginPane

import org.jdesktop.swingx.auth.LoginService; //导入依赖的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


示例12: getLoginService

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GzipFilter类代码示例发布时间:2022-05-23
下一篇:
Java Base64Data类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap