How to jump to error line in eclipse editor from my created view - eclipse

I have created a view in eclipse like console and it shows the errors to users.So when user clicks on that error it should go to that line number.How should I do this?

Throw away your selfmade view, implement the console factory extension point instead to create new console sub windows in the existing console view. Afterwards implement the console pattern match extension point to find and link text segments in the console output.
Implementing a full view in Eclipse that behaves like an already existing view is always wrong. All of the existing views in the eclipse platform have extension points to change and enhance them. Nobody really wants to have 5 different console views being shown in a perspective.

Related

Netbeans has phantom html error

Using Netbeans 8.0.2, I'm getting an error (red circle/exclamation mark) on the tab for the html file, but there is no error shown in the html itself:
While just an irritant, it does keep drawing my eye to it. I'd like to make it either go away or show exactly where the error is, but I can't find anything online about this particular problem.
Two more things to try:
check Action Items window to see if there is something (Window->Action Items)
could be issue of NetBeans - check IDE log if there is some exception via View->IDE log
I usually just add a space in the file and then save it. It is annoying but it does the job.

how to remove google sign in button in eclipse

I'm facing a wierd problem. My eclipse, has a google signin button which is occupying some of the space which I do not want to happen. Initially it had "Sign-in to Google" text along with it. I've followed some blog post and set accordingly to show just the icon (I don't remember that blog post link).
But now, the icon is getting replicating .. it is being shown 12 times. It is actually creating childs :P
I've gone through all the options present in Customize Perspective menu, none of them had this button listed. Can someone help me in removing that google sign button from my perspective? One possible suspect is- my eclipse crashes when I suspend and wakeup my machine.
You can use the Window > Reset Perspective... menu command to reset the perspective to its default state, which might eliminate that toolbar and buttons. If that fails, I would create a new workspace and import the projects into it using File > Import > Existing Projects into Workspace.
If you want to try to salvage your existing workspace, it's possible to do so my manually editing Eclipse's internal file that stores your Workbench layout, but it's a bit tricky. Here are the steps I've followed to eliminate a similar repeated toolbar item:
Exit Eclipse.
Find the Workbench layout file, it's path is <workbench>\.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi. Make a backup of this file before you touch it - this is essential because it's easy to corrupt the file if you change the wrong things.
Open the file in your favorite XML-aware editor - most packages of Eclipse include the XML editor that works just fine1, but be aware that if you use Eclipse to edit the file you can't have Eclipse open on the workspace that contains the workbench.xmi you want to edit.
Find the section of <trimBars> nodes in the XML; from there you have to determine which <trimBars> node you need to edit. In your case it looks like a vertical one, probably with a side="Right" attribute.
Under the correct <trimBars> node you'll find multiple <chlidren> nodes, each with an elementId attribute that should help you identify it; you're looking for <children> nodes that are identified as something related to the Google plugin.
Delete the <children> nodes that seem related to the unwanted toolbar buttons. In your case, it appears that there is an entire toolbar that you might want to eliminate, so you might want to delete the entire containing <trimBars> node.
Save the file and start Eclipse on that workspace.
1Some packages of Eclipse include EMF tools that will open it in a special XMI editor that does not provide a view of the source, only a structural tree view. Depending on how you like to work with XML, this might be easier than editing raw XML.
This is not a perspective but a view. You can hover over that bar with the buttons and click Alt+Shift+F1 to check where this View comes from. Then you can either disable/uninstall the contributing feature (Help -> Installation Details) or check where the feature came from.
If it comes from the IDE, you can open a bug for it. If it is contributed from a third party plugin, contact the developers of that plugin.
There is an eclipse bug concerning duplicate view toolbar buttons in Luna that has recently closed as well. Maybe this solves your problem as well.
Edit: Taken from this bug:
root cause is that in Luna 4.4M5 WorkbenchWindowControlContribution.createControl is called twice, the
first time with a null value for
WorkbenchWindowControlContribution.getWorkbenchWindow() while it is
still being created. This is related to what has been reported here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=427452
second cause is that my createControl(Composite parent) method was calling PlatformUI.getWorkbench().getActiveWorkbenchWindow() instead
of WorkbenchWindowControlContribution.getWorkbenchWindow(). This
resulted in an attempt to create a new Workbench Window, which
recursively calls createControl() again. This has already been
reported here https://bugs.eclipse.org/bugs/show_bug.cgi?id=366708

MarkerResolution not shown when invoked with quickassist shortcut

I'm working on an eclipse plugin where i've created a custom resource marker together with a markerResolution to added quickfixes to XML files. So far everything is working, except that the quickFix only shows in the Problem view of eclipse. The quickassist popup which is opend using Ctrl+1 in the XML file itself does not show the quickfix.
The marker definition can be found here, the markerResolution is this one.
Is there any additional extension point i need to implement to make the quickFix show up in the shortcut popup?
I think i found the solution. One needs to implement an editorConfiguration for the XML editor with a provisionalConfiguration.
In this class you parse the AnnotationModel and check for your marker. If the marker is found, you return an ICompletionProposal

Programmatically affecting load order of perspectives

So, I'm working on an Eclipse Plugin which includes a custom view based on analysis of source code. The majority of the time, it works great. However, if I quit Eclipse with that view open, when I reopen it, it runs into an error with either IWorkbenchWindow.getActivePage() or IWorkbenchPage.getEditorReferences() returning null. This inconsistency seems to be because the view has the focus when Eclipse quits and is the first thing that Eclipse tries to reconstruct on start up. the focus is on a non-window shell (I don't fully understand this, but that's what this said). Is there a workaround so that I can ensure that Eclipse fully loads its IWorkbenchWindow before my custom plugin regardless of what has the focus when Eclipse closes?
Thanks
You can consider using the site instead: getSite().getPage()...
Tonny Madsen pointed out in the comments that, from within a View, I can access the Active Page from getSite().getPage(), which solved the issues.

How to control a View on selecting particular File Type in Eclipse Editor

I want to control a view , like if I select a .js type of file , a particular view should be visible else for all other type it shouldn't.
I dont want to use perspective as for just a single selection, it will be an overhead.
Please suggest me any way to achieve the same through Eclipse plug-in Development.
When you contribute the view, you either don't mention a perspective (in which case when the view is shown it defaults to the bottom right) or you use the org.eclipse.ui.perspectiveExtensions extension point to contribute it to a specific location. You can make it visible or invisible by default.
You make the view visible/invisible at runtime using the org.eclipse.ui.IWorkbenchCommandConstants.VIEWS_SHOW_VIEW command and the view ID parameter, or by using the showView()/hideView() API in org.eclipse.ui.IWorkbenchPage
See Plugging into the Workbench for more information.