Author: yradtsevich
Date: 2012-05-16 07:35:54 -0400 (Wed, 16 May 2012)
New Revision: 41057
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/PlatformUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/WebKitBrowserFactory.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86_64.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_webkit_cocoa_macos.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_win32_win32_x86.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/actions/RunBrowserSimAction.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/callbacks/OpenFileCallback.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/callbacks/ViewSourceCallback.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/util/BrowserSimLauncher.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/model/DevicesListStorage.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/model/SkinMap.java
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/CustomMessageBox.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/EditDeviceDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/ExceptionNotifier.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/ManageDevicesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/Messages.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/SizeWarningDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/messages.properties
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.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/android/AndroidNavBarComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidResizableSkin.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidTimeComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone4ResizableSkin.java
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/IOSPageTitleStyledText.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOsTimeComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/util/ResourcesUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-11739 : browsersim does not set the right height if
monitor has lower resolution - should handle/warn about it
https://issues.jboss.org/browse/JBIDE-11863 : BrowserSim: convert Devices dialog to
Preferences dialog
- dialog conversion
- strings i18n
- added non-nls comments/annotations
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/model/DevicesListStorage.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/model/DevicesListStorage.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/model/DevicesListStorage.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -28,6 +28,7 @@
/**
* @author Yahor Radtsevich (yradtsevich)
*/
+@SuppressWarnings("nls")
public class DevicesListStorage {
private static final String DEFAULT_PREFERENCES_RESOURCE =
"config/devices.cfg";
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/model/SkinMap.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/model/SkinMap.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/model/SkinMap.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -18,9 +18,9 @@
private SkinMap(){
map = new HashMap<String, Class<? extends BrowserSimSkin>>();
- map.put("iPhone 3", AppleIPhone3ResizableSkin.class);
- map.put("iPhone 4", AppleIPhone4ResizableSkin.class);
- map.put("Android", AndroidResizableSkin.class);
+ map.put(AppleIPhone3ResizableSkin.IPHONE3_SKIN_ID, AppleIPhone3ResizableSkin.class);
+ map.put(AppleIPhone4ResizableSkin.IPHONE4_SKIN_ID, AppleIPhone4ResizableSkin.class);
+ map.put(AndroidResizableSkin.ANDROID_SKIN_ID, AndroidResizableSkin.class);
}
public static SkinMap getInstance() {
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-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/BrowserSim.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -60,7 +60,6 @@
import org.jboss.tools.vpe.browsersim.ui.skin.BrowserSimSkin;
import org.jboss.tools.vpe.browsersim.ui.skin.ResizableSkinSizeAdvisor;
import org.jboss.tools.vpe.browsersim.util.ResourcesUtil;
-import org.w3c.dom.DOMConfiguration;
/**
* @author Yahor Radtsevich (yradtsevich)
@@ -68,11 +67,11 @@
public class BrowserSim {
private static final String DEFAULT_URL = "about:blank";
//"http://www.w3schools.com/js/tryit_view.asp?filename=try_nav_useragent";
//$NON-NLS-1$
private static final String[] BROWSERSIM_ICONS = {"icons/browsersim_16px.png",
"icons/browsersim_32px.png", "icons/browsersim_64px.png",
"icons/browsersim_128px.png", "icons/browsersim_256px.png", };
//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$
- private static final String BROWSERSIM_CLASS_NAME =
"org.jboss.tools.vpe.browsersim.ui.BrowserSim";
+ private static final String BROWSERSIM_CLASS_NAME =
"org.jboss.tools.vpe.browsersim.ui.BrowserSim"; //$NON-NLS-1$
/** @see org.jboss.tools.vpe.browsersim.eclipse.callbacks.OpenFileCallback */
- private static final String OPEN_FILE_COMMAND = BROWSERSIM_CLASS_NAME +
".command.openFile:";
+ private static final String OPEN_FILE_COMMAND = BROWSERSIM_CLASS_NAME +
".command.openFile:"; //$NON-NLS-1$
/** @see org.jboss.tools.vpe.browsersim.eclipse.callbacks.ViewSourceCallback */
- private static final String VIEW_SOURCE_COMMAND = BROWSERSIM_CLASS_NAME +
".command.viewSource:";
+ private static final String VIEW_SOURCE_COMMAND = BROWSERSIM_CLASS_NAME +
".command.viewSource:"; //$NON-NLS-1$
private Display display;
private String homeUrl;
@@ -231,6 +230,7 @@
browser.addLocationListener(new LocationListener() {
private BrowserFunction scrollListener = null;
+ @SuppressWarnings("nls")
public void changed(LocationEvent event) {
if (scrollListener != null) {
scrollListener.dispose();
@@ -335,7 +335,7 @@
addDevicesListForMenu(devicesListHolder.getDevicesList(), devicesMenu);
MenuItem manageDevicesMenuItem = new MenuItem(devicesMenu, SWT.PUSH);
- manageDevicesMenuItem.setText(Messages.BrowserSim_MORE);
+ manageDevicesMenuItem.setText(Messages.BrowserSim_PREFERENCES);
manageDevicesMenuItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
DevicesList newDevicesList = new ManageDevicesDialog(e.display.getActiveShell(),
SWT.APPLICATION_MODAL | SWT.SHELL_TRIM,
@@ -348,7 +348,7 @@
});
MenuItem useSkinsMenuItem = new MenuItem(devicesMenu, SWT.CHECK);
- useSkinsMenuItem.setText("Use Skins");
+ useSkinsMenuItem.setText(Messages.BrowserSim_USE_SKINS);
useSkinsMenuItem.setSelection(devicesListHolder.getDevicesList().getUseSkins());
useSkinsMenuItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -413,7 +413,7 @@
openInDefaultBrowser.setText(Messages.BrowserSim_VIEW_PAGE_SOURCE);
openInDefaultBrowser.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- if (skin.getBrowser().getUrl().startsWith("file:")) {
+ if (skin.getBrowser().getUrl().startsWith("file:")) { //$NON-NLS-1$
URI uri = null;
try {
uri = new URI(skin.getBrowser().getUrl());
@@ -515,11 +515,13 @@
return SkinMap.getInstance().getSkinClass(useSkins ? device.getSkinId() : null);
}
+ @SuppressWarnings("nls")
private void initOrientation(int orientation) {
skin.getBrowser().execute("window.onorientationchange = null;"
+ "window.orientation = " + orientation + ";");
}
+ @SuppressWarnings("nls")
private void fireOrientationChangeEvent(int orientation, Point browserSize) {
Rectangle clientArea = getMonitorClientArea();
skin.setOrientationAndSize(orientation, browserSize, getSizeAdvisor());
@@ -646,7 +648,10 @@
boolean truncateWindow = false;
if (devicesList.getTruncateWindow() == null) {
if (prefferedShellSize.x > clientArea.width || prefferedShellSize.y >
clientArea.height) {
- SizeWarningDialog dialog = new SizeWarningDialog(skin.getShell(), new
Point(clientArea.width, clientArea.height), prefferedShellSize, "[TODO]",
+ String deviceName =
devicesList.getDevices().get(devicesList.getSelectedDeviceIndex()).getName();
+
+ SizeWarningDialog dialog = new SizeWarningDialog(skin.getShell(), new
Point(clientArea.width, clientArea.height),
+ prefferedShellSize, deviceName,
orientation == DeviceOrientation.PORTRAIT || orientation ==
DeviceOrientation.PORTRAIT_INVERTED);
dialog.open();
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/CustomMessageBox.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/CustomMessageBox.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/CustomMessageBox.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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;
import org.eclipse.swt.SWT;
@@ -12,6 +22,9 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
class CustomMessageBox extends Dialog {
private Shell shell;
private Composite messageComposite;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/EditDeviceDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/EditDeviceDialog.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/EditDeviceDialog.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -169,8 +169,8 @@
buttonOk.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
resultDevice = new Device(textName.getText(),
- checkButtonWidth.getSelection() ? Integer.valueOf("0" +
textWidth.getText()) : Device.DEFAULT_SIZE,
- checkButtonHeight.getSelection() ? Integer.valueOf("0" +
textHeight.getText()) : Device.DEFAULT_SIZE,
+ checkButtonWidth.getSelection() ? Integer.valueOf("0" +
textWidth.getText()) : Device.DEFAULT_SIZE, //$NON-NLS-1$
+ checkButtonHeight.getSelection() ? Integer.valueOf("0" +
textHeight.getText()) : Device.DEFAULT_SIZE, //$NON-NLS-1$
checkButtonUserAgent.getSelection() ? textUserAgent.getText() : null,
comboSkin.getSelectionIndex() == 0 ? null :
skinIds.get(comboSkin.getSelectionIndex()));
shell.close();
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/ExceptionNotifier.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/ExceptionNotifier.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/ExceptionNotifier.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -41,7 +41,7 @@
message = Messages.ExceptionNotifier_ONLY_32_BIT_ECLIPSE_IS_SUPPORTED_ON_WINDOWS;
} else if (PlatformUtil.OS_WIN32.equals(os) &&
PlatformUtil.ARCH_X86.equals(arch) // Eclipse 32-bit on Windows and
&& error.getMessage() != null // Apple Application Support is not
installed
- && error.getMessage().contains("Safari must be installed to use a
SWT.WEBKIT-style Browser")) {
+ && error.getMessage().contains("Safari must be installed to use a
SWT.WEBKIT-style Browser")) { //$NON-NLS-1$
message = Messages.ExceptionNotifier_APPLE_APPLICATION_SUPPORT_IS_NOT_FOUND;
} else if (PlatformUtil.OS_LINUX.equals(os) && error.getMessage() != null) {
// Linux - probably WebKitGTK is not installed
message =
MessageFormat.format(Messages.ExceptionNotifier_BROWSERSIM_IS_FAILED_TO_START_ON_LINUX,
error.getMessage());
@@ -82,7 +82,7 @@
public ErrorMessageBoxWithLinks(Shell parent) {
super(parent, parent.getDisplay().getSystemImage(SWT.ICON_ERROR));
- message = "";
+ message = ""; //$NON-NLS-1$
}
@Override
@@ -99,7 +99,7 @@
});
Button ok = new Button(getButtonsComposite(), SWT.PUSH);
- ok.setText("OK");
+ ok.setText(Messages.ExceptionNotifier_OK);
ok.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/ManageDevicesDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/ManageDevicesDialog.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/ManageDevicesDialog.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2011 Red Hat, Inc.
+ * 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,
@@ -19,7 +19,6 @@
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
@@ -61,7 +60,7 @@
*/
public ManageDevicesDialog(Shell parent, int style, DevicesList oldDevicesList) {
super(parent, style);
- setText(Messages.ManageDevicesDialog_DEVICES);
+ setText(Messages.ManageDevicesDialog_PREFERENCES);
this.oldDevicesList = oldDevicesList;
this.devices = new ArrayList<Device>(oldDevicesList.getDevices());
this.selectedDeviceIndex = oldDevicesList.getSelectedDeviceIndex();
@@ -96,7 +95,7 @@
shell.setLayout(new GridLayout(1, false));
Group devicesGroup = new Group(shell, SWT.NONE);
- devicesGroup.setText("Devices");
+ devicesGroup.setText(Messages.ManageDevicesDialog_DEVICES);
devicesGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
devicesGroup.setLayout(new GridLayout(2, false));
@@ -191,9 +190,9 @@
Group useSkinsGroup = new Group(shell, SWT.NONE);
useSkinsGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
useSkinsGroup.setLayout(new RowLayout(SWT.VERTICAL));
- useSkinsGroup.setText("Skins options");
+ useSkinsGroup.setText(Messages.ManageDevicesDialog_SKINS_OPTIONS);
useSkinsCheckbox = new Button(useSkinsGroup, SWT.CHECK);
- useSkinsCheckbox.setText("Use skins");
+ useSkinsCheckbox.setText(Messages.ManageDevicesDialog_USE_SKINS);
useSkinsCheckbox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -204,18 +203,18 @@
Group truncateWindowGroup = new Group(shell, SWT.NONE);
truncateWindowGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2,
1));
- truncateWindowGroup.setText("Truncate the browser window when it does not fit
display");
+ truncateWindowGroup.setText(Messages.ManageDevicesDialog_TRUNCATE_THE_DEVICE_WINDOW);
truncateWindowGroup.setLayout(new RowLayout(SWT.HORIZONTAL));
alwaysTruncateRadio = new Button(truncateWindowGroup, SWT.RADIO);
- alwaysTruncateRadio.setText("Always truncate");
+ alwaysTruncateRadio.setText(Messages.ManageDevicesDialog_ALWAYS_TRUNCATE);
neverTruncateRadio = new Button(truncateWindowGroup, SWT.RADIO);
- neverTruncateRadio.setText("Never truncate");
+ neverTruncateRadio.setText(Messages.ManageDevicesDialog_NEVER_TRUNCATE);
askBeforeTruncateRadio = new Button(truncateWindowGroup, SWT.RADIO);
- askBeforeTruncateRadio.setText("Prompt");
+ askBeforeTruncateRadio.setText(Messages.ManageDevicesDialog_PROMPT);
SelectionListener truncateSelectionListener = new SelectionAdapter() {
@Override
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/Messages.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/Messages.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/Messages.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2011 Red Hat, Inc.
+ * 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,
@@ -24,10 +24,11 @@
public static String BrowserSim_ERROR;
public static String BrowserSim_EXIT;
public static String BrowserSim_FILE;
- public static String BrowserSim_MORE;
public static String BrowserSim_OPEN_IN_DEFAULT_BROWSER;
+ public static String BrowserSim_PREFERENCES;
public static String BrowserSim_TURN_LEFT;
public static String BrowserSim_TURN_RIGHT;
+ public static String BrowserSim_USE_SKINS;
public static String BrowserSim_VIEW_PAGE_SOURCE;
public static String EditDeviceDialog_CANCEL;
public static String EditDeviceDialog_EDIT_DEVICE;
@@ -54,13 +55,27 @@
public static String ManageDevicesDialog_NEW_DEVICE;
public static String ManageDevicesDialog_NEW_USER_AGENT;
public static String ManageDevicesDialog_OK;
+ public static String ManageDevicesDialog_PREFERENCES;
public static String ManageDevicesDialog_REMOVE;
public static String ManageDevicesDialog_REVERT_ALL;
public static String ManageDevicesDialog_SKIN;
public static String ManageDevicesDialog_LOAD_DEFAULTS;
public static String ManageDevicesDialog_USER_AGENT;
public static String ManageDevicesDialog_WIDTH;
-
+ public static String SizeWarningDialog_DEVICE_SIZE_WILL_BE_TRUNCATED;
+ public static String SizeWarningDialog_DESKTOP_SIZE_TOO_SMALL_VERTICAL;
+ public static String SizeWarningDialog_DESKTOP_SIZE_TOO_SMALL_HORIZONTAL;
+ public static String SizeWarningDialog_REMEMBER_MY_DECISION;
+ public static String SizeWarningDialog_OK;
+ public static String SizeWarningDialog_CANCEL;
+ public static String ManageDevicesDialog_SKINS_OPTIONS;
+ public static String ManageDevicesDialog_USE_SKINS;
+ public static String ManageDevicesDialog_TRUNCATE_THE_DEVICE_WINDOW;
+ public static String ManageDevicesDialog_ALWAYS_TRUNCATE;
+ public static String ManageDevicesDialog_NEVER_TRUNCATE;
+ public static String ManageDevicesDialog_PROMPT;
+ public static String ExceptionNotifier_OK;
+
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/SizeWarningDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/SizeWarningDialog.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/SizeWarningDialog.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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;
import java.text.MessageFormat;
@@ -13,6 +23,9 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
class SizeWarningDialog extends CustomMessageBox {
private Point actualSize;
private Point requiredSize;
@@ -27,7 +40,7 @@
this.requiredSize = requiredSize;
this.deviceName = deviceName;
this.vertical = vertical;
- setText("Device size will be truncated");
+ setText(Messages.SizeWarningDialog_DEVICE_SIZE_WILL_BE_TRUNCATED);
}
@Override
@@ -41,19 +54,17 @@
Label message = new Label(messageRow, SWT.WRAP);
String messageText;
if (vertical) {
- messageText = MessageFormat.format("Your desktop size ({0}x{1} pixels) is smaller
than what {2} needs in vertical layout ({3}x{4}).\n" +
- "Device size will be truncated to fit your desktop.",
+ messageText =
MessageFormat.format(Messages.SizeWarningDialog_DESKTOP_SIZE_TOO_SMALL_VERTICAL,
actualSize.x, actualSize.y, deviceName, requiredSize.x, requiredSize.y);
} else {
- messageText = MessageFormat.format("Your desktop size ({0}x{1} pixels) is smaller
than what {2} needs in horizontal layout ({3}x{4}).\n" +
- "Device size will be truncated to fit your desktop.",
+ messageText =
MessageFormat.format(Messages.SizeWarningDialog_DESKTOP_SIZE_TOO_SMALL_HORIZONTAL,
actualSize.x, actualSize.y, deviceName, requiredSize.x, requiredSize.y);
}
message.setText(messageText);
message.setBackground(getMessageCompositeBackground());
Button rememberDecisionCheckbox = new Button(messageRow, SWT.CHECK);
- rememberDecisionCheckbox.setText("Remember my decision (this can be changed in the
Preferences dialog later).");
+ rememberDecisionCheckbox.setText(Messages.SizeWarningDialog_REMEMBER_MY_DECISION);
rememberDecisionCheckbox.setBackground(getMessageCompositeBackground());
rememberDecisionCheckbox.setSelection(rememberDecision);
rememberDecisionCheckbox.addSelectionListener(new SelectionAdapter() {
@@ -69,7 +80,7 @@
buttonRow.setLayoutData(buttonRowLayoutData);
Button okButton = new Button(buttonRow, SWT.PUSH);
- okButton.setText("Yes (recommended)");
+ okButton.setText(Messages.SizeWarningDialog_OK);
okButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -79,7 +90,7 @@
});
Button noButton = new Button(buttonRow, SWT.PUSH);
- noButton.setText("No, show me actual size");
+ noButton.setText(Messages.SizeWarningDialog_CANCEL);
noButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -98,4 +109,4 @@
public boolean getRememberDecision() {
return rememberDecision;
}
-}
\ No newline at end of file
+}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/messages.properties
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/messages.properties 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/messages.properties 2012-05-16
11:35:54 UTC (rev 41057)
@@ -5,10 +5,11 @@
BrowserSim_ERROR=Error
BrowserSim_EXIT=Exit
BrowserSim_FILE=File
-BrowserSim_MORE=More...
+BrowserSim_PREFERENCES=Preferences...
BrowserSim_OPEN_IN_DEFAULT_BROWSER=Open in default browser
BrowserSim_TURN_LEFT=Turn Left
BrowserSim_TURN_RIGHT=Turn Right
+BrowserSim_USE_SKINS=Use Skins
BrowserSim_VIEW_PAGE_SOURCE=View page source
EditDeviceDialog_CANCEL=Cancel
EditDeviceDialog_EDIT_DEVICE=Edit Device
@@ -21,19 +22,14 @@
EditDeviceDialog_USER_AGENT=User-Agent:
EditDeviceDialog_WIDTH=Width:
ExceptionNotifier_APPLE_APPLICATION_SUPPORT_IS_NOT_FOUND=Apple Application Support is not
found.\n\
-Please install <a
href\="http\://www.apple.com/quicktime/download/">Apple
QuickTime</a> or <a
href\="http\://www.apple.com/itunes/download/">Apple iTunes</a> to run
BrowserSim.\n\
-Also see <a
href\="https\://community.jboss.org/docs/DOC-18100">BrowserSim FAQ</a>.
-ExceptionNotifier_BROWSERSIM_IS_FAILED_TO_START=BrowserSim is failed to start with the
following error:\n\
-\"{0}\"\n\
-Also see <a
href\="https\://community.jboss.org/docs/DOC-18100">BrowserSim
FAQ</a>.
+Please install <a
href\="http\://www.apple.com/quicktime/download/">Apple
QuickTime</a> or <a
href\="http\://www.apple.com/itunes/download/">Apple iTunes</a> to run
BrowserSim.\nAlso see <a
href\="https\://community.jboss.org/docs/DOC-18100">BrowserSim FAQ</a>.
+ExceptionNotifier_BROWSERSIM_IS_FAILED_TO_START=BrowserSim is failed to start with the
following error\:\n"{0}"\nAlso see <a
href\="https\://community.jboss.org/docs/DOC-18100">BrowserSim
FAQ</a>.
ExceptionNotifier_ONLY_32_BIT_ECLIPSE_IS_SUPPORTED_ON_WINDOWS=BrowserSim is not supported
with 64-bit Eclipse/JBDS on MS Windows.\n\
Please install 32-bit Eclipse/JBDS to run BrowserSim.\n\
Also see <a
href\="https\://community.jboss.org/docs/DOC-18100">BrowserSim
FAQ</a>.
-ExceptionNotifier_BROWSERSIM_IS_FAILED_TO_START_ON_LINUX=BrowserSim is failed to start
with the following error:\n\
-\"{0}\"\n\
+ExceptionNotifier_BROWSERSIM_IS_FAILED_TO_START_ON_LINUX=BrowserSim is failed to start
with the following error\:\n"{0}"\n\
Please note that WebKitGTK 1.2.0 or newer must be installed and available in the library
load path.\n\
-If not, use your package manager to install libwebkitgtk.\n\
-Also see <a
href\="https\://community.jboss.org/docs/DOC-18100">BrowserSim
FAQ</a>.
+If not, use your package manager to install libwebkitgtk.\nAlso see <a
href\="https\://community.jboss.org/docs/DOC-18100">BrowserSim
FAQ</a>.
ManageDevicesDialog_ADD=Add
ManageDevicesDialog_CANCEL=Cancel
ManageDevicesDialog_DEFAULT=DEFAULT
@@ -45,9 +41,25 @@
ManageDevicesDialog_NEW_DEVICE=New Device
ManageDevicesDialog_NEW_USER_AGENT=New User-Agent
ManageDevicesDialog_OK=OK
+ManageDevicesDialog_PREFERENCES=Preferences
ManageDevicesDialog_REMOVE=Remove
ManageDevicesDialog_REVERT_ALL=Revert All
ManageDevicesDialog_SKIN=Skin
ManageDevicesDialog_LOAD_DEFAULTS=Load Defaults
ManageDevicesDialog_USER_AGENT=User-Agent
ManageDevicesDialog_WIDTH=Width
+SizeWarningDialog_DEVICE_SIZE_WILL_BE_TRUNCATED=Device size will be truncated
+SizeWarningDialog_DESKTOP_SIZE_TOO_SMALL_VERTICAL=Your desktop size ({0}x{1} pixels) is
smaller than what {2} needs in vertical layout ({3}x{4}).\n\
+Device size will be truncated to fit your desktop.
+SizeWarningDialog_DESKTOP_SIZE_TOO_SMALL_HORIZONTAL=Your desktop size ({0}x{1} pixels) is
smaller than what {2} needs in horizontal layout ({3}x{4}).\n\
+Device size will be truncated to fit your desktop.
+SizeWarningDialog_REMEMBER_MY_DECISION=Remember my decision (this can be changed in the
Preferences dialog later).
+SizeWarningDialog_OK=OK (recommended)
+SizeWarningDialog_CANCEL=Cancel, show me actual size
+ManageDevicesDialog_SKINS_OPTIONS=Skins options
+ManageDevicesDialog_USE_SKINS=Use skins
+ManageDevicesDialog_TRUNCATE_THE_DEVICE_WINDOW=Truncate the device window when it does
not fit display
+ManageDevicesDialog_ALWAYS_TRUNCATE=Always truncate
+ManageDevicesDialog_NEVER_TRUNCATE=Never truncate
+ManageDevicesDialog_PROMPT=Prompt
+ExceptionNotifier_OK=OK
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/AppleIPhone3Skin.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -36,6 +36,7 @@
/**
* @author Yahor Radtsevich (yradtsevich)
*/
+@SuppressWarnings("nls")
public class AppleIPhone3Skin implements BrowserSimSkin {
private static final String[] SHELL_IMAGE = {"iphone_skin/iPhone3.png",
"iphone_skin/iPhone3-horizontal.png"};
private static final String[] ADDRESS_BAR_IMAGE =
{"iphone_skin/address-bar.png",
"iphone_skin/address-bar-horizontal.png"};
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-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ResizableSkin.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -101,7 +101,7 @@
public void handleEvent(Event event) {
Control contol = event.display.getCursorControl();
Point displayPoint = event.display.getCursorLocation();
- Image rotateImage = imageList.getImage("cursors/rotate.gif");
+ Image rotateImage = imageList.getImage("cursors/rotate.gif");
//$NON-NLS-1$
if (deviceComposite.isDeviceCorner(displayPoint) &&
deviceComposite.isDeviceBody(contol)) {
deviceComposite.setCursor(new Cursor(Display.getCurrent(),
rotateImage.getImageData(), 0, 0));
} else {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidNavBarComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidNavBarComposite.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidNavBarComposite.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.android;
import org.eclipse.swt.SWT;
@@ -13,6 +23,10 @@
import org.jboss.tools.vpe.browsersim.ui.skin.ImageDescriptor;
import org.jboss.tools.vpe.browsersim.ui.skin.ImageList;
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+@SuppressWarnings("nls")
public class AndroidNavBarComposite extends Composite {
private final String BD = "android/";
private final ImageDescriptor[] BODY_DESCRIPTOR = {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidResizableSkin.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidResizableSkin.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidResizableSkin.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.android;
import org.eclipse.swt.SWT;
@@ -10,7 +20,12 @@
import org.jboss.tools.vpe.browsersim.ui.skin.ios.AppleIPhone3ResizableSkin;
import org.jboss.tools.vpe.browsersim.ui.skin.ios.ButtonDescriptor;
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+@SuppressWarnings("nls")
public class AndroidResizableSkin extends AppleIPhone3ResizableSkin {
+ public static final String ANDROID_SKIN_ID = "Android";
private static final Point NORMAL_SKREEN_SIZE = new Point(240, 1);
private static final Point NORMAL_SKIN_SIZE = new Point(339, 156);
public static final int[] VISIBLE_REGION_VERTICAL = {24, 0, 314, 0, 315, 1, 318, 1,
319, 2, 320, 2, 321, 3, 322,
@@ -41,7 +56,7 @@
FormData formData = new FormData();
formData.left = new FormAttachment(0, 61);
formData.bottom = new FormAttachment(100, -41);
- backButtonDescriptor = new ButtonDescriptor(formData, bd2 + "back.png", bd2
+ "back.png", bd2 + "back-selected.png");//XXX
+ backButtonDescriptor = new ButtonDescriptor(formData, bd2 + "back.png", bd2
+ "back.png", bd2 + "back-selected.png");
}
ButtonDescriptor forwardButtonDescriptor;
@@ -49,21 +64,21 @@
FormData formData = new FormData();
formData.left = new FormAttachment(33, 12);
formData.bottom = new FormAttachment(100, -41);
- forwardButtonDescriptor = new ButtonDescriptor(formData, bd2 +
"forward.png", bd2 + "forward.png", bd2 +
"forward-selected.png");//XXX
+ forwardButtonDescriptor = new ButtonDescriptor(formData, bd2 +
"forward.png", bd2 + "forward.png", bd2 +
"forward-selected.png");
}
ButtonDescriptor homeButtonDescriptor;
{
FormData formData = new FormData();
formData.left = new FormAttachment(67, -45);
formData.bottom = new FormAttachment(100, -41);
- homeButtonDescriptor = new ButtonDescriptor(formData, bd2 + "home.png", bd2
+ "home.png", bd2 + "home-selected.png");//XXX
+ homeButtonDescriptor = new ButtonDescriptor(formData, bd2 + "home.png", bd2
+ "home.png", bd2 + "home-selected.png");
}
ButtonDescriptor refreshButtonDescriptor;
{
FormData formData = new FormData();
formData.left = new FormAttachment(100, -61 - 28);
formData.bottom = new FormAttachment(100, -41);
- refreshButtonDescriptor = new ButtonDescriptor(formData, bd2 +
"refresh.png", bd2 + "refresh.png", bd2 +
"refresh-selected.png");//XXX
+ refreshButtonDescriptor = new ButtonDescriptor(formData, bd2 +
"refresh.png", bd2 + "refresh.png", bd2 +
"refresh-selected.png");
}
VERTICAL_DESCRIPTOR = new AndroidSkinDescriptor(bodyGridSize, bodyGridImageDescriptors,
iOsDescriptor, cornersSize,
backButtonDescriptor, forwardButtonDescriptor, homeButtonDescriptor,
refreshButtonDescriptor);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidTimeComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidTimeComposite.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/android/AndroidTimeComposite.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.android;
import org.eclipse.swt.SWT;
@@ -6,6 +16,10 @@
import org.jboss.tools.vpe.browsersim.ui.skin.ImageDescriptor;
import org.jboss.tools.vpe.browsersim.ui.skin.ImageList;
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+@SuppressWarnings("nls")
public class AndroidTimeComposite extends AbstractTimeComposite {
private static final String BD = "android/";
private static final ImageDescriptor[] BODY_DESCRIPTOR = {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone3ResizableSkin.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.ios;
import java.util.Arrays;
@@ -23,7 +33,12 @@
import org.jboss.tools.vpe.browsersim.ui.skin.ResizableSkin;
import org.jboss.tools.vpe.browsersim.ui.skin.ResizableSkinSizeAdvisor;
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+@SuppressWarnings("nls")
public class AppleIPhone3ResizableSkin extends ResizableSkin {
+ public static final String IPHONE3_SKIN_ID = "iPhone 3";
private static final Point NORMAL_SKREEN_SIZE = new Point(320, 480);
private static final Point NORMAL_SKIN_SIZE = new Point(384, 727);
private static final Point VERTICAL_BORDERS_SIZE = new Point(NORMAL_SKIN_SIZE.x -
NORMAL_SKREEN_SIZE.x, NORMAL_SKIN_SIZE.y - NORMAL_SKREEN_SIZE.y);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone4ResizableSkin.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone4ResizableSkin.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/AppleIPhone4ResizableSkin.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.ios;
import org.eclipse.swt.SWT;
@@ -8,7 +18,12 @@
import org.jboss.tools.vpe.browsersim.ui.skin.DeviceComposite;
import org.jboss.tools.vpe.browsersim.ui.skin.ImageDescriptor;
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+@SuppressWarnings("nls")
public class AppleIPhone4ResizableSkin extends AppleIPhone3ResizableSkin {
+ public static final String IPHONE4_SKIN_ID = "iPhone 4";
private static final Point NORMAL_SCREEN_SIZE = new Point(236, 198);
private static final Point NORMAL_SKIN_SIZE = new Point(292, 429);
private static final Point VERTICAL_BORDERS_SIZE = new Point(NORMAL_SKIN_SIZE.x -
NORMAL_SCREEN_SIZE.x, NORMAL_SKIN_SIZE.y - NORMAL_SCREEN_SIZE.y);
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-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOSNavBarComposite.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.ios;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
@@ -14,6 +24,10 @@
import org.jboss.tools.vpe.browsersim.ui.skin.ImageList;
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+@SuppressWarnings("nls")
public class IOSNavBarComposite extends Composite {
private final String BD = "ios/";
private final ImageDescriptor[] BODY_DESCRIPTOR = {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOSPageTitleStyledText.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOSPageTitleStyledText.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOSPageTitleStyledText.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -18,6 +18,10 @@
import org.eclipse.swt.widgets.Composite;
import org.jboss.tools.vpe.browsersim.ui.skin.ImageList;
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+@SuppressWarnings("nls")
public class IOSPageTitleStyledText extends StyledText {
private final String BD = "ios/";
private Font font;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOsTimeComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOsTimeComposite.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/ui/skin/ios/IOsTimeComposite.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.ios;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
@@ -5,7 +15,10 @@
import org.jboss.tools.vpe.browsersim.ui.skin.ImageDescriptor;
import org.jboss.tools.vpe.browsersim.ui.skin.ImageList;
-
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+@SuppressWarnings("nls")
public class IOsTimeComposite extends AbstractTimeComposite {
private static final String BD = "ios/";
private static final ImageDescriptor[] BODY_DESCRIPTOR = {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/util/ResourcesUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/util/ResourcesUtil.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim/src/org/jboss/tools/vpe/browsersim/util/ResourcesUtil.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -22,7 +22,7 @@
private static final String RESOURCES_ROOT_FOLDER =
"/org/jboss/tools/vpe/browsersim/resources/"; //$NON-NLS-1$
public static InputStream getResourceAsStream(String name) {
- if (name.startsWith("/")) {
+ if (name.startsWith("/")) { //$NON-NLS-1$
return BrowserSim.class.getResourceAsStream(name);
} else {
return BrowserSim.class.getResourceAsStream(RESOURCES_ROOT_FOLDER + name);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/PlatformUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/PlatformUtil.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/PlatformUtil.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -15,6 +15,7 @@
/**
* @author "Yahor Radtsevich (yradtsevich)"
*/
+@SuppressWarnings("nls")
public class PlatformUtil {
public static final String ARCH_X86 = "x86";
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/WebKitBrowserFactory.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/WebKitBrowserFactory.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/WebKitBrowserFactory.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -20,6 +20,7 @@
/**
* @author "Yahor Radtsevich (yradtsevich)"
*/
+@SuppressWarnings("nls")
public class WebKitBrowserFactory implements IBrowserSimBrowserFactory {
@Override
public AbstractWebKitBrowser createBrowser(Composite parent, int style) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -21,6 +21,7 @@
/**
* @author Yahor Radtsevich (yradtsevich)
*/
+@SuppressWarnings("nls")
public class WebKitBrowser_gtk_linux_x86 extends AbstractWebKitBrowser {
private static final byte[] USER_AGENT; // = WebKitGTK.user_agent
static {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86_64.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86_64.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_gtk_linux_x86_64.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -21,6 +21,7 @@
/**
* @author Yahor Radtsevich (yradtsevich)
*/
+@SuppressWarnings("nls")
public class WebKitBrowser_gtk_linux_x86_64 extends AbstractWebKitBrowser {
private static final byte[] USER_AGENT; // = WebKitGTK.user_agent
static {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_webkit_cocoa_macos.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_webkit_cocoa_macos.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_webkit_cocoa_macos.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -21,6 +21,7 @@
/**
* @author Yahor Radtsevich (yradtsevich)
*/
+@SuppressWarnings("nls")
public class WebKitBrowser_webkit_cocoa_macos extends AbstractWebKitBrowser {
public WebKitBrowser_webkit_cocoa_macos(Composite parent, int style) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_win32_win32_x86.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_win32_win32_x86.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.browser/src/org/jboss/tools/vpe/browsersim/browser/internal/WebKitBrowser_win32_win32_x86.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -21,6 +21,7 @@
/**
* @author Yahor Radtsevich (yradtsevich)
*/
+@SuppressWarnings({"nls", "restriction"})
public class WebKitBrowser_win32_win32_x86 extends AbstractWebKitBrowser {
public WebKitBrowser_win32_win32_x86(Composite parent, int style) {
super(parent, style);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/actions/RunBrowserSimAction.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/actions/RunBrowserSimAction.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/actions/RunBrowserSimAction.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -40,6 +40,7 @@
/**
* @author "Yahor Radtsevich (yradtsevich)"
*/
+@SuppressWarnings("restriction")
public class RunBrowserSimAction implements IWorkbenchWindowActionDelegate {
@Override
@@ -103,13 +104,13 @@
if (part instanceof IViewPart) {
IViewSite viewSite = ((IViewPart) part).getViewSite();
if (WebBrowserView.WEB_BROWSER_VIEW_ID.equals(viewSite.getId()) && part
instanceof WebBrowserView) {
- browserViewer = getFieldValue(part, "viewer");
+ browserViewer = getFieldValue(part, "viewer"); //$NON-NLS-1$
}
} else if (part instanceof IEditorPart) {
IEditorPart editorPart = (IEditorPart) part;
IEditorSite editorSite = editorPart.getEditorSite();
if (WebBrowserEditor.WEB_BROWSER_EDITOR_ID.equals(editorSite.getId()) && part
instanceof WebBrowserEditor) {
- browserViewer = getFieldValue(part, "webBrowser");
+ browserViewer = getFieldValue(part, "webBrowser"); //$NON-NLS-1$
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/callbacks/OpenFileCallback.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/callbacks/OpenFileCallback.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/callbacks/OpenFileCallback.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -33,7 +33,7 @@
* @author Yahor Radtsevich (yradtsevich)
*/
public class OpenFileCallback implements BrowserSimCallback {
- private static final String OPEN_FILE_COMMAND = BrowserSimLauncher.BROWSERSIM_CLASS_NAME
+ ".command.openFile:";
+ private static final String OPEN_FILE_COMMAND = BrowserSimLauncher.BROWSERSIM_CLASS_NAME
+ ".command.openFile:"; //$NON-NLS-1$
/* (non-Javadoc)
* @see
org.jboss.tools.vpe.browsersim.eclipse.callbacks.BrowserSimCallback#getCallbackId()
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/callbacks/ViewSourceCallback.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/callbacks/ViewSourceCallback.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/callbacks/ViewSourceCallback.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -44,7 +44,7 @@
* @author Yahor Radtsevich (yradtsevich)
*/
public class ViewSourceCallback implements BrowserSimCallback {
- private static final String VIEW_SOURCE_COMMAND =
BrowserSimLauncher.BROWSERSIM_CLASS_NAME + ".command.viewSource:";
+ private static final String VIEW_SOURCE_COMMAND =
BrowserSimLauncher.BROWSERSIM_CLASS_NAME + ".command.viewSource:";
//$NON-NLS-1$
/* (non-Javadoc)
* @see
org.jboss.tools.vpe.browsersim.eclipse.callbacks.BrowserSimCallback#getCallbackId()
@@ -77,16 +77,16 @@
if (page != null) {
try {
IEditorDescriptor editorDescriptor = PlatformUI.getWorkbench()
- .getEditorRegistry().getDefaultEditor("view-source.html"); // get default
editor for .html
+ .getEditorRegistry().getDefaultEditor("view-source.html"); // get default
editor for .html //$NON-NLS-1$
String editorId;
if (editorDescriptor != null && editorDescriptor.isInternal()) {
editorId = editorDescriptor.getId();
} else {
- editorId = "org.eclipse.ui.DefaultTextEditor";
+ editorId = "org.eclipse.ui.DefaultTextEditor"; //$NON-NLS-1$
}
- IStorage storage = new StringStorage("", // see the long comment below to
know why an empty storage is created
- "view-source.html"); // .html extension is needed to enable code
highlighting in the WTP HTML editor
+ IStorage storage = new StringStorage("", // see the long comment below to
know why an empty storage is created //$NON-NLS-1$
+ "view-source.html"); // .html extension is needed to enable code
highlighting in the WTP HTML editor //$NON-NLS-1$
IStorageEditorInput input = new StringInput(storage, name, toolTip);
IEditorPart editor = page.openEditor(input, editorId);
@@ -100,7 +100,7 @@
IDocument doc = null;
// this checking is needed to do not load jst.jsp plug-ins if it is unnecessary
- if ("org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor".equals(editorId)) {
+ if ("org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor".equals(editorId)) {
//$NON-NLS-1$
try {
if (editor instanceof JSPMultiPageEditor) {
JSPMultiPageEditor multiPageEditor = (JSPMultiPageEditor) editor;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/util/BrowserSimLauncher.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/util/BrowserSimLauncher.java 2012-05-16
11:09:50 UTC (rev 41056)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.browsersim.eclipse/src/org/jboss/tools/vpe/browsersim/eclipse/util/BrowserSimLauncher.java 2012-05-16
11:35:54 UTC (rev 41057)
@@ -31,28 +31,28 @@
* @author "Yahor Radtsevich (yradtsevich)"
*/
public class BrowserSimLauncher {
- public static final String BROWSERSIM_CLASS_NAME =
"org.jboss.tools.vpe.browsersim.ui.BrowserSim";
+ public static final String BROWSERSIM_CLASS_NAME =
"org.jboss.tools.vpe.browsersim.ui.BrowserSim"; //$NON-NLS-1$
private static final BrowserSimCallback[] BROWSERSIM_CALLBACKS = { new
ViewSourceCallback(), new OpenFileCallback() };
public static void launchBrowserSim(String initialUrl) {
- String pathSeparator = System.getProperty("path.separator");
+ String pathSeparator = System.getProperty("path.separator"); //$NON-NLS-1$
try {
- String classPath = getBundleLocation("org.jboss.tools.vpe.browsersim")
- + pathSeparator +
getBundleLocation("org.jboss.tools.vpe.browsersim.browser")
- + pathSeparator + getBundleLocation("org.eclipse.swt")
- + pathSeparator + getBundleLocation("org.eclipse.swt." +
PlatformUtil.CURRENT_PLATFORM);
- String javaCommand = System.getProperty("java.home") +
"/bin/java";
+ String classPath = getBundleLocation("org.jboss.tools.vpe.browsersim")
//$NON-NLS-1$
+ + pathSeparator +
getBundleLocation("org.jboss.tools.vpe.browsersim.browser") //$NON-NLS-1$
+ + pathSeparator + getBundleLocation("org.eclipse.swt") //$NON-NLS-1$
+ + pathSeparator + getBundleLocation("org.eclipse.swt." +
PlatformUtil.CURRENT_PLATFORM); //$NON-NLS-1$
+ String javaCommand = System.getProperty("java.home") +
"/bin/java"; //$NON-NLS-1$ //$NON-NLS-2$
List<String> commandElements = new ArrayList<String>();
commandElements.add(javaCommand);
if (Platform.OS_MACOSX.equals(Platform.getOS())) {
- commandElements.add("-XstartOnFirstThread");
+ commandElements.add("-XstartOnFirstThread"); //$NON-NLS-1$
if (Platform.ARCH_X86.equals(Platform.getOSArch())) {
- commandElements.add("-d32");
+ commandElements.add("-d32"); //$NON-NLS-1$
}
}
- commandElements.add("-cp");
+ commandElements.add("-cp"); //$NON-NLS-1$
commandElements.add(classPath);
commandElements.add(BROWSERSIM_CLASS_NAME);
if (initialUrl != null) {
@@ -110,7 +110,7 @@
File bundleLocation = FileLocator.getBundleFile(bundle);
if (bundleLocation.isDirectory()) {
- File binDirectory = new File(bundleLocation, "bin");
+ File binDirectory = new File(bundleLocation, "bin"); //$NON-NLS-1$
if (binDirectory.isDirectory()) {
bundleLocation = binDirectory;
}