Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jubula.client.ui.rcp')
-rw-r--r--org.eclipse.jubula.client.ui.rcp/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.jubula.client.ui.rcp/plugin.xml60
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/contributionitems/ChooseHTMLWindowContributionItem.java51
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/html/OMChooseWindow.java84
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/sourceprovider/HTMLAutSourceProvider.java149
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/HTMLAutWindowManager.java91
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/widgets/autconfig/HtmlAutConfigComponent.java727
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ProjectSettingWizardPage.java122
8 files changed, 0 insertions, 1285 deletions
diff --git a/org.eclipse.jubula.client.ui.rcp/META-INF/MANIFEST.MF b/org.eclipse.jubula.client.ui.rcp/META-INF/MANIFEST.MF
index 1f2ef51b7..15af39b08 100644
--- a/org.eclipse.jubula.client.ui.rcp/META-INF/MANIFEST.MF
+++ b/org.eclipse.jubula.client.ui.rcp/META-INF/MANIFEST.MF
@@ -81,7 +81,6 @@ Require-Bundle: org.eclipse.jubula.tools;bundle-version="[4.0.0,5.0.0)",
org.eclipse.core.databinding.beans;bundle-version="[1.2.100,2.0.0)",
org.eclipse.core.databinding.property;bundle-version="[1.3.0,2.0.0)",
org.eclipse.equinox.security;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jubula.toolkit.html;bundle-version="[3.1.0,5.0.0)",
org.eclipse.ui.views.log;bundle-version="[1.0.600,2.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/org.eclipse.jubula.client.ui.rcp/plugin.xml b/org.eclipse.jubula.client.ui.rcp/plugin.xml
index bd55ffff0..b5f18c593 100644
--- a/org.eclipse.jubula.client.ui.rcp/plugin.xml
+++ b/org.eclipse.jubula.client.ui.rcp/plugin.xml
@@ -732,16 +732,6 @@
</command>
<command
categoryId="org.eclipse.jubula.client.ui.rcp.commands"
- id="org.eclipse.jubula.client.ui.rcp.commands.html.ChooseAuTWindow"
- name="%ChooseAUTWindow">
- <commandParameter
- id="org.eclipse.jubula.client.ui.rcp.commands.html.ChooseAuTWindow.parameter.openWindow"
- name="Open Windows"
- optional="false"
- typeId="org.eclipse.jubula.client.ui.rcp.commands.parametertypes.WindowTitle" />
- </command>
- <command
- categoryId="org.eclipse.jubula.client.ui.rcp.commands"
id="org.eclipse.jubula.client.ui.rcp.commands.ConnectToAUTAgentCommand"
name="%Connect">
<commandParameter
@@ -1687,23 +1677,6 @@
value="true">
</parameter>
</command>
- <command
- commandId="org.eclipse.jubula.client.ui.rcp.commands.html.ChooseAuTWindow"
- id="org.eclipse.jubula.client.ui.rcp.toolbar.ObjectMappingToolbar.ChooseHTMLWindowCommand"
- style="pulldown"
- icon="platform:/plugin/org.eclipse.jubula.client.ui/icons/selectWindow.png"
- tooltip="%ChooseAUTWindow">
- <visibleWhen checkEnabled="false">
- <and>
- <with variable="activeEditorId">
- <equals value="org.eclipse.jubula.client.ui.rcp.editors.ObjectMappingEditor" />
- </with>
- <with variable="org.eclipse.jubula.client.ui.rcp.variable.isHtmlAut">
- <equals value="true" />
- </with>
- </and>
- </visibleWhen>
- </command>
</toolbar>
<toolbar id="org.eclipse.jubula.client.ui.rcp.toolbar.NavigationToolbar">
<command
@@ -1912,12 +1885,6 @@
id="menu:org.eclipse.jubula.client.ui.rcp.toolbar.AutAgentToolbar.ConnectToAUTAgentCommand.dropdown" />
</menuContribution>
<menuContribution
- locationURI="menu:org.eclipse.jubula.client.ui.rcp.toolbar.ObjectMappingToolbar.ChooseHTMLWindowCommand">
- <dynamic
- class="org.eclipse.jubula.client.ui.rcp.contributionitems.ChooseHTMLWindowContributionItem"
- id="menu:org.eclipse.jubula.client.ui.rcp.toolbar.ObjectMappingToolbar.ChooseHTMLWindowCommand.dropdown" />
- </menuContribution>
- <menuContribution
locationURI="menu:org.eclipse.jubula.client.ui.rcp.toolbar.NavigationToolbar.GoForward">
<dynamic
class="org.eclipse.jubula.client.ui.rcp.contributionitems.NavGoForwardContributionItem"
@@ -2970,24 +2937,6 @@
class="org.eclipse.jubula.client.ui.rcp.handlers.ShowInOMEHandler"
commandId="org.eclipse.jubula.client.ui.rcp.commands.ShowInOME">
</handler>
- <handler
- class="org.eclipse.jubula.client.ui.rcp.handlers.html.OMChooseWindow"
- commandId="org.eclipse.jubula.client.ui.rcp.commands.html.ChooseAuTWindow">
- <enabledWhen>
- <and>
- <with variable="org.eclipse.jubula.client.ui.rcp.variable.isHtmlAut">
- <equals value="true" />
- </with>
- <with variable="org.eclipse.jubula.client.ui.rcp.variable.isObjectMappingRunning">
- <equals value="true" />
- </with>
- <with
- variable="org.eclipse.jubula.client.ui.rcp.variable.html.windowCount">
- <count value="2" />
- </with>
- </and>
- </enabledWhen>
- </handler>
<handler
class="org.eclipse.jubula.client.ui.rcp.handlers.project.ProjectPropertiesHandler"
commandId="org.eclipse.jubula.client.ui.rcp.commands.ProjectProperties">
@@ -4622,15 +4571,6 @@
name="org.eclipse.jubula.client.ui.rcp.variable.autConnectionStatus"
priorityLevel="workbench" />
</sourceProvider>
- <sourceProvider
- provider="org.eclipse.jubula.client.ui.rcp.sourceprovider.HTMLAutSourceProvider">
- <variable
- name="org.eclipse.jubula.client.ui.rcp.variable.isHtmlAut"
- priorityLevel="workbench" />
- <variable
- name="org.eclipse.jubula.client.ui.rcp.variable.html.windowCount"
- priorityLevel="workbench" />
- </sourceProvider>
</extension>
<extension point="org.eclipse.ui.contexts">
<context
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/contributionitems/ChooseHTMLWindowContributionItem.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/contributionitems/ChooseHTMLWindowContributionItem.java
deleted file mode 100644
index 7b713820e..000000000
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/contributionitems/ChooseHTMLWindowContributionItem.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 BREDEX GmbH.
- * 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:
- * BREDEX GmbH - initial API and implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.jubula.client.ui.rcp.contributionitems;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jubula.client.ui.rcp.constants.RCPCommandIDs;
-import org.eclipse.jubula.client.ui.rcp.utils.HTMLAutWindowManager;
-import org.eclipse.jubula.client.ui.utils.CommandHelper;
-import org.eclipse.ui.actions.CompoundContributionItem;
-import org.eclipse.ui.menus.CommandContributionItem;
-/**
- * Populates the dropdown list for the HTML window chooser toolbar item
- * @author BREDEX GmbH
- *
- */
-public class ChooseHTMLWindowContributionItem extends CompoundContributionItem {
- /**
- * {@inheritDoc}
- */
- protected IContributionItem[] getContributionItems() {
- String[] titles = HTMLAutWindowManager.getInstance().getWindowTitles();
- List<IContributionItem> contributionItems =
- new ArrayList<IContributionItem>();
- for (int i = 0; i < titles.length; i++) {
- Map<String, Object> params = new HashMap<String, Object>();
- params.put("org.eclipse.jubula.client.ui.rcp.commands.html.ChooseAuTWindow.parameter.openWindow", titles[i]); //$NON-NLS-1$
-
- IContributionItem test = CommandHelper
- .createContributionItem(RCPCommandIDs.CHOOSE_HTML_WINDOW,
- params, titles[i], CommandContributionItem.STYLE_CHECK);
- contributionItems.add(test);
- }
- return contributionItems
- .toArray(new IContributionItem[contributionItems.size()]);
- }
-
-
-}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/html/OMChooseWindow.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/html/OMChooseWindow.java
deleted file mode 100644
index 5c9b4e57c..000000000
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/html/OMChooseWindow.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 BREDEX GmbH.
- * 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:
- * BREDEX GmbH - initial API and implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.jubula.client.ui.rcp.handlers.html;
-
-import java.util.Map;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.jubula.client.core.commands.SelectedWindowCommand;
-import org.eclipse.jubula.client.core.communication.AUTConnection;
-import org.eclipse.jubula.client.internal.BaseConnection.NotConnectedException;
-import org.eclipse.jubula.client.ui.rcp.utils.HTMLAutWindowManager;
-import org.eclipse.jubula.communication.internal.message.html.OMSelectWindowMessage;
-import org.eclipse.jubula.tools.internal.exception.CommunicationException;
-import org.eclipse.ui.commands.IElementUpdater;
-import org.eclipse.ui.menus.UIElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-/**
- * Handler for choosing window in html for OMM
- * @author BREDEX GmbH
- *
- */
-public class OMChooseWindow extends AbstractHandler implements IElementUpdater {
- /** Timeout for the response */
- private static final int TIMEOUT = 3000;
- /** name of the parameter used by the client */
- private static final String WINDOW_TITLE_PARAMETER = "org.eclipse.jubula.client.ui.rcp.commands.html.ChooseAuTWindow.parameter.openWindow"; //$NON-NLS-1$
- /** The logger */
- private static final Logger LOG =
- LoggerFactory.getLogger(OMChooseWindow.class);
-
- /**
- * {@inheritDoc}
- */
- public Object execute(ExecutionEvent event) {
- Map map = event.getParameters();
- String name = (String) map.get(WINDOW_TITLE_PARAMETER);
- if (name == null) {
- name = HTMLAutWindowManager.getInstance().getLastSelectedWindow();
- }
- OMSelectWindowMessage message = new OMSelectWindowMessage();
- message.setWindowTitle(name);
- try {
- if (name != null) {
- AUTConnection.getInstance().request(message,
- new SelectedWindowCommand(), TIMEOUT);
- }
- } catch (NotConnectedException nce) {
- if (LOG.isErrorEnabled()) {
- LOG.error(nce.getLocalizedMessage(), nce);
- }
- } catch (CommunicationException ce) {
- if (LOG.isErrorEnabled()) {
- LOG.error(ce.getLocalizedMessage(), ce);
- }
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public void updateElement(UIElement element, Map parameters) {
- String name = (String) parameters.get(WINDOW_TITLE_PARAMETER);
- String lastTitle = HTMLAutWindowManager.getInstance()
- .getLastSelectedWindow();
- boolean checked = false;
- if (name != null && lastTitle != null && name.equals(lastTitle)) {
- checked = true;
- }
- element.setChecked(checked);
- }
-
-}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/sourceprovider/HTMLAutSourceProvider.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/sourceprovider/HTMLAutSourceProvider.java
deleted file mode 100644
index e40247fca..000000000
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/sourceprovider/HTMLAutSourceProvider.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 BREDEX GmbH.
- * 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:
- * BREDEX GmbH - initial API and implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.jubula.client.ui.rcp.sourceprovider;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
-
-import org.eclipse.jubula.client.core.agent.AutAgentRegistration;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IOMAUTListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IOMStateListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IOMWindowsListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.OMState;
-import org.eclipse.jubula.client.core.model.IAUTMainPO;
-import org.eclipse.jubula.client.core.model.IProjectPO;
-import org.eclipse.jubula.client.core.persistence.GeneralStorage;
-import org.eclipse.jubula.client.ui.rcp.utils.HTMLAutWindowManager;
-import org.eclipse.jubula.communication.internal.message.html.OMSelWinResponseMessage;
-import org.eclipse.jubula.tools.internal.constants.CommandConstants;
-import org.eclipse.jubula.tools.internal.registration.AutIdentifier;
-import org.eclipse.ui.ISources;
-/**
- * Provides variables related to the status of an HTML AuT.
- * 1. is it an HTML AuT
- * 2. the window count of the browser
- * @author BREDEX GmbH
- */
-public class HTMLAutSourceProvider extends AbstractJBSourceProvider implements
- IOMAUTListener, IOMStateListener, IOMWindowsListener {
- /**
- * the id of this source provider
- */
- public static final String ID = "org.eclipse.jubula.client.ui.rcp.sourceprovider.HTMLAutSourceProvider"; //$NON-NLS-1$
-
- /**
- * ID of variable that indicates whether the client is currently connected
- * to an AUT Agent
- */
- public static final String IS_HTML_AUT =
- "org.eclipse.jubula.client.ui.rcp.variable.isHtmlAut"; //$NON-NLS-1$
-
- /**
- * ID of variable that indicates whether the client is currently connecting
- * to an AUT Agent
- */
- public static final String WINDOW_TITLES =
- "org.eclipse.jubula.client.ui.rcp.variable.html.windowCount"; //$NON-NLS-1$
-
- /** is it an HTML AUT in OMM */
- private boolean m_isHTMLAut = false;
-
- /**
- * Constructor for adding listeners to the DataEventDispatcher
- */
- public HTMLAutSourceProvider() {
- DataEventDispatcher dispatch = DataEventDispatcher.getInstance();
- dispatch.addOMAUTListener(this, false);
- dispatch.addOMStateListener(this, true);
- dispatch.addAUTWindowsListener(this, false);
- HTMLAutWindowManager.getInstance();
- }
-
- /**
- * {@inheritDoc}
- */
- public void dispose() {
- DataEventDispatcher dispatch = DataEventDispatcher.getInstance();
- dispatch.removeOMAUTListener(this);
- dispatch.removeOMStateListener(this);
- dispatch.removeAUTWindowsListener(this);
- }
-
- /**
- * {@inheritDoc}
- */
- public Map getCurrentState() {
- Map<String, Object> values = new HashMap<String, Object>();
-
- values.put(IS_HTML_AUT, m_isHTMLAut);
- values.put(WINDOW_TITLES, new LinkedList<String>());
- return values;
- }
-
- /**
- * {@inheritDoc}
- */
- public String[] getProvidedSourceNames() {
- return new String[] { IS_HTML_AUT };
- }
-
- /**
- * {@inheritDoc}
- */
- public void handleAUTChanged(AutIdentifier identifier) {
- if (identifier != null) {
- IProjectPO project = GeneralStorage.getInstance().getProject();
- IAUTMainPO aut = AutAgentRegistration.getAutForId(identifier,
- project);
- String toolkit = aut.getToolkit();
- m_isHTMLAut = toolkit
- .equalsIgnoreCase(CommandConstants.HTML_TOOLKIT);
- } else {
- m_isHTMLAut = false;
- }
- fireModeChanged();
- }
-
- /**
- * {@inheritDoc}
- */
- public void handleOMStateChanged(OMState state) {
- if (state == OMState.notRunning) {
- m_isHTMLAut = false;
- }
- }
-
- /**
- * Fires a source changed event for <code>IS_HTML_AUT</code>.
- */
- private void fireModeChanged() {
- gdFireSourceChanged(ISources.WORKBENCH, IS_HTML_AUT, m_isHTMLAut);
- }
-
- /**
- * {@inheritDoc}
- */
- public void handleAUTChanged(String[] windowTitles) {
- LinkedList<String> listOfTitles = new LinkedList<String>();
- for (int i = 0; i < windowTitles.length; i++) {
- listOfTitles.add(windowTitles[i]);
- }
- gdFireSourceChanged(ISources.WORKBENCH, WINDOW_TITLES, listOfTitles);
- }
-
- /** {@inheritDoc} */
- public void handleNewWindowSelected(OMSelWinResponseMessage msg) {
- // we aren't interested yet...
- }
-
-}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/HTMLAutWindowManager.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/HTMLAutWindowManager.java
deleted file mode 100644
index 54568a335..000000000
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/HTMLAutWindowManager.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 BREDEX GmbH.
- * 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:
- * BREDEX GmbH - initial API and implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.jubula.client.ui.rcp.utils;
-
-import org.eclipse.jubula.client.core.events.DataEventDispatcher;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IOMWindowsListener;
-import org.eclipse.jubula.client.ui.utils.ErrorHandlingUtil;
-import org.eclipse.jubula.communication.internal.message.html.OMSelWinResponseMessage;
-import org.eclipse.jubula.tools.internal.messagehandling.MessageIDs;
-/**
- * The {@link HTMLAutWindowManager} tracks the open browser windows with their titles
- * @author BREDEX GmbH
- *
- */
-public class HTMLAutWindowManager implements IOMWindowsListener {
- /** the singleton instance */
- private static HTMLAutWindowManager instance;
- /** the window titles of the browser*/
- private String[] m_windowTitles;
- /** the last window selected */
- private String m_lastSelectedWindow = null;
-
- /**
- * The constructor listens to the AUTWindowsEvents
- */
- private HTMLAutWindowManager() {
- DataEventDispatcher.getInstance().addAUTWindowsListener(this, false);
- }
- /**
- *
- * @return single instance {@link HTMLAutWindowManager}
- */
- public static HTMLAutWindowManager getInstance() {
- if (instance == null) {
- instance = new HTMLAutWindowManager();
- return instance;
- }
- return instance;
- }
-
- /**
- *
- * @return the titles of all browser windows
- */
- public String[] getWindowTitles() {
- return m_windowTitles;
- }
-
- /**
- * {@inheritDoc}
- */
- public void handleAUTChanged(String[] windowTitles) {
- m_windowTitles = windowTitles;
- }
-
- /**
- *
- * @return the title of the last selected window
- */
- public String getLastSelectedWindow() {
- return m_lastSelectedWindow;
- }
-
- /**
- *
- * @param lastSelectedWindowTitle the title of the last selected window
- */
- public void setLastSelectedWindow(String lastSelectedWindowTitle) {
- this.m_lastSelectedWindow = lastSelectedWindowTitle;
- }
-
- /** {@inheritDoc} */
- public void handleNewWindowSelected(OMSelWinResponseMessage msg) {
- m_lastSelectedWindow = msg.getTitle();
- if (msg.getCode() == OMSelWinResponseMessage.NO_SUCH_WINDOW) {
- ErrorHandlingUtil.createMessageDialog(MessageIDs.E_OM_NO_SUCH_WIN,
- new String[] {m_lastSelectedWindow}, null);
- } else if (msg.getCode() == OMSelWinResponseMessage.UNEXPECTED_ERROR) {
- ErrorHandlingUtil.createMessageDialog(
- MessageIDs.E_OM_WINDOW_SWITCH_FAILED);
- }
- }
-}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/widgets/autconfig/HtmlAutConfigComponent.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/widgets/autconfig/HtmlAutConfigComponent.java
deleted file mode 100644
index 9a63558e1..000000000
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/widgets/autconfig/HtmlAutConfigComponent.java
+++ /dev/null
@@ -1,727 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 BREDEX GmbH.
- * 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:
- * BREDEX GmbH - initial API and implementation and/or initial documentation
- *******************************************************************************/
-package org.eclipse.jubula.client.ui.rcp.widgets.autconfig;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Map;
-
-import org.apache.commons.lang.StringUtils;
-import org.eclipse.jubula.client.core.model.IAUTConfigPO.ActivationMethod;
-import org.eclipse.jubula.client.ui.rcp.businessprocess.RemoteFileBrowserBP;
-import org.eclipse.jubula.client.ui.rcp.provider.ControlDecorator;
-import org.eclipse.jubula.client.ui.rcp.utils.DialogStatusParameter;
-import org.eclipse.jubula.client.ui.widgets.I18nEnumCombo;
-import org.eclipse.jubula.client.ui.widgets.UIComponentHelper;
-import org.eclipse.jubula.toolkit.html.Browser;
-import org.eclipse.jubula.toolkit.html.BrowserSize;
-import org.eclipse.jubula.tools.internal.constants.AutConfigConstants;
-import org.eclipse.jubula.tools.internal.constants.StringConstants;
-import org.eclipse.jubula.tools.internal.constants.SwtToolkitConstants;
-import org.eclipse.jubula.tools.internal.exception.Assert;
-import org.eclipse.jubula.tools.internal.i18n.I18n;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * @author BREDEX GmbH
- * @created Nov 4, 2009
- */
-public class HtmlAutConfigComponent extends AutConfigComponent {
- /** gui component */
- private Text m_autUrlTextField;
- /** gui field for browser */
- private Text m_browserTextField;
- /** gui field for driver */
- private Text m_driverTextField;
- /** gui field for aut id attribute text field */
- private Text m_autIdAttibuteTextField;
- /** gui button for browser path */
- private Button m_browserPathButton;
- /** gui button for driver path */
- private Button m_driverPathButton;
- /** gui checkbox for the singeWindowMode */
- private Button m_singleWindowCheckBox;
- /** gui checkbox for the using webdriver */
- private Button m_webdriverCheckBox;
- /** gui component */
- private I18nEnumCombo<Browser> m_browserCombo;
- /** gui component */
- private I18nEnumCombo<ActivationMethod> m_activationMethodCombo;
- /** gui component */
- private I18nEnumCombo<BrowserSize> m_browserSizeCombo;
- /** the WidgetModifyListener */
- private WidgetModifyListener m_modifyListener;
- /** the the WidgetSelectionListener */
- private WidgetSelectionListener m_selectionListener;
-
-
- /**
- * @param parent {@inheritDoc}
- * @param style {@inheritDoc}
- * @param autConfig data to be displayed/edited
- * @param autName the name of the AUT that will be using this configuration.
- */
- public HtmlAutConfigComponent(Composite parent, int style,
- Map<String, String> autConfig, String autName) {
-
- super(parent, style, autConfig, autName, true);
- }
-
- /**
- * @param basicAreaComposite The composite that represents the basic area.
- */
- protected void createBasicArea(Composite basicAreaComposite) {
- super.createBasicArea(basicAreaComposite);
-
- // URL property
- Label urlLabel = UIComponentHelper.createLabel(
- basicAreaComposite, "WebAutConfigComponent.URL"); //$NON-NLS-1$
- urlLabel.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.urlLabel"); //$NON-NLS-1$
-
- m_autUrlTextField = UIComponentHelper.createTextField(
- basicAreaComposite, 2);
- m_autUrlTextField.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.autUrlTextField"); //$NON-NLS-1$
-
- // browser
- Label browserLabel = UIComponentHelper.createLabel(
- basicAreaComposite, "WebAutConfigComponent.browser"); //$NON-NLS-1$
- browserLabel.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.browserLabel"); //$NON-NLS-1$
-
- m_browserCombo = UIComponentHelper.createEnumCombo(
- basicAreaComposite, 2, "WebAutConfigComponent.Browser", //$NON-NLS-1$
- Browser.class);
- m_browserCombo.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.browserCombo"); //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- protected void createAdvancedArea(Composite advancedAreaComposite) {
- super.createAdvancedArea(advancedAreaComposite);
-
- createBrowserAndDriverPathEditor(advancedAreaComposite);
-
- createWebdriverCheckBox(advancedAreaComposite);
-
- createSingleModeCheckBox(advancedAreaComposite);
-
- // browser window size
- Label browserSizeLabel = UIComponentHelper.createLabel(
- advancedAreaComposite, "WebAutConfigComponent.BrowserSize"); //$NON-NLS-1$
- browserSizeLabel.setData(SwtToolkitConstants.WIDGET_NAME,
- "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.browserSizeLabel"); //$NON-NLS-1$
- m_browserSizeCombo = UIComponentHelper.createEnumCombo(
- advancedAreaComposite, 2, "WebAutConfigComponent.BrowserSize", //$NON-NLS-1$
- BrowserSize.class);
- m_browserSizeCombo.setData(SwtToolkitConstants.WIDGET_NAME,
- "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.browserSizeCombo"); //$NON-NLS-1$
- }
-
- /**
- * Create this dialog's expert area component.
- *
- * @param expertAreaComposite Composite representing the expert area.
- */
- protected void createExpertArea(Composite expertAreaComposite) {
- super.createExpertArea(expertAreaComposite);
-
- // activation method editor
- Label activationMethodLabel = UIComponentHelper.createLabel(
- expertAreaComposite, "AUTConfigComponent.activationMethod"); //$NON-NLS-1$
- activationMethodLabel.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.activationMethodLabel"); //$NON-NLS-1$
-
- m_activationMethodCombo = UIComponentHelper.createEnumCombo(
- expertAreaComposite, 2, "AUTConfigComponent.ActivationMethod", //$NON-NLS-1$
- ActivationMethod.class);
- m_activationMethodCombo.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.activationMethodCombo"); //$NON-NLS-1$
-
- // AUT ID Attribute property
- Label autIdAttibuteLabel = UIComponentHelper.createLabel(
- expertAreaComposite, "HTMLAutConfigComponent.AutIdAttibuteLabel"); //$NON-NLS-1$
- autIdAttibuteLabel.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.autIdAttibuteLabel"); //$NON-NLS-1$
-
- m_autIdAttibuteTextField = UIComponentHelper.createTextField(
- expertAreaComposite, 2);
- m_autIdAttibuteTextField.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.autIdAttibuteTextField"); //$NON-NLS-1$
- }
-
- /**
- * Inits the browser path area.
- *
- * @param parent The parent Composite.
- */
- protected void createBrowserAndDriverPathEditor(Composite parent) {
-
- Label browserPathLabel = UIComponentHelper.createLabel(parent, "WebAutConfigComponent.browserPath"); //$NON-NLS-1$
- browserPathLabel.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.browserPathLabel"); //$NON-NLS-1$
- ControlDecorator.createInfo(browserPathLabel,
- I18n.getString("ControlDecorator.WebBrowserPath"), false); //$NON-NLS-1$
-
- m_browserTextField = UIComponentHelper.createTextField(
- parent, 1);
- m_browserTextField.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.BrowserTextField"); //$NON-NLS-1$
-
- m_browserPathButton = new Button(UIComponentHelper
- .createLayoutComposite(parent), SWT.PUSH);
- m_browserPathButton.setText(I18n.getString("AUTConfigComponent.browse")); //$NON-NLS-1$
- m_browserPathButton.setLayoutData(BUTTON_LAYOUT);
- m_browserPathButton.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.browserPathButton"); //$NON-NLS-1$
-
-
- Label driverPathLabel = UIComponentHelper.createLabel(parent, "WebAutConfigComponent.driverPath"); //$NON-NLS-1$
- driverPathLabel.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.driverPathLabel"); //$NON-NLS-1$
- ControlDecorator.createInfo(driverPathLabel,
- I18n.getString("ControlDecorator.WebDriverPath"), false); //$NON-NLS-1$
-
- m_driverTextField = UIComponentHelper.createTextField(
- parent, 1);
- m_driverTextField.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.DriverTextField"); //$NON-NLS-1$
-
- m_driverPathButton = new Button(UIComponentHelper
- .createLayoutComposite(parent), SWT.PUSH);
- m_driverPathButton.setText(I18n.getString("AUTConfigComponent.browse")); //$NON-NLS-1$
- m_driverPathButton.setLayoutData(BUTTON_LAYOUT);
- m_driverPathButton.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.driverPathButton"); //$NON-NLS-1$
- }
-
- /**
- *
- * {@inheritDoc}
- */
- protected void installListeners() {
- super.installListeners();
- WidgetModifyListener modifyListener = getModifyListener();
- WidgetSelectionListener selectionListener = getSelectionListener();
-
- getAUTAgentHostNameCombo().addModifyListener(modifyListener);
- m_autUrlTextField.addModifyListener(modifyListener);
- m_autIdAttibuteTextField.addModifyListener(modifyListener);
- m_browserTextField.addModifyListener(modifyListener);
- m_driverTextField.addModifyListener(modifyListener);
- m_browserPathButton.addSelectionListener(selectionListener);
- m_driverPathButton.addSelectionListener(selectionListener);
- m_browserCombo.addSelectionListener(selectionListener);
- m_activationMethodCombo.addSelectionListener(selectionListener);
- m_singleWindowCheckBox.addSelectionListener(selectionListener);
- m_webdriverCheckBox.addSelectionListener(selectionListener);
- m_browserSizeCombo.addSelectionListener(selectionListener);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- protected void deinstallListeners() {
- super.deinstallListeners();
- WidgetModifyListener modifyListener = getModifyListener();
- WidgetSelectionListener selectionListener = getSelectionListener();
-
- getAUTAgentHostNameCombo().removeModifyListener(modifyListener);
- m_autUrlTextField.removeModifyListener(modifyListener);
- m_autIdAttibuteTextField.removeModifyListener(modifyListener);
- m_browserTextField.removeModifyListener(modifyListener);
- m_driverTextField.removeModifyListener(modifyListener);
- m_browserPathButton.removeSelectionListener(selectionListener);
- m_driverPathButton.removeSelectionListener(selectionListener);
- m_browserCombo.removeSelectionListener(selectionListener);
- m_activationMethodCombo.removeSelectionListener(selectionListener);
- m_singleWindowCheckBox.removeSelectionListener(selectionListener);
- m_webdriverCheckBox.removeSelectionListener(selectionListener);
- m_browserSizeCombo.removeSelectionListener(selectionListener);
- }
-
- /**
- * This private inner class contains a new SelectionListener.
- *
- * @author BREDEX GmbH
- * @created 13.07.2005
- */
- private class WidgetSelectionListener implements SelectionListener {
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("synthetic-access")
- public void widgetSelected(SelectionEvent e) {
- Object source = e.getSource();
- boolean checked = false;
-
- if (source.equals(m_activationMethodCombo)) {
- checked = true;
- } else if (source.equals(m_browserSizeCombo)) {
- checked = true;
- } else if (source.equals(m_browserCombo)) {
- handleBrowserDependentEnablement();
- checked = true;
- } else if (source.equals(m_browserPathButton)) {
- if (isRemoteRequest()) {
- remoteBrowse(false, AutConfigConstants.BROWSER_PATH,
- m_browserTextField,
- I18n.getString("WebAutConfigComponent.SelectBrowserPath")); //$NON-NLS-1$
- } else {
- FileDialog fileDialog = new FileDialog(getShell(),
- SWT.APPLICATION_MODAL | SWT.ON_TOP);
- //handleBrowserPathButtonEvent(fileDialog);
-
- fileDialog.setText(I18n.getString("WebAutConfigComponent.SelectBrowserPath")); //$NON-NLS-1$
- String browserFile = fileDialog.open();
- if (browserFile != null) {
- m_browserTextField.setText(browserFile);
- }
- }
- handleBrowserDependentEnablement();
- return;
- } else if (source.equals(m_driverPathButton)) {
- if (isRemoteRequest()) {
- remoteBrowse(false, AutConfigConstants.DRIVER_PATH,
- m_driverTextField,
- I18n.getString("WebAutConfigComponent.SelectDriverPath")); //$NON-NLS-1$
- } else {
- FileDialog fileDialog = new FileDialog(getShell(),
- SWT.APPLICATION_MODAL | SWT.ON_TOP);
- //handleBrowserPathButtonEvent(fileDialog);
-
- fileDialog.setText(I18n.getString("WebAutConfigComponent.SelectDriverPath")); //$NON-NLS-1$
- String browserFile = fileDialog.open();
- if (browserFile != null) {
- m_driverTextField.setText(browserFile);
- }
- }
- handleBrowserDependentEnablement();
- return;
- } else if (source.equals(m_singleWindowCheckBox)) {
- checked = true;
- } else if (source.equals(m_webdriverCheckBox)) {
- handleWebdriverDependentEnablement();
- checked = true;
- }
- if (checked) {
- checkAll();
- return;
- }
- Assert.notReached("Event activated by unknown widget(" + source + ")."); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * {@inheritDoc}
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- // Do nothing
- }
- }
-
- /**
- *
- */
- private void handleWebdriverDependentEnablement() {
- if (m_webdriverCheckBox.getSelection()) {
- m_browserSizeCombo.setEnabled(true);
- m_singleWindowCheckBox.setEnabled(false);
- m_driverPathButton.setEnabled(true);
- m_driverTextField.setEnabled(true);
- } else {
- m_browserSizeCombo.setEnabled(false);
- m_singleWindowCheckBox.setEnabled(true);
- m_driverPathButton.setEnabled(false);
- m_driverTextField.setEnabled(false);
- }
- handleBrowserDependentEnablement();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- protected boolean checkLocalhostServer() {
- boolean enable = super.checkLocalhostServer();
- boolean browseEnabled = enable || isRemoteRequest();
- m_browserPathButton.setEnabled(
- browseEnabled && m_browserTextField.getEnabled());
- return enable;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- protected boolean handleBrowserDependentEnablement() {
- boolean enable = super.checkLocalhostServer();
- boolean browseEnabled = enable || isRemoteRequest();
- boolean isIE = m_browserCombo.getSelectedObject().equals(
- Browser.InternetExplorer);
- Browser browser = m_browserCombo.getSelectedObject();
- m_browserPathButton.setEnabled(!isIE && browseEnabled);
- m_browserTextField.setEnabled(!isIE && browseEnabled);
- boolean isWebDriver = m_webdriverCheckBox.getSelection();
- if (isWebDriver) {
- if (browser.equals(Browser.Firefox)) {
- m_driverPathButton.setEnabled(false);
- m_driverTextField.setEnabled(false);
- } else {
- m_driverPathButton.setEnabled(browseEnabled);
- m_driverTextField.setEnabled(browseEnabled);
- }
- }
- return isIE;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- protected void initState() {
- m_activationMethodCombo.setEnabled(true);
- m_activationMethodCombo.setEnabled(true);
- m_autUrlTextField.setEnabled(true);
- m_autIdAttibuteTextField.setEnabled(true);
- m_browserCombo.setEnabled(true);
- m_browserPathButton.setEnabled(true);
- m_browserTextField.setEnabled(true);
- m_driverPathButton.setEnabled(false);
- m_driverTextField.setEnabled(false);
- handleWebdriverDependentEnablement();
- checkLocalhostServer();
- handleBrowserDependentEnablement();
- RemoteFileBrowserBP.clearCache(); // avoid all caches
- }
-
- /**
- * This private inner class contains a new ModifyListener.
- *
- * @author BREDEX GmbH
- * @created 22.11.2006
- */
- private class WidgetModifyListener implements ModifyListener {
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("synthetic-access")
- public void modifyText(ModifyEvent e) {
- Object source = e.getSource();
- boolean checked = false;
- if (source.equals(m_autUrlTextField)) {
- checked = true;
- } else if (source.equals(m_browserTextField)) {
- checked = true;
- } else if (source.equals(m_driverTextField)) {
- checked = true;
- } else if (source.equals(m_autIdAttibuteTextField)) {
- checked = true;
- } else if (source.equals(getAUTAgentHostNameCombo())) {
- checkLocalhostServer();
- checked = true;
- } else if (source.equals(m_browserCombo)) {
- handleBrowserDependentEnablement();
- checked = true;
- }
- if (checked) {
- checkAll();
- return;
- }
- Assert.notReached("Event activated by unknown widget."); //$NON-NLS-1$
- }
-
- }
-
- /**
- * The action of the activation combo
- * @return true
- */
- boolean handleActivationComboEvent() {
- putConfigValue(AutConfigConstants.ACTIVATION_METHOD,
- ActivationMethod.getRCString(m_activationMethodCombo
- .getSelectedObject()));
- return true;
- }
-
- /**
- * @return <code>null</code> if the new value is valid. Otherwise, returns
- * a status parameter indicating the cause of the problem.
- */
- DialogStatusParameter modifyUrlTextField() {
- DialogStatusParameter error = null;
- String urlText = m_autUrlTextField.getText();
- if (m_autUrlTextField.getText().length() == 0) {
- error = createErrorStatus(I18n.getString("WebAutConfigComponent.emptyUrl")); //$NON-NLS-1$
- } else {
- try {
- new URL(urlText);
- } catch (MalformedURLException e) {
- error = createErrorStatus(I18n.getString("WebAutConfigComponent.wrongUrl")); //$NON-NLS-1$
- }
- }
-
- putConfigValue(AutConfigConstants.AUT_URL, urlText);
-
- return error;
- }
-
- /**
- * @return <code>null</code> if the new value is valid. Otherwise, returns
- * a status parameter indicating the cause of the problem.
- */
- DialogStatusParameter modifyIDAttributeTextField() {
- DialogStatusParameter error = null;
- String idText = m_autIdAttibuteTextField.getText();
- if (!idText.matches("[a-zA-Z]*")) { //$NON-NLS-1$
- error = createErrorStatus(I18n
- .getString("HTMLAutConfigComponent.wrongAutIdAttribute")); //$NON-NLS-1$
- } else {
- putConfigValue(AutConfigConstants.WEB_ID_TAG, idText);
- }
- return error;
- }
-
- /**
- * @return <code>null</code> if the new value is valid. Otherwise, returns
- * a status parameter indicating the cause of the problem.
- */
- DialogStatusParameter modifyBrowserPathTextField() {
- DialogStatusParameter error = null;
- String txt = m_browserTextField.getText();
-
- putConfigValue(AutConfigConstants.BROWSER_PATH, txt);
-
- return error;
- }
-
- /**
- * @return <code>null</code> if the new value is valid. Otherwise, returns
- * a status parameter indicating the cause of the problem.
- */
- DialogStatusParameter modifyDriverPathTextField() {
- DialogStatusParameter error = null;
- String txt = m_driverTextField.getText();
-
- putConfigValue(AutConfigConstants.DRIVER_PATH, txt);
-
- return error;
- }
-
- /**
- * @return <code>null</code> if the new value is valid. Otherwise, returns
- * a status parameter indicating the cause of the problem.
- */
- DialogStatusParameter modifyBrowser() {
- final Browser browser = m_browserCombo.getSelectedObject();
- if (browser != null) {
- putConfigValue(AutConfigConstants.BROWSER, browser.toString());
- }
-
- return null;
- }
-
- /**
- * @return <code>null</code> if the new value is valid. Otherwise, returns a
- * status parameter indicating the cause of the problem.
- */
- DialogStatusParameter modifyBrowserSize() {
- final BrowserSize browserSize = m_browserSizeCombo.getSelectedObject();
- if (browserSize == null || BrowserSize.FULLSCREEN == browserSize) {
- putConfigValue(AutConfigConstants.BROWSER_SIZE,
- BrowserSize.FULLSCREEN.toString());
- } else {
- putConfigValue(AutConfigConstants.BROWSER_SIZE,
- browserSize.toString());
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- protected void populateBasicArea(Map<String, String> data) {
- super.populateBasicArea(data);
-
- String browser = data.get(AutConfigConstants.BROWSER);
- if (browser == null) {
- browser = Browser.InternetExplorer.toString();
- }
- m_browserCombo.setSelectedObject(Browser.valueOf(browser));
-
- if (!isDataNew(data)) {
- m_autUrlTextField.setText(
- StringUtils.defaultString(
- data.get(AutConfigConstants.AUT_URL)));
- }
- }
-
- /**
- * {@inheritDoc}
- */
- protected void populateAdvancedArea(Map<String, String> data) {
- if (!isDataNew(data)) {
- m_browserTextField.setText(StringUtils.defaultString(data
- .get(AutConfigConstants.BROWSER_PATH)));
-
- m_driverTextField.setText(StringUtils.defaultString(data
- .get(AutConfigConstants.DRIVER_PATH)));
-
- String browserSize = data.get(AutConfigConstants.BROWSER_SIZE);
- if (StringUtils.isEmpty(browserSize)) {
- m_browserSizeCombo.setSelectedObject(BrowserSize.FULLSCREEN);
- } else {
- m_browserSizeCombo.setSelectedObject(BrowserSize
- .valueOf(browserSize));
- }
- String selection = data.get(AutConfigConstants.SINGLE_WINDOW_MODE);
- boolean selected = false;
- if (StringUtils.isEmpty(selection)) {
- selected = true;
- } else {
- selected = Boolean.parseBoolean(selection);
- }
- m_singleWindowCheckBox.setSelection(selected);
- String webdriverSelection = data.get(
- AutConfigConstants.WEBDRIVER_MODE);
- boolean webdriverSelected = false;
- if (StringUtils.isEmpty(webdriverSelection)) {
- webdriverSelected = false;
- } else {
- webdriverSelected = Boolean.parseBoolean(webdriverSelection);
- }
- m_webdriverCheckBox.setSelection(webdriverSelected);
- } else {
- m_singleWindowCheckBox.setSelection(true);
- }
-
- }
-
- /**
- * {@inheritDoc}
- */
- protected void populateExpertArea(Map<String, String> data) {
- m_activationMethodCombo.setSelectedObject(
- ActivationMethod.getEnum(data
- .get(AutConfigConstants.ACTIVATION_METHOD)));
- if (!isDataNew(data)) {
- String webIdTag = data.get(AutConfigConstants.WEB_ID_TAG);
- if (webIdTag == null) {
- webIdTag = StringConstants.EMPTY;
- }
- m_autIdAttibuteTextField.setText(webIdTag);
- }
- }
-
- /**
- *
- * @return the modifier listener.
- */
- @SuppressWarnings("synthetic-access")
- private WidgetModifyListener getModifyListener() {
- if (m_modifyListener == null) {
- m_modifyListener = new WidgetModifyListener();
- }
-
- return m_modifyListener;
-
- }
-
- /**
- *
- * @return the single instance of the selection listener.
- */
- @SuppressWarnings("synthetic-access")
- private WidgetSelectionListener getSelectionListener() {
- if (m_selectionListener == null) {
- m_selectionListener = new WidgetSelectionListener();
- }
-
- return m_selectionListener;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- protected void checkAll(java.util.List<DialogStatusParameter> paramList) {
- super.checkAll(paramList);
- addError(paramList, modifyUrlTextField());
- addError(paramList, modifyIDAttributeTextField());
- addError(paramList, modifyBrowser());
- addError(paramList, modifyBrowserPathTextField());
- addError(paramList, modifyDriverPathTextField());
- addError(paramList, modifySingleWindowCheckBox());
- addError(paramList, modifyWebdriverCheckBox());
- addError(paramList, modifyBrowserSize());
- handleActivationComboEvent();
- }
-
- /**
- * @return <code>null</code> if the new value is valid. Otherwise, returns
- * a status parameter indicating the cause of the problem.
- */
- DialogStatusParameter modifySingleWindowCheckBox() {
- DialogStatusParameter error = null;
- Boolean checked = m_singleWindowCheckBox.getSelection();
- putConfigValue(AutConfigConstants.SINGLE_WINDOW_MODE,
- checked.toString());
-
- return error;
- }
-
- /**
- * @return <code>null</code> if the new value is valid. Otherwise, returns
- * a status parameter indicating the cause of the problem.
- */
- DialogStatusParameter modifyWebdriverCheckBox() {
- DialogStatusParameter error = null;
- Boolean checked = m_webdriverCheckBox.getSelection();
- putConfigValue(AutConfigConstants.WEBDRIVER_MODE,
- checked.toString());
-
- return error;
- }
-
- /**
- * Inits the SingleWindowMode CheckBox which tells the server in which mode to run
- * @param parent The parent Composite.
- */
- protected void createSingleModeCheckBox(Composite parent) {
- Label singleWindowModeLabel = UIComponentHelper.createLabel(parent, "WebAutConfigComponent.singleWindowMode"); //$NON-NLS-1$
- singleWindowModeLabel.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.singleWindowModeLabel"); //$NON-NLS-1$
- ControlDecorator.createInfo(singleWindowModeLabel,
- I18n.getString("ControlDecorator.SingleWindowMode"), false); //$NON-NLS-1$
- m_singleWindowCheckBox = UIComponentHelper
- .createToggleButton(parent, 2);
- m_singleWindowCheckBox.setData(SwtToolkitConstants.WIDGET_NAME, "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.SingleWindowCheckBox"); //$NON-NLS-1$
-
- }
-
- /**
- * Creates checkbox determining whether webdriver should be used
- * @param parent The parent Composite.
- */
- protected void createWebdriverCheckBox(Composite parent) {
- Label useWebdriverLabel = UIComponentHelper.createLabel(parent,
- "WebAutConfigComponent.webdriverMode"); //$NON-NLS-1$
- useWebdriverLabel.setData(SwtToolkitConstants.WIDGET_NAME,
- "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.WebdriverLabel"); //$NON-NLS-1$
- ControlDecorator.createInfo(useWebdriverLabel,
- I18n.getString("ControlDecorator.WebdriverMode"), false); //$NON-NLS-1$
- m_webdriverCheckBox = UIComponentHelper
- .createToggleButton(parent, 2);
- m_webdriverCheckBox.setData(SwtToolkitConstants.WIDGET_NAME,
- "org.eclipse.jubula.toolkit.provider.html.gui.HtmlAutConfigComponent.WebdriverCheckBox"); //$NON-NLS-1$
- }
-
-}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ProjectSettingWizardPage.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ProjectSettingWizardPage.java
index 2a384fe45..7689faad2 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ProjectSettingWizardPage.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/wizards/pages/ProjectSettingWizardPage.java
@@ -35,10 +35,8 @@ import org.eclipse.jubula.client.ui.rcp.widgets.CheckedProjectNameText;
import org.eclipse.jubula.client.ui.rcp.wizards.ProjectWizard;
import org.eclipse.jubula.client.ui.utils.LayoutUtil;
import org.eclipse.jubula.client.ui.widgets.DirectCombo;
-import org.eclipse.jubula.client.ui.widgets.I18nEnumCombo;
import org.eclipse.jubula.client.ui.widgets.UIComponentHelper;
import org.eclipse.jubula.toolkit.common.exception.ToolkitPluginException;
-import org.eclipse.jubula.toolkit.html.Browser;
import org.eclipse.jubula.tools.internal.constants.AutConfigConstants;
import org.eclipse.jubula.tools.internal.constants.CommandConstants;
import org.eclipse.jubula.tools.internal.constants.EnvConstants;
@@ -97,16 +95,6 @@ public class ProjectSettingWizardPage extends WizardPage {
private Composite m_autToolkit;
/** the combo box for the aut toolkit */
private DirectCombo<String> m_autToolKitComboBox;
- /** Browser label container */
- private Composite m_browser;
- /** the combo box for browser */
- private I18nEnumCombo<Browser> m_browserComboBox;
- /** Browser path label container */
- private Composite m_browserPath;
- /** the text field for browser path*/
- private Text m_browserPathTF;
- /** browse button for the executable */
- private Button m_browserPathButton;
/** the selectionListener */
private final WidgetSelectionListener m_selectionListener =
new WidgetSelectionListener();
@@ -156,8 +144,6 @@ public class ProjectSettingWizardPage extends WizardPage {
.PROJECT_WIZARD);
createAutToolKit();
createExecutableCommandField();
- createBrowserCombo();
- createBrowserPathField();
validation();
createProjectTemplateCheckBox(bottomComp);
createNextLabel(bottomComp);
@@ -259,39 +245,6 @@ public class ProjectSettingWizardPage extends WizardPage {
refresh();
}
- /** Creates the browser combo line */
- private void createBrowserCombo() {
- m_browser = createLineComposite();
- Composite leftComp = createLeftComposite(m_browser,
- I18n.getString("WebAutConfigComponent.browser")); //$NON-NLS-1$
- Composite rightComp = createRightComposite(m_browser);
- m_browserComboBox = UIComponentHelper.createEnumCombo(rightComp, 2,
- "WebAutConfigComponent.Browser", Browser.class); //$NON-NLS-1$
- GridData comboGridData = new GridData();
- comboGridData.grabExcessHorizontalSpace = true;
- LayoutUtil.addToolTipAndMaxWidth(comboGridData, m_browserComboBox);
- m_browserComboBox.setLayoutData(comboGridData);
- m_browserComboBox.addSelectionListener(m_selectionListener);
- m_browserComboBox.setData(SwtToolkitConstants.WIDGET_NAME,
- "NewProjectWizard.BrowserComboBox"); //$NON-NLS-1$
- refresh();
- }
-
- /** Creates the browser path line */
- private void createBrowserPathField() {
- m_browserPath = createLineComposite();
- Composite leftComp = createLeftComposite(m_browserPath,
- I18n.getString("WebAutConfigComponent.browserPath")); //$NON-NLS-1$
- Composite rightComp = createRightComposite(m_browserPath,
- NUM_COLUMNS_2);
- m_browserPathTF = createTextField(rightComp, null, false);
- m_browserPathTF.addModifyListener(m_modifyListener);
- m_browserPathButton = createBrowseButton(rightComp);
- m_browserPathTF.setData(SwtToolkitConstants.WIDGET_NAME,
- "NewProjectWizard.BrowserPathField"); //$NON-NLS-1$
- refresh();
- }
-
/** Creates the project template check box
* @param parent
*/
@@ -457,28 +410,6 @@ public class ProjectSettingWizardPage extends WizardPage {
refresh();
}
- /** remove the aut browser combo line */
- private void removeBrowserCombo() {
- if (m_browser != null) {
- m_browser.dispose();
- m_browser = null;
- }
- m_browserComboBox = null;
- putConfigValue(AutConfigConstants.BROWSER, EMPTY);
- refresh();
- }
-
- /** remove the aut browser path line */
- private void removeBrowserPathField() {
- if (m_browserPath != null) {
- m_browserPath.dispose();
- m_browserPath = null;
- }
- m_browserPathTF = null;
- putConfigValue(AutConfigConstants.BROWSER_PATH, EMPTY);
- refresh();
- }
-
/** Handle aut config */
private void handleAutConfig() {
String projectToolkit = m_projectToolKitComboBox.getSelectedObject();
@@ -585,16 +516,6 @@ public class ProjectSettingWizardPage extends WizardPage {
}
}
- /** Handle the browser path button */
- private void handleBrowserPathButtonEvent() {
- String directory = fileBrowser(
- I18n.getString("WebAutConfigComponent.SelectBrowserPath"), //$NON-NLS-1$
- m_browserPathTF, null);
- if (directory != null) {
- m_browserPathTF.setText(directory);
- validation();
- }
- }
/**
* Writes the path of the executable file in the AUT Working Dir field.
@@ -645,27 +566,6 @@ public class ProjectSettingWizardPage extends WizardPage {
putConfigValue(AutConfigConstants.AUT_URL, urlText);
}
- /** Modify the browser */
- private void modifyBrowser() {
- final String browser = (m_browserComboBox == null || m_browserComboBox
- .getSelectedObject() == null ? EMPTY
- : m_browserComboBox.getSelectedObject().toString());
- putConfigValue(AutConfigConstants.BROWSER, browser);
- }
-
- /** Check and modify the browser path */
- private void modifyBrowserPathTextField() {
- String txt = EMPTY;
- if (m_browserPathTF != null && !m_browserPathTF.getText().isEmpty()) {
- txt = m_browserPathTF.getText();
- File file = new File(txt);
- if (!file.exists()) {
- warningMessage(Messages.AUTConfigComponentFileNotFound);
- }
- }
- putConfigValue(AutConfigConstants.BROWSER_PATH, txt);
- }
-
/** set default message */
private void noMessage() {
setMessage(Messages.ProjectWizardNewProject);
@@ -699,8 +599,6 @@ public class ProjectSettingWizardPage extends WizardPage {
modifyProjectNameField();
modifyUrlTextField();
modifyExecutableTextField();
- modifyBrowser();
- modifyBrowserPathTextField();
setPageComplete(true);
} catch (DialogValidationException e) {
e.errorMessageHandling();
@@ -741,8 +639,6 @@ public class ProjectSettingWizardPage extends WizardPage {
m_autMain.setToolkit(toolkit);
removeAutExecutable();
removeAutUrl();
- removeBrowserCombo();
- removeBrowserPathField();
if (toolkit == null) {
return;
}
@@ -754,10 +650,6 @@ public class ProjectSettingWizardPage extends WizardPage {
case CommandConstants.JAVAFX_TOOLKIT:
createExecutableCommandField();
break;
- case CommandConstants.HTML_TOOLKIT:
- createUrlField();
- createBrowserCombo();
- break;
default:
m_autMain.setToolkit(null);
createAutToolKit();
@@ -766,15 +658,6 @@ public class ProjectSettingWizardPage extends WizardPage {
validation();
}
- /** Handle the combobox of browser */
- private void handleBrowserCombo() {
- Browser browser = m_browserComboBox.getSelectedObject();
- removeBrowserPathField();
- if (!browser.equals(Browser.InternetExplorer)) {
- createBrowserPathField();
- }
- }
-
/** Set the default keyboard layout on */
private void keyboardLayout() {
String local = InputContext.getInstance().getLocale().toString();
@@ -803,8 +686,6 @@ public class ProjectSettingWizardPage extends WizardPage {
Object o = e.getSource();
if (o.equals(m_autExecButton)) {
handleExecButtonEvent();
- } else if (o.equals(m_browserPathButton)) {
- handleBrowserPathButtonEvent();
} else if (o.equals(m_projectToolKitComboBox)) {
handleProjectToolkitCombo();
validation();
@@ -812,9 +693,6 @@ public class ProjectSettingWizardPage extends WizardPage {
handleAutToolkitCombo(m_autToolKitComboBox
.getSelectedObject());
validation();
- } else if (o.equals(m_browserComboBox)) {
- handleBrowserCombo();
- validation();
}
}

Back to the top