Commit d7119907 authored by Romain Bioteau's avatar Romain Bioteau Committed by GitHub

tr(eclipse) update platform (#966)

Closes BS-17122
parent 400d2bd0
......@@ -75,6 +75,7 @@ Import-Package: org.bonitasoft.engine.api,
org.bonitasoft.engine.bpm.process.impl,
org.bonitasoft.engine.exception,
org.bonitasoft.engine.expression,
org.bonitasoft.engine.identity,
org.bonitasoft.engine.operation,
org.bonitasoft.engine.page,
org.bonitasoft.engine.platform,
......
......@@ -14,6 +14,8 @@
*/
package org.bonitasoft.studio.engine;
import static java.util.Objects.requireNonNull;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
......@@ -38,10 +40,12 @@ import org.bonitasoft.engine.exception.BonitaHomeNotSetException;
import org.bonitasoft.engine.exception.ServerAPIException;
import org.bonitasoft.engine.exception.UnknownAPITypeException;
import org.bonitasoft.engine.exception.UpdateException;
import org.bonitasoft.engine.identity.UserNotFoundException;
import org.bonitasoft.engine.platform.InvalidPlatformCredentialsException;
import org.bonitasoft.engine.platform.LoginException;
import org.bonitasoft.engine.platform.PlatformLoginException;
import org.bonitasoft.engine.platform.PlatformLogoutException;
import org.bonitasoft.engine.search.SearchOptionsBuilder;
import org.bonitasoft.engine.session.APISession;
import org.bonitasoft.engine.session.InvalidSessionException;
import org.bonitasoft.engine.session.PlatformSession;
......@@ -294,15 +298,10 @@ public class BOSEngineManager {
}
start();
}
if (BonitaStudioLog.isLoggable(IStatus.OK)) {
BonitaStudioLog.debug("Attempt to login as " + login, EnginePlugin.PLUGIN_ID);
}
final APISession session = getLoginAPI().login(login, password);
BonitaStudioLog.debug("Attempt to login as " + login + ":" + password, EnginePlugin.PLUGIN_ID);
final APISession session = getLoginAPI().login(requireNonNull(login), requireNonNull(password));
if (session != null) {
if (BonitaStudioLog.isLoggable(IStatus.OK)) {
BonitaStudioLog.debug("Login successful.", EnginePlugin.PLUGIN_ID);
}
BonitaStudioLog.debug("Login successful.", EnginePlugin.PLUGIN_ID);
}
return session;
}
......@@ -394,15 +393,23 @@ public class BOSEngineManager {
final Configuration configuration = BarExporter.getInstance().getConfiguration(process, configurationId);
APISession session;
try {
// APISession loginDefaultTenant = BOSEngineManager.getInstance().loginDefaultTenant(monitor);
// BonitaStudioLog.info("DEBUG: Found users:", EnginePlugin.PLUGIN_ID);
// BOSEngineManager.getInstance().getIdentityAPI(loginDefaultTenant).searchUsers(new SearchOptionsBuilder(0, 999).done()).getResult()
// .stream()
// .forEach(user -> {
// BonitaStudioLog.info("DEBUG: "+user.getUserName(), EnginePlugin.PLUGIN_ID);
// });
// BOSEngineManager.getInstance().logoutDefaultTenant(loginDefaultTenant);
session = BOSEngineManager.getInstance().loginTenant(configuration.getUsername(), configuration.getPassword(),
monitor);
} catch (final Exception e1) {
throw new Exception(Messages.bind(Messages.loginFailed,
new String[] { configuration.getUsername(), process.getName(), process.getVersion() }), e1);
new String[] { configuration.getUsername()+":"+configuration.getPassword(), process.getName(), process.getVersion() }), e1);
}
if (session == null) {
throw new Exception(Messages.bind(Messages.loginFailed,
new String[] { configuration.getUsername(), process.getName(), process.getVersion() }));
new String[] { configuration.getUsername()+":"+configuration.getPassword(), process.getName(), process.getVersion() }));
}
return session;
}
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component name="org.eclipse.ui.views.properties.tabbed_3.8.0.v20170516-1617" version="1.2">
<plugin id="org.eclipse.ui.views.properties.tabbed_3.8.0.v20170516-1617"/>
<component name="org.eclipse.ui.views.properties.tabbed_3.8.1.v20170713-0803" version="1.2">
<plugin id="org.eclipse.ui.views.properties.tabbed_3.8.1.v20170713-0803"/>
</component>
......@@ -7,32 +7,32 @@ Require-Bundle: org.eclipse.ui.forms;bundle-version="[3.3.0,4.0.0)";visibility:=
org.eclipse.ui.views;bundle-version="[3.2.0,4.0.0)";visibility:=reexport,
org.eclipse.ui;bundle-version="[3.3.0,4.0.0)";visibility:=reexport,
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.e4.ui.workbench;bundle-version="1.5.0",
org.eclipse.e4.ui.css.core;bundle-version="0.12.100",
org.eclipse.e4.ui.css.swt,
org.eclipse.e4.core.contexts;bundle-version="1.6.0",
org.eclipse.e4.core.di;bundle-version="1.6.100"
org.eclipse.e4.core.di;bundle-version="1.6.100",
org.eclipse.e4.ui.workbench;bundle-version="1.5.1"
Bundle-ManifestVersion: 2
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Eclipse-SourceReferences: scm:git:git://git.eclipse.org/gitroot/platfo
rm/eclipse.platform.ui.git;path="bundles/org.eclipse.ui.views.propert
ies.tabbed";tag="I20170516-2000";commitId=d786bd652250609bcd4dbff6a92
91e3ba1824dd9
ies.tabbed";tag="M20170719-0400";commitId=36224d3f8a411456721b9a78870
2b591adfbd20b
Bundle-Vendor: Bonitasoft S.A.
Import-Package: com.ibm.icu.text
Export-Package: org.eclipse.ui.internal.views.properties.tabbed;x-inte
rnal:=true,org.eclipse.ui.internal.views.properties.tabbed.css;x-inte
rnal:=true,org.eclipse.ui.internal.views.properties.tabbed.l10n;x-int
ernal:=true,org.eclipse.ui.internal.views.properties.tabbed.view;x-in
ternal:=true,org.eclipse.ui.views.properties.tabbed
Bundle-Name: %Plugin.name
Bundle-Version: 3.8.0.v20170516-1617
Bundle-Version: 3.8.1.v20170713-0803
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.ui.internal.views.properties.tabbed.Tabb
edPropertyViewPlugin
Created-By: Apache Maven 3.3.3
Build-Jdk: 1.8.0_121
Name: plugin.xml
SHA-256-Digest: /xwaZK4P8KhV7b5X/79TK6qlsWCFefxkDYMvan/0stU=
SHA-256-Digest: UcHmXR2O4yPWZLCqGPbyH/trpHvxxRihLdZmLNMPzUQ=
Name: org/eclipse/ui/views/properties/tabbed/ITypeMapper.class
SHA-256-Digest: 444K1Qs21j+O0gtDTXX7p2jz8JzRYDq0qRo1VqVOZNc=
......@@ -54,7 +54,7 @@ SHA-256-Digest: Tcs+BAOsiY+rojv2WTAcqwvPdT5q4sN0sBR/LplzrMo=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabDescript
or.class
SHA-256-Digest: PxIOaLYCwWtYDPZ3t/xKHh3p7mZPCzLgSTbUliZLGak=
SHA-256-Digest: hJS5vguqWdRorc1xIjFI7u9GbsP9u6DJuB690VHH9tE=
Name: org/eclipse/ui/views/properties/tabbed/ITabbedPropertySheetPageC
ontributor.class
......@@ -75,6 +75,10 @@ SHA-256-Digest: /FXMIEr+clGFk1/JZunfFBdQyEfeihqp808DWSLpjMw=
Name: org/eclipse/ui/views/properties/tabbed/ISectionDescriptor.class
SHA-256-Digest: Km8A38PlonBrDu502HJVy1XMkQXPUXoJRWyjrvaq6pM=
Name: org/eclipse/ui/internal/views/properties/tabbed/css/TabbedProper
tyListCssPropertyHandler.class
SHA-256-Digest: MCQyd/MXCEcvwOBellWgMwm+JS/3kDAOuEUz9CPWC3M=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyRegistryFactory$CacheData.class
SHA-256-Digest: jgo/OV+/wiK3cmsVSsBJR8aqp8CKEWm/c7m2oJQnzNI=
......@@ -89,7 +93,7 @@ SHA-256-Digest: zp2NqW+L+O+ms/vozYvEb0IJqcJQHc/Zy3OO7QUlt6o=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$4.class
SHA-256-Digest: W9iKJzM60feaqEFHC/YPKvdQeNDkcC0Tl+OIlETAhiU=
SHA-256-Digest: yEnxXT+SBzgoJtY2hf9p/6KPm5Q/CHOKBuwtNHWGPfc=
Name: org/eclipse/ui/views/properties/tabbed/AdvancedPropertySection.c
lass
......@@ -98,10 +102,6 @@ SHA-256-Digest: xp2oiPg5sg79Fw9A2W17Avy0nN4YBsWaeaptJs6034Y=
Name: plugin.properties
SHA-256-Digest: HW0AjE4Tnmv7NTIKAjrnZ+zixaBiOc/Sgcko+0TIMPM=
Name: org/eclipse/ui/internal/views/properties/tabbed/TabbedPropertyVi
ewPlugin.class
SHA-256-Digest: ZfXGFdmwIgyw19YHMNiZc4OVaIqBzyGh0gPK6BYFg50=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$ListElement$1.class
SHA-256-Digest: oHwH7b2FAvOxQ412UtoQGvRXoxJgTjczGrbQ5J9HXiI=
......@@ -119,11 +119,11 @@ SHA-256-Digest: NAhCUIhhNi6RWLgh89LILDSEo0CqkEsbc4SSazUvBZI=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$7.class
SHA-256-Digest: htjnC5StD+aFQgH74PZQvG57cyztk7NM89Xick9lOdQ=
SHA-256-Digest: KLR6UTgyUHVEeYyY0XBz2Q0Diw4bh3tv4yvaGViz/8Y=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList.class
SHA-256-Digest: GxDmyrYFvAkjwHuOe1w4dlr3KGIH1CjQgNv9ltdN0FM=
SHA-256-Digest: Aca8yiTtrqbbriHUZLd3IVQm8vhVnWPqDS8hRGJXAzA=
Name: org/eclipse/ui/views/properties/tabbed/AbstractOverridableTabLis
tPropertySection.class
......@@ -141,7 +141,7 @@ Name: org/eclipse/ui/internal/views/properties/tabbed/TabbedPropertyVi
SHA-256-Digest: YIHwZiaCaou3R4xu6F+UkhcxrYiG38RpkafLvhUKNH8=
Name: .api_description
SHA-256-Digest: 6DG7yf8YFCZvXsjxTpVyqHOc4Moqdr0Rz7w2/c8Ra+Y=
SHA-256-Digest: 2QM8OgnL62TMD3fzH5fLeTrkUalpyEXMbTYfh8vFa44=
Name: org/eclipse/ui/views/properties/tabbed/ISection.class
SHA-256-Digest: bMYZ8kABX21vamzw1+grbq6OYbjWLRPWLiuYJWZeARY=
......@@ -174,7 +174,7 @@ SHA-256-Digest: 0ZV3wY/D6n4DSiPGseUKKMOn8CyfqD7BfCBb+CFXt/E=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$6.class
SHA-256-Digest: g4YZ8T7k2kwN93pbdQkLr5fP4/W+19bj0J2hBYL4RYE=
SHA-256-Digest: xxn8dqK1FYh/YC2pWX3LYNYKzoMyZq2WIIdz2k/SO80=
Name: org/eclipse/ui/views/properties/tabbed/IActionProvider.class
SHA-256-Digest: ToHlf8jLLxhDmCWMTt9kAtFEZgXDvYtNCAdyfcWOIBE=
......@@ -193,6 +193,10 @@ SHA-256-Digest: X4AC0m77f49dvzSmr4FfLmRnZ8oqZijQcJd/a/n9rWk=
Name: org/eclipse/ui/views/properties/tabbed/TabContents$3.class
SHA-256-Digest: nuKVYyCVUSyLb1woumnRRqvdnOuGwe8Zx92CZI03PMc=
Name: org/eclipse/ui/internal/views/properties/tabbed/css/TabbedProper
tyTitleCssPropertyHandler.class
SHA-256-Digest: Q83TQsved+WQslo9aJVW9bMa56IdopNvoU/OxbMqLzI=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$BottomNavigationElement$2.class
SHA-256-Digest: 7iAZbw0z6HdBAr2/V+MmaY/+yMDH71Z702RZB2c5Rdk=
......@@ -211,7 +215,7 @@ SHA-256-Digest: /oamIkBxZqb+LCy82keGHLuwKG6dkUhnsfFDYjuJV70=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyRegistry.class
SHA-256-Digest: C/ni4EZMVPhECkW9rZD32HSBIEvuDGl/IlaVnpHyNik=
SHA-256-Digest: 3PH0wbPF9z/flLE+4P9to7dkEffdoTRYKWxsihdr40c=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$ListElement.class
......@@ -254,12 +258,16 @@ SHA-256-Digest: rXonZitMCKCye+bGlFoHU3SLDoV07jobQbnb/mNzzyg=
Name: org/eclipse/ui/views/properties/tabbed/TabContents$1.class
SHA-256-Digest: DpJQ6ruNs1xfn5cDYHq0k9dj/J4QIfg9F6TkvMgnvQE=
Name: org/eclipse/ui/internal/views/properties/tabbed/css/TabbedProper
tyElementProvider.class
SHA-256-Digest: 4EHakJJz+nZtjKDsS5XAOIBkP4AiNS5GIRuZj8jZE74=
Name: org/eclipse/ui/views/properties/tabbed/TabContents$4.class
SHA-256-Digest: /cctOpXQyvCBSSEwofGV46z51/ccDKpZSo4hWSEzc7c=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyTitle.class
SHA-256-Digest: Ngg46QO2O14dZBSW3pYqW6V5kkknbtM/lA/tGNFqaEs=
SHA-256-Digest: wvpB7pI5IErN9aJHlvTaUWJVztkM5rrnrrj5AmH2hG8=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyRegistry$2.class
......@@ -277,22 +285,30 @@ Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$ListElement$2.class
SHA-256-Digest: ov+s2H47nCCl1G2juwT54YmqS+gEsn2J0ncO0ot3E1Y=
Name: org/eclipse/ui/internal/views/properties/tabbed/css/TabbedProper
tyTitleAdapter.class
SHA-256-Digest: VLghf8P3zhhdHW5QvSzOkaK4Rt7dxJfGwrbseAlVUac=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$TopNavigationElement$1.class
SHA-256-Digest: grh0OBMTA5g6o2gezm674bqLH3pp5L1LsNPnEBMzBuY=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/SectionDesc
riptor.class
SHA-256-Digest: hduwQx8V5vOnbwe5M9M4aAUiQPKfCr3z7vma1sHQhu4=
SHA-256-Digest: qa5HLsX5fRuYLXw43b4IqSPbeJx+d3Xkmz3Pmp6lGuA=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$5.class
SHA-256-Digest: d0KGLNBsAn9GjZuU3of+I5z1mX+uwEcQu7ylaLR+2YA=
SHA-256-Digest: xmQU2NeNAd+3uP0qmlb4DvncIhrQAVPVzrjVmalsWM8=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyList$2.class
SHA-256-Digest: +QAGXx7ywqjSu8CXRwCN9qWIQ4RST75qVCTAyNNhadg=
Name: org/eclipse/ui/internal/views/properties/tabbed/css/TabbedProper
tyListAdapter.class
SHA-256-Digest: r8rlG2kzu+jskuWu4dKFGFhh47lY20Wm65DXX/PQbIQ=
Name: org/eclipse/ui/views/properties/tabbed/TabbedPropertySheetWidget
Factory.class
SHA-256-Digest: 2Gwn3RPLB7WIWqvsEozVVQx50q8cg7TvBjlhq8De90M=
......@@ -306,9 +322,9 @@ SHA-256-Digest: HQ4WbQvNbIfBRUE0husAYjPK3LcemmmGACJejvISq+4=
Name: org/eclipse/ui/views/properties/tabbed/AbstractTabDescriptor.cla
ss
SHA-256-Digest: lyvv1LgJUKnknmvZZfoi9ocXXxiOl00RyxESnmhUWfs=
SHA-256-Digest: fkqAluL1dGKUtu0URYMVVUMXrJpew6VmXiJNacfPsEw=
Name: org/eclipse/ui/internal/views/properties/tabbed/view/TabbedPrope
rtyTitle$1.class
SHA-256-Digest: BUqtf4l/5JXN7A7WrMNrBIbZlsipAzHCJlDJMCaHXrs=
SHA-256-Digest: oeY1r7rEL3M7m7PvRRd3B5TpJeNnEsbI+ccL8sKScA8=
......@@ -8,8 +8,8 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
Plugin.name= Tabbed Properties View
Plugin.providerName=Bonitasoft
Plugin.name = Tabbed Properties View
Plugin.providerName = Eclipse.org
ExtPoint.propertyContributor = Property Contributor
ExtPoint.propertyTabs = Property Tabs
......
......@@ -5,5 +5,56 @@
<extension-point id="propertyContributor" name="%ExtPoint.propertyContributor" schema="schema/propertyContributor.exsd"/>
<extension-point id="propertyTabs" name="%ExtPoint.propertyTabs" schema="schema/propertyTabs.exsd"/>
<extension-point id="propertySections" name="%ExtPoint.propertySections" schema="schema/propertySections.exsd"/>
<extension
point="org.eclipse.e4.ui.css.core.propertyHandler">
<handler
adapter="org.eclipse.ui.internal.views.properties.tabbed.css.TabbedPropertyTitleAdapter"
composite="true"
handler="org.eclipse.ui.internal.views.properties.tabbed.css.TabbedPropertyTitleCssPropertyHandler">
<property-name
name="swt-backgroundBottomKeyline1-color">
</property-name>
<property-name
name="swt-backgroundBottomKeyline2-color">
</property-name>
<property-name
name="swt-backgroundGradientStart-color">
</property-name>
<property-name
name="swt-backgroundGradientEnd-color">
</property-name>
</handler>
<handler
adapter="org.eclipse.ui.internal.views.properties.tabbed.css.TabbedPropertyListAdapter"
composite="true"
handler="org.eclipse.ui.internal.views.properties.tabbed.css.TabbedPropertyListCssPropertyHandler">
<property-name
name="swt-tabAreaBackground-color">
</property-name>
<property-name
name="swt-tabBackground-color">
</property-name>
<property-name
name="swt-tabNormalShadow-color">
</property-name>
<property-name
name="swt-tabDarkShadow-color">
</property-name>
<property-name
name="color">
</property-name>
</handler>
</extension>
<extension
point="org.eclipse.e4.ui.css.core.elementProvider">
<provider
class="org.eclipse.ui.internal.views.properties.tabbed.css.TabbedPropertyElementProvider">
<widget
class="org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle"></widget>
<widget
class="org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyList">
</widget>
</provider>
</extension>
</plugin>
......@@ -9,6 +9,6 @@
</parent>
<groupId>org.bonitasoft.studio.patched-plugins</groupId>
<artifactId>org.eclipse.ui.views.properties.tabbed</artifactId>
<version>3.8.0.v20170516-1617</version>
<version>3.8.1.v20170713-0803</version>
<packaging>eclipse-plugin</packaging>
</project>
/*******************************************************************************
* Copyright (c) 2001, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ui.internal.views.properties.tabbed;
import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
* The common ui properties plug-in.
*
* @author Anthony Hunter
*/
public class TabbedPropertyViewPlugin
extends AbstractUIPlugin {
private static TabbedPropertyViewPlugin plugin;
/**
* Constructor for TabbedPropertyViewPlugin.
*/
public TabbedPropertyViewPlugin() {
super();
plugin = this;
}
/**
* Retrieve the plug-in class for this plug-in.
* @return the plug-in class for this plug-in.
*/
public static TabbedPropertyViewPlugin getPlugin() {
return plugin;
}
}
/*******************************************************************************
* Copyright (c) 2017 SAP SE and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.eclipse.ui.internal.views.properties.tabbed.css;
import org.eclipse.e4.ui.css.core.dom.IElementProvider;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyList;
import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle;
import org.w3c.dom.Element;
public class TabbedPropertyElementProvider implements IElementProvider {
@Override
public Element getElement(Object element, CSSEngine engine) {
if (element instanceof TabbedPropertyTitle) {
return new TabbedPropertyTitleAdapter((TabbedPropertyTitle) element, engine);
} else if (element instanceof TabbedPropertyList) {
return new TabbedPropertyListAdapter((TabbedPropertyList) element, engine);
}
return null;
}
}
/*******************************************************************************
* Copyright (c) 2017 SAP SE and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.eclipse.ui.internal.views.properties.tabbed.css;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.eclipse.e4.ui.css.swt.dom.CompositeElement;
import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyList;
public class TabbedPropertyListAdapter extends CompositeElement {
public TabbedPropertyListAdapter(TabbedPropertyList composite, CSSEngine engine) {
super(composite, engine);
}
@Override
public void reset() {
super.reset();
getTabbedPropertyTitle().initColours();
}
private TabbedPropertyList getTabbedPropertyTitle() {
return (TabbedPropertyList) getNativeWidget();
}
}
/*******************************************************************************
* Copyright (c) 2017 SAP SE and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.eclipse.ui.internal.views.properties.tabbed.css;
import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper;
import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyList;
import org.w3c.dom.css.CSSValue;
public class TabbedPropertyListCssPropertyHandler extends AbstractCSSPropertySWTHandler implements ICSSPropertyHandler {
private static final String TAB_AREA_BACKGROUND_COLOR = "swt-tabAreaBackground-color"; //$NON-NLS-1$
private static final String TAB_BACKGROUND_COLOR = "swt-tabBackground-color"; //$NON-NLS-1$
private static final String TAB_NORMAL_SHADOW_COLOR = "swt-tabNormalShadow-color"; //$NON-NLS-1$
private static final String TAB_DARK_SHADOW_COLOR = "swt-tabDarkShadow-color"; //$NON-NLS-1$
private static final String COLOR = "color"; //$NON-NLS-1$
@Override
protected void applyCSSProperty(Control control, String property, CSSValue value, String pseudo, CSSEngine engine)
throws Exception {
if (!(control instanceof TabbedPropertyList)) {
return;
}
TabbedPropertyList list = (TabbedPropertyList) control;
if (TAB_BACKGROUND_COLOR.equals(property)) {
if ((value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)) {
Color color = CSSSWTColorHelper.getSWTColor(value, control.getDisplay());
list.setListBackgroundColor(color);
}
} else if (TAB_AREA_BACKGROUND_COLOR.equals(property)) {
if ((value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)) {
Color color = CSSSWTColorHelper.getSWTColor(value, control.getDisplay());
list.setWidgetBackgroundColor(color);
}
} else if (COLOR.equals(property)) {
if ((value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)) {
Color color = CSSSWTColorHelper.getSWTColor(value, control.getDisplay());
list.setWidgetForegroundColor(color);
}
} else if (TAB_NORMAL_SHADOW_COLOR.equals(property)) {
if ((value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)) {
Color color = CSSSWTColorHelper.getSWTColor(value, control.getDisplay());
list.setWidgetNormalShadowColor(color);
}
} else if (TAB_DARK_SHADOW_COLOR.equals(property)) {
if ((value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)) {
Color color = CSSSWTColorHelper.getSWTColor(value, control.getDisplay());
list.setWidgetDarkShadowColor(color);
}
}
}
@Override
protected String retrieveCSSProperty(Control control, String property, String pseudo, CSSEngine engine)
throws Exception {
return null;
}
}
/*******************************************************************************
* Copyright (c) 2017 SAP SE and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.eclipse.ui.internal.views.properties.tabbed.css;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.eclipse.e4.ui.css.swt.dom.CompositeElement;
import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle;
public class TabbedPropertyTitleAdapter extends CompositeElement {
public TabbedPropertyTitleAdapter(TabbedPropertyTitle composite, CSSEngine engine) {
super(composite, engine);
}
@Override
public void reset() {
super.reset();
getTabbedPropertyTitle().resetSectionToolBarColors();
}
private TabbedPropertyTitle getTabbedPropertyTitle() {
return (TabbedPropertyTitle) getNativeWidget();
}
}
/*******************************************************************************
* Copyright (c) 2017 SAP SE and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.eclipse.ui.internal.views.properties.tabbed.css;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.e4.ui.css.core.dom.properties.ICSSPropertyHandler;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.eclipse.e4.ui.css.swt.helpers.CSSSWTColorHelper;
import org.eclipse.e4.ui.css.swt.properties.AbstractCSSPropertySWTHandler;
import org.eclipse.swt.graphics.RGBA;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.internal.views.properties.tabbed.view.TabbedPropertyTitle;
import org.w3c.dom.css.CSSValue;
public class TabbedPropertyTitleCssPropertyHandler extends AbstractCSSPropertySWTHandler
implements ICSSPropertyHandler {
private static final String GRADIENT_START = "swt-backgroundGradientStart-color"; //$NON-NLS-1$
private static final String GRADIENT_END = "swt-backgroundGradientEnd-color"; //$NON-NLS-1$
private static final String BOTTOM_KEYLINE_1 = "swt-backgroundBottomKeyline1-color"; //$NON-NLS-1$
private static final String BOTTOM_KEYLINE_2 = "swt-backgroundBottomKeyline2-color"; //$NON-NLS-1$
private final Map<String, String> cssPropertyToSWTProperty = new HashMap<>();
public TabbedPropertyTitleCssPropertyHandler() {
cssPropertyToSWTProperty.put(BOTTOM_KEYLINE_1, IFormColors.H_BOTTOM_KEYLINE1);
cssPropertyToSWTProperty.put(BOTTOM_KEYLINE_2, IFormColors.H_BOTTOM_KEYLINE2);
cssPropertyToSWTProperty.put(GRADIENT_START, IFormColors.H_GRADIENT_START);
cssPropertyToSWTProperty.put(GRADIENT_END, IFormColors.H_GRADIENT_END);
}
@Override
protected void applyCSSProperty(Control control, String property, CSSValue value, String pseudo, CSSEngine engine)
throws Exception {
if (!(control instanceof TabbedPropertyTitle)) {
return;
}
TabbedPropertyTitle title = (TabbedPropertyTitle) control;
String swtProperty = cssPropertyToSWTProperty.get(property);
if (swtProperty != null) {
if ((value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE)) {
RGBA rgba = CSSSWTColorHelper.getRGBA(value);
title.setColor(swtProperty, rgba);
}
}
}
@Override
protected String retrieveCSSProperty(Control control, String property, String pseudo, CSSEngine engine)
throws Exception {
return null;
}
}
......@@ -24,12 +24,13 @@ import org.eclipse.e4.core.di.InjectionException;
import org.eclipse.jface.viewers.IFilter;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.Workbench;
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewPlugin;
import org.eclipse.ui.internal.views.properties.tabbed.TabbedPropertyViewStatusCodes;
import org.eclipse.ui.internal.views.properties.tabbed.l10n.TabbedPropertyMessages;
import org.eclipse.ui.views.properties.tabbed.AbstractSectionDescriptor;
import org.eclipse.ui.views.properties.tabbed.ISection;
import org.eclipse.ui.views.properties.tabbed.ITypeMapper;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import com.ibm.icu.text.MessageFormat;
......@@ -111,7 +112,7 @@ public class SectionDescriptor extends AbstractSectionDescriptor {
* @param exception
* an optional CoreException
*/
private void handleSectionError(Throwable exception) {
private void handleSectionError(CoreException exception) {
String pluginId = getConfigurationElement().getDeclaringExtension()
.getNamespaceIdentifier();
String message = TabbedPropertyMessages.SectionDescriptor_Section_error;
......@@ -122,7 +123,8 @@ public class SectionDescriptor extends AbstractSectionDescriptor {
}
IStatus status = new Status(IStatus.ERROR, pluginId,
TabbedPropertyViewStatusCodes.SECTION_ERROR, message, exception);
TabbedPropertyViewPlugin.getPlugin().getLog().log(status);
Bundle bundle = FrameworkUtil.getBundle(SectionDescriptor.class);
Platform.getLog(bundle).log(status);
}
/**
......@@ -191,12 +193,9 @@ public class SectionDescriptor extends AbstractSectionDescriptor {
.loadClass(
getConfigurationElement().getAttribute(ATT_CLASS)),
workbench.getContext());
} catch (final InjectionException e) {
handleSectionError(e);
} catch (final ClassNotFoundException e) {