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

Service: changed super class of 'ElkServicePlugin' from 'AbstractUIPlugin' to just 'Plugin' #516

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

sailingKieler
Copy link
Contributor

@sailingKieler sailingKieler commented Mar 6, 2020

... because loading class 'AbstractUIPlugin' seems to require SWT (esp. 'SWTError') on the classpath that may not be available in standalone scenarios;
Copied 'IPreferenceStore' provision from 'AbstractUIPlugin'

To my surprise this change is also required in the standalone context,
otherwise failures (java.lang.Error) may happen at locations like this

try {
Class.forName("org.eclipse.elk.core.service.ElkServicePlugin");
} catch (Exception e) {

This also looks like such a candidate:

IStatus status = new Status(Status.WARNING, ElkServicePlugin.PLUGIN_ID,
"Unable to build the layout graph from the given selection.");

@uruuru
Copy link
Contributor

uruuru commented Mar 7, 2020

Doesn't jface require swt as well?

import org.eclipse.elk.core.data.ILayoutMetaDataProvider;
import org.eclipse.elk.core.data.LayoutMetaDataService;
import org.eclipse.elk.core.service.util.MonitoredOperation;
import org.eclipse.elk.core.util.Pair;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.plugin.AbstractUIPlugin;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be required anymore, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Came in while adding this javadoc

/**
* Return the preference store associated with this plug-in.
*
* Implementation is inspired by {@link AbstractUIPlugin#getPreferenceStore()}.
*/

I'll refine that.

@sailingKieler
Copy link
Contributor Author

Doesn't jface require swt as well?

In its entirety yes. However, here only the preference store interface and impl from JFace are referenced, and the impl is not (and should not be) instantiated in standalone usage.
The same applies to stuff from org.eclipse.ui.workbench. The basically only used parts are the interface IWorkbenchPart, and the StatusManager impl. The latter should also not be accessed in standalone scenarios.

…ugin' to just 'Plugin'

... because loading class 'AbstractUIPlugin' seems to require SWT (esp. 'SWTError') on the classpath that may not be available in standalone scenarios;

* copied 'IPreferenceStore' provision from 'AbstractUIPlugin'

Signed-off-by: Christian Schneider <christian.schneider@typefox.io>
@sailingKieler
Copy link
Contributor Author

@uruuru refinement is done.

@uruuru
Copy link
Contributor

uruuru commented Mar 9, 2020

I'm fine with the changes. @le-cds?

@le-cds le-cds merged commit fe68b1a into eclipse:master Mar 10, 2020
@le-cds le-cds added core Affects the ELK core. enhancement An improvement to existing functionality. labels Jun 22, 2020
@le-cds le-cds added this to the Release 0.7.0 milestone Jun 22, 2020
@le-cds le-cds added the breaking Breaks the API or significantly affects layouts with default-ish settings. label Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaks the API or significantly affects layouts with default-ish settings. core Affects the ELK core. enhancement An improvement to existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants