Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup Capella Startup #2315

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ Export-Package: org.polarsys.capella.common.ef,
org.polarsys.capella.common.ef.domain,
org.polarsys.capella.common.ef.internal.command,
org.polarsys.capella.common.ef.internal.domain
Bundle-Activator: org.polarsys.capella.common.ef.CapellaEFPlugin
Bundle-Localization: plugin

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.polarsys.capella.common.flexibility.properties;singleton:=true
Bundle-Version: 6.0.0.qualifier
Bundle-Activator: org.polarsys.capella.common.flexibility.properties.Activator
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.polarsys.capella.common.flexibility.wizards;singleton:=true
Bundle-Version: 6.0.0.qualifier
Bundle-Activator: org.polarsys.capella.common.flexibility.wizards.Activator
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.ui,
org.eclipse.ui.views.properties.tabbed,
Expand All @@ -20,11 +19,12 @@ Require-Bundle: org.eclipse.ui,
org.polarsys.capella.core.model.helpers,
org.polarsys.capella.common.flexibility.properties;visibility:=reexport,
org.polarsys.capella.core.model.handler,
javax.inject
javax.inject,
org.eclipse.ui.workbench,
org.eclipse.osgi
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.polarsys.capella.common.flexibility.wizards,
org.polarsys.capella.common.flexibility.wizards.constants,
Export-Package: org.polarsys.capella.common.flexibility.wizards.constants,
org.polarsys.capella.common.flexibility.wizards.group.renderer,
org.polarsys.capella.common.flexibility.wizards.loader,
org.polarsys.capella.common.flexibility.wizards.policy,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.FrameworkUtil;
import org.polarsys.capella.common.flexibility.properties.schema.IProperty;
import org.polarsys.capella.common.flexibility.properties.schema.IPropertyContext;
import org.polarsys.capella.common.flexibility.properties.schema.IRestraintProperty;
import org.polarsys.capella.common.flexibility.wizards.Activator;
import org.polarsys.capella.common.flexibility.wizards.schema.IRendererContext;
import org.polarsys.capella.common.ui.toolkit.dialogs.SelectElementsDialog;
import org.polarsys.capella.common.ui.toolkit.dialogs.TransferTreeListDialog;
Expand Down Expand Up @@ -77,11 +78,12 @@ protected int getNbColumn() {
protected void initializeControls(final Composite parent, final IRendererContext context) {
super.initializeControls(parent, context);

ToolBar toolbar = new ToolBar(parent, SWT.HORIZONTAL);
ToolBar toolbar = new ToolBar(parent, SWT.HORIZONTAL);
final String ICONS_PATH = "icons/"; //$NON-NLS-1$
if (isBrowseButton()) {
browse = new ToolItem(toolbar, SWT.PUSH);
browse.setToolTipText(getBrowseText());
browse.setImage(Activator.getDefault().getImage("full/etool16/browse.gif"));
browse.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + "full/etool16/browse.gif").createImage());
browse.addSelectionListener(new SelectionListener() {

public void widgetSelected(SelectionEvent event) {
Expand All @@ -97,7 +99,7 @@ public void widgetDefaultSelected(SelectionEvent e) {
if (isDeleteButton()) {
delete = new ToolItem(toolbar, SWT.PUSH);
delete.setToolTipText("Delete all elements");
delete.setImage(Activator.getDefault().getImage("full/etool16/delete_edit.gif"));
delete.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + "full/etool16/delete_edit.gif").createImage());
delete.addSelectionListener(new SelectionListener() {

public void widgetSelected(SelectionEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@

package org.polarsys.capella.common.flexibility.wizards.renderer;

import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;

import org.polarsys.capella.common.flexibility.wizards.Activator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.FrameworkUtil;
import org.polarsys.capella.common.flexibility.wizards.schema.IRendererContext;

/**
Expand All @@ -45,10 +45,11 @@ protected boolean isImage() {
@Override
protected void initializeControls(final Composite parent, IRendererContext context) {

if (isCopyButton()) {
if (isCopyButton()) {
final String ICONS_PATH = "icons/"; //$NON-NLS-1$
copyButton = new Label(rootTextControl, SWT.NONE);
copyButton.setToolTipText("Copy to clipboard");
copyButton.setImage(Activator.getDefault().getImage("full/etool16/copy.gif"));
copyButton.setToolTipText("Copy to clipboard"); //$NON-NLS-1$
copyButton.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + "full/etool16/copy.gif").createImage()); //$NON-NLS-1$
copyButton.addMouseListener(new MouseListener() {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.widgets.Composite;
import org.osgi.framework.FrameworkUtil;
import org.polarsys.capella.common.flexibility.properties.PropertyChangeListener;
import org.polarsys.capella.common.flexibility.properties.PropertyChangedEvent;
import org.polarsys.capella.common.flexibility.properties.schema.IProperties;
import org.polarsys.capella.common.flexibility.properties.schema.IProperty;
import org.polarsys.capella.common.flexibility.properties.schema.IPropertyContext;
import org.polarsys.capella.common.flexibility.wizards.Activator;
import org.polarsys.capella.common.flexibility.wizards.schema.IRenderer;
import org.polarsys.capella.common.flexibility.wizards.schema.IRendererContext;

Expand Down Expand Up @@ -162,7 +162,7 @@ protected void findMostSevere() {
status = null;

if (context != null) {
MultiStatus multiStatus = new CompoundMultiStatus(Activator.PLUGIN_ID);
MultiStatus multiStatus = new CompoundMultiStatus(FrameworkUtil.getBundle(this.getClass()).getSymbolicName());
IProperties properties = context.getProperties();
if (properties != null) {
for (IProperty item : properties.getAllItems()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,31 @@

import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Label;
import org.polarsys.capella.common.flexibility.wizards.Activator;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.FrameworkUtil;
import org.polarsys.capella.common.mdsofa.common.constant.ICommonConstants;

public class StatusLabelHelper {

StatusLabelHelper() {}

/**
* This method allows to set an image to the given SWT label according to the status
*/
public static void updateImage(IStatus status, Label label) {
if (!label.isDisposed() && status != null) {
final String ICONS_PATH = "icons/"; //$NON-NLS-1$
if (status.isOK()) {
label.setImage(Activator.getDefault().getImage("full/etool16/empty.gif"));
label.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(StatusLabelHelper.class).getSymbolicName(), ICONS_PATH + "full/etool16/empty.gif").createImage());

} else if (status.matches(IStatus.INFO)) {
label.setImage(Activator.getDefault().getImage("full/etool16/info_tsk.gif"));
label.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(StatusLabelHelper.class).getSymbolicName(), ICONS_PATH + "full/etool16/info_tsk.gif").createImage());

} else if (status.matches(IStatus.WARNING)) {
label.setImage(Activator.getDefault().getImage("full/etool16/warn_tsk.gif"));
label.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(StatusLabelHelper.class).getSymbolicName(), ICONS_PATH + "full/etool16/warn_tsk.gif").createImage());

} else if (status.matches(IStatus.ERROR)) {
label.setImage(Activator.getDefault().getImage("full/etool16/error_tsk.gif"));
label.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(StatusLabelHelper.class).getSymbolicName(), ICONS_PATH + "full/etool16/error_tsk.gif").createImage());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ Export-Package: org.polarsys.capella.common.helpers,
org.polarsys.capella.common.helpers.validation.xml
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.polarsys.capella.common.helpers.HelperPlugin
Bundle-Localization: plugin
Loading