Commit 07020d90 authored by azara's avatar azara
Browse files

BS-14273 improve generation guidance

rename constant
parent e0d20d19
......@@ -110,7 +110,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(process, editingDomain(), repositoryAccessor, operationBuilder,
expressionBuilder,
......@@ -136,7 +136,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(process, editingDomain(), repositoryAccessor, operationBuilder,
expressionBuilder,
preferenceStore, sharedImages, dialogFactory);
......@@ -161,7 +161,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
when(expressionBuilder.toExpression(any(BusinessObjectData.class), any(FieldToContractInputMapping.class), anyBoolean())).thenReturn(
aGroovyScriptExpression().build());
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(process, editingDomain(), repositoryAccessor, operationBuilder,
......@@ -190,7 +190,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(task, editingDomain(), repositoryAccessor, operationBuilder,
expressionBuilder,
preferenceStore, sharedImages, dialogFactory);
......@@ -217,7 +217,7 @@ public class ContractInputGenerationWizardTest {
when(store.getBusinessObjectByQualifiedName("org.company.Employee")).thenReturn(
BusinessObjectBuilder.aBO("org.company.Employee").withField(SimpleFieldBuilder.aStringField("firstName").build()).build());
when(repositoryAccessor.getRepositoryStore(BusinessObjectModelRepositoryStore.class)).thenReturn(store);
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.HIDE_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
when(preferenceStore.getString(ContractInputGenerationInfoDialogFactory.SHOW_GENERATION_SUCCESS_DIALOG)).thenReturn("always");
when(operationBuilder.toOperation(any(BusinessObjectData.class), any(FieldToContractInputMapping.class))).thenReturn(
anOperation().build());
final ContractInputGenerationWizard wizard = new ContractInputGenerationWizard(task, editingDomain(), repositoryAccessor, operationBuilder,
......
......@@ -29,12 +29,12 @@ import org.eclipse.swt.widgets.Shell;
public class ContractInputGenerationInfoDialogFactory {
public static final int NOT_OPENED = -2;
public static final String HIDE_GENERATION_SUCCESS_DIALOG = "SHOW_GENERATION_SUCCESS_DIALOG";
public static final String SHOW_GENERATION_SUCCESS_DIALOG = "SHOW_GENERATION_SUCCESS_DIALOG";
public int openInfoDialog(final IPreferenceStore preferenceStore, final Shell shell, final ContractContainer contractContainer,
final boolean isAutogeneratedScript) {
if (isNullOrEmpty(preferenceStore.getString(HIDE_GENERATION_SUCCESS_DIALOG))
if (isNullOrEmpty(preferenceStore.getString(SHOW_GENERATION_SUCCESS_DIALOG))
&& isAutogeneratedScript) {
return MessageDialogWithToggle.openOkCancelConfirm(shell,
Messages.contractGenerationTitle,
......@@ -42,7 +42,7 @@ public class ContractInputGenerationInfoDialogFactory {
Messages.doNotShowMeAgain,
false,
preferenceStore,
HIDE_GENERATION_SUCCESS_DIALOG).getReturnCode();
SHOW_GENERATION_SUCCESS_DIALOG).getReturnCode();
}
return NOT_OPENED;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment