Commit babfd72e authored by Romain Bioteau's avatar Romain Bioteau

tr(refactorPlugin) merge browser into

preferences
parent c627e4db
......@@ -518,13 +518,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
version="0.0.0"
unpack="false"/>
<plugin
id="org.bonitasoft.studio.browser"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.bonitasoft.studio.validation.common"
download-size="0"
......
<?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.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-test/java"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.bonitasoft.studio.browser</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: Browser Support Plugin
Bundle-SymbolicName: org.bonitasoft.studio.browser
Bundle-Version: 7.6.0.qualifier
Bundle-Activator: org.bonitasoft.studio.browser.BrowserSupportPlugin
Bundle-Vendor: Bonitasoft S.A.
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.junit;bundle-version="4.11.0";resolution:=optional,
org.mockito;bundle-version="1.9.5";resolution:=optional,
assertj-core;bundle-version="1.5.0";resolution:=optional,
org.eclipse.ui.browser,
org.bonitasoft.studio.preferences,
org.bonitasoft.studio.common
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.bonitasoft.studio.browser.operation
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin*.properties,\
messages*.properties
src.excludes = src-test/java/
noBrowserFoundTitle=No web browser defined
noBrowserFoundMsg=The Portal cannot be launched because no web browser has been defined. Please set a web browser in order to continue.
\ No newline at end of file
#X-Generator: crowdin.com
noBrowserFoundTitle=Ning\u00fan navegador definido
noBrowserFoundMsg=El Portal no se puede lanzar porque no se ha definido ning\u00fan navegador web. Por favor seleccione un navegador para continuar.
#X-Generator: crowdin.com
noBrowserFoundTitle=Aucun navigateur web d\u00e9finie
noBrowserFoundMsg=Le portail ne peut pas \u00eatre lanc\u00e9 car aucun navigateur web n'a \u00e9t\u00e9 d\u00e9fini. Veuillez configurer un navigateur web pour pouvoir continuer.
#X-Generator: crowdin.com
noBrowserFoundTitle=\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b web \u30d6\u30e9\u30a6\u30b6\u304c\u3042\u308a\u307e\u305b\u3093
noBrowserFoundMsg=Web \u30d6\u30e9\u30a6\u30b6\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u30dd\u30fc\u30bf\u30eb\u3092\u8d77\u52d5\u3067\u304d\u307e\u305b\u3093\u3002\u7d9a\u884c\u3059\u308b\u306b\u306f\u3001web \u30d6\u30e9\u30a6\u30b6\u3092\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002
<?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.6.0-SNAPSHOT</version>
</parent>
<groupId>org.bonitasoft.studio.bundles.plugins</groupId>
<artifactId>org.bonitasoft.studio.browser</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
/**
* Copyright (C) 2014 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.browser.operation;
import org.junit.After;
import org.junit.Before;
/**
* @author Romain Bioteau
*
*/
public class OpenBrowserOperationTest {
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
}
}
package org.bonitasoft.studio.browser;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class BrowserSupportPlugin extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.bonitasoft.studio.browser"; //$NON-NLS-1$
// The shared instance
private static BrowserSupportPlugin plugin;
/**
* The constructor
*/
public BrowserSupportPlugin() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static BrowserSupportPlugin getDefault() {
return plugin;
}
}
/**
* Copyright (C) 2014 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.browser.i18n;
import org.eclipse.osgi.util.NLS;
/**
* @author Romain Bioteau
*
*/
public class Messages extends NLS {
static {
NLS.initializeMessages("messages", Messages.class);
}
public static String noBrowserFoundTitle;
public static String noBrowserFoundMsg;
}
......@@ -44,7 +44,6 @@ Require-Bundle: org.bonitasoft.studio.engine;bundle-version="1.0.0",
org.eclipse.emf;bundle-version="2.6.0",
org.eclipse.emf.transaction,
org.eclipse.emf.databinding,
org.bonitasoft.studio.browser;bundle-version="6.5.0",
com.google.guava,
org.eclipse.e4.core.services,
org.eclipse.osgi.services;bundle-version="3.4.0",
......
......@@ -30,7 +30,6 @@ import org.bonitasoft.engine.bdm.model.Query;
import org.bonitasoft.engine.bdm.model.QueryParameter;
import org.bonitasoft.engine.bdm.model.field.Field;
import org.bonitasoft.engine.bdm.model.field.SimpleField;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.businessobject.i18n.Messages;
import org.bonitasoft.studio.businessobject.ui.wizard.editingsupport.QueryParameterNameEditingSupport;
import org.bonitasoft.studio.businessobject.ui.wizard.editingsupport.QueryParameterTypeEditingSupport;
......@@ -39,6 +38,7 @@ import org.bonitasoft.studio.common.jface.BonitaStudioFontRegistry;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.pics.Pics;
import org.bonitasoft.studio.pics.PicsConstants;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
......
......@@ -20,7 +20,6 @@ Export-Package: org.bonitasoft.studio.designer,
org.bonitasoft.studio.designer.ui.contribution
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.bonitasoft.studio.browser;bundle-version="6.5.0",
org.bonitasoft.studio.common.repository;bundle-version="6.5.0",
org.bonitasoft.studio.preferences,
org.bonitasoft.studio.common,
......
......@@ -20,11 +20,11 @@ import static org.mockito.Mockito.verify;
import java.net.URL;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.common.repository.model.IRepositoryFileStore;
import org.bonitasoft.studio.common.repository.model.IRepositoryStore;
import org.bonitasoft.studio.designer.core.PageDesignerURLFactory;
import org.bonitasoft.studio.designer.core.repository.WebPageFileStore;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
......
......@@ -22,9 +22,9 @@ import static org.mockito.Mockito.when;
import java.net.URL;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.common.jface.FileActionDialog;
import org.bonitasoft.studio.preferences.BonitaPreferenceConstants;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.junit.After;
import org.junit.Before;
......
......@@ -19,7 +19,6 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.Set;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.platform.tools.PlatformUtil;
import org.bonitasoft.studio.common.repository.model.IRepositoryFileStore;
......@@ -30,6 +29,7 @@ import org.bonitasoft.studio.designer.core.PageDesignerURLFactory;
import org.bonitasoft.studio.designer.core.bar.BarResourceCreationException;
import org.bonitasoft.studio.designer.core.bos.WebFormBOSArchiveFileStoreProvider;
import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IWorkbenchPart;
......
......@@ -21,7 +21,6 @@ import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.common.jface.BonitaErrorDialog;
import org.bonitasoft.studio.common.jface.FileActionDialog;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
......@@ -29,6 +28,7 @@ import org.bonitasoft.studio.designer.UIDesignerPlugin;
import org.bonitasoft.studio.designer.core.PageDesignerURLFactory;
import org.bonitasoft.studio.designer.i18n.Messages;
import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
......
......@@ -38,7 +38,6 @@ Require-Bundle: org.bonitasoft.studio.model;bundle-version="1.0.0",
org.eclipse.jdt.core,
org.eclipse.xtext.ui,
org.bonitasoft.studio.designer;bundle-version="6.5.0",
org.bonitasoft.studio.browser;bundle-version="6.5.0",
org.bonitasoft.studio.validation.common;bundle-version="7.1.0",
org.eclipse.e4.core.contexts,
org.eclipse.e4.core.di;bundle-version="1.4.0",
......
......@@ -18,7 +18,6 @@ import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.engine.BOSEngineManager;
import org.bonitasoft.studio.engine.i18n.Messages;
......@@ -26,6 +25,7 @@ import org.bonitasoft.studio.engine.operation.PortalURLBuilder;
import org.bonitasoft.studio.engine.preferences.BonitaUserXpPreferencePage;
import org.bonitasoft.studio.preferences.BonitaPreferenceConstants;
import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
......
......@@ -19,7 +19,6 @@ import java.net.URL;
import org.bonitasoft.engine.api.ProcessAPI;
import org.bonitasoft.engine.session.APISession;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.common.jface.BonitaErrorDialog;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.repository.Repository;
......@@ -33,6 +32,7 @@ import org.bonitasoft.studio.model.process.Actor;
import org.bonitasoft.studio.model.process.Contract;
import org.bonitasoft.studio.model.process.FormMappingType;
import org.bonitasoft.studio.model.process.Pool;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.runtime.IProgressMonitor;
......
......@@ -28,7 +28,6 @@ Require-Bundle: org.bonitasoft.studio.common;bundle-version="6.0.0",
org.bonitasoft.studio.diagram.custom;bundle-version="1.0.0",
org.bonitasoft.studio.configuration;bundle-version="6.0.0",
org.bonitasoft.studio.profiles;bundle-version="6.0.0",
org.bonitasoft.studio.browser;bundle-version="6.5.0",
org.mockito;resolution:=optional,
assertj-core;bundle-version="1.5.0";resolution:=optional,
org.junit;bundle-version="4.11.0";resolution:=optional,
......
......@@ -40,7 +40,6 @@ import org.bonitasoft.engine.exception.UnknownAPITypeException;
import org.bonitasoft.engine.exception.UpdateException;
import org.bonitasoft.engine.identity.UserNotFoundException;
import org.bonitasoft.engine.session.APISession;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.common.BonitaConstants;
import org.bonitasoft.studio.common.ProjectUtil;
import org.bonitasoft.studio.common.editingdomain.CustomDiagramEditingDomainFactory;
......@@ -66,6 +65,7 @@ import org.bonitasoft.studio.model.process.Task;
import org.bonitasoft.studio.model.process.diagram.part.ProcessDiagramEditorUtil;
import org.bonitasoft.studio.preferences.BonitaPreferenceConstants;
import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.bonitasoft.studio.repository.themes.ApplicationLookNFeelFileStore;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.Assert;
......
......@@ -18,7 +18,7 @@ Require-Bundle: org.eclipse.ui,
org.bonitasoft.studio.migration;bundle-version="1.0.0",
org.bonitasoft.studio.importer;bundle-version="6.2.0",
org.bonitasoft.studio.engine,
org.bonitasoft.studio.browser;bundle-version="6.5.0"
org.bonitasoft.studio.preferences;bundle-version="7.6.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.bonitasoft.studio.intro,org.bonitasoft.studio.intr
......
/**
* Copyright (C) 2014 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
* 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/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.intro.actions;
......@@ -23,43 +20,42 @@ import java.net.URL;
import java.net.URLDecoder;
import java.util.Properties;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.eclipse.ui.intro.IIntroSite;
import org.eclipse.ui.intro.config.IIntroAction;
/**
* @author Aurelien Pupier
*
*/
public class OpenInExternalBrowserIntroAction implements IIntroAction {
@Override
public void run(final IIntroSite site, final Properties params) {
final String urlToOpen = retrieveURLToOpen(params);
openInExternalBrowser(urlToOpen);
}
@Override
public void run(final IIntroSite site, final Properties params) {
final String urlToOpen = retrieveURLToOpen(params);
openInExternalBrowser(urlToOpen);
}
private void openInExternalBrowser(final String urlToOpen) {
try {
if(urlToOpen != null){
final URL url = new URL(urlToOpen);
private void openInExternalBrowser(final String urlToOpen) {
try {
if (urlToOpen != null) {
final URL url = new URL(urlToOpen);
new OpenBrowserOperation(url).execute();
}
} catch (final MalformedURLException e) {
BonitaStudioLog.error(e);
}
} catch (final MalformedURLException e) {
BonitaStudioLog.error(e);
}
}
}
private String retrieveURLToOpen(final Properties params) {
String urlToOpen = null;
try {
final String urlEncoded = params.getProperty("url");
urlToOpen = URLDecoder.decode(urlEncoded, "UTF-8");
} catch (final UnsupportedEncodingException e) {
BonitaStudioLog.error(e);
}
return urlToOpen;
}
private String retrieveURLToOpen(final Properties params) {
String urlToOpen = null;
try {
final String urlEncoded = params.getProperty("url");
urlToOpen = URLDecoder.decode(urlEncoded, "UTF-8");
} catch (final UnsupportedEncodingException e) {
BonitaStudioLog.error(e);
}
return urlToOpen;
}
}
/**
* Copyright (C) 2014 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
* 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/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.intro.actions;
......@@ -23,44 +20,44 @@ import java.net.URL;
import java.net.URLEncoder;
import java.util.Properties;
import org.bonitasoft.studio.browser.operation.OpenBrowserOperation;
import org.bonitasoft.studio.common.ModelVersion;
import org.bonitasoft.studio.common.ProductVersion;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.preferences.browser.OpenBrowserOperation;
import org.eclipse.ui.intro.IIntroSite;
import org.eclipse.ui.intro.config.IIntroAction;
/**
* @author Aurelien Pupier
*
*/
public class SearchDocumentationInExternalBrowser implements IIntroAction {
private final static String SEARCH_DOC_URL = String.format("http://www.bonitasoft.com/bos_redirect.php?bos_redirect_id=668&amp;bos_redirect_product=bos&amp;bos_redirect_major_version=%s&amp;bos_redirect_minor_version=0",ProductVersion.CURRENT_VERSION);
private final static String SEARCH_DOC_URL = String.format(
"http://www.bonitasoft.com/bos_redirect.php?bos_redirect_id=668&amp;bos_redirect_product=bos&amp;bos_redirect_major_version=%s&amp;bos_redirect_minor_version=0",
ProductVersion.CURRENT_VERSION);
@Override
public void run(final IIntroSite arg0, final Properties params) {
final String urlToOpen = calculateURLToOpen(params);
openInExternalBrowser(urlToOpen);
}
@Override
public void run(final IIntroSite arg0, final Properties params) {
final String urlToOpen = calculateURLToOpen(params);
openInExternalBrowser(urlToOpen);
}
private void openInExternalBrowser(final String urlToOpen) {
try {
final URL url = new URL(urlToOpen);
private void openInExternalBrowser(final String urlToOpen) {
try {
final URL url = new URL(urlToOpen);
new OpenBrowserOperation(url).execute();
} catch (final MalformedURLException e) {
BonitaStudioLog.error(e);
}
}
private String calculateURLToOpen(final Properties params) {
String searchField = "";
try {
searchField = URLEncoder.encode(params.getProperty("keys"), "UTF-8");
} catch (final UnsupportedEncodingException e) {
BonitaStudioLog.error(e);
}
return SEARCH_DOC_URL + "?start=0&pageSize=10&searchRequest="+searchField;
}
} catch (final MalformedURLException e) {
BonitaStudioLog.error(e);
}
}
private String calculateURLToOpen(final Properties params) {
String searchField = "";
try {
searchField = URLEncoder.encode(params.getProperty("keys"), "UTF-8");
} catch (final UnsupportedEncodingException e) {
BonitaStudioLog.error(e);
}
return SEARCH_DOC_URL + "?start=0&pageSize=10&searchRequest=" + searchField;
}
}
......@@ -29,6 +29,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.bonitasoft.studio.preferences,
org.bonitasoft.studio.preferences.browser,
org.bonitasoft.studio.preferences.dialog,
org.bonitasoft.studio.preferences.extension,
org.bonitasoft.studio.preferences.i18n,
......
......@@ -37,3 +37,5 @@ 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.
noBrowserFoundTitle=No web browser defined
noBrowserFoundMsg=The Portal cannot be launched because no web browser has been defined. Please set a web browser in order to continue.
......@@ -5,22 +5,20 @@
* 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.browser.operation;
package org.bonitasoft.studio.preferences.browser;
import java.net.URL;
import org.bonitasoft.studio.browser.i18n.Messages;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.preferences.dialog.BonitaPreferenceDialog;
import org.bonitasoft.studio.preferences.i18n.Messages;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PartInitException;
......@@ -30,10 +28,8 @@ import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import org.eclipse.ui.internal.browser.ExternalBrowserInstance;
import org.eclipse.ui.internal.browser.WebBrowserUtil;
/**
* @author Romain Bioteau
*
*/
public class OpenBrowserOperation implements Runnable {
......@@ -57,7 +53,8 @@ public class OpenBrowserOperation implements Runnable {
if (browserIsSet()) {
IWebBrowser browser = externalBrowser;
if (browser == null) {
browser = PlatformUI.getWorkbench().getBrowserSupport().createBrowser(IWorkbenchBrowserSupport.AS_EDITOR, TYPE_ID, "", ""); //$NON-NLS-1$
browser = PlatformUI.getWorkbench().getBrowserSupport().createBrowser(IWorkbenchBrowserSupport.AS_EDITOR,
TYPE_ID, "", ""); //$NON-NLS-1$
}
browser.openURL(url);
}
......@@ -65,7 +62,8 @@ public class OpenBrowserOperation implements Runnable {
protected boolean browserIsSet() {
if (noExternalBrowserSet()) {
if (MessageDialog.openConfirm(Display.getDefault().getActiveShell(), Messages.noBrowserFoundTitle, Messages.noBrowserFoundMsg)) {