本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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(".", "*");
}
示例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);
}
示例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);
}
示例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;
}
示例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 ) );
}
示例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;
}