Commit c933ccb8 authored by Romain Bioteau's avatar Romain Bioteau Committed by Adrien

feat(la) move subscription to community (#307)

* moves generic code from rest api extension (sp) to studio ui
(community)

relates to [BS-16102](https://bonitasoft.atlassian.net/browse/BS-16102)
parent 340e19b5
......@@ -45,7 +45,9 @@ Require-Bundle: org.bonitasoft.studio.model;bundle-version="1.0.0",
org.eclipse.e4.ui.workbench;bundle-version="1.2.1",
org.eclipse.debug.core,
org.eclipse.debug.ui,
org.eclipse.jst.server.core;bundle-version="1.2.400"
org.eclipse.jst.server.core;bundle-version="1.2.400",
org.apache.httpcomponents.httpclient;bundle-version="4.3.6";visibility:=reexport,
org.apache.httpcomponents.httpcore;bundle-version="4.3.3";visibility:=reexport
Export-Package: org.bonitasoft.studio.engine,
org.bonitasoft.studio.engine.command,
org.bonitasoft.studio.engine.config,
......@@ -53,6 +55,7 @@ Export-Package: org.bonitasoft.studio.engine,
org.bonitasoft.studio.engine.export,
org.bonitasoft.studio.engine.export.builder,
org.bonitasoft.studio.engine.export.expression.converter.comparison,
org.bonitasoft.studio.engine.http,
org.bonitasoft.studio.engine.i18n;x-friends:="org.bonitasoft.studio.engine.test",
org.bonitasoft.studio.engine.operation,
org.bonitasoft.studio.engine.preferences,
......@@ -75,6 +78,7 @@ Import-Package: org.bonitasoft.engine.api,
org.bonitasoft.engine.exception,
org.bonitasoft.engine.expression,
org.bonitasoft.engine.operation,
org.bonitasoft.engine.page,
org.bonitasoft.engine.platform,
org.bonitasoft.engine.profile,
org.bonitasoft.engine.search,
......
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.engine.http;
import java.io.IOException;
import java.net.HttpURLConnection;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.EntityBuilder;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
public class AddCustomPageRequest extends HttpRequest<String> {
private static final String PORTAL_ADD_PAGE_API = "API/portal/page";
private final String uploadedFileToken;
public AddCustomPageRequest(final String uploadedFileToken, final HttpClientFactory httpClientFactory) {
super(httpClientFactory);
this.uploadedFileToken = uploadedFileToken;
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.rest.api.extension.core.remote.http.HttpRequest#doExecute(org.apache.http.impl.client.CloseableHttpClient)
*/
@Override
protected String doExecute(final HttpClient httpClient) throws IOException, HttpException {
final HttpPost addPageRequest = new HttpPost(getURLBase() + PORTAL_ADD_PAGE_API);
addPageRequest.setHeader(API_TOKEN_HEADER, getAPITokenFromCookie());
final EntityBuilder entityBuilder = EntityBuilder.create();
entityBuilder.setContentType(ContentType.APPLICATION_JSON);
entityBuilder.setText(String.format("{\"pageZip\" : \"%s\" }", uploadedFileToken));
addPageRequest.setEntity(entityBuilder.build());
final HttpResponse response = httpClient.execute(addPageRequest);
final int status = response.getStatusLine().getStatusCode();
if (status != HttpURLConnection.HTTP_OK) {
throw new HttpException(String.format("Add custom page failed with status: %s. Open Engine log for more details.", status));
}
return contentAsString(response);
}
}
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.engine.http;
import java.io.File;
import org.apache.http.client.CookieStore;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.impl.client.BasicCookieStore;
import org.apache.http.impl.client.HttpClients;
import org.bonitasoft.engine.page.Page;
import org.eclipse.e4.core.di.annotations.Creatable;
/**
* HttpClientFactory create a HTTP client sharing a common Cookie Store
*/
@Creatable
public class HttpClientFactory {
private final RequestConfig requestConfiguration;
private final HttpClientContext context;
public HttpClientFactory() {
requestConfiguration = RequestConfig.custom().setCookieSpec(CookieSpecs.BEST_MATCH).build();
context = HttpClientContext.create();
context.setCookieStore(new BasicCookieStore());
}
public HttpClient createHttpClient() {
return HttpClients.custom().setDefaultRequestConfig(requestConfiguration)
.setDefaultCookieStore(context.getCookieStore()).build();
}
public HttpRequest<String> newLoginRequest() {
return new LoginRequest(this);
}
public HttpRequest<String> newUploadCustomPageRequest(File file) {
return new UploadCustomPageRequest(file, this);
}
public HttpRequest<String> newUpdateCustomPageRequest(String uploadedFileToken, Page pageToUpdate) {
return new UpdateCustomPageRequest(uploadedFileToken, pageToUpdate, this);
}
public HttpRequest<String> newAddCustomPageRequest(String uploadedFileToken) {
return new AddCustomPageRequest(uploadedFileToken, this);
}
public CookieStore getCookieStore() {
return context.getCookieStore();
}
}
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.engine.http;
import static com.google.common.collect.Iterables.find;
import static com.google.common.io.ByteStreams.toByteArray;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Objects;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.client.CookieStore;
import org.apache.http.client.HttpClient;
import org.apache.http.cookie.Cookie;
import org.bonitasoft.studio.preferences.BonitaPreferenceConstants;
import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin;
import org.eclipse.jface.preference.IPreferenceStore;
import com.google.common.base.Predicate;
public abstract class HttpRequest<T> {
private static final Charset UTF_8 = Charset.forName("UTF-8");
public static final String API_TOKEN_HEADER = "X-Bonita-API-Token";
private final HttpClientFactory httpClientFactory;
public HttpRequest(HttpClientFactory httpClientFactory) {
this.httpClientFactory = httpClientFactory;
}
public T execute() throws IOException, HttpException {
return doExecute(httpClientFactory.createHttpClient());
}
protected String contentAsString(final HttpResponse response) throws IOException {
return new String(toByteArray(response.getEntity().getContent()), UTF_8);
}
protected abstract T doExecute(HttpClient httpClient) throws IOException, HttpException;
protected String getURLBase() {
final IPreferenceStore store = BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore();
final String port = store.getString(BonitaPreferenceConstants.CONSOLE_PORT);
final String host = store.getString(BonitaPreferenceConstants.CONSOLE_HOST);
return String.format("http://%s:%s/bonita/", host, port);
}
protected String getAPITokenFromCookie() {
final CookieStore cookieStore = httpClientFactory.getCookieStore();
return find(cookieStore.getCookies(), new Predicate<Cookie>() {
@Override
public boolean apply(Cookie c) {
return Objects.equals(c.getName(), API_TOKEN_HEADER);
}
}).getValue();
}
}
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.engine.http;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URISyntaxException;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.bonitasoft.studio.common.repository.Repository;
import org.bonitasoft.studio.engine.operation.PortalURLBuilder;
public class LoginRequest extends HttpRequest<String> {
public LoginRequest(final HttpClientFactory httpClientFactory) {
super(httpClientFactory);
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.rest.api.extension.core.remote.http.HttpRequest#doExecute(org.apache.http.impl.client.CloseableHttpClient)
*/
@Override
protected String doExecute(final HttpClient httpClient) throws IOException, HttpException {
HttpGet loginRequest;
try {
loginRequest = new HttpGet(new PortalURLBuilder().toTechnicalUserLoginURL(Repository.NULL_PROGRESS_MONITOR).toURI());
} catch (final URISyntaxException e) {
throw new HttpException("Failed to create login request", e);
}
final HttpResponse loginResponse = httpClient.execute(loginRequest);
final int statusCode = loginResponse.getStatusLine().getStatusCode();
if (statusCode != HttpURLConnection.HTTP_OK) {
throw new HttpException(String.format("Login failed with status: %s. Open Engine log for more details.", statusCode));
}
return contentAsString(loginResponse);
}
}
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.engine.http;
import java.io.IOException;
import java.net.HttpURLConnection;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.EntityBuilder;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.ContentType;
import org.bonitasoft.engine.page.Page;
public class UpdateCustomPageRequest extends HttpRequest<String> {
private static final String PORTAL_UPDATE_PAGE_API = "API/portal/page/%s";
private final String uploadedFileToken;
private final Page pageToUpdate;
public UpdateCustomPageRequest(final String uploadedFileToken, final Page pageToUpdate,
final HttpClientFactory httpClientFactory) {
super(httpClientFactory);
this.uploadedFileToken = uploadedFileToken;
this.pageToUpdate = pageToUpdate;
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.rest.api.extension.core.remote.http.HttpRequest#doExecute(org.apache.http.impl.client.CloseableHttpClient)
*/
@Override
protected String doExecute(final HttpClient httpClient) throws IOException, HttpException {
final HttpPut updatePageRequest = new HttpPut(
String.format(getURLBase() + PORTAL_UPDATE_PAGE_API, pageToUpdate.getId()));
updatePageRequest.setHeader(API_TOKEN_HEADER, getAPITokenFromCookie());
final EntityBuilder entityBuilder = EntityBuilder.create();
entityBuilder.setContentType(ContentType.APPLICATION_JSON);
entityBuilder.setText(String.format("{\"pageZip\" : \"%s\" }", uploadedFileToken));
updatePageRequest.setEntity(entityBuilder.build());
final HttpResponse response = httpClient.execute(updatePageRequest);
final int status = response.getStatusLine().getStatusCode();
if (status != HttpURLConnection.HTTP_OK) {
throw new HttpException(
String.format("Update custom page failed with status: %s. Open Engine log for more details.", status));
}
return contentAsString(response);
}
}
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.engine.http;
import static com.google.common.base.Strings.isNullOrEmpty;
import java.io.File;
import java.io.IOException;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
public class UploadCustomPageRequest extends HttpRequest<String> {
private static final String PORTAL_PAGE_UPLOAD_API = "portal/pageUpload";
private final File file;
public UploadCustomPageRequest(final File file, final HttpClientFactory httpClientFactory) {
super(httpClientFactory);
this.file = file;
}
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.rest.api.extension.core.remote.http.HttpRequest#doExecute(org.apache.http.impl.client.CloseableHttpClient)
*/
@Override
protected String doExecute(final HttpClient httpClient) throws IOException, HttpException {
final HttpPost uploadFileRequest = new HttpPost(getURLBase() + PORTAL_PAGE_UPLOAD_API);
uploadFileRequest.setHeader(API_TOKEN_HEADER, getAPITokenFromCookie());
final MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.addBinaryBody("file", file, ContentType.APPLICATION_OCTET_STREAM, file.getName());
uploadFileRequest.setEntity(builder.build());
final HttpResponse response = httpClient.execute(uploadFileRequest);
final String result = contentAsString(response);
final int uploadStatus = response.getStatusLine().getStatusCode();
if (isNullOrEmpty(result)) {
throw new HttpException(String.format("Custom page upload failed with status: %s. Open Engine log for more details.", uploadStatus));
}
return result;
}
}
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: UI Toolkit Plug In
Bundle-SymbolicName: org.bonitasoft.studio.ui
Bundle-Localization: plugin
Bundle-SymbolicName: org.bonitasoft.studio.ui;singleton:=true
Bundle-Version: 7.5.0.qualifier
Bundle-Vendor: BonitaSoft S.A.
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
......@@ -14,10 +15,29 @@ Require-Bundle: org.eclipse.jface;bundle-version="3.10.1",
org.eclipse.e4.core.di,
org.junit;bundle-version="4.11.0";resolution:=optional,
org.bonitasoft.studio.tests-utils;bundle-version="7.4.0";resolution:=optional,
assertj-core;bundle-version="1.5.0";resolution:=optional
assertj-core;bundle-version="1.5.0";resolution:=optional,
org.eclipse.ui.workbench,
org.eclipse.e4.ui.workbench.swt,
org.eclipse.e4.core.contexts,
org.eclipse.e4.ui.model.workbench,
org.eclipse.jdt.ui,
org.eclipse.ui.editors;bundle-version="3.8.200",
org.eclipse.wst.xml.ui,
org.eclipse.jface.text;bundle-version="3.9.1",
org.codehaus.groovy.eclipse.ui,
org.eclipse.jdt.core;bundle-version="3.10.0",
com.google.guava;bundle-version="11.0.1",
org.eclipse.core.resources,
org.eclipse.team.core,
org.eclipse.e4.ui.workbench.renderers.swt,
org.eclipse.ui.ide;bundle-version="3.10.1",
org.eclipse.ui
Export-Package: org.bonitasoft.studio.ui,
org.bonitasoft.studio.ui.databinding,
org.bonitasoft.studio.ui.dialog,
org.bonitasoft.studio.ui.editors,
org.bonitasoft.studio.ui.validator,
org.bonitasoft.studio.ui.widget,
org.bonitasoft.studio.ui.wizard
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.bonitasoft.studio.ui.UIPlugin
......@@ -2,5 +2,8 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
messages.properties
messages*.properties,\
plugin.xml,\
icons/,\
plugin*.properties
src.excludes = src-test/java/
groovyEditor=Groovy Editor
propertiesFileEditor=Properties File Editor
xmlEditor=XML Editor
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.editors">
<editor
class="org.bonitasoft.studio.ui.editors.FilteredGroovyEditor"
contributorClass="org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor"
default="true"
extensions="groovy"
icon="icons/groovy_file.gif"
id="org.bonitasoft.studio.rest.api.extension.groovyEditor"
name="%groovyEditor"
symbolicFontName="org.eclipse.jdt.ui.editors.textfont">
<contentTypeBinding
contentTypeId="org.eclipse.jdt.groovy.core.groovySource">
</contentTypeBinding>
</editor>
<editor
class="org.bonitasoft.studio.ui.editors.FilteredPropertiesFileEditor"
contributorClass="org.eclipse.jdt.internal.ui.propertiesfileeditor.PropertiesFileEditorActionContributor"
default="true"
icon="icons/file_obj.gif"
id="org.bonitasoft.studio.rest.api.extension.PropertiesFileEditor"
name="%propertiesFileEditor"
symbolicFontName="org.eclipse.jdt.ui.PropertiesFileEditor.textfont">
<contentTypeBinding
contentTypeId="org.eclipse.jdt.core.javaProperties">
</contentTypeBinding>
</editor>
<editor
class="org.bonitasoft.studio.ui.editors.FilteredXMLEditor"
contributorClass="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorActionBarContributor"
default="true"
icon="icons/xmldoc.gif"
id="org.bonitasoft.studio.rest.api.extension.XMLMultiPageEditorPart"
name="%xmlEditor"
symbolicFontName="org.eclipse.wst.sse.ui.textfont">
<contentTypeBinding
contentTypeId="org.eclipse.core.runtime.xml">
</contentTypeBinding>
<contentTypeBinding
contentTypeId="org.eclipse.wst.xml.core.xmlsource">
</contentTypeBinding>
</editor>
</extension>
<extension
point="org.eclipse.ui.startup">
<startup
class="org.bonitasoft.studio.ui.editors.DefaultEditorAssociationContribution">
</startup>
</extension>
</plugin>
/**
* Copyright (C) 2017 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.ui;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
public class UIPlugin extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.bonitasoft.studio.ui"; //$NON-NLS-1$
// The shared instance
private static UIPlugin plugin;
/**
* The constructor
*/
public UIPlugin() {
}
/*
* (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 UIPlugin getDefault() {
return plugin;
}
}
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.ui.editors;
import org.codehaus.groovy.eclipse.editor.GroovyEditor;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.registry.EditorRegistry;
/**
* Replace default editors with filtered editor
*/
public class DefaultEditorAssociationContribution implements IStartup {
@Override
public void earlyStartup() {
final EditorRegistry editorRegistry = (EditorRegistry) WorkbenchPlugin.getDefault().getEditorRegistry();
editorRegistry.removeExtension(null, new Object[] {
editorRegistry.findEditor(GroovyEditor.EDITOR_ID),
editorRegistry.findEditor("org.eclipse.jdt.ui.PropertiesFileEditor"),
editorRegistry.findEditor("org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart")
});
}
}
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.ui.editors;
import org.codehaus.groovy.eclipse.editor.GroovyEditor;
import org.eclipse.swt.widgets.Composite;
public class FilteredGroovyEditor extends GroovyEditor {
public static final String ID = "org.bonitasoft.studio.rest.api.extension.groovyEditor";
/*
* (non-Javadoc)
* @see org.codehaus.groovy.eclipse.editor.GroovyEditor#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
new MenuManagerFilter().filter(getSite());
}
}
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.ui.editors;
import org.eclipse.jdt.internal.ui.propertiesfileeditor.PropertiesFileEditor;
import org.eclipse.swt.widgets.Composite;
public class FilteredPropertiesFileEditor extends PropertiesFileEditor {
public static final String ID = "org.bonitasoft.studio.rest.api.extension.PropertiesFileEditor";
/*
* (non-Javadoc)
* @see org.codehaus.groovy.eclipse.editor.GroovyEditor#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
new MenuManagerFilter().filter(getSite());
}
}
/*******************************************************************************
* Copyright (C) 2015 Bonitasoft S.A.
* Bonitasoft is a trademark of Bonitasoft SA.
* This software file is BONITASOFT CONFIDENTIAL. Not For Distribution.
* For commercial licensing information, contact:
* Bonitasoft, 32 rue Gustave Eiffel – 38000 Grenoble
* or Bonitasoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107
*******************************************************************************/
package org.bonitasoft.studio.ui.editors;
import org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart;
public class FilteredXMLEditor extends XMLMultiPageEditorPart {
public static final String ID = "org.bonitasoft.studio.rest.api.extension.XMLMultiPageEditorPart";
/*
* (non-Javadoc)
* @see org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart#createPages()
*/