diff options
author | Stephanie-Cao | 2017-10-20 14:33:48 +0000 |
---|---|---|
committer | Stephanie-Cao | 2017-10-20 14:33:48 +0000 |
commit | ab71cda1c595ece533e9b4fc846c963e4aa11d57 (patch) | |
tree | 915aa9c2b6a2b36ea8410b797f8a13d1d37c7bf0 | |
parent | 9d57bc9e27215b7604d699acb0eec5435386210a (diff) | |
download | webtools.servertools-ab71cda1c595ece533e9b4fc846c963e4aa11d57.tar.gz webtools.servertools-ab71cda1c595ece533e9b4fc846c963e4aa11d57.tar.xz webtools.servertools-ab71cda1c595ece533e9b4fc846c963e4aa11d57.zip |
[383289]Server Editor possible to copy password from password field
Signed-off-by: Stephanie-Cao <stephanie.cao@ibm.com>
-rw-r--r-- | plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/TextAction.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/TextAction.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/TextAction.java index fad866056..41c680288 100644 --- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/TextAction.java +++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/TextAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 2017 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 @@ -12,6 +12,7 @@ package org.eclipse.wst.server.ui.internal.editor; import org.eclipse.jface.action.Action; import org.eclipse.wst.server.ui.internal.Trace; +import org.eclipse.swt.SWT; import org.eclipse.swt.SWTError; import org.eclipse.swt.dnd.Clipboard; import org.eclipse.swt.dnd.TextTransfer; @@ -112,6 +113,15 @@ public class TextAction extends Action { */ public void copy() { Point selection = getControlSelection(); + Control control = getControl(); + if (control == null) + return; + + if (control instanceof Text) { + Text textcontrol = (Text) control; + if ((textcontrol.getStyle() & SWT.PASSWORD) != 0) return; + } + String text = getControlText(); if (selection == null || text == null) return; @@ -139,6 +149,15 @@ public class TextAction extends Action { if (selection == null) return; + Control control = getControl(); + if (control == null) + return; + + if (control instanceof Text) { + Text textcontrol = (Text) control; + if ((textcontrol.getStyle() & SWT.PASSWORD) != 0) return; + } + if (selection.y > selection.x) { copy(); delete(); @@ -245,4 +264,4 @@ public class TextAction extends Action { } } } -}
\ No newline at end of file +} |