Commit a1af659c authored by Romain Bioteau's avatar Romain Bioteau

fix(contract) update refactor dialog message when type is updated

Closes BS-16692
parent d4cb1773
......@@ -219,6 +219,7 @@ currentScript=Original Source
refactoredScript=Refactored Source
refactorTitle=Refactor {0}
reviewChangesMessageRefactoring=Replacing {0} by {1} might cause minor errors in scripts{2}.\nDouble click a script name to review and edit changes. Click Cancel to cancel the name change.
reviewTypeChangesMessageRefactoring=Updating {0} type might cause minor errors in scripts{1}.\nDouble click a script name to review and edit changes. Click Cancel to cancel the type change.
reviewChangesMessageRemoving={0} has been removed from all scripts{1}.\nDouble click a script name to review and edit changes. Click Cancel to cancel the remove operation.
reviewChangesMessageWithConditionPlace=and conditions
askConfirmationForDeleting=Do you really want to remove the following widget\: {0} \nif the variable is used in a Groovy script, the refactor window is displayed and you can validate the changes.
......
......@@ -283,5 +283,6 @@ public class Messages extends NLS {
public static String invalidPath;
public static String pathDoesNotExist;
public static String moreDetails;
public static String reviewTypeChangesMessageRefactoring;
}
......@@ -31,7 +31,6 @@ public class TomcatVmArgsBuilder {
protected static final String WATCHDOG_PORT_PROPERTY = "org.bonitasoft.studio.watchdog.port";
protected static final String BONITA_WEB_REGISTER = "bonita.web.register";
private final RepositoryAccessor repositoryAccessor;
public TomcatVmArgsBuilder(final RepositoryAccessor repositoryAccessor) {
......@@ -54,13 +53,18 @@ public class TomcatVmArgsBuilder {
addSystemProperty(args, "wtp.deploy", "\"" + tomcatInstanceLocation + File.separatorChar + "webapps\"");
addSystemProperty(args, "java.endorsed.dirs", "\"" + tomcatInstanceLocation + File.separatorChar + "endorsed\"");
addSystemProperty(args, "sysprop.bonita.db.vendor", "h2");
addSystemProperty(args, "org.bonitasoft.platform.setup.folder", "\"" + bundleLocation + File.separatorChar + "setup\"");
addSystemProperty(args, "org.bonitasoft.platform.setup.folder",
"\"" + bundleLocation + File.separatorChar + "setup\"");
addSystemProperty(args, "org.bonitasoft.engine.incident.folder",
"\"" + tomcatInstanceLocation + File.separatorChar + "logs\"");
addSystemProperty(args, "bitronix.tm.configuration",
"\"" + tomcatInstanceLocation + File.separatorChar + "conf" + File.separatorChar + "bitronix-config.properties\"");
"\"" + tomcatInstanceLocation + File.separatorChar + "conf" + File.separatorChar
+ "bitronix-config.properties\"");
addSystemProperty(args, "java.util.logging.manager", "org.apache.juli.ClassLoaderLogManager");
if (tomcatExtraParams == null || !tomcatExtraParams.contains("-Djava.util.logging.config.file=")) {
addSystemProperty(args, "java.util.logging.config.file",
"\"" + tomcatInstanceLocation + File.separatorChar + "conf" + File.separatorChar + "logging.properties\"");
"\"" + tomcatInstanceLocation + File.separatorChar + "conf" + File.separatorChar
+ "logging.properties\"");
}
addSystemProperty(args, "file.encoding", "UTF-8");
addWatchDogProperties(args);
......@@ -91,7 +95,6 @@ public class TomcatVmArgsBuilder {
repositoryAccessor.getCurrentRepository().getDatabaseHandler().createBitronixConfFile();
}
public String getProductApplicationId() {
return Platform.getProduct() != null ? Platform.getProduct().getApplication() : null;
}
......@@ -106,7 +109,8 @@ public class TomcatVmArgsBuilder {
addSystemProperty(args, workspaceSystemProperties.getPageRepositoryLocation());
addSystemProperty(args, workspaceSystemProperties.getWidgetRepositoryLocation());
addSystemProperty(args, workspaceSystemProperties.getFragmentRepositoryLocation());
addSystemProperty(args, workspaceSystemProperties.getRestAPIURL(WorkspaceResourceServerManager.getInstance().runningPort()));
addSystemProperty(args,
workspaceSystemProperties.getRestAPIURL(WorkspaceResourceServerManager.getInstance().runningPort()));
addSystemProperty(args, workspaceSystemProperties.activateSpringProfile("studio"));
}
......
......@@ -75,8 +75,9 @@ public class BonitaCompareEditorInput extends CompareEditorInput {
private final List<ScriptContainer<?>> scripts;
private final AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(new ComposedAdapterFactory(
ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
private final AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(
new ComposedAdapterFactory(
ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
public BonitaCompareEditorInput(final CompareConfiguration configuration, final List<ScriptContainer<?>> scripts,
final RefactoringOperationType operationType,
......@@ -113,9 +114,17 @@ public class BonitaCompareEditorInput extends CompareEditorInput {
@Override
public Control createContents(final Composite parent) {
final CLabel label = new CLabel(parent, SWT.NONE);
final String lastArgumentWithConditionOrNot = canBeContainedInScript ? " " + Messages.reviewChangesMessageWithConditionPlace : "";
final String lastArgumentWithConditionOrNot = canBeContainedInScript
? " " + Messages.reviewChangesMessageWithConditionPlace : "";
if (operationType == RefactoringOperationType.UPDATE) {
label.setText(Messages.bind(Messages.reviewChangesMessageRefactoring, new String[] { elementName, newName, lastArgumentWithConditionOrNot }));
if (elementName.equals(newName)) {
label.setText(Messages.bind(Messages.reviewTypeChangesMessageRefactoring,
new String[] { elementName, lastArgumentWithConditionOrNot }));
} else {
label.setText(Messages.bind(Messages.reviewChangesMessageRefactoring,
new String[] { elementName, newName, lastArgumentWithConditionOrNot }));
}
} else {
label.setText(Messages.bind(Messages.reviewChangesMessageRemoving, elementName, lastArgumentWithConditionOrNot));
}
......@@ -242,7 +251,8 @@ public class BonitaCompareEditorInput extends CompareEditorInput {
getAllNodes(nodes, root);
for (final DiffNode node : nodes) {
if (node.getAncestor() != null
&& ((EObjectNode) node.getAncestor()).getElement().equals(((EObjectNode) nodeToInsert.getAncestor()).getElement())) {
&& ((EObjectNode) node.getAncestor()).getElement()
.equals(((EObjectNode) nodeToInsert.getAncestor()).getElement())) {
addChildrenToParent(node, nodeToInsert.getChildren());
return true;
}
......
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