Commit ba0397ac authored by Romain Bioteau's avatar Romain Bioteau

Remove deprecated preferences

parent 0b68fde9
...@@ -20,9 +20,7 @@ import java.lang.reflect.InvocationTargetException; ...@@ -20,9 +20,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.List; import java.util.List;
import org.bonitasoft.studio.common.log.BonitaStudioLog; import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.repository.CommonRepositoryPlugin;
import org.bonitasoft.studio.common.repository.RepositoryManager; import org.bonitasoft.studio.common.repository.RepositoryManager;
import org.bonitasoft.studio.common.repository.preferences.OrganizationPreferenceConstants;
import org.bonitasoft.studio.engine.BOSWebServerManager; import org.bonitasoft.studio.engine.BOSWebServerManager;
import org.bonitasoft.studio.engine.i18n.Messages; import org.bonitasoft.studio.engine.i18n.Messages;
import org.bonitasoft.studio.engine.server.PortConfigurator; import org.bonitasoft.studio.engine.server.PortConfigurator;
...@@ -31,21 +29,15 @@ import org.bonitasoft.studio.pics.PicsConstants; ...@@ -31,21 +29,15 @@ import org.bonitasoft.studio.pics.PicsConstants;
import org.bonitasoft.studio.preferences.BonitaPreferenceConstants; import org.bonitasoft.studio.preferences.BonitaPreferenceConstants;
import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin; import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin;
import org.bonitasoft.studio.preferences.pages.AbstractBonitaPreferencePage; import org.bonitasoft.studio.preferences.pages.AbstractBonitaPreferencePage;
import org.bonitasoft.studio.preferences.pages.PasswordFieldEditor;
import org.bonitasoft.studio.repository.themes.LookNFeelRepositoryStore; import org.bonitasoft.studio.repository.themes.LookNFeelRepositoryStore;
import org.bonitasoft.studio.repository.themes.UserXpFileStore; import org.bonitasoft.studio.repository.themes.UserXpFileStore;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.ComboFieldEditor; import org.eclipse.jface.preference.ComboFieldEditor;
import org.eclipse.jface.preference.IntegerFieldEditor; import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.osgi.util.NLS; import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Group;
import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI; import org.eclipse.ui.PlatformUI;
...@@ -88,22 +80,6 @@ public class BonitaUserXpPreferencePage extends AbstractBonitaPreferencePage imp ...@@ -88,22 +80,6 @@ public class BonitaUserXpPreferencePage extends AbstractBonitaPreferencePage imp
port = new IntegerFieldEditor(BonitaPreferenceConstants.CONSOLE_PORT, Messages.consolePreferencePortLabel, getFieldEditorParent()); port = new IntegerFieldEditor(BonitaPreferenceConstants.CONSOLE_PORT, Messages.consolePreferencePortLabel, getFieldEditorParent());
port.setValidRange(PortConfigurator.MIN_PORT_NUMBER, PortConfigurator.MAX_PORT_NUMBER); port.setValidRange(PortConfigurator.MIN_PORT_NUMBER, PortConfigurator.MAX_PORT_NUMBER);
addField(port); addField(port);
final Group loginGroup = new Group(getFieldEditorParent(), SWT.NONE);
loginGroup.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(15, 15).create());
loginGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());
loginGroup.setText(Messages.loginAs);
final StringFieldEditor user = new StringFieldEditor(OrganizationPreferenceConstants.DEFAULT_USER, Messages.userNameLLabel, loginGroup);
user.setPreferenceStore(CommonRepositoryPlugin.getDefault().getPreferenceStore());
addField(user);
user.getTextControl(loginGroup).setLayoutData(GridDataFactory.fillDefaults().grab(true, false).indent(0, 15).create());
user.getLabelControl(loginGroup).setLayoutData(GridDataFactory.fillDefaults().grab(false, false).indent(0, 15).create());
final PasswordFieldEditor password = new PasswordFieldEditor(OrganizationPreferenceConstants.DEFAULT_PASSWORD, Messages.userPasswordLabel, loginGroup);
password.setPreferenceStore(CommonRepositoryPlugin.getDefault().getPreferenceStore());
addField(password);
defaultTheme = new ComboFieldEditor(BonitaPreferenceConstants.DEFAULT_USERXP_THEME, Messages.defaultUserXPThemeLabel + " " + bonitaPortalModuleName, defaultTheme = new ComboFieldEditor(BonitaPreferenceConstants.DEFAULT_USERXP_THEME, Messages.defaultUserXPThemeLabel + " " + bonitaPortalModuleName,
getAvailableThemes(), getFieldEditorParent()); getAvailableThemes(), getFieldEditorParent());
addField(defaultTheme); addField(defaultTheme);
......
...@@ -28,13 +28,8 @@ import org.bonitasoft.studio.preferences.i18n.Messages; ...@@ -28,13 +28,8 @@ import org.bonitasoft.studio.preferences.i18n.Messages;
import org.bonitasoft.studio.repository.themes.ApplicationLookNFeelFileStore; import org.bonitasoft.studio.repository.themes.ApplicationLookNFeelFileStore;
import org.bonitasoft.studio.repository.themes.LookNFeelRepositoryStore; import org.bonitasoft.studio.repository.themes.LookNFeelRepositoryStore;
import org.eclipse.gmf.runtime.common.ui.preferences.CheckBoxFieldEditor; import org.eclipse.gmf.runtime.common.ui.preferences.CheckBoxFieldEditor;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.preference.ComboFieldEditor; import org.eclipse.jface.preference.ComboFieldEditor;
import org.eclipse.jface.preference.RadioGroupFieldEditor; import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.IWorkbenchPreferencePage;
...@@ -73,34 +68,16 @@ public class BonitaRunPreferencePage extends AbstractBonitaPreferencePage imple ...@@ -73,34 +68,16 @@ public class BonitaRunPreferencePage extends AbstractBonitaPreferencePage imple
final CheckBoxFieldEditor validateBeforeRunEditor = new CheckBoxFieldEditor(BonitaPreferenceConstants.VALIDATION_BEFORE_RUN, Messages.validateBeforeRun, getFieldEditorParent()); final CheckBoxFieldEditor validateBeforeRunEditor = new CheckBoxFieldEditor(BonitaPreferenceConstants.VALIDATION_BEFORE_RUN, Messages.validateBeforeRun, getFieldEditorParent());
addField(validateBeforeRunEditor) ; addField(validateBeforeRunEditor) ;
new Label(getFieldEditorParent(), SWT.NONE);
Composite radioComposite = new Composite(getFieldEditorParent(), SWT.NONE) ;
radioComposite.setLayoutData(GridDataFactory.fillDefaults().span(3,1).grab(true,false).create()) ;
radioComposite.setLayout(new GridLayout(1, false)) ;
radioFiled = new RadioGroupFieldEditor(BonitaPreferenceConstants.APLLICATION_DEPLOYMENT_MODE,"", 1, new String[][] {
{ Messages.embeddedMode, BonitaPreferenceConstants.ALL_IN_BAR },
{Messages.warMode, BonitaPreferenceConstants.WAR_GENERATION }}, radioComposite,
true) ;//TODO: remove use group when we will reactivate war mode
radioFiled.getLabelControl(radioComposite).dispose();
radioFiled.getRadioBoxControl(radioComposite).setLayoutData(GridDataFactory.fillDefaults().span(3, 1).create()) ;
radioFiled.setEnabled(false, null);
addField(radioFiled) ;
defaultAppLookNFeel = new ComboFieldEditor(BonitaPreferenceConstants.DEFAULT_APPLICATION_THEME, Messages.defaultAppliThemeLabel,getAvailableThemes(), getFieldEditorParent()) ; defaultAppLookNFeel = new ComboFieldEditor(BonitaPreferenceConstants.DEFAULT_APPLICATION_THEME, Messages.defaultAppliThemeLabel,getAvailableThemes(), getFieldEditorParent()) ;
addField(defaultAppLookNFeel); addField(defaultAppLookNFeel);
} }
private String[][] getAvailableThemes() { private String[][] getAvailableThemes() {
LookNFeelRepositoryStore store = (LookNFeelRepositoryStore) RepositoryManager.getInstance().getRepositoryStore(LookNFeelRepositoryStore.class) ; final LookNFeelRepositoryStore store = RepositoryManager.getInstance().getRepositoryStore(LookNFeelRepositoryStore.class) ;
List<ApplicationLookNFeelFileStore> artifacts = store.getApplicationLookNFeels(); final List<ApplicationLookNFeelFileStore> artifacts = store.getApplicationLookNFeels();
String[][] result = new String[artifacts.size()][] ; final String[][] result = new String[artifacts.size()][] ;
for(int i = 0 ; i < artifacts.size() ; i++){ for(int i = 0 ; i < artifacts.size() ; i++){
String[] item = { artifacts.get(i).getDisplayName(), artifacts.get(i).getName() }; final String[] item = { artifacts.get(i).getDisplayName(), artifacts.get(i).getName() };
result[i] = item ; result[i] = item ;
} }
...@@ -114,6 +91,7 @@ public class BonitaRunPreferencePage extends AbstractBonitaPreferencePage imple ...@@ -114,6 +91,7 @@ public class BonitaRunPreferencePage extends AbstractBonitaPreferencePage imple
* @see * @see
* org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/ */
@Override
public void init(IWorkbench workbench) { public void init(IWorkbench workbench) {
} }
......
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