Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bonita
bonita-studio
Commits
07020d90
Commit
07020d90
authored
Sep 08, 2015
by
azara
Browse files
BS-14273 improve generation guidance
rename constant
parent
e0d20d19
Changes
2
Hide whitespace changes
Inline
Side-by-side
bundles/plugins/org.bonitasoft.studio.contract/src-test/java/org/bonitasoft/studio/contract/ui/wizard/ContractInputGenerationWizardTest.java
View file @
07020d90
...
...
@@ -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
,
...
...
bundles/plugins/org.bonitasoft.studio.contract/src/org/bonitasoft/studio/contract/ui/wizard/ContractInputGenerationInfoDialogFactory.java
View file @
07020d90
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment