how to get java docs attached to my java projects? [duplicate] - java

This question already has answers here:
How to solve "This element has no attached source and the Javadoc could not be found in the attached Javadoc"?
(9 answers)
Closed 8 years ago.
How to get ino about the Java classes and methods. when I use the auto Assist to add a method or interface normally in Android I receive ino about them, but when I use java it seems the javadocs attached to my java proojects are not existing ad i always receive the below message
please let e know how to solve this.
Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be
found.

In the source code, place caret on the class with the missing javadoc, and press F3.
Then you will see
From here you wil lbe able to add the javadoc.

If you are in eclipse, locate the .jar in the JRE System Library under your project. Right Click -> Javadoc Location. Download the docs and specify the location of the archive.

Related

Android Studio project doesn't work properly both java or xml [duplicate]

This question already has answers here:
Android Studio shows wrong file contents
(10 answers)
Closed 2 years ago.
I'm using Android Studio for long enough, but never experienced this kind of error. I don't know how to fix it. All XML is not usual, it has component or javadoc or something and all java file suddenly has a child. I don't understand why the project turn to be like that.
Here some preview of my error :
So, what should I do?
Finally I found how to fixed the problem. Go to
C:\Users\(user name)\.AndroidStudio3.5\system then delete caches file. Done!
Your class is actually named:
FragmentHome.java and you instead have a class named PhoneUtil
And your package name is incorrect:
com.android.ex.chips
it should be:
id.technow.kjur
in addition to this, your XML is not a layout XML. It is a ProjectCodeStyleConfiguration XML snippet.
So it is IMHO, you have copied files to the wrong places.

How to create a saving file with a specific image in java? [duplicate]

This question already has answers here:
How do I associate a filetype with an icon?
(2 answers)
Closed 3 years ago.
I'm writing a java program and I need to create a save file with an extension invented by me and the file should also have an image chosen by me. Can anyone tell me how to do it?
How can i assign icon for my custom file extension?
It's a system behaviour you can't alter this unless you change the registery in your machine.
to achive this you need to modify the registery in the deployed system (google for this you'll find links)
you need use RegOpenKeyEx(), RegGetValue(), RegSetKeyValue(), and don't forget to RegCloseKey()
Here's a link to the reference: http://msdn.microsoft.com/en-us/library/ms724875(VS.85).aspx
HKEY_CLASSES_ROOT/
this call to SHChangeNotify this tell explorer to refresh the icon whenever it changes.

Auto-generate Javadoc comments in intelliJ? [duplicate]

This question already has answers here:
Intellij generate javadoc for methods and classes
(9 answers)
Closed 4 years ago.
Is it possible to auto-generate Javadoc comments for each method in one class in IntelliJ IDEA?
Yes.
Under Tools you have Generate JavaDoc. Read about it in the official site.
In addition you may (Intellij 15):
Position caret above a method name, type /** and press Enter to let IntelliJ IDEA automatically generate JavaDoc stubs for this method
Edit: You can use the action Fix doc comment. It doesn't have a default shortcut, but you can assign the Alt+Shift+J shortcut to it in the Keymap, because this shortcut isn't used for anything else.
A QuickShortCut is
CTRL+SHIFT+A
From the dropdown List "Fix doc comment"
You can use JavaDoc plugin for generation JavaDoc comments in batch mode. It is the simpliest way for do it.

How to access class' javadoc programmatically? [duplicate]

This question already has answers here:
How to get a JavaDoc of a method at run time?
(5 answers)
Closed 7 years ago.
I would like to display some text before service class run. This text could be HTML, generated from class' javadoc. Is it possible to access/generate it from class itself?
Now with Java 8 you have a whole interface to play with comments and documentation. Check this package com.sun.source.doctree
You need access to the source code files to be able to read comments. If you don't have access (which is most likely the case if you want to read the comments at runtime) you will have to use another solution, like providing the text as a string or resource file.
It's possible to get comments using the Java Compiler API. See: How to access comments from the java compiler tree api generated ast?. The problem here is you still need to know where the source code files are located on the system, if they are even there at all.
Another solution is to use an annotation processor. It has the advantage that it provides you with an abstract representation of the source code without the need to manually read files. You would need to identify the class you want to read the comments from and then use Element.getDocComment.

Why cant we modify R.java? [duplicate]

This question already has answers here:
R.java can't be modified
(2 answers)
Closed 9 years ago.
I have read in several places that we shouldn't modify R.java. My question is why shouldn't we modify R.java?. What is so important about those Ids that they should not be modified?
R.java is an auto generated file contains all your resources used in project. If you want to change R.java you can't.
You have to add or delete resources, then it will be modified according to your resources present in project.
This is basic thing in Android. You have to read Android Developers documents, then you will get good knowledge about it.
Courtesy :R.java can't be modified
This is a generated file. It contains all references to your ids you defined in your xml files, to your drawables, strings, etc. Therefore it makes no sense to modify this file!
This also means that all your changes will be gone when the file is generated the next time (e.g. when you add an id)

Categories

Resources