當前位置: 首頁>>代碼示例>>Java>>正文


Java SWT.PASSWORD屬性代碼示例

本文整理匯總了Java中org.eclipse.swt.SWT.PASSWORD屬性的典型用法代碼示例。如果您正苦於以下問題:Java SWT.PASSWORD屬性的具體用法?Java SWT.PASSWORD怎麽用?Java SWT.PASSWORD使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.swt.SWT的用法示例。


在下文中一共展示了SWT.PASSWORD屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDialogArea

@Override
protected Control createDialogArea(Composite parent) {
  Composite container = (Composite) super.createDialogArea(parent);
  GridLayout layout = new GridLayout(2, false);
  layout.marginRight = 5;
  layout.marginLeft = 10;
  container.setLayout(layout);

  Label lblUser = new Label(container, SWT.NONE);
  lblUser.setText("User:");

  txtUser = new Text(container, SWT.BORDER);
  txtUser.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
  txtUser.setText(user);

  Label lblPassword = new Label(container, SWT.NONE);
  GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
  gd_lblNewLabel.horizontalIndent = 1;
  lblPassword.setLayoutData(gd_lblNewLabel);
  lblPassword.setText("Password:");

  txtPassword = new Text(container, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD);
  txtPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
  txtPassword.setText(password);
  return container;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:26,代碼來源:PasswordDialog.java

示例2: createDialogArea

@Override
protected Control createDialogArea( Composite parent ) {
  Composite comp = (Composite) super.createDialogArea( parent );

  GridLayout layout = (GridLayout) comp.getLayout();
  layout.numColumns = 2;

  Label usernameLabel = new Label( comp, SWT.RIGHT );
  usernameLabel.setText( "Username: " );
  usernameText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  usernameText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );

  Label passwordLabel = new Label( comp, SWT.RIGHT );
  passwordLabel.setText( "Password: " );
  passwordText = new Text( comp, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD );
  passwordText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );

  return comp;
}
 
開發者ID:HiromuHota,項目名稱:pdi-git-plugin,代碼行數:19,代碼來源:UsernamePasswordDialog.java

示例3: updateContents

@Override
protected void updateContents(Object value) {
	Label labelCtrl = getDefaultLabel();
	if (labelCtrl == null)
		return;
	 String text = "";//$NON-NLS-1$
	 if (value != null) {
		 boolean isMasked = (getStyle() & SWT.PASSWORD) == 0;
		 String regexp = value instanceof String ? ".":"[^\\[\\]\\,]";
		 text = value.toString();
		 text = isMasked ? text:text.replaceAll(regexp, "*");
	 }
	 labelCtrl.setText(text);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:14,代碼來源:AbstractDialogCellEditor.java

示例4: getColumnText

public String getColumnText(Object element, int columnIndex) {
	
	if (element instanceof Item) {
		element = ((Item) element).getData();
	}
	
	ArrayEditorRow row = (ArrayEditorRow) element;
	Object object = row.getValue(columnIndex);
	String text = object.toString();
	return (style & SWT.PASSWORD) == 0 ? text:text.replaceAll(".", "*");
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:11,代碼來源:ArrayEditorLabelProvider.java

示例5: createConvertigoGroup

/**
 * This method initializes convertigoGroup	
 *
 */
private void createConvertigoGroup() {
	convertigoGroup = new Group(this, SWT.FILL);
	convertigoGroup.setLayout(new GridLayout());
	convertigoGroup.setText("Convertigo server login");
	
	GridData gridData2 = new GridData();
	gridData2.horizontalAlignment = GridData.FILL;
	gridData2.verticalAlignment = GridData.FILL;
	gridData2.grabExcessHorizontalSpace = true;
	gridData2.verticalIndent = 10;
	convertigoGroup.setLayoutData(gridData2);
	
	GridData gridData3 = new GridData();
	gridData3.horizontalAlignment = GridData.FILL;
	gridData3.verticalAlignment = GridData.CENTER;
	gridData3.grabExcessHorizontalSpace = true;
	convertigoAdminLabel = new Label(convertigoGroup, SWT.NONE);
	convertigoAdminLabel.setText("Server administrator");
	convertigoAdmin = new Text(convertigoGroup, SWT.BORDER);
	convertigoAdmin.setLayoutData(gridData3);
	
	GridData gridData5 = new GridData();
	gridData5.horizontalAlignment = GridData.FILL;
	gridData5.verticalAlignment = GridData.CENTER;
	gridData5.grabExcessHorizontalSpace = true;
	convertigoAdminPassword = new Label(convertigoGroup, SWT.NONE);
	convertigoAdminPassword.setText("Password");
	convertigoPassword = new Text(convertigoGroup, SWT.BORDER | SWT.PASSWORD);
	convertigoPassword.setLayoutData(gridData5);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:34,代碼來源:ProjectDeployDialogComposite.java

示例6: createUITextPassword

/**
 * 
 */
private void createUITextPassword() {
	// Create the text widget
	int style = SWT.PASSWORD | SWT.BORDER;
	fTextPassword = new Text(fCompositeLogin, style);
	// Configure layout data
	GridData data = new GridData(SWT.NONE, SWT.NONE, false, false);
	data.widthHint = F_TEXT_WIDTH_HINT;
	data.horizontalSpan = 2;
	fTextPassword.setLayoutData(data);		
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:13,代碼來源:InteractiveSplashHandler.java

示例7: createDialogArea

/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	
	getShell().setText("Credentials Required");
	
	Composite container = (Composite) super.createDialogArea(parent);
	container.getLayout();

	
	Composite composite = new Composite(container, SWT.NONE);
	composite.setLayout(new GridLayout(4, false));
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	new Label(composite, SWT.NONE);
	new Label(composite, SWT.NONE);
	new Label(composite, SWT.NONE);
	new Label(composite, SWT.NONE);
	new Label(composite, SWT.NONE);
	
	Label lblUserName = new Label(composite, SWT.NONE);
	lblUserName.setText("User Name");
	new Label(composite, SWT.NONE);
	
	username = new Text(composite, SWT.BORDER);
	username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	new Label(composite, SWT.NONE);
	
	Label lblPassword = new Label(composite, SWT.NONE);
	lblPassword.setText("Password");
	new Label(composite, SWT.NONE);
	
	password = new Text(composite, SWT.PASSWORD|SWT.BORDER);
	password.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	
	createErrorComposite(container);

	return container;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:41,代碼來源:HiveInputExtractMetaStoreDialog.java

示例8: createInput

@Override
protected void createInput ( final DataBindingContext dbc, final Label label, final Composite composite )
{
    this.input = new Text ( composite, SWT.PASSWORD | SWT.BORDER );
    this.input.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:6,代碼來源:PasswordWidgetFactory.java

示例9: addBasicAuthenticationComposite

/**
 * @param container
 * @return
 */
private Control addBasicAuthenticationComposite(Composite container) {
	Composite basicAuthComposite = new Composite(container, SWT.BORDER);
	basicAuthComposite.setLayout(new GridLayout(2, false));
	basicAuthComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	
	String label1Text = null;
	String label2Text = null;
	int textStyle = 0;
	if(StringUtils.equalsIgnoreCase(protocolText, "AWS S3 HTTPS")){
		label1Text = "Access Key ID";
		label2Text = "Secret Access Key";
		textStyle = SWT.BORDER;
	}else{
		label1Text = "User ID";
		label2Text = "Password";
		textStyle = SWT.PASSWORD | SWT.BORDER;
	}
	
	FTPWidgetUtility ftpWidgetUtility = new FTPWidgetUtility();
	Label label1 = (Label) ftpWidgetUtility.createLabel(basicAuthComposite, label1Text);
	setPropertyHelpText(label1, "Used to provide the value for authentication");
	text1 = (Text) ftpWidgetUtility.createText(basicAuthComposite, "", SWT.BORDER);
	Utils.INSTANCE.addMouseMoveListener(text1, cursor);	
	
	Label label2 = (Label) ftpWidgetUtility.createLabel(basicAuthComposite, label2Text);
	setPropertyHelpText(label2, "Used to provide the value for authentication");
	text2 = (Text) ftpWidgetUtility.createText(basicAuthComposite, "", textStyle);
	Utils.INSTANCE.addMouseMoveListener(text2, cursor);	
	
	ControlDecoration text1ControlDecoration = WidgetUtility.addDecorator(text1,Messages.EMPTYFIELDMESSAGE);
	ControlDecoration text2ControlDecoration = WidgetUtility.addDecorator(text2,Messages.EMPTYFIELDMESSAGE);
	
	FTPWidgetUtility widgetUtility = new FTPWidgetUtility();
	widgetUtility.validateWidgetText(text1, propertyDialogButtonBar, cursor, text1ControlDecoration);
	widgetUtility.validateEmptyWidgetText(text2, propertyDialogButtonBar, cursor, text2ControlDecoration);
	
	addModifyListener(text1);
	addModifyListener(text2);
	
	return basicAuthComposite;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:45,代碼來源:FTPAuthenticEditorDialog.java


注:本文中的org.eclipse.swt.SWT.PASSWORD屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。