Eclipse debugger variables don't show name, only values - java

Please the the attached snapshot. In my debugger, I can only see the variable values, but no names. It's very annoying. what might cause this?

I tried everything found in the link that jotadepicas provided. It might be a combination of all those suggestions that lead up to me resolving the variable names not showing.
After trying all of the suggestions, I clicked on the down arrow in debug variables tab --> Layout --> Select Columns. Both the Name and Value boxes were already checked. I simply clicked OK and the Name column displayed. This Select Columns and Show Columns under Layout were not available prior to all the previous steps.
I am running Eclipse Mars 4.5.1 on Linux Mint 17.3.

You could try reseting the Perspective, closing and opening de variables view again, even restarting eclipse. Have a look at this similar question just in case: Eclipse Debug Mode: Variables not showing

It's a rendering problem in eclipse. click on the Variables Tab -> click on the vertically three dots icon appearing in the corner-> Layout - > Select columns -> Deselect all columns -> apply -> go back and select all columns .
This should work.

Related

how can i jump to a specific line in an editor when click a label in the treeviewer in jface/swt-eclipse plugin development

I'm doing an eclipse plugin project. I have realized a view by TreeViewer, which can read info from text and show them.
The treeViewer has several columns and one of which shows the specific line number in a file,
just like this:
java.lang.NoClassDefFoundError: Could not initialize class
de.toem.pattern.element.Elements at
de.toem.eclipse.toolkits.util.SelectionUtils.getElements(SelectionUtils.java:36)
I have no idea how to jump to the file when click the number, please help me..
You could look at the source of org.eclipse.jdt.internal.debug.ui.console.JavaStackTraceHyperlink which is the code called from the Console view when you click on a class name hyperlink in a Java stack trace. This understands how to find the class, open the Java editor and go to the line number.

Intellij project view: not show multiple classes in same file

One frustrating thing I find in Intellij's project view is that it shows all the classes in a file instead of just the class for which the file is named.
The problem with this is that to open a file I have to double click twice: once to expand the file and show the classes in the file, and then a second time to actually open the file.
In most cases I don't want to see the classes inside of a file. I just want to see the file in the project view and when I double click on the file I want to open the file, not drill down into its structure.
Is it possible to configure my UI this way?
UPDATE: further explanation
Apparently people are having problems understanding this question. See the above picture of the Intellij Project navigation pane. Notice that some classes (the blue circles) have a + sign and others do not. The ones with a plus sign are files that have multiple classes inside of them.
The problem is that if you double click on a file with only one class (no plus sign) it opens (GOOD), but if you double click on a file with multiple classes in it (has plus sign) then the file does NOT open, it just expands the plus sign to show you the individual classes in the file as BoxArray.java, for example (BAD).
For example, if I double click on the file Coastline.java in the view above it will NOT open the file, it will expand the plus sign. I want it to open Coastline.java when I double click on Coastline.java, not expand it. I do not care about seeing the classes inside of a class file, I just want to open it in one double click.
I know that I can use the hotkey F4 to do this. I do not want to reach for the F4 key. I want to double click on the file and have it open.
When you enable Autoscroll to Source in the little menu of your Project tool window (View > Tool Windows > Project), single clicking a collection (closed and opened) goes straight to the code as well as folding / unfolding it.
This works in IntelliJ 13.1 and 14 (in OSX and Linux)
You could bind Jump to Source function to double click in Settings -> Keymap -> search for "Jump to Source" -> RMB click and choose "Add Mouse Shortcut".
Now double clicking on file will open it. Drawback could be that from now if you double click on some code to select it you will always go to source..
There is a way to open a file without unfolding/drill down via "jump to source" action. Unfortunately, you need a keyboard to do this. On Mac you use F4/⌘↓/⌘Enter, on linux/windows it is F4/Ctrl+Enter.
go to file -> settings -> Editor -> General -> editor tabs
in tab closeing policy and set tab limit and set it to what number you want.
You can avoid navigating through mouse and even double clicking on the file by making use of the shortcut ctrl + shift + n and just start typing the file name or even just first letters of the words( ex: BA for BoxArray) and select the file. Which will open without asking the class name!!

what does cross sign means in eclipse

I have a project opened in eclipse, its a java web application. In eclipse I can see that there is a red cross sign with my project name, On expanding my project I can see many files have the same red cross sign.
What does this cross sign means in eclipse? Is it showing some compilation error? if error how can I see the error? Also what does that triangle icon means?
Please check the screenshot above and see the cross and triangle signs...
The cross on red ground means an error in this file, while a question mark on yellow ground indicates a warning. You can see them in the Problems tab in eclipse:
You can customize what is treated as an error and as a warning under Window -> Preferences and then search for errors/warnings (Also take a look at the docs: Java Compiler Errors/Warnings Preferences
In addition to the markings on the resources, you can see errors and warnings in an open file next to the scroll bar:
Cross sign shows the error in that Source,Triangle indicates that your source has some warinings
Just open those files could find the Red x under line and marks in the source editor , if warnings will be displayed as Triangle with ! in the side bar of the source editor
If your source code is large then you can use shortcut ctrl + . to see the errors in the source file. The following shortcuts will move to the warnings and errors from top to bottom in your eclipse
Few shortcuts to see the errors in eclipse:
Next error: `Ctrl + .`
Previous error: `Ctrl + ,`
Quick fixes: `Ctrl + 1`
The cross sign indicates that the file web.xml has some error. Also, possibly some files within the 'jsp' and 'lib' directories also have error.
The yellow triangles are warnings. To see the details of all, Go to Window -> Show view -> Problems
I don't see anyone mentioning one thing that may be confusing to a beginner: the red X appears on the file with the error as well as on all its parents. These other marks are a great convenience when your tree is collapsed—they lead you to the file in error, but can also cause confusion when viewing an expanded tree.
Every error marked with the red X annotation also appears in the Problems view, if the view's filter is properly configured. You configure the filter through the view's local menu (accessed through the little downward-facing triangle in the top-right corner of the view's title bar).
It means your projects contains error, if appears red-cross.
It seems that your project contains error,if it shows red-cross
General way you can see Window > Show View > Problems
The easy way using shut cut key Alt+Shift+Q,X
Yes, it means you have an error, whereas the yellow triangle with the exclamation mark means you have a warning.
You can view the error by opening the file. The line with the error will an error mark on the left margin.

Empty Netbeans 7 palette? How to restore it?

I use Netbeans 7 on Kubuntu 12.04. I start Netbeans like this:
netbeans --cp:a /usr/share/java/xercesImpl.jar &
cause of known issue with Netbeans and Kubuntu 12.04. In the middle of my project my palette with Swing components just .. disappeared!
I see only sth like this:
How to restore default Netbeans palette?
I checked Ctrl+Shift+8 shortcut but with no results - the problem is still the same.
**EDIT:
I dont know what I did but now I see ONLY EMPTY palette :( : **
I also tried this:
1) I cd'ed to /home/mazix/.netbeans/7.0/config/Windows2Local/Groups/commonpalette
, ls'ed and saw only this: CommonPalette.wstcgrp
2) cd'ed to /home/mazix/.netbeans/7.0/config/Windows2Local/Components and saw this:
AnalyzerTopComponent.settings output.settings
AnalyzeStackTopComponent.settings projectTabLogical_tc.settings
breakpointsView.settings projectTab_tc.settings
CallHierarchyTopComponent.settings properties_1.settings
callstackView.settings properties.settings
CommonPalette.settings refactoring-preview.settings
ComponentInspector.settings
ReporterResultTopComponent.settings CssPreviewTC.settings
resultsView.settings debugging.settings
search-results.settings DeclarationTopComponent.settings
services.settings evaluator.settings
sessionsView.settings favorites.settings
sources.settings find-usages.settings
StyleBuilderTC.settings gsf-testrunner-results.settings
svnversioning.settings hgversioning.settings
synchronize.settings JavadocTopComponent.settings
TaskListTopComponent.settings localsView.settings
TerminalContainerTopComponent.settings
MultiView-java#007Cform#007C_1.settings threadsView.settings
MultiView-java#007Cform#007C_2.settings versioning_output.settings
MultiView-java#007Cform#007C_4.settings watchesView.settings
MultiView-java#007Cform#007C.settings Welcome.settings
navigatorTC.settings
and didnt see any _hidden files :(
Open NetBeans and choose Window -> Palette
It will appear but it will be empty because you didn't choose a GUI class yet.
To fill the palette with the GUI components like labels, follow these steps:
Create a new project .
Right click in the package name or project name, and choose New -> Other...
In the New File dialog box, choose the "Swing GUI Forms" from category and the "JFrame"
Form file type sub window. Click Next.
Enter name lets say "MyGUI" for the new the class which you created now.
The palette window is now full with components like labels, text,checkboxes, ...
if not appear yet make sure to press "Design" button in the upper of the GUI class bar "MyGUI"class
I got the same issue and this work for me window -> reset window. hope it work for you :)
I think the same problem occur here.Check this solution.it may helpful to you.
This steps for restore the default palette?
Exit the IDE.
Go to your user directory and go down to config/Palette subdir. In this directory, the files or directories deleted from the default palette content are presented as empty files with _hidden suffix in their names.
Delete these _hidden files to let the palette categories and items appear again in the IDE.
I think this will help you
Do one thing, simply right click on your netbeans project and then open it. It resolves the problem. You will observe if u open a new project the palette is there, so just copy the project with a different name, its will solve your problem.
In my case after creating a new project without a default constructor, the search box at the palette holds a single character i.e. '='. this results in an empty palette too.
In that case the solution is obvious: just delete the content of the search input.
It puzzled me for a moment, though, not noticing the search input field content.
I had the same situation with my netbeans. The only solution I did was to backup my project folder (saving it to other drive). Then re-install the netbeans. Afterwards I re-paste the project folder at the directory and re-open it.
Right-click mouse button at palette box. Choose command "reset palette".
I encountered the same problem. Just check the bottom of the palette to see if there is a search box open. If there is, close it. Then the palette will be available once again.
So, nothing suggested here worked for me, I am leaving my solution.
You create the project, name it.
Create a package.
Click on the package with the right mouse button
select New filme
select Other
select AWT GUI Forms
select Frame form
Now you should see the menu at the right part of your screen with the option to create buttons, labels, etc.
As of 2021 for mac users;
Open your NetBeans app and click on "windows" located at the top menu of the application. A drop down will appear.
Scroll down and click "IDE Tools". You'll see another dropdown containing list of items including palette.
Click on the "palette". This will make the palette visible.
That's all!

Eclipse autocompletion problem

Just installed Eclipse Helios (Win7 64) and I'm having a strange problem. I type syso-Ctrl-Space which is expected to complete to System.out.println("") but it doesn't work! I searched the web for about an hour now, I set Preferences > Java > Editor > Content Assist to defaults, nothing. Everything else seems to work. Ideas?
To be clear: the shortcut works, it completes everything except "syso" as seen so far, on syso (also tried sysout) it says "No Default Proposals". I couldn't find this kind of shortcuts in the Content Assist, but I set them to default anyway.
If you still cant get auto-completion working,try enabling the Template proposals under Content assist menu.This is the exact location,
Windows->Preferences->Java->Editor->Content Assist->Advanced
And make sure you have only one entry for syso(Under Templates menu).
I believe the right template is "sysout" and I believe this can be configured somewhere but could not tell you where. Try sysout and then Ctrl+Space
It's a template, you can find all templates under
Window -> Preferences -> Java -> Editor -> Templates
There you can see that the template name is "sysout" this will then trigger the string substitution for System.out.writeln() but you can change both the template name (if you prefer syso) and/or the actual code produced by invoking the template
Cheers
I am using Eclipse Galileo and had the same problem. Even after trying the above proposed solutions but it didn't work. After making the below change it finally comes out.
Go to Windows->Preferences->Java->Editor->Templates
Select sysout template and edit it.
Change the context from Java statement to Java.
And it worked for me. I hope this will be helpful for you.
As Peter stated, it is under Window -> Java -> editor -> templates.
Look for the line with the following values.
sysout "Java Statements" "Print to standard out" "on"
the preview should be as follows...
System.out.println(${word_selection}${});${cursor}
Your cursor needs to be located in a place where it would be legal to get that line. If your cursor is within a method definition and you type syso you will get the replacement. However if your cursor is in the portion of the text outside of any method definition, say where you declare variables for your class for instance, then syso will not suggest the illegal line system.output.println();.
I had this problem, read all the answers here, became convinced that it MUST be working in my copy, and realized I had been typing syso BELOW the closing } of my last method instead of in the method.
Eclipse on!
You may try to set the shortcut of Content Assist with ALT+L, if it works, then you can choose your favorite shortcut again. (The shortcut Ctrl+Space conflicts with the shortcut of switching input method). In eclipse on linux, the shortcut of Word Completion is ALT+/, so if you set this as the shortcut of Content Assist it also conflicts.)
Just go to the below address:
Windows->Preferences->Java->Editor->Content Assist->Advanced
and click restore default..........that's all
its work like a charm again.
Also check in this eclipse menu:
Windows -> Preferences -> Java -> Appearance -> Type Filters
If you see java.* or javax.* here then try removing it (or Restore Default will do the job) and see that works, it did for me.
Just found the solution for Eclipse Luna: write syso and press CTRL+Space and click on "enable intelligent code completion" and you are set.
I am sure you can find it somewhere in the options as well but this way it is fast and easy!
DIRTY WORKAROUND:
You can try out the following AutoHotkey-Code if you're still struggling like I am (STILL haven't been able to fix it myself)
#persistent
#ifwinactive ahk_class SWT_Window0 ; eclipse java
:*:syso::
sendraw System.out.println()`;
loop, 2
send {left}
return
#ifwinactive
You need to write this in a .ahk file and run it (AutoHotkey needs to be installed). You might wanna put this file into your startup folder. It's a very useful tool, you might wanna expand it one day.
You might have overlapping shortcuts.. Goto 'Overview' than the 'Keys' subsection. Type "ctrl +space" in the 'filter text' section. You should see the "content assist" and probably another command with the same shortcut. If another shortcut does exists, change its shortcut to something else.

Categories

Resources