eclipse-plugin interview questions
Top eclipse-plugin frequently asked interview questions
I was looking for a small plugin for Eclipse that would allow to open windows explorer on currently selected resource from Package Explorer tree.
I know that Aptana Studio provides this functionality via context menu on the resource, but it has tons of other stuff that I am not interested to.
Are there other solutions?
Source: (StackOverflow)
I'm running Eclipse 3.6.1 Classic, which does not come with the Eclipse Marketplace plugin by default. I've looked around the Eclipse website, but I don't see an available plugin for installing Eclipse Marketplace. Am I just not seeing it?
Source: (StackOverflow)
The question has two parts, one of which I already have the answer for.
- How to auto-remove trailing whitespace from the entire file being edited? -> Answer: use the AnyEdit plugin, which can be set to do that on any save to the file.
- How to auto-remove trailing whitespace only from the lines I changed? -> This I don't know and would appreciate any help.
Source: (StackOverflow)
I'm working on a 3.8-e4 hybrid (i.e we have the Luna dependencies, but we do not use the Application.e4xmi, yet). So we're basically running the compact layer.
With that being said, it would be nice to find an e4 programmatic way to stack these nasty views onto the editor folder.
1.) Problem
I want to place a generic view folder in the editor area, so that each view which is opened at runtime will be opened there.
(pic stolen from this question)
2.1) Possible fix no.1: Using plugin.xml
Create a perspective extension, and add each possible view to that extension, with relationship stack over relative org.eclipse.ui.editorss. This is a bit inconvenient if you have too many views awating to be opened, and if the project scales quickly. I also noticed that wildcard view IDs do not work here.
If you find yourself the time to add each possible view to the perspective extension, that would work. Although, IF you open a view which is not added here (ie: opens in a different folder), then each subsequent opened view will be opened in the previous folder, and NOT in the editor area (inquire further explanation if you don't get it).
2.2) Possible fix no.2: Using code in the perspective factory
In the IPerspectiveFactory
, we do have access to the IPageLayout
, which happens to be org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout
(e4 stuff).
Now, this ModeledPageLayout
implementation is reasonable, but also no documentation and weird public APIs. This one gives the possibility to stack a view over any other relative
modeledPageLayout.stackView("newView0", IPageLayout.ID_EDITOR_AREA);
This would be the programmatic version of 2.1. Also, the same problem appears here. If a view is opened somewhere else, the code above becomes useless.
Interesting enough, the stackView
API does not support wildcards (while others such as addView
do).
2.3) Possible fix no.3: Workarounds yaaay!
I have a lot of perspectives, and a lot of different folders in each one. Everything is precisely placed.
Since Eclipse offers the APIs to get all the view IDs from everywhere around the system, I want to do the following, per perspective: each view ID which wasn't added to a specific folder will be appended to the editor area (ie editor folder, editor stack).
This would be my last resort, unless someone offers a more convenient and timesaving solution.
Remember, an e4 programmatic alternative is more flexible!
3.) Related questions
These would be rendered deprecated for the e4 release.
4.) Related Bug on Eclipse's Bugzilla:
This recent bug opened by myself has an attachment with a small SSCCE. The steps to reproduce this are described in this comment, so I'm not going to copy-paste them here.
Source: (StackOverflow)
Is there any simple SQL editor plugin for Eclipse?
By simple I mean, the editor does NOT connect to any DB, does syntax highlighting and preferably formatting sql is a bonus.
Source: (StackOverflow)
When I launch Eclipse, it does not start.
An error appears and tells me to see the log file.
"See the log file: /Users/max/work/projects/.metadata/.log"
OS: MacOS 10.7.4
Eclipse: 4.2 Juno
ADT: 20
My old version of Eclipse starts without issue.
!SESSION 2012-07-03 16:22:48.261 -----------------------------------------------
eclipse.buildId=I20120608-1400
java.version=1.6.0_33
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=ru_RU
Framework arguments: -product org.eclipse.epp.package.java.product -keyring /Users/max/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/max/.eclipse_keyring -showlocation
!ENTRY org.eclipse.core.resources 2 10035 2012-07-03 16:22:50.101
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
!ENTRY org.eclipse.equinox.preferences 4 2 2012-07-03 16:22:56.457
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.equinox.preferences".
!STACK 0
java.lang.ExceptionInInitializerError
at org.eclipse.wb.internal.core.preferences.PreferenceInitializer.initializeDefaultPreferences( PreferenceInitializer.java:50)
at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper$1.run(PreferenceServiceRegistryHelper.java:300)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.runInitializer(PreferenceServiceRegistryHelper.java:303)
at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:131)
at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:368)
at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:166)
at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:237)
at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:410)
at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:663)
at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:805)
at org.eclipse.core.internal.preferences.AbstractScope.getNode(AbstractScope.java:38)
at org.eclipse.core.runtime.preferences.DefaultScope.getNode(DefaultScope.java:76)
at org.eclipse.ui.preferences.ScopedPreferenceStore.getDefaultPreferences(ScopedPreferenceStore.java:250)
at org.eclipse.ui.preferences.ScopedPreferenceStore.getPreferenceNodes(ScopedPreferenceStore.java:285)
at org.eclipse.ui.preferences.ScopedPreferenceStore.internalGet(ScopedPreferenceStore.java:475)
at org.eclipse.ui.preferences.ScopedPreferenceStore.getBoolean(ScopedPreferenceStore.java:387)
at org.eclipse.wb.internal.core.editor.describer.JavaSourceUiDescriber.isGUISource(JavaSourceUiDescriber.java:65)
at org.eclipse.wb.internal.core.editor.describer.JavaSourceUiDescriber.describe(JavaSourceUiDescriber.java:52)
at org.eclipse.core.internal.content.ContentTypeCatalog.describe(ContentTypeCatalog.java:218)
at org.eclipse.core.internal.content.ContentTypeCatalog.collectMatchingByContents(ContentTypeCatalog.java:190)
at org.eclipse.core.internal.content.ContentTypeCatalog.internalFindContentTypesFor(ContentTypeCatalog.java:403)
at org.eclipse.core.internal.content.ContentTypeCatalog.internalFindContentTypesFor(ContentTypeCatalog.java:450)
at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:346)
at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:360)
at org.eclipse.core.internal.content.ContentTypeMatcher.getDescriptionFor(ContentTypeMatcher.java:86)
at org.eclipse.core.internal.resources.ContentDescriptionManager.readDescription(ContentDescriptionManager.java:445)
at org.eclipse.core.internal.resources.ContentDescriptionManager.getDescriptionFor(ContentDescriptionManager.java:355)
at org.eclipse.core.internal.resources.File.internalGetCharset(File.java:246)
at org.eclipse.core.internal.resources.File.getCharset(File.java:207)
at org.eclipse.core.internal.resources.File.getCharset(File.java:194)
at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1156)
at org.eclipse.jdt.internal.core.builder.SourceFile.getContents(SourceFile.java:79)
at org.eclipse.jdt.internal.compiler.ReadManager.run(ReadManager.java:173)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4361)
at org.eclipse.swt.SWT.error(SWT.java:4276)
at org.eclipse.swt.SWT.error(SWT.java:4247)
at org.eclipse.swt.widgets.Display.error(Display.java:1068)
at org.eclipse.swt.widgets.Display.checkDevice(Display.java:621)
at org.eclipse.swt.graphics.Device.getSystemFont(Device.java:476)
at org.eclipse.jface.preference.PreferenceConverter.<clinit>(PreferenceConverter.java:84)
... 35 more
!ENTRY org.eclipse.osgi 4 0 2012-07-03 16:22:59.978
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jface.preference.PreferenceConverter
at org.eclipse.ui.internal.themes.ThemeElementHelper.installFont(ThemeElementHelper.java:103)
at org.eclipse.ui.internal.themes.ThemeElementHelper.populateRegistry(ThemeElementHelper.java:59)
at org.eclipse.ui.internal.Workbench$27.runWithException(Workbench.java:1550)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3944)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2478)
at org.eclipse.ui.internal.Workbench.access$7(Workbench.java:2386)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:583)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
!ENTRY org.eclipse.core.jobs 4 2 2012-07-03 16:23:05.824
!MESSAGE An internal error occurred during: "Android Library Update".
!STACK 0
java.lang.NullPointerException
at com.android.ide.eclipse.adt.AdtPlugin.getOutStream(AdtPlugin.java:1714)
at com.android.ide.eclipse.adt.internal.project.LibraryClasspathContainerInitializer.allocateLibraryContainer(LibraryClasspathContainerInitializer.java:264)
at com.android.ide.eclipse.adt.internal.project.LibraryClasspathContainerInitializer.updateProjects(LibraryClasspathContainerInitializer.java:81)
at com.android.ide.eclipse.adt.internal.sdk.Sdk$3$1.run(Sdk.java:1197)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
!ENTRY com.android.ide.eclipse.adt 4 0 2012-07-03 16:23:05.998
!MESSAGE parseSdkContent failed
!STACK 0
java.lang.NullPointerException
at com.android.ide.eclipse.adt.AdtPlugin.getDisplay(AdtPlugin.java:334)
at com.android.ide.eclipse.adt.AdtPlugin$7.run(AdtPlugin.java:1422)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
!ENTRY org.eclipse.core.jobs 2 2 2012-07-03 16:23:06.504
!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: com.android.ide.eclipse.adt.internal.sdk.Sdk$5
!ENTRY org.eclipse.core.jobs 2 2 2012-07-03 16:23:06.505
!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: com.android.ide.eclipse.adt.internal.sdk.Sdk$5
Source: (StackOverflow)
I'm using Eclipse + ADT, and my physical device (listed below) is unlisted on Android Device Chooser. I have updated Eclipse and all of the Android packages. My phone is running Android OS 1.6, which corresponds to the target version listed in the Eclipse Project.
Also, the reason I decided to try testing on a real device is because the emulator doesn't seem to be working right anymore when I run my project. The emulator launches, but the program never does. Any ideas?
(using windows 7/t-mobile mytouch 3g)
Source: (StackOverflow)
I installed the Maven plugin for Eclipse, and then I got an error like below:
please make sure the -vm option in eclipse.ini is pointing to a JDK
How do I use the -vm
option to point to my JDK in eclipse.ini?
Source: (StackOverflow)
I'm using eclipse galileo. Is it possible to display the tabs of my open files on several lines instead of using the >>
sign. I still want a unique window to view the code though.
If there is no such settings, do any plugin exists ?
Source: (StackOverflow)
I want the same behaviour Firefox has, when you use the scroll button in the mouse to zoom in and out on the current view.
Is there something like it for eclipse?
Source: (StackOverflow)
Is there an Eclipse plugin available for JavaScript that allows for syntax checking and autosuggestions for .js files in Eclipse?
Source: (StackOverflow)
What is the proper way to install Hibernate Tools in Eclipse as a plugin?
The Hibernate site doesn't really give any instructions.
Looking at the Hibernate Tools binary HibernateTools-3.2.4.Beta1-R200810311334.zip
, it appears that I can just unzip this in my eclipse directory. Do I just unzip it in my eclipse directory? This seems like a hacky was to install it.
Source: (StackOverflow)