Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Struckmann2015-08-20 11:07:17 +0000
committerSebastian Struckmann2015-08-25 14:14:56 +0000
commit9a6ff55691b2f279ddb5fb8d7de042195f8eaf58 (patch)
treec331f8f8d4a7b6bf4ee44a6b9cd4a382090287af /org.eclipse.jubula.client.ui.rcp
parentd1020777c4bb021a99ab8cd001c82635e40256c6 (diff)
downloadorg.eclipse.jubula.core-9a6ff55691b2f279ddb5fb8d7de042195f8eaf58.tar.gz
org.eclipse.jubula.core-9a6ff55691b2f279ddb5fb8d7de042195f8eaf58.tar.xz
org.eclipse.jubula.core-9a6ff55691b2f279ddb5fb8d7de042195f8eaf58.zip
Sprint task - Support collecting of all supported parents in OMM for JavaFX, see http://eclip.se/472954
Diffstat (limited to 'org.eclipse.jubula.client.ui.rcp')
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/StartObjectMappingModeHandler.java50
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/Messages.java1
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/messages.properties3
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/ObjectMappingPreferencePage.java54
4 files changed, 97 insertions, 11 deletions
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/StartObjectMappingModeHandler.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/StartObjectMappingModeHandler.java
index f3db909ae..7466a22cc 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/StartObjectMappingModeHandler.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/StartObjectMappingModeHandler.java
@@ -89,6 +89,12 @@ public class StartObjectMappingModeHandler extends AbstractRunningAutHandler {
/** the code for the key used to collect UI Elements */
private int m_key;
+ /** the code for the modifier key(s) used to collect UI Elements and their parents */
+ private int m_modifierWithParents;
+
+ /** the code for the key used to collect UI Elements and their parents */
+ private int m_keyWithParents;
+
/** the category into which collected UI Elements will be collected */
private IObjectMappingCategoryPO m_category;
@@ -98,6 +104,13 @@ public class StartObjectMappingModeHandler extends AbstractRunningAutHandler {
* @see {@link org.eclipse.jubula.tools.internal.constants.InputConstants}
*/
private int m_type;
+
+ /**
+ * the type of input action that will collect a UI Element and its parents
+ *
+ * @see {@link org.eclipse.jubula.tools.internal.constants.InputConstants}
+ */
+ private int m_typeWithParents;
/**
* Constructor
@@ -112,11 +125,18 @@ public class StartObjectMappingModeHandler extends AbstractRunningAutHandler {
* @param category The category into which collected UI Elements will
* be collected.
* @param type The type of input action that will collect a UI Element.
+ * @param modifierWP The code for the modifier key(s) used to collect
+ * UI Elements and their parents.
+ * @param keyWP The code for the key used to collect UI Elements
+ * and their parents.
+ * @param typeWP The type of input action that will collect a UI Element
+ * and its parents.
* @see {@link org.eclipse.jubula.tools.internal.constants.InputConstants}
*/
public StartObjectMappingModeJob(ObjectMappingMultiPageEditor editor,
AutIdentifier autId, int modifier, int key,
- IObjectMappingCategoryPO category, int type) {
+ IObjectMappingCategoryPO category, int type,
+ int modifierWP, int keyWP, int typeWP) {
super("Start Object Mapping Mode"); //$NON-NLS-1$
m_editor = editor;
m_autId = autId;
@@ -124,6 +144,9 @@ public class StartObjectMappingModeHandler extends AbstractRunningAutHandler {
m_key = key;
m_category = category;
m_type = type;
+ m_modifierWithParents = modifierWP;
+ m_keyWithParents = keyWP;
+ m_typeWithParents = typeWP;
}
/**
@@ -134,7 +157,9 @@ public class StartObjectMappingModeHandler extends AbstractRunningAutHandler {
try {
TestExecutionContributor.getInstance()
.getClientTest().startObjectMapping(
- m_autId, m_modifier, m_key, m_type);
+ m_autId, m_modifier, m_key, m_type,
+ m_modifierWithParents, m_keyWithParents,
+ m_typeWithParents);
DataEventDispatcher.getInstance()
.fireOMStateChanged(OMState.running);
DataEventDispatcher.getInstance()
@@ -267,20 +292,29 @@ public class StartObjectMappingModeHandler extends AbstractRunningAutHandler {
} else {
IPreferenceStore preferenceStore = Plugin.getDefault()
.getPreferenceStore();
- int mod = preferenceStore.getInt(Constants.MAPPING_MOD_KEY);
- int key = preferenceStore.getInt(Constants.MAPPING_TRIGGER_KEY);
- int type = preferenceStore
+ int mappingMod = preferenceStore.getInt(
+ Constants.MAPPING_MOD_KEY);
+ int mappingKey = preferenceStore.getInt(
+ Constants.MAPPING_TRIGGER_KEY);
+ int mappingType = preferenceStore
.getInt(Constants.MAPPING_TRIGGER_TYPE_KEY);
+ int mappingWPMod = preferenceStore.getInt(
+ Constants.MAPPING_WITH_PARENTS_MOD_KEY);
+ int mappingWPKey = preferenceStore.getInt(
+ Constants.MAPPING_WITH_PARENTS_TRIGGER_KEY);
+ int mappingWPType = preferenceStore
+ .getInt(Constants.MAPPING_WITH_PARENTS_TRIGGER_TYPE_KEY);
final String toolkit = editor.getAut().getToolkit();
if (toolkit.equals(CommandConstants.SWT_TOOLKIT)
|| toolkit.equals(CommandConstants.RCP_TOOLKIT)) {
- mod = KeyConverter.convertSwingStateMask(mod);
- key = KeyConverter.convertSwingToSwt(key);
+ mappingMod = KeyConverter.convertSwingStateMask(mappingMod);
+ mappingKey = KeyConverter.convertSwingToSwt(mappingKey);
}
Job startObjectMappingModeJob = new StartObjectMappingModeJob(
- editor, autId, mod, key, category, type);
+ editor, autId, mappingMod, mappingKey, category,
+ mappingType, mappingWPMod, mappingWPKey, mappingWPType);
startObjectMappingModeJob.setSystem(true);
JobUtils.executeJob(startObjectMappingModeJob, null);
}
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/Messages.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/Messages.java
index 0d919358c..e1c1312da 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/Messages.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/Messages.java
@@ -444,6 +444,7 @@ public class Messages extends NLS {
public static String ObjectMappingEditorSplitPaneView;
public static String ObjectMappingEditorTechnicalName;
public static String ObjectMappingPreferencePageCollectShortcut;
+ public static String ObjectMappingPreferencePageCollectWithParentsShortcut;
public static String ObjectMappingPreferencePageContextFactor;
public static String ObjectMappingPreferencePageDescription;
public static String ObjectMappingPreferencePageLock;
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/messages.properties b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/messages.properties
index 5e2820042..9f29ce0a6 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/messages.properties
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/i18n/messages.properties
@@ -426,7 +426,8 @@ ObjectMappingEditorEditor=OM /
ObjectMappingEditorLogicalName=Component Name
ObjectMappingEditorSplitPaneView=Object Mapping
ObjectMappingEditorTechnicalName=Technical Name
-ObjectMappingPreferencePageCollectShortcut=Shortcut to collect components from the AUT\:
+ObjectMappingPreferencePageCollectShortcut=Shortcut to collect the component at mouse position from any Java AUT\:
+ObjectMappingPreferencePageCollectWithParentsShortcut=Shortcut to collect the component at mouse position and all its supported parents from a JavaFX AUT\:
ObjectMappingPreferencePageContextFactor=&Context Weight
ObjectMappingPreferencePageDescription=Here you can configure everything concerning Object Mapping.
ObjectMappingPreferencePageLock=lock
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/ObjectMappingPreferencePage.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/ObjectMappingPreferencePage.java
index edd77c804..247e361a4 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/ObjectMappingPreferencePage.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/ObjectMappingPreferencePage.java
@@ -58,7 +58,13 @@ public class ObjectMappingPreferencePage extends PreferencePage
private Combo m_mappingModifier = null;
/** combo for mapping keyboard shortcut */
+ private Combo m_mappingWithParentsModifier = null;
+
+ /** combo for mapping keyboard shortcut */
private DirectCombo<UserInput> m_mappingKey = null;
+
+ /** combo for mapping keyboard shortcut */
+ private DirectCombo<UserInput> m_mappingWithParentsKey = null;
/**
* Default Constructor
@@ -167,6 +173,21 @@ public class ObjectMappingPreferencePage extends PreferencePage
label.setText(" + "); //$NON-NLS-1$
m_mappingKey = InputComboUtil.createInputCombo(
composite, SWT.DROP_DOWN | SWT.READ_ONLY);
+
+ label = new Label(composite, SWT.NONE);
+ label.setText(Messages
+ .ObjectMappingPreferencePageCollectWithParentsShortcut);
+ label.setFont(LayoutUtil.BOLD_TAHOMA);
+ label.setLayoutData(data2);
+
+ label = new Label(composite, SWT.NONE);
+ m_mappingWithParentsModifier = new Combo(composite,
+ SWT.DROP_DOWN | SWT.READ_ONLY);
+ m_mappingWithParentsModifier.setItems(keys.getModifierString());
+ label = new Label(composite, SWT.NONE);
+ label.setText(" + "); //$NON-NLS-1$
+ m_mappingWithParentsKey = InputComboUtil.createInputCombo(
+ composite, SWT.DROP_DOWN | SWT.READ_ONLY);
}
/**
@@ -189,9 +210,17 @@ public class ObjectMappingPreferencePage extends PreferencePage
m_mappingModifier.select(InputCodeHelper.getInstance()
.getIndexOfModifier(
getDefaultPrefsInt(Constants.MAPPING_MOD_KEY)));
+ m_mappingWithParentsModifier.select(InputCodeHelper.getInstance()
+ .getIndexOfModifier(
+ getDefaultPrefsInt(
+ Constants.MAPPING_WITH_PARENTS_MOD_KEY)));
InputComboUtil.setSelectedInput(m_mappingKey,
getDefaultPrefsInt(Constants.MAPPING_TRIGGER_KEY),
getDefaultPrefsInt(Constants.MAPPING_TRIGGER_TYPE_KEY));
+ InputComboUtil.setSelectedInput(m_mappingWithParentsKey,
+ getDefaultPrefsInt(Constants.MAPPING_WITH_PARENTS_TRIGGER_KEY),
+ getDefaultPrefsInt(Constants.
+ MAPPING_WITH_PARENTS_TRIGGER_TYPE_KEY));
}
/**
@@ -205,9 +234,18 @@ public class ObjectMappingPreferencePage extends PreferencePage
m_mappingModifier.select(
InputCodeHelper.getInstance().getIndexOfModifier(
getPreferenceStore().getInt(Constants.MAPPING_MOD_KEY)));
+ m_mappingWithParentsModifier.select(
+ InputCodeHelper.getInstance().getIndexOfModifier(
+ getPreferenceStore().getInt(
+ Constants.MAPPING_WITH_PARENTS_MOD_KEY)));
InputComboUtil.setSelectedInput(m_mappingKey,
getPreferenceStore().getInt(Constants.MAPPING_TRIGGER_KEY),
getPreferenceStore().getInt(Constants.MAPPING_TRIGGER_TYPE_KEY));
+ InputComboUtil.setSelectedInput(m_mappingWithParentsKey,
+ getPreferenceStore().getInt(
+ Constants.MAPPING_WITH_PARENTS_TRIGGER_KEY),
+ getPreferenceStore().getInt(
+ Constants.MAPPING_WITH_PARENTS_TRIGGER_TYPE_KEY));
}
@@ -241,12 +279,24 @@ public class ObjectMappingPreferencePage extends PreferencePage
getPreferenceStore().setValue(Constants.SHOWCHILDCOUNT_KEY, showCount);
getPreferenceStore().setValue(
Constants.MAPPING_MOD_KEY,
- InputCodeHelper.getInstance().getModifier()[m_mappingModifier
- .getSelectionIndex()]);
+ InputCodeHelper.getInstance().getModifier()[
+ m_mappingModifier.getSelectionIndex()]);
+ getPreferenceStore().setValue(
+ Constants.MAPPING_WITH_PARENTS_MOD_KEY,
+ InputCodeHelper.getInstance().getModifier()[
+ m_mappingWithParentsModifier.getSelectionIndex()]);
+
InputComboUtil.setPrefCode(m_mappingKey, getPreferenceStore(),
Constants.MAPPING_TRIGGER_KEY);
InputComboUtil.setPrefType(m_mappingKey, getPreferenceStore(),
Constants.MAPPING_TRIGGER_TYPE_KEY);
+
+ InputComboUtil.setPrefCode(m_mappingWithParentsKey,
+ getPreferenceStore(),
+ Constants.MAPPING_WITH_PARENTS_TRIGGER_KEY);
+ InputComboUtil.setPrefType(m_mappingWithParentsKey,
+ getPreferenceStore(),
+ Constants.MAPPING_WITH_PARENTS_TRIGGER_TYPE_KEY);
return super.performOk();
}
}

Back to the top