Share / Export eclipse working sets - eclipse

I have created a couple of java working sets for a project in my workspace and want to share them with other people (using different workspaces). Is there a way to export them?

You can try and export (as in "copy to another people workspace metadata directory"):
</path/to/.metadata>\.plugins\org.eclipse.ui.workbench\workingsets.xml
This is the file referencing your working sets.
z0r adds in the comments:
my team mate replaced his workingsets.xml with my version of the file, and it worked well.
However, you must exit Eclipse before replacing the file, because Eclipse will overwrite it with the old version when it exits.
I think you only need to do this once.

download the AnyEdit addon:
Description | Download page
and then use the following work through:
Via the menu bar: File > “Export…”
Select “General” / “Working Sets”
Click “Next >”
Select the working set(s) you want to export and where you want to export the file.
Click “Finish” to perform the export.

In Eclipse Indigo the working sets export has moved to Export -> Team Project Set and there is a check box top left to export working sets.

Although, File → Export → Team → Team Project Set is the correct way to export working sets, you could write an Eclipse External Tool.
External Tools
Open a new dialog by navigating:
Run → External Tools → External Tools Configurations…
Select Program and click the New button to create a new configuration.
Note: You will only need to use the "Main" tab.
Give the tool a title e.g. "Export Working Sets"
Windows
Location: ${env_var:SystemRoot}\System32\cmd.exe
Working Directory: ${env_var:USERPROFILE}\Documents
Arguments:
/c copy /y ${workspace_loc}\.metadata\.plugins\org.eclipse.ui.workbench\workingsets.xml workingsets-${current_date}.xml
Linux
Location: /bin/cp
Working Directory: ${env_var:HOME}/Documents
Arguments:
${workspace_loc}/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml workingsets-${current_date}.xml

Related

Golang on eclipse: "Resource doesn't have a corresponding Go package" on Mac

As stated in the title, I have a problem running the Golang code on Eclipse. I'm currently using Mac, and I installed go by using homebrew.
Currently, the folder where go is installed is as follows.
/usr/local/Cellar/go/1.5.2/..
and after running Terminal and typing open ~/.bash_profile I added the following.
export GOROOT="/usr/local/Cellar/go/1.5.2/"
export PATH=$PATH:$GOROOT/bin
Am I still missing something else?
PS If I run the code using Terminal like go run main.go, I have absolutely no problem. The problem must be due to some misconfiguration in Eclipse.
I had the same error. Putting the source file under a sub-folder in src fixed it.
Go to 'Run Configurations' -> Filter with Go Application -> select your project and then click the Environment tab, then click on select button and tick the GOPATH environment. select apply and then Run.
I had the same problem and I did two things to solve it:
I opened Run configurations, filtered using "Go" and created a new configuration (right click on "Go Application" as a result of the filter). In the Environment tab added a new variable: GOPATH = [path to your workspace].
I had .go files right under src folder, and this is wrong. I created a folder under src folder and moved .go files to that folder.
The first step could be replaced by creating a system environment and adding it to the list using the "Select" option instead of creating a new one. I prefered to create a new one so I can run differente projects in the same laptop without having to change the value of the system environment.
Because the executable path is not right.
GoClipse compiles source into $project/bin, so we must set GOPATH = $project
Select project > Alt+Enter > Go Compiler > Use project specific settings > Eclipse GOPATH
In my case of wiki tutorial, GOPATH = :/home/sovann/go/wiki.
Then the IDE is able to locate /home/sovann/go/wiki/bin/main

How can I import perl scripts in a project using Epic?

I am interested in using Epic for Perl development as my background is Java. So I have installed Epic in my Eclipse.
There is already a source code repository with perl scripts in a remote file system.
My question is, if I mount the remote file system how am I supposed to use Eclipse to work on the scripts?
In Java there files would be under a project (with the corresponding files).
I see that there is an equivalent Eclipse Project in the Eclipse menu after installing Epic.
So how would I access the perl scripts? Some how add them under a new project?
First map your network drive/mount your remote file system.
Go to File -> New -> Perl Project (or project and then select Perl from the list), name it, click Finish.
Right click on the project in your Navigator Tab and click Import...
Under General select File System, click next.
Click browse and select your file system, this will be the one on your remote machine.
Check the files you want to import.
Expand the Advanced Tab and check "Create links in workspace." (This part is the trick to edit the files on your remote machine instead of copying them locally and having two locations)
Click Finish.
Please comment if you have any questions, I set this up a while ago and I believe that's what I did but it's not currently working on my machine.

How to go to specific folder in Eclipse?

From Eclipse, how to go to the specific folder? I mean in windows, how to open a command line which corresponding to the folder or direct open the file explorer to open the corresponding folder?
You have to create an external tool with location ${env_var:SystemRoot}\explorer.exe (or cmd.exe) and arguments /select,${resource_loc} . Any selected file or directory can now be shown in the windows explorer.
Create an External tool
Go into the external tool configuration (you can find it into the corresponding toolbar icon) :
Then you can create your own external tool :
Create a new Program (select Program in the tree)
Name it shell
Set the location to ${env_var:SystemRoot}\explorer.exe
Set the arguments to /select,${resource_loc}
Run the external tool
Once created you can run the external tool from the context menu or from the toolbar ...
I have been using an Eclipse plugin called PathTools for sometime now, and am happy with it.
It adds a number of buttons to the Eclipse toolbar which allow you to :
Directly open a cmd prompt at the selected folder.
Open an Explorer window for the selected folder.
Update site : http://pathtools.googlecode.com/svn/trunk/PathToolsUpdateSite/site.xml
Sample screenshots
Installing the `Path Tools Feature`
I chose to install only the Path Tools Feature
Opening a terminal
Opening a terminal directly at the Folder Path :
(The above snapshot is that for OSX but works in Windows as well)
Opening Explorer
Opening a folder directly in Explorer/Finder :
Great simple plugin for this:
http://basti1302.github.com/startexplorer/
2019 update (no plugins required):
Right click the desired folder in the Project Explorer, go to Show In, choose either Terminal or System Explorer. See below screenshot:
Right click the file (in left pane).. then use Win Goodies -> Open file in Explorer

Copy path/file name in Eclipse to clipboard

Is there a shortcut to copy the current path/file to the clipboard?
Just select the file tab and hit Ctrl+C to copy file basename into clipboard.
Hit Alt+Enter to bring up the file properties with absolute path and copy it manually.
Additionally you can use an Eclipse macro plugin that can do the steps in one go:
http://sourceforge.net/projects/practicalmacro/files/
There is Copy Qualified Name function in Eclipse, it will copy the full name of the element you select (or element on cursor).
For example :
/MyProject/src/app/Application.java : when you select Application.java in Package Explorer
java.util.HashSet<String> : when you copy while cursor at HashSet<String>
However, it required you to select the element you want.
So, here is what I do.
Make your Package Explorer link with editor, you can active this by click the double-arrow icon at top-right corner.
Set up a hot-key for Show View (Package Explorer) ex : Alt + 1
Set up a hot-key for Copy Qualified Name ex : Alt + Ctrl + Shift + c
Whenever I need these information in current file, I just press the hot-key to call my Package Explorer Since it links with editor and will always select the file in current editor, you can just copy with the hot-key. Then you can use F12 back to your editor, or simply ESC if you use fast view.
Not perfect, but it works :D
There is yet another plugin that supports copying the path along with a number of other related functions:
http://code.google.com/p/pathtools/
Just search Eclipse Marketplace within Eclipse for 'pathtools'.
You can do it with a single keystroke by configuring an Eclipse external tool (a much underused tool in my opinion). Takes about a minute to configure the first time you use it but then it's always available. Here's a YouTube video demonstrating the technique.
An alternative to the answer of Rangi Lin, which provides some additional functionality: The StartExplorer plugin for Eclipse. The solution mentioned by Rangi Lin doesn't work in all cases. It doesn't work in my case e.g. in the Team Synchronizing perspective in the Synchronize view. However, the StartExplorer's context menu command "Copy Resource Path To Clipboard", as well as the default keyboard shortcut for it (Ctrl+Alt+C) works also there.
The advantage of this plugin is that it additionally allows you to open the file manager at the location of the selected file etc.
Another option is EasyShell. It has a single entry in the context menu, under which you'll find copying of the path, opening explorer, a dos box and others (configurable).
Alt+Enter - open properties
Alt+L - go to path location
Shift+End - select path
Ctrl+C - copy
Go to Project Explorer View in Eclipse which is at the left panel.
Click on link with editor.
After linking, your opened file will get selected.
Right-click on the selected file. You will get the option 'Copy Qualified Name' which is just below 'Copy' option.
Open the directory where your project resides. e.g. if your project is 'abc' and it's in the directory 'project', go to the 'project' directory.
In the folders address bar, the address will be like this: D:\project.
Paste in front of this address like: D:\project/abc/source/com/connect.java
Delete the java file name(connect.java) and press enter.
You will be in folder 'com'.
The video demonstrating the technique was prepared for Eclipse in Windows. In Linux you have to change:
External Tools Configurations - Location: /home/username/path/to/script.sh
External Tools Configurations - Arguments: ${selected_resource_loc}
External Tools Configurations - Standard Input and Output - CHECK "Allocate console (necessary for input)"
Create a script /home/username/path/to/script.sh as follows
echo $1
echo $1 > /home/username/clipboard_tmp.txt
xclip -in -selection clipboard /home/username/clipboard_tmp.txt
xclip -selection clipboard -o
I don't know why, but following command echo $1 | xsel --clipboard doesn't work in the script.
It was checked in Ubuntu 12.04 LTS and Eclipse IDE for C/C++ Developers (Version: Kepler Service Release 2, Build id: 20140224-0627)
In Eclipse Version: 2020-03 (4.15.0)
In Project Explorer
Select your file> right Click> Copy Qualified Name

Open directory containing a source file via Eclipse

In Visual Studio, or MyEclipse, you have a button which is able to locate a source file on disk, and open the containing directory in Windows explorer.
This is useful, for example, to browse images, or to use an other tool when a conflict occurs in CVS or SVN.
What would be the way to do it in Eclipse with a free plugin, or without any plugin ?
I found it :
"In eclipse, it is common requirement to open the folder containing source file but there is no direct method to do that like in Visual studio of Microsoft."
http://shivasoft.in/blog/others/tips/locate-source-file-on-local-disc-in-eclipse-external-tool/
An actual plugin can be found at http://blog.samsonis.me/2009/02/open-explorer-plugin-for-eclipse/
And version 1.5 can be found here http://blog.samsonis.me/2011/08/openexplorer-eclipse-plugin-1-5-0/
One that I've since upgraded to & find more useful
http://basti1302.github.io/startexplorer/
I always do this:
right click on file/folder, show in..., system explorer. Done.
I guess we don't need a plugin to do that, or I am misunderstanding the question?? I am using Luna 4.4.2 on Windows 7.
On Mac you can follow this steps to add it without a plug-in:
Click the disclosure icon to the right of the External Tools icon:
Select External Tools Configuration:
The External Tools Configuration window will appear. Select Programs and then click New Launch Configuration:
This will create a new launch configuration. Enter a name of the configuration in the name field:
In the Location field enter the path to the Open Finder, "/usr/bin/open" without quotes:
In the Arguments field enter the following argument, "${container_loc}" with quotes:
Click Apply. It should look like the following:
Switch to the build tab and deselect Build before launch:
Switch to the Common tab and select the External Tools checkbox in Favorites. Click Apply again and close out of the window.
You are done. Now to use:
Select a file or folder in Eclipse Package Explorer.
Click the disclosure icon to the right of the External Tools icon:
Select the Open Containing Folder from the drop down menu:
You're file or folder should open in Finder.
PRO TIP: After you use the external tool once you can click the External Tools icon again and it will run the last used external tool. In other words, you won't need to select it from the pop up menu each time.
You can also look up the source directory by right clicking on the project, going to properties, and looking at "Location: ... "