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


Java UserCredential类代码示例

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


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

示例1: PasswordDialog

import com.rapidminer.gui.security.UserCredential; //导入依赖的package包/类
private PasswordDialog(Window owner, String i18nKey, UserCredential preset, Object... args) {
	super(owner, i18nKey, ModalityType.APPLICATION_MODAL, args);
	setModal(true);
	if (preset != null && preset.getUsername() != null) {
		usernameField.setText(preset.getUsername());
	}
	if (preset != null && preset.getPassword() != null) {
		passwordField.setText(new String(preset.getPassword()));
		rememberBox.setSelected(true);
	}
	String url = preset != null ? preset.getURL() : null;

	JPanel main = new JPanel(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.BOTH;
	c.anchor = GridBagConstraints.FIRST_LINE_START;
	c.insets = new Insets(4, 4, 4, 4);

	JLabel label = new ResourceLabel("authentication.username", url);
	label.setLabelFor(usernameField);
	c.gridwidth = GridBagConstraints.RELATIVE;
	main.add(label, c);
	c.gridwidth = GridBagConstraints.REMAINDER;
	main.add(usernameField, c);

	label = new ResourceLabel("authentication.password", url);
	label.setLabelFor(passwordField);
	c.gridwidth = GridBagConstraints.RELATIVE;
	main.add(label, c);
	c.gridwidth = GridBagConstraints.REMAINDER;
	main.add(passwordField, c);

	main.add(rememberBox, c);

	layoutDefault(main, makeOkButton(), makeCancelButton());

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:38,代码来源:PasswordDialog.java

示例2: showCard

import com.rapidminer.gui.security.UserCredential; //导入依赖的package包/类
public void showCard() {
    String errorMessage = (String)this.getContainer().getSharedObject("com.rapidminer.onboarding.error");
    if(errorMessage != null) {
        this.showError(errorMessage);
    }

    UserCredential credentials = Wallet.getInstance().getEntry("RapidMiner.com account", "https://my.rapidminer.com");
    if(credentials != null) {
        this.tfEmail.setText(credentials.getUsername());
        this.tfPassword.setText(credentials.getPassword() != null?new String(credentials.getPassword()):null);
    }

    this.tfEmail.requestFocusInWindow();
    this.getContainer().getRootPane().setDefaultButton(this.btLogin);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:16,代码来源:ConnectToServiceCard.java

示例3: makeRepository

import com.rapidminer.gui.security.UserCredential; //导入依赖的package包/类
@Override
public void makeRepository() throws RepositoryException {
	final URL url;
	try {
		url = new URL(urlField.getText());
	} catch (MalformedURLException e) {
		SwingTools.showSimpleErrorMessage("illegal_url", e);
		return;
	}
	String alias = aliasField.getText().trim();
	if (alias.length() == 0) {
		alias = url.toString();
	}
	final String finalAlias = alias;
	
	checkConfiguration(alias);

	ProgressThread pt = new ProgressThread("add_repository") {

		@Override
		public void run() {
			getProgressListener().setTotal(100);
			getProgressListener().setCompleted(10);
			Repository repository = new RemoteRepository(url, finalAlias, userField.getText(), passwordField.getPassword(), false);
			getProgressListener().setCompleted(90);
			RepositoryManager.getInstance(null).addRepository(repository);
			UserCredential authenticationCredentials = new UserCredential(urlField.getText(), userField.getText(), passwordField.getPassword());
			// use alias as ID to store credentials
			Wallet.getInstance().registerCredentials(finalAlias, authenticationCredentials);
			Wallet.getInstance().saveCache();
			getProgressListener().setCompleted(100);
			getProgressListener().complete();
		}
	};
	pt.start();
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:37,代码来源:RemoteRepositoryPanel.java

示例4: configureUIElementsFrom

import com.rapidminer.gui.security.UserCredential; //导入依赖的package包/类
@Override
public void configureUIElementsFrom(Repository remote) {
	aliasField.setText(((RemoteRepository) remote).getAlias());
	urlField.setText(((RemoteRepository) remote).getBaseUrl().toString());
	userField.setText(((RemoteRepository) remote).getUsername());
	UserCredential credentials = Wallet.getInstance().getEntry(aliasField.getText(), urlField.getText());
	if (credentials != null) {
		passwordField.setText(new String(credentials.getPassword()));
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:11,代码来源:RemoteRepositoryPanel.java

示例5: PasswordDialog

import com.rapidminer.gui.security.UserCredential; //导入依赖的package包/类
private PasswordDialog(String i18nKey, UserCredential preset, Object... args) {
	super(i18nKey, args);
	setModal(true);
	if ((preset != null) && (preset.getPassword() != null)) {
		usernameField.setText(preset.getUsername());
	}
	if ((preset != null) && (preset.getPassword() != null)) {
		passwordField.setText(new String(preset.getPassword()));
		rememberBox.setSelected(true);
	}
	String url = (preset != null) ? preset.getURL() : null;

	JPanel main = new JPanel(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.BOTH;
	c.anchor = GridBagConstraints.FIRST_LINE_START;
	c.insets = new Insets(4, 4, 4, 4);

	JLabel label = new ResourceLabel("authentication.username", url);
	label.setLabelFor(usernameField);
	c.gridwidth = GridBagConstraints.RELATIVE;
	main.add(label, c);
	c.gridwidth = GridBagConstraints.REMAINDER;
	main.add(usernameField, c);

	label = new ResourceLabel("authentication.password", url);
	label.setLabelFor(passwordField);
	c.gridwidth = GridBagConstraints.RELATIVE;
	main.add(label, c);
	c.gridwidth = GridBagConstraints.REMAINDER;
	main.add(passwordField, c);

	main.add(rememberBox, c);

	layoutDefault(main, makeOkButton(), makeCancelButton());

}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:38,代码来源:PasswordDialog.java

示例6: run

import com.rapidminer.gui.security.UserCredential; //导入依赖的package包/类
public void run() {
    try {
        String e = (String)EmailVerificationCard.this.onboarding.getSharedObject("com.rapidminer.onboarding.user");
        char[] password = (char[])((char[])EmailVerificationCard.this.onboarding.getSharedObject("com.rapidminer.onboarding.password"));
        NexusConnectionManager.INSTANCE.installAvailableLicenses(new UserCredential("", e, password));
        final License activeLicense = ProductConstraintManager.INSTANCE.getActiveLicense();
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                EmailVerificationCard.this.getContainer().putSharedObject("com.rapidminer.onboarding.license.owner", activeLicense.getLicenseUser().getName());
                EmailVerificationCard.this.getContainer().putSharedObject("com.rapidminer.onboarding.license.edition", LicenseTools.translateProductEdition(activeLicense));
                EmailVerificationCard.this.getContainer().putSharedObject("com.rapidminer.onboarding.license.expiration", activeLicense.getExpirationDate() != null?df.format(activeLicense.getExpirationDate()):I18N.getGUILabel("license.no_end_date", new Object[0]));
                if(activeLicense.getProductEdition().equals("trial")) {
                    EmailVerificationCard.this.getContainer().putSharedObject("com.rapidminer.onboarding.license.additional_info", ActivationSuccessfulCard.getRemaingTrialDaysMessage(activeLicense));
                    EmailVerificationCard.this.getContainer().showActivationSuccessfulCard();
                } else {
                    EmailVerificationCard.this.getContainer().showActivationSuccessfulCard();
                }

                EmailVerificationCard.this.connecting(false);
            }
        });
    } catch (final NexusCommunicationException var4) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                EmailVerificationCard.this.connecting(false);
                EmailVerificationCard.this.showError(NexusUtilities.translateApplicationStatusCode(var4.getApplicationStatusCode()));
                EmailVerificationCard.this.showMessage((String)null);
                LogService.getRoot().log(Level.WARNING, "Could not fetch license information: " + var4.getMessage());
            }
        });
    } catch (final IOException var5) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                EmailVerificationCard.this.connecting(false);
                EmailVerificationCard.this.showError(I18N.getGUILabel("nexus.connection_error", new Object[0]));
                EmailVerificationCard.this.showMessage((String)null);
                LogService.getRoot().log(Level.WARNING, "Could not fetch license information: " + var5.getMessage());
            }
        });
    }

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:44,代码来源:EmailVerificationCard.java


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