Author: yradtsevich
Date: 2012-04-30 07:48:24 -0400 (Mon, 30 Apr 2012)
New Revision: 40632
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/UIUtil.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/resources/ios/stop-selected.png
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/resources/ios/stop.png
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/NativeSkin.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ResizableSkin.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOSNavBarComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-11334 : BrowserSim: provide a more appropriate stop
button
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/resources/ios/stop-selected.png
===================================================================
(Binary files differ)
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/resources/ios/stop.png
===================================================================
(Binary files differ)
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java 2012-04-30
11:46:55 UTC (rev 40631)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java 2012-04-30
11:48:24 UTC (rev 40632)
@@ -588,21 +588,25 @@
@Override
public void goBack() {
browser.back();
+ browser.setFocus();
}
@Override
public void goForward() {
browser.forward();
+ browser.setFocus();
}
@Override
public void goHome() {
browser.setUrl(homeUrl);
+ browser.setFocus();
}
@Override
public void goToAddress(String address) {
browser.setUrl(address);
+ browser.setFocus();
}
@Override
@@ -618,11 +622,13 @@
@Override
public void stop() {
browser.stop();
+ browser.setFocus();
}
@Override
public void refresh() {
browser.refresh();
+ browser.setFocus();
}
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/NativeSkin.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/NativeSkin.java 2012-04-30
11:46:55 UTC (rev 40631)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/NativeSkin.java 2012-04-30
11:48:24 UTC (rev 40632)
@@ -170,6 +170,8 @@
controlHandler.goToAddress(locationText.getText());
}
});
+
+ UIUtil.addSelectTextOnFocusListener(locationText);
}
@Override
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ResizableSkin.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ResizableSkin.java 2012-04-30
11:46:55 UTC (rev 40631)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ResizableSkin.java 2012-04-30
11:48:24 UTC (rev 40632)
@@ -62,8 +62,8 @@
controlHandler.goToAddress(((Text)e.widget).getText());
}
});
+ UIUtil.addSelectTextOnFocusListener(deviceComposite.getUrlText());
-
Listener moveListener = new Listener() {
Point origin;
Point shellOrigin;
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/UIUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/UIUtil.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/UIUtil.java 2012-04-30
11:48:24 UTC (rev 40632)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.browsersim.ui.skin;
+
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class UIUtil {
+ public static void addSelectTextOnFocusListener(final Text targetText) {
+ targetText.addFocusListener(new FocusAdapter() {
+ @Override
+ public void focusGained(FocusEvent e) {
+ e.display.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (!targetText.isDisposed()) {
+ targetText.selectAll();
+ }
+ }
+ });
+ }
+ });
+ }
+}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOSNavBarComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOSNavBarComposite.java 2012-04-30
11:46:55 UTC (rev 40631)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOSNavBarComposite.java 2012-04-30
11:48:24 UTC (rev 40632)
@@ -43,11 +43,11 @@
formData.bottom = new FormAttachment(0, 26);
formData.height = 27;
pageTitleStyledText.setLayoutData(formData);
+
urlText = new Text(this, SWT.SINGLE);
-
formData = new FormData();
formData.left = new FormAttachment(0, 12);
- formData.right = new FormAttachment(100, -62);
+ formData.right = new FormAttachment(100, -58);
formData.top = new FormAttachment(0, 33);
formData.bottom = new FormAttachment(100, -8);
urlText.setLayoutData(formData);
@@ -65,7 +65,7 @@
formData = new FormData();
Rectangle stopImageBounds = imageList.getImage(BD + "stop.png").getBounds();
formData.right = new FormAttachment(100, -42);
- formData.bottom = new FormAttachment(100, -11);
+ formData.bottom = new FormAttachment(100, -12);
formData.width = stopImageBounds.width;
formData.height = stopImageBounds.height;
stopButtonComposite.setLayoutData(formData);