Showing posts with label eclipse-plugin. Show all posts
Showing posts with label eclipse-plugin. Show all posts

Sunday, June 10, 2018

Clean the workspace .metadata folder on product startup

Leave a Comment

I develop an Eclipse plugin which extends to Eclipse UI, and we deliver it as a whole Eclipse product. The plugin has as a target some automotive projects.

The version of the product can be configured from the project and executing a batch file will launch the proper version of the product.

So the final command will be something like this:

start /B %PRODUCT_PATH%/eclipse.exe -clean -configuration %PATH_TO_PROJECT_CONFIG% -data %PROJECT_PATH 

The problem comes when switching from one product version to another, the .metadata folder is corrupted or the information from it is not compatible between products, I am not sure what happens exactly but I get sporadic exceptions at startup.

When I clean the .metadata and launch the product without an existing .metadata folder in the project location, everything runs normally.

Is there an command line option for Eclipse to clean the workspace .metadata before startup?

1 Answers

Answers 1

All (I think!) the Eclipse command line arguments can be found in the Runtime options section of the reference documentation.

I find nothing in that document about removing the .metadatadirectory.

I have also searched for usage of the words "clean", "clear" and "remove", and reference to osgi.instance.area (which and think is the OSGI term for the .metadata directory) and found nothing that seems relevant.

Suggestion 1: clearPersistedState

You could try -clearPersistedState option. Maybe that could help? (I don' really know the purpose of the option, I just found it in the documentation.)

Suggestion 2: Start script

Otherwise maybe you could have a start script which simply runs del to remove the directory.

Suggestion 3: Find the root cause

The best thing to do is of course to find the root cause of the startup problems and solve that. But maybe that is too time consuming or impossible in your case.

Read More

Monday, March 12, 2018

Setting a WorkbenchWindowControlContribution as a SelectionProvider

Leave a Comment

I added a control in the toolbar which extends WorkbenchWindowControlContribution and implements ISelectionProvider. This control contains a Combo and when I change the selection I want to notify another view. Because it's not a ViewPart I can't call getSite().setSelectionProvider directly. I tried to set it like this:

        PlatformUI.getWorkbench().getDisplay().asyncExec(() -> {         PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite().setSelectionProvider(MyControl.this);     }); 

If I add this to the protected Control createControl(Composite parent) method the getActivePart would always be null. I also tried registering it when the Combo's value changes for the first time, but that way my other View wasn't notified about the change event.

Here is the ISelectionProvider methods:

@Override public void addSelectionChangedListener(ISelectionChangedListener listener) {     listeners.add(listener); }  @Override public ISelection getSelection() {     return new StructuredSelection(comboBox.getText()); }  @Override public void removeSelectionChangedListener(ISelectionChangedListener listener) {     listeners.remove(listener); }  @Override public void setSelection(ISelection selection) {     for (ISelectionChangedListener listener : listeners) {         listener.selectionChanged(new SelectionChangedEvent(this, selection));     }  } 

The View that should be getting notified implements ISelectionListener. I register it in the public void createPartControl(Composite parent) with getSite().getPage().addSelectionListener(this);

And here is the override of the SelectionChanged too:

@Override public void selectionChanged(IWorkbenchPart part, ISelection selection) {     if (part instanceof MyControl) {         String selectedProtocol = ((StructuredSelection) selection).getFirstElement().toString();                } } 

Can it be done?
Thanks!

0 Answers

Read More

Thursday, March 2, 2017

Eclipse 4.4 Luna pinning editor tabs

Leave a Comment

I've found this question: Eclipse - How to pin editor tabs? and I've installed "Extended VS Presentation plugin for Eclipse", but it's not working.

How it should look (from http://andrei.gmxhome.de/skins/index.html):

http://andrei.gmxhome.de/skins/extendedvs_props.gif

How it actually looks on my Eclipse 4.4 (on Ubuntu):

Eclipse 4.4 (on Ubuntu)

As you can see, "Current presentation" setting is missing.

When I've installed this plugin (via eclipse), it was in "Eclipse 3.6 - 3.8 plugins", so maybe it's incompatible with 4.4 Luna? However, it was possible to install it, so it should work, right?

Also, if you know any plugin that would allow pinning tabs in eclipse, feel free to post your answer and describe it.

3 Answers

Answers 1

That first Appearance dialog is how it looks in Eclipse 3.x. The appearance code was completely rewritten for Eclipse 4.x.

The fact the plugin installs may just mean the install is not careful enough about specifying the versions of Eclipse it supports.

You should try and contact the plugin author to see if it supports Eclipse Luna.

Answers 2

Support eclipse versions for this plugins:

Eclipse Versions: Juno (4.2, 3.8), Previous to Juno (<=4.1)

This plugin NOT works(See this) in eclipse 3.x on Linux.(But here author says it support Linux platform. Contact author for more details)

This plugin NOT works in eclipse 4.x on any platform.

Please note, that the skin, tab actions and lists are available for Eclipse 3.x only! Eclipse 4.x is not supported.

Answers 3

In my point of view, everything is fine.

As you can see in the images below, (Check bottom (console) ).

Main Page

The above page is updated on 06-25-2014

But the screenshot in that page is taken on 06-02-2008 , (Check bottom (console) ).

Screenshot

The screenshot given in that page is a screenshot of very very old version. The plugin is updated, but the screenshot in the page is not yet updated.
The new plugin will work as shown in the image in the question

Alternative

In Eclipse 4.4.0 there You'll find a pin symbol in the default toolbar of Eclipse on the right side. After clicking it, the Java Editor Tab symbol gets changed indicating this editor is pinned now. Unfortunatelly I could not find a corresponding entry in the popup menu. But it is easy to assign e.g. the keys Ctrl-P to "Pin Editor" in the key bindings of Eclipse. (Don't forget to unbind Ctr-P = Print).
In Eclipse Neon 4.6.0 Pin is not functioning.

Read More

Wednesday, March 16, 2016

SWTBot for Lotus Notes java plugin testing

Leave a Comment

Is it possible to use SWTBot to make automatic GUI tests for Lotus Notes Eclipse Java plugins?

EDIT: If yes, how exactly to integrate a Client Services Run Configuration with a SWTBot Test Run Configuration in Eclipse? Certain attributes like the Personality framework can't be added to a SWTBot Test Run Config... enter image description here

If not, is there a GUI Testing Framework that works well with Lotus Notes?

Thanks

P.S. In the bowels of the Internet I found this link where it seems QF Test integration was not successful

1 Answers

Answers 1

Since Lotus Notes is an Eclipse RCP application (as far as I know), it's totally possible to use SWTBot with it.

Read More