We have one dock window created in EA and it is displaying the xml file contents in tree view but the problem is if we exit EA and open the same eap file again the dock window with tree view contents doesn't appear.So we want to store the tree contents in eap file such that if we reopen the eap file we want the dock window to read the tree contents and display it.
Look into Tools/Directories and Paths. You can use "%"-enclosed names to define paths so you can use it from different environments. That's the only option you have here. There's a help button with the dialog that pops up which explains its use.
Related
Every time I open my xml file, it is not showing in the Notepad style but like in the screenshot, instead. How can i write my code, any remedies?
You are in Design tab so you are seeing xml file intree structure. Clicking on Source tab will resolve your issue. For xml file native editor in eclipse have 2 tabs.
Design Tab:
It will show file in tree structure so you can drill down from parent node to child nodes
Source Tab:
It will show xml as source.
Right click on the xml file and select OPEN WITH as Text Editor or XML editor, you will see the correct format.
i will build an eclipse rcp. in this context i will add some some views into this rcp. the views will be the project explorer view, editor like the same with the eclipse ide. and there will be some other views corresponding to my project.beside this i also have a databasetable, where the files are saved with their paths. so the thing is: if the user clicks to a file, then i will get the path of the file or save it into a variable so that i can compare the path of the selected file with the existing files of the databasetable... so their will not be another view, who will use this i hope i could explain my question better
My questions is.in the project explorer view of the eclipse ide.if you click on a file, then i would like to get the path of this file.does anyone know how i can get the path of a file in the project exlporer. or is this path saved anywhere, so i can get the path of the file from this place.
i will try to explain my qustion with this example:
if i click on the File: abc.java
and the path of the abc.java File in the project explorer is for example: Example/src/abc.java
My question is:
where can i find the path of the File abc.java or is this path saved anywhere?
or better:
if i click on the abc.java File
how can i get the path of this abc.java, to use this path for other topics.
thank you in advance
You use the ISelectionService to get the current selection:
ISelectionService service = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
ISelection selection = service.getSelection();
if (selection instanceof IStructuredSelection)
{
Object selected = ((IStructuredSelection)selection).getFirstElement();
IFile file = (IFile)Platform.getAdapterManager().getAdapter(selected, IFile.class);
.... use file
}
The current selection will be in whatever view or editor is currently active. You can also ask the selection service for the current selection in a particular view.
Ultimately, the answer is that you need to get to the selection as an IFile. Then you can just ask the IFile for its path using getFullPath(). See http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fcore%2Fresources%2FIFile.html
But you need to provide more context for this question. Do you have a popup menu action that's being passed the selection? Are you registering a selection listener from some other view? Or something else entirely? Basically, you need to tell us what context you're in and what data you have available.
i will build an eclipse rcp.
in this context i will add some some views into this rcp. the views will be the project explorer view, editor like the same with the eclipse ide. and there will be some other views corresponding to my project.beside this i also have a databasetable, where the files are saved with their paths. so the thing is: if the user clicks to a file, then i will get the path of the file or save it into a variable so that i can compare the path of the selected file with the existing files of the databasetable...
so their will not be another view, who will use this
i hope i could explain my questio better
thanks
I am working on eclipse RCP application which implements CommonNavigator view to display navigator. I have few LinkedResources in navigator that link to files on the file system with custom extension. These custom extension files are opened in custom editor as well as in TextEditor.
One of the file named default.ext will be common to all the projects and I want to keep it read only. Is it possible to open file in custom editor only? For ex. Default.ext should be opened in only custom editor, however Test.ext should be opened in custom editor as well as text editor.
This way I could handle save action in my editor depending upon file name and keep the file read only.
Is there any other way to keep files read only?
Short answer: not possible in the way you describe.
Long answer: if somebody really wants to modify a file then there's no way or need to stop this. What you can do is either (1) hide the file from user or (2) set Read-only flag to discourage users from modifying the file.
I have two laptops and on one of them in Eclipse I was able to add a type hierarchy that shows class members, etc. directly under the opened files (or whatever you call the tabs that are right about the red box in my image). I have no idea how to do this though, anyone have any suggestions?
Also, on a related note, when I do just open the type hierarchy it always requires that I open it given the context of the current opened .java file. On my other laptop it's sort of dynamic and allows me to explore the type hierarchy of whatever file I'm viewing. I want it all to work like how it is in Microsoft Visual Studio.
I think you mean the breadcrumb - Navigate > Show in Breadcrumb
In Eclipse / Aptana Studio is there a setting that allows the tab to show both the directory and file name (instead of just the file name) so I can see:
blog/views.py
instead of just
views
If you hover the pointer over the file’s tab, Eclipse will display a tooltip showing the full path and filename.
Normally when you open two files with the same name, it will display filename and the directory. It doesn't look like there is a way to do this by default.
The closest thing I found was showing the file extension in python under Preferences/PyDev/Editor/"Editor caption/icon"