Commit c675e249 authored by apupier's avatar apupier
Browse files

BS-13172: provide a preference page to change the property to

activate legacy mode
parent dae2d85d
......@@ -3,10 +3,10 @@
id="studio-feature"
label="Studio"
version="7.0.0.qualifier"
provider-name="BonitaSoft S.A.">
provider-name="Bonitasoft S.A.">
<description url="http://www.example.com/description">
Core feature of Bonita Open Solution
Core feature of Bonita BPM Studio
</description>
<copyright url="http://www.example.com/copyright">
......@@ -469,9 +469,9 @@
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
unpack="false"/>
<plugin
id="org.eclipse.emf.edapt.common"
download-size="0"
install-size="0"
......@@ -556,4 +556,11 @@
version="0.0.0"
unpack="false"/>
<plugin
id="org.bonitasoft.studio.legacy6x"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.bonitasoft.studio.legacy6x</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Legacy6x
Bundle-SymbolicName: org.bonitasoft.studio.legacy6x;singleton:=true
Bundle-Version: 7.0.0.qualifier
Bundle-Activator: org.bonitasoft.studio.legacy6x.Activator
Bundle-Vendor: Bonitasoft S.A.
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.bonitasoft.studio.preferences;bundle-version="7.0.0",
org.bonitasoft.studio.pics,
org.bonitasoft.studio.common;bundle-version="7.0.0",
org.eclipse.xtext.ui;bundle-version="2.7.3"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
messages.properties,\
plugin.xml,\
plugin.properties
showLegacyMode=Show 6.x legacy features
showLegcyModeDescriptionPreferncePage=The 6.x legacy features enable you to continue to use forms that were created with {0} 6.x and imported into this version.\nThis is for backward compatibility and to ease migration.\nYou are recommended to migrate your process to take advantage of the 7.x features and use UI designer forms.\nWhen migration is complete, you no longer need to show the 6.x legacy features.
\ No newline at end of file
legacy6xPreferencePageTitle=6.x legacy
legacy6xKeywords=legacy,migration
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.preferencePages">
<page
category="org.bonitasoft.studio.preferences.pages.BPM"
class="org.bonitasoft.studio.legacy6x.preferences.Legacy6xPreferencePage"
id="org.bonitasoft.studio.preferences.legacy6x"
name="%legacy6xPreferencePageTitle">
<keywordReference
id="org.bonitasoft.studio.preferences.keyword.legacy6x">
</keywordReference>
</page>
</extension>
<extension
point="org.eclipse.ui.keywords">
<keyword
id="org.bonitasoft.studio.preferences.keyword.legacy6x"
label="%legacy6xKeywords">
</keyword>
</extension>
</plugin>
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.bonitasoft.studio.bundles</groupId>
<artifactId>plugins</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<groupId>org.bonitasoft.studio.bundles.plugins</groupId>
<artifactId>org.bonitasoft.studio.legacy6x</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
/**
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.legacy6x;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.bonitasoft.studio.legacy6x"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(final BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
public void stop(final BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}
/**
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.legacy6x.i18n;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
public static String showLegacyMode;
public static String showLegcyModeDescriptionPreferncePage;
}
......@@ -12,14 +12,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.preferences.pages;
package org.bonitasoft.studio.legacy6x.preferences;
import org.bonitasoft.studio.legacy6x.i18n.Messages;
import org.bonitasoft.studio.pics.Pics;
import org.bonitasoft.studio.pics.PicsConstants;
import org.bonitasoft.studio.preferences.BonitaPreferenceConstants;
import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin;
import org.bonitasoft.studio.preferences.i18n.Messages;
import org.bonitasoft.studio.preferences.pages.AbstractBonitaPreferencePage;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.xtext.ui.editor.preferences.fields.LabelFieldEditor;
public class Legacy6xPreferencePage extends AbstractBonitaPreferencePage {
......@@ -31,11 +33,23 @@ public class Legacy6xPreferencePage extends AbstractBonitaPreferencePage {
@Override
protected void createFieldEditors() {
createTitleBar(Messages.BonitaPreferenceDialog_legacy6x, Pics.getImage(PicsConstants.preferenceLegacy6x), false);
createTitleBar(org.bonitasoft.studio.preferences.i18n.Messages.BonitaPreferenceDialog_legacy6x, Pics.getImage(PicsConstants.preferenceLegacy6x), false);
createDescription();
createBooleanField();
}
final BooleanFieldEditor legacyModeFieldEditor = new BooleanFieldEditor(BonitaPreferenceConstants.SHOW_LEGACY_6X_MODE, Messages.showLegacyMode,
private void createBooleanField() {
final BooleanFieldEditor legacyModeFieldEditor = new BooleanFieldEditor(
BonitaPreferenceConstants.SHOW_LEGACY_6X_MODE,
Messages.showLegacyMode,
getFieldEditorParent());
addField(legacyModeFieldEditor);
}
private void createDescription() {
final String descriptionText = Messages.bind(Messages.showLegcyModeDescriptionPreferncePage,
org.bonitasoft.studio.common.Messages.bonitaStudioModuleName);
addField(new LabelFieldEditor(descriptionText, getFieldEditorParent()));
}
}
......@@ -27,7 +27,9 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.bonitasoft.studio.preferences,org.bonitasoft.studi
o.preferences.dialog,org.bonitasoft.studio.preferences.extension,org.
bonitasoft.studio.preferences.pages
Export-Package: org.bonitasoft.studio.preferences,
org.bonitasoft.studio.preferences.dialog,
org.bonitasoft.studio.preferences.extension,
org.bonitasoft.studio.preferences.i18n,
org.bonitasoft.studio.preferences.pages
Bundle-ClassPath: .
......@@ -28,7 +28,7 @@ BonitaPreferenceDialog_search=Search...
BonitaPreferenceDialog_UserXP_Settings=Server settings
BonitaPreferenceDialog_Web=Web
BonitaPreferenceDialog_userProfile=User profile
BonitaPreferenceDialog_legacy6x=6.x Legacy
BonitaPreferenceDialog_legacy6x=6.x legacy
EclipsePreferences=Eclipse
showPassword=Show password
defaultAppliThemeLabel=Default Look'n'Feel for application forms (applied for new process)
......@@ -37,4 +37,3 @@ BonitaPreferenceDialog_DBConnectors=DB connectors
automaticallyAddDriver=Automatically add the driver in the .bar file.
askRenameDiagram=Rename diagram the first time you save it.
doNotDisplayConnectorDefConfirmationMessage=Do not show confirmation on connector definition edition.
showLegacyMode=Show 6.x Legacy views
\ No newline at end of file
......@@ -62,13 +62,9 @@
</keywordReference>
</page>
<page
category="org.bonitasoft.studio.preferences.pages.BPM"
class="org.bonitasoft.studio.preferences.pages.Legacy6xPreferencePage"
id="org.bonitasoft.studio.preferences.legacy6x"
name="Legacy 6.x">
<keywordReference
id="org.bonitasoft.studio.preferences.keyword.legacy6x">
</keywordReference>
class="org.bonitasoft.studio.preferences.pages.ParentBPMPreferencePage"
id="org.bonitasoft.studio.preferences.pages.BPM"
name="BPM">
</page>
</extension>
<extension
......@@ -115,10 +111,6 @@
id="org.bonitasoft.studio.preferences.keyword.run"
label="%runKeywords">
</keyword>
<keyword
id="org.bonitasoft.studio.preferences.keyword.legacy6x"
label="%legacy6xKeywords">
</keyword>
</extension>
</plugin>
......@@ -25,9 +25,6 @@ public class Messages extends NLS {
private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
......@@ -73,6 +70,4 @@ public class Messages extends NLS {
public static String BonitaPreferenceDialog_DBConnectors;
public static String askRenameDiagram;
public static String doNotDisplayConnectorDefConfirmationMessage;
public static String showLegacyMode;
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-test"/>
<classpathentry kind="output" path="bin"/>
</classpath>
#Thu Jun 23 15:26:53 CEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
......@@ -17,7 +17,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.e4.ui.workbench.swt,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.ui.model.workbench,
org.eclipse.core.expressions;bundle-version="3.4.500"
org.eclipse.core.expressions;bundle-version="3.4.500",
org.junit;bundle-version="4.11.0";resolution:=optional,
assertj-core;bundle-version="1.5.0";resolution:=optional,
org.mockito;bundle-version="1.10.19";resolution:=optional
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.bonitasoft.studio.profiles,org.bonitasoft.studio.p
......
/**
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.profiles.manager;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import org.bonitasoft.studio.preferences.BonitaPreferenceConstants;
import org.eclipse.jface.preference.IPreferenceStore;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class ActivityPropertyTesterTest {
@Mock
private IPreferenceStore bonitaPrefStore;
private ActivityPropertyTester tester;
@Before
public void setup() {
tester = spy(new ActivityPropertyTester());
doReturn(bonitaPrefStore).when(tester).getBonitaPreferenceStore();
}
@Test
public void test6XModeEnabled() {
doReturn(true).when(bonitaPrefStore).getBoolean(BonitaPreferenceConstants.SHOW_LEGACY_6X_MODE);
final boolean test = tester.test(null, ActivityPropertyTester.PROPERTY_IS_6XLEGACY_ENABLED, new String[] {}, null);
assertThat(test).isTrue();
}
@Test
public void test6XModeNotEnabled() {
doReturn(false).when(bonitaPrefStore).getBoolean(BonitaPreferenceConstants.SHOW_LEGACY_6X_MODE);
final boolean test = tester.test(null, ActivityPropertyTester.PROPERTY_IS_6XLEGACY_ENABLED, new String[] {}, null);
assertThat(test).isFalse();
}
}
Supports Markdown
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