upload only current file with netbeans - netbeans

I'm using netbeans 6.9.1 to work on a php project, how do I manually upload a file without having to 'run' the project?

Under the options->keymap, I mapped Ctrl-L to upload, which is easy enough.
The only other place to upload is to right-click the file in the project browser and 'upload', unlike aptana there's no button for it, which is what got me stumped.

If you have the project's "Run Configuration" properly configured as a "Remote Web Site (FTP, SFTP)", then simply right-click on the file in the "Projects" pane and click on "Upload" in the file's context menu.
If you want to upload automatically on save instead of on run,
Right-click on the project node in the "Projects" pane (it's the top-most node in the tree)
Click on "Properties" in the project's context menu.
Click on "Run Configuration" in "Categories"
Change "Upload Files" to "On Save"
Click "OK"
If you sometimes want to upload on run, sometimes on save, sometimes only manually, sometimes to one server, sometimes to another server, or any combination of the run configuration options, then you can click on the "New..." button to create and save one or more run configurations. You can then choose which one is active on the run configurations project properties page, or set it through "Set Configuration..." on the project's context menu.

Related

Eclipse does not remember external source attachments

Using Eclipse 4.3.1 (Kepler) on Ubuntu, I find that each time I exit and reenter Eclipse, I have to respecify my external source attachments. What is the key to making Eclipse remember them?
Open the Source Attachment Configuration dialog by clicking on the "Change Attached Source" button in the Class File Editor; or open the similar Java Source Attachment dialog by right-clicking on the containing jar in Package Explorer and selecting "Properties".
I've tried both.
In the dialog, click on the "External File" button and navigate to a jar containing sources, or click on the "External Folder" button and navigate to a directory containing .java files in subdirectories corresponding to the package hierarchy.
All these ways work until I quit Eclipse and come back in.
I have never used these parts of Eclipse; I'm using Maven to manage my dependencies and Maven will automatically attach sources - so take my answer with a grain of salt :-)
I'm not sure why Eclipse doesn't remember those settings. My current feeling is that those settings are temporary.
If you edit the source attachments in the project's properties (look for "Java Build Path"; there is a tab "Libraries"), then the changes should be saved in the file .classpath. Have a look in there.
Lastly, you can try to create a "User Library" (search for this term in the preferences dialog). Here, you can define a bundle of JARs which make up some library. After adding the code JAR, you get options to specify the source JAR.

Eclipse: Open in New Window

In Package Explorer I right-clicked on project and selected "Open in New Window". New Eclipse window was opened with that project. Then I closed old, "main" Eclipse window, so only new "project" window remained.
Now each time I launch Eclipse I have this "project" window with project name in window title and Package Explorer drilled down into this project. And I need to press "Up" button in Package Explorer to see all my projects.
How can I restore default behaviour and launch Eclipse with workspace scope and not project?
My original answer: Once you get the Package Explorer the way you want it, if you exit Eclipse cleanly it should come back that way.
My revised answer: It looks like a bug, even if you exit cleanly it comes back inside of the project. And in fact when you create a new window no matter what it puts you into the project. Even if you switch to the project explorer.
I found a way to fix it though, do a Window -> Close All Perspectives, then open the Java perspective and exit and come back in and you should be OK. I have filed this bug about it.
Close the project properly " File --> Close All", Then restart eclipse.
OR you can create a new work space " File --> Switch Workspace --> Other..."
Im not sure this is what you are looking for but the Documentation offers a command line option to select the start workspace:
The workspace is the physical location (file path) you are working in.
You can choose the workspace during startup of Eclipse or via the menu
( File → Switch Workspace → Others.

Is there an equivalent of "Add existing file" (to project) in Eclipse?

I am trying to map my Visual Studio experience onto Eclipse. Right now, I wish to add a file existing somewhere on the file system into a project in Eclipse. I expect it to be copied to the project source folder.
Currently, I see only one way - switch to the windows explorer (total commander, in my case) and copy the file myself, after which to refresh the project.
Can I do the same without leaving the Eclipse IDE?
Thanks.
I had the same problem, but found yet another solution.
Let me state my problem so that we're sure we're talking about the same thing.
I had a file in a directory where a bunch of code files were and some of the files in that directory were shown as "in my project" and some of the files were missing. I wanted the missing files to appear in my project.
I simply selected the folder in my project and pressed 'F5' or right-clicked and selected 'refresh' and the files appeared in my project. It looks like that is the intended way of doing this.
File->Import->General->File System should do it.
There you can select the file(s) from some file system folder to your project (into folder).
Even easier. Just drag and drop the file from explorer into the correct package in Eclipse. It will ask you if you want to copy or link the file(s).
I am a newbie to Eclipse Luna (the 64 bit latest version on Windows 7) but this worked for me:
Copy the preexisting source files you which add to your project.
In Project Explorer, right click your project and select New > File
In the "New File" dialog box, your project's name / folder should be displayed as the parent folder for your new (existing) source file.
Click on the "Advanced" button at the bottom of the "New File" dialog box.
Check the "Link to file in the file system" checkbox.
Click the "Browse" and browse to your preexisting source.
Click the "Finish" button at the bottom of the dialog box.
In my case, I had to:
right-click the project's name
choose "Close Project"
right-click the (now closed) project's name again
choose "Open Project"
Refreshing didn't work for me. :(
Hopefully this helps someone else...
Just found the quickest way to add files:
Copy-paste your file into your project disk directory using your file browser.
In Eclipse project browser select your project.
Click [right mouse button]->Refresh (or press F5 on Windows machine).
Voila
(worked on Neon-4.6.2)
I just got this to work. YMMV
I don't suppose it has to be there, but I put my file, xyz.cpp, into my project's source directory. My project has a source subdir named src, as in ProjName/src.
Right Click on project name (my project was open and the only one open).
NEW->FILE. Put in the filename, xyz.cpp. Click OK or press enter.
The file will open in the editor and complain that it is empty. Close it WITHOUT SAVING.
Reopen the file. It now has its contents.
It turns out that just simply dragging the files into the src folder would work!
Right-click on the file after you have copied it into the project directory. Select Properties... in the left hand pane select C/C++ Build. There will be a checkbox "Exclude resource from build" uncheck that check box.

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: ... "

Build file and Ant Targets from Project Menu in Netbeans (6.7)

I've recently started using netbeans for a few hobby projects. I've come from a JDeveloper background and I'm used to been able to see my ant build file from the project explorer window.
In JDeveloper this has the advantage of allowing you to right click on it, allow easy edits, or run a required target when you want to.
The only way I can seem to do this in netbeans is to open up the build.xml file, right click and select my target and run it.
Hope everyone is still with me.
I guess the build, compile, test, clean options you get in the project menu when you right click on a project are wired automagically to the ant targets. But I tried to create a new target and see if it was displayed in the normal project menu, and its not.
Does anyone know why Netbeans doesn't include the build.xml file in the project structure or whether it can be included in the project explorer display easily.
Kris
It sounds like you want to switch to the Files view. You can find the build.xml file in that view easily. If you right click on the file, you get a menu that includes items like 'Run Target' and 'Debug Target'.
If you want to have even more control over the mapping between menu items and ant targets, you should explore the Java Free-Form Project type.
Go to Files tab, find your build.xml, expand all targets, right click on the target you want to add and choose between the options provided.