| Summary: | SWT.PASSWORD Allows Copy/Paste of Text Value | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Daniel Johnson <danijoh2> | ||||||||||
| Component: | SWT | Assignee: | Scott Kovatch <skovatch> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | Felipe Heidrich <eclipse.felipe> | ||||||||||
| Severity: | critical | ||||||||||||
| Priority: | P1 | CC: | gheorghe, nmehrega, pwebster, skovatch | ||||||||||
| Version: | 3.6.1 | Flags: | eclipse.felipe:
review+
gheorghe: review+ |
||||||||||
| Target Milestone: | 3.7 M6 | ||||||||||||
| Hardware: | Macintosh | ||||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Daniel Johnson
It looks like this is only in Carbon, correct? I can't reproduce it with 3.7 HEAD of Cocoa. I consider this a serious bug, and not something a developer should have to worry about. I am running 10.6.6. I haven't tried 3.7 HEAD. If I have time I will try to give it a shot. Jar in question: org.eclipse.swt.cocoa.macosx.x86_64_3.6.1.v3655c.jar
code snippet:
This is a sample createSection method from extending org.eclipse.wst.server.ui.editor.ServerEditorSection
public void createSection(Composite parent) {
super.createSection(parent);
FormToolkit toolkit = getFormToolkit(parent.getDisplay());
Section section = toolkit.createSection(parent, Section.TWISTIE | Section.EXPANDED);
section.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
Composite comp = toolkit.createComposite(section);
toolkit.createText(comp, "", SWT.PASSWORD | SWT.SINGLE | SWT.BORDER);
}
Actually, this snippet will reproduce it in 3.6.1 and 3.7: /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.swt.snippets; /* * Button example snippet: set the default button * * For a list of all SWT example snippets see * http://www.eclipse.org/swt/snippets/ */ import org.eclipse.swt.*; import org.eclipse.swt.widgets.*; import org.eclipse.swt.events.*; import org.eclipse.swt.layout.*; public class PasswordCopyTest { public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); Label label = new Label (shell, SWT.NONE); label.setText ("Enter your password:"); final Text text = new Text (shell, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD); text.setLayoutData (new RowData (100, SWT.DEFAULT)); Button copy = new Button (shell, SWT.PUSH); copy.setText ("Copy"); copy.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { text.selectAll(); text.copy(); } }); Button cut = new Button (shell, SWT.PUSH); cut.setText ("Cut"); cut.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { text.selectAll(); text.cut(); } }); shell.setDefaultButton (cut); shell.setLayout (new RowLayout ()); shell.pack (); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } } Created attachment 187888 [details]
Fix for HEAD
Fix based on HEAD from 1/28/11. This should go into the 3.6 stream, too.
Created attachment 187892 [details]
Fix for 3.6.2
Essentially the same patch for 3.6 branch.
Created attachment 187893 [details] Carbon fix Carbon has the same bug for cut(). copy() was taken care of in bug 243012. Created attachment 187894 [details]
Carbon fix for 3.6.2
Same patch as Carbon HEAD.
Scott, if you could get this out today that would be great. I'd like to do a 3.6.2 build submission tonight. Thanks! Thanks, guys! Fixed in Carbon and Cocoa for R_3_6_maintenance and HEAD > 20110131. |