Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon van der Zanden2015-06-26 08:40:42 +0000
committerSimon van der Zanden2015-07-08 11:36:01 +0000
commitdaa4a8a227bab7f5e9b33910ff2046e491cbabf1 (patch)
tree0ab5abc43913dc62db0123d5a7f5911f8d7173e2 /org.eclipse.jubula.client.ui.rcp
parentee9333e7470a855d0cc9f11b1c62952e496f224e (diff)
downloadorg.eclipse.jubula.core-daa4a8a227bab7f5e9b33910ff2046e491cbabf1.tar.gz
org.eclipse.jubula.core-daa4a8a227bab7f5e9b33910ff2046e491cbabf1.tar.xz
org.eclipse.jubula.core-daa4a8a227bab7f5e9b33910ff2046e491cbabf1.zip
Bug 466819 - Extract getText methods from GeneralLabelProvider, to make it useable in ExecutionController
Signed-off-by: Simon van der Zanden <simon.vanderzanden@bredex.de> Change-Id: Ia1c84eb49ebba223b32e03abd9622875cea99e61
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/controllers/TestExecutionContributor.java2
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/PrefPageBasic.java17
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/labelprovider/GeneralLabelProvider.java136
3 files changed, 5 insertions, 150 deletions
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/TestExecutionContributor.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/TestExecutionContributor.java
index 67cd24b80..aa911c6e6 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/TestExecutionContributor.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/TestExecutionContributor.java
@@ -751,7 +751,7 @@ public class TestExecutionContributor
TimeUtil.delay(TimingConstantsClient.START_TEST_SUITE_DELAY);
getClientTest().startTestSuite(ts, WorkingLanguageBP.getInstance()
.getWorkingLanguage(), autId, autoScreenshot, null,
- TestExecutionConstants.RunSteps.NORMAL.getStepValue());
+ TestExecutionConstants.RunSteps.NORMAL.getStepValue(), null);
}
/**
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/PrefPageBasic.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/PrefPageBasic.java
index c227bf320..6a0b9dfb0 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/PrefPageBasic.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/preferences/PrefPageBasic.java
@@ -77,8 +77,6 @@ public class PrefPageBasic extends PreferencePage implements
/** widgets used in preference page to define preference values private */
private Button m_minimize;
/** widgets used in preference page to define preference values private */
- private Button m_showOrigName;
- /** widgets used in preference page to define preference values private */
private Button m_treeScroll;
/** widgets used in preference page to define preference values private */
private Button m_askStopAUT;
@@ -170,7 +168,6 @@ public class PrefPageBasic extends PreferencePage implements
createTreeScrollButton(composite);
createMinimizeClientButton(composite);
createAskStopAUTButton(composite);
- createShowOrigTestCaseName(composite);
createShowCAPInfosCheckbox(composite);
createShowTransientChildrensCheckbox(composite);
createDefaultProjectCheckbox(composite);
@@ -198,16 +195,6 @@ public class PrefPageBasic extends PreferencePage implements
return scrollComposite;
}
-
- /**
- * @param composite the composite
- */
- private void createShowOrigTestCaseName(Composite composite) {
- m_showOrigName = new Button(composite, SWT.CHECK);
- m_showOrigName.setText(Messages.JubulaPrefPageBasicShowOrig);
- m_showOrigName.setSelection(getPreferenceStore()
- .getBoolean(Constants.SHOWORIGINALNAME_KEY));
- }
/**
* @param composite the parent composite
@@ -548,8 +535,6 @@ public class PrefPageBasic extends PreferencePage implements
.getDefaultBoolean(Constants.TREEAUTOSCROLL_KEY));
m_askStopAUT.setSelection(m_store
.getDefaultBoolean(Constants.ASKSTOPAUT_KEY));
- m_showOrigName.setSelection(m_store
- .getDefaultBoolean(Constants.SHOWORIGINALNAME_KEY));
m_capInfoCheckbox.setSelection(m_store
.getDefaultBoolean(Constants.SHOWCAPINFO_KEY));
m_showTransientChildrenCheckBox.setSelection(m_store
@@ -595,8 +580,6 @@ public class PrefPageBasic extends PreferencePage implements
m_dataDirIsWorkspaceValue);
getPreferenceStore().setValue(Constants.DATADIR_PATH_KEY,
m_dataDirPathTextfield.getText());
- getPreferenceStore().setValue(Constants.SHOWORIGINALNAME_KEY,
- m_showOrigName.getSelection());
getPreferenceStore().setValue(Constants.SHOWCAPINFO_KEY,
m_capInfoCheckbox.getSelection());
getPreferenceStore().setValue(Constants.SHOW_TRANSIENT_CHILDREN_KEY,
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/labelprovider/GeneralLabelProvider.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/labelprovider/GeneralLabelProvider.java
index 37e2a66e9..d1bc18d10 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/labelprovider/GeneralLabelProvider.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/labelprovider/GeneralLabelProvider.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.jubula.client.ui.rcp.provider.labelprovider;
-import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
@@ -32,7 +31,6 @@ import org.eclipse.jubula.client.core.model.IExecObjContPO;
import org.eclipse.jubula.client.core.model.IExecTestCasePO;
import org.eclipse.jubula.client.core.model.INodePO;
import org.eclipse.jubula.client.core.model.IParamDescriptionPO;
-import org.eclipse.jubula.client.core.model.IParamNodePO;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.IRefTestSuitePO;
import org.eclipse.jubula.client.core.model.IReusedProjectPO;
@@ -42,6 +40,7 @@ import org.eclipse.jubula.client.core.model.ITestDataCubePO;
import org.eclipse.jubula.client.core.model.ITestJobPO;
import org.eclipse.jubula.client.core.model.ITestSuitePO;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
+import org.eclipse.jubula.client.core.utils.NodeNameUtil;
import org.eclipse.jubula.client.core.utils.StringHelper;
import org.eclipse.jubula.client.ui.constants.Constants;
import org.eclipse.jubula.client.ui.constants.IconConstants;
@@ -221,15 +220,15 @@ public class GeneralLabelProvider extends ColumnLabelProvider
}
if (node instanceof IRefTestSuitePO) {
- name = getText((IRefTestSuitePO)node);
+ name = NodeNameUtil.getText((IRefTestSuitePO)node);
} else if (node.getName() == null) {
name = UNNAMED_NODE;
} else if (node instanceof ICapPO) {
name = getText((ICapPO)node);
} else if (node instanceof IExecTestCasePO) {
- name = getText((IExecTestCasePO)node);
+ name = NodeNameUtil.getText((IExecTestCasePO)node, true);
} else if (node instanceof ISpecTestCasePO) {
- name = getText((ISpecTestCasePO)node);
+ name = NodeNameUtil.getText((ISpecTestCasePO)node, true);
} else {
name = node.getName();
}
@@ -404,48 +403,6 @@ public class GeneralLabelProvider extends ColumnLabelProvider
}
/**
- *
- * @param testCaseRef The Test Case Reference to examine.
- * @return label text for the given Test Case Reference.
- */
- public static String getText(IExecTestCasePO testCaseRef) {
- StringBuilder nameBuilder = new StringBuilder();
-
- String realName = testCaseRef.getRealName();
- if (!StringUtils.isBlank(realName)) {
- nameBuilder.append(realName);
- if (Plugin.getDefault().getPreferenceStore().getBoolean(
- Constants.SHOWORIGINALNAME_KEY)) {
- ISpecTestCasePO testCase = testCaseRef.getSpecTestCase();
- String testCaseName = testCase != null
- ? testCase.getName()
- : StringUtils.EMPTY;
- appendSpecName(nameBuilder, testCaseName);
- }
-
- } else {
- ISpecTestCasePO testCase = testCaseRef.getSpecTestCase();
- String testCaseName = testCase != null
- ? testCase.getName()
- : StringUtils.EMPTY;
- createSpecName(nameBuilder, testCaseName);
- }
-
- nameBuilder.append(getParameterString(testCaseRef));
-
- return nameBuilder.toString();
- }
-
- /**
- *
- * @param testCase The Test Case to examine.
- * @return label text for the given Test Case.
- */
- private static String getText(ISpecTestCasePO testCase) {
- return testCase.getName() + getParameterString(testCase);
- }
-
- /**
* @param paramDesc The parameter description.
* @return The short type name of the given parameter description, e.g.
* the name <code>String</code>, if the parameter has the type
@@ -467,89 +424,4 @@ public class GeneralLabelProvider extends ColumnLabelProvider
+ getShortTypeName(paramDesc)
+ CLOSE_BRACKED;
}
-
- /**
- *
- * @param paramNode The Parameter Node to examine.
- * @return a label representing all Parameters used by the given node.
- */
- private static String getParameterString(IParamNodePO paramNode) {
- StringBuilder nameBuilder = new StringBuilder();
- Iterator<IParamDescriptionPO> iter =
- paramNode.getParameterList().iterator();
- boolean parameterExist = false;
- if (iter.hasNext()) {
- parameterExist = true;
- nameBuilder.append(GeneralLabelProvider.OPEN_BRACKED);
- }
- if (iter.hasNext()) {
- while (iter.hasNext()) {
- IParamDescriptionPO descr = iter.next();
- nameBuilder.append(descr.getName());
- if (iter.hasNext()) {
- nameBuilder.append(GeneralLabelProvider.SEPARATOR);
- }
- }
- }
- if (parameterExist) {
- nameBuilder.append(GeneralLabelProvider.CLOSE_BRACKED);
- }
-
- return nameBuilder.toString();
- }
-
- /**
- *
- * @param testSuitRef The Reference Test Suit to examine.
- * @return label text for the given Reference Test Suit.
- */
- private static String getText(IRefTestSuitePO testSuitRef) {
- StringBuilder nameBuilder = new StringBuilder();
-
- String refRealName = testSuitRef.getRealName();
-
- if (!StringUtils.isBlank(refRealName)) {
- nameBuilder.append(refRealName);
- if (Plugin.getDefault().getPreferenceStore().getBoolean(
- Constants.SHOWORIGINALNAME_KEY)) {
- ITestSuitePO testSuite = testSuitRef.getTestSuite();
- String testSuiteName = testSuite != null
- ? testSuite.getName()
- : StringUtils.EMPTY;
- appendSpecName(nameBuilder, testSuiteName);
- }
-
- } else {
- String testSuiteRefName = testSuitRef != null ? testSuitRef
- .getTestSuite().getName() : UNNAMED_NODE;
- createSpecName(nameBuilder, testSuiteRefName);
-
- }
- return nameBuilder.toString();
- }
-
- /**
- * helper method to have same appearance for TS and TC
- * @param nameBuilder {@link StringBuilder} where the name should be appended
- * @param refName ref TC or TS string
- */
- private static void createSpecName(StringBuilder nameBuilder,
- String refName) {
- nameBuilder.append(StringConstants.LEFT_INEQUALITY_SING)
- .append(refName)
- .append(StringConstants.RIGHT_INEQUALITY_SING);
- }
-
- /**
- * helper method to have same appearance for TS and TC
- * @param nameBuilder {@link StringBuilder} where the name should be appended
- * @param specName spec TC or TS string
- */
- private static void appendSpecName(StringBuilder nameBuilder,
- String specName) {
- nameBuilder.append(StringConstants.SPACE)
- .append(StringConstants.LEFT_PARENTHESES)
- .append(specName)
- .append(StringConstants.RIGHT_PARENTHESES);
- }
} \ No newline at end of file

Back to the top