Submit Eclipse Project on Perforce - eclipse-plugin

I have a noob Perforce question. I got my perforce plug-in on Eclipse working(for both Java and C).
I have no problems "opening" my perforce stored projects on Eclipse.
Scenario 1:
Whenever I want to change code, I open the project on Eclipse and right-click on it and go to "team" and check out, make changes and then submit. Works fine. But even after that I see a tick mark(indicating check-out) on my perforce screen.
Scenario 2:
I just open perforce code as Eclipse project and make changes(If read only, it prompts and asks if i have to allow write and I say yes). I make changes and save. It doesnt ask for submit. Also if I now open the code on Perforce screen, I already see the new changes made.
Scenario 3:
Just on a Perforce screen, if I check a file out and don't make any changes, I obviously dont want to submit as there are no changes. In this case, how can i "disable" check-out so that my fellow programmers dont think i'm working on it??

Scenario3:
So here are 2 ways i consider a good usage of the plugin:
Use Revert Unchanged Files:
Before you begin development of a feature, checkout the entire tree/branch that your changes will be concentrated around in future. You can do this by right-click the relevant package in package explorer. Once you want to submit, Project->Right-click->Team->Revert Unchanged Files. Now, you can submit your changelist.
This approach stands very useful if you know you will be editing a lot of files or replacing files.
Ofcourse, others can see that you have checked out the files.
Enable Auto checkout:
Incase you are going to make few changes, you should enable autocheckout. This will checkout the file when you begin to make edits. Eclipse->Preferences->Team->Perforce->Enable support for workbench edit..
detailed explainations here. Its a good idea to have this enabled always as it checks out on demand.
However, this does not monitor the filesystem so and code/libs you replace outside of eclipse are not checked out.

For Scenario 3, you can change a workspace option to prevent submitting unchanged files:
SubmitOptions: reverttunchanged
If you have a file checked out (open for edit), others will be able to see that. I guess I'm not clear on why you check a file out if you don't intend to modify it?

If you are going to setup this way and are also using the desktop client, I recommend the following steps in the desktop client:
1.) Open your desktop Perforce client
2.) Click “Connection” on the global menu
3.) Select “Edit Current Workspace…”
4.) Under the “Advanced” tab select “allwrite”
5.) Click Apply, then OK

Related

Disable all svn auto checks in Intellij

I'm not sure if this is an intellij version control or SVN issue, but is there a way to disable all auto subversion / version control update checks in Intellij?
When you click the version control tab at the bottom of the IDE and look at local changes, the lists often say "Updating...".
I want to use subversion, but for huge projects the "updating" in intellij version control sometimes takes a good 10 minutes, and it starts randomly for no reason, even when I have not made changes. I checked the settings and I don't have "check every" or "refresh every" options checked under subversion.
Basically I never want Intellij to stop checking the whole project and server every time I make a small change to a file.
When you click the version control tab at the bottom of the IDE and look at local changes, the lists often say "Updating...".
This means IDE is refreshing the local status of the files to correctly show them in the Local changes and other respective places. It is not related to remote servers.
It could take long because of e.g. huge number of unversioned files in the project. In this case, adding them to svn:ignore should help.

Change default tool window behaviour in IntelliJ IDEA 2016

Every time I open a new project in IntelliJ IDEA, the first time I open a particular tool window, for example 'Maven Projects', it appears in 'pinned' mode and remains visible until either I close it, or I go to the view settings for the window (the little cog) and deselect "Pinned Mode". I don't want any of my tool windows to be pinned so this gets a little annoying.
Do you know of a way to change the default behaviour of new project / tool windows?
As far as IJ 2016.2 I don't know about a dedicated setting for this. However I used an approach which allows you to define a default layout for all projects. Although the window-pinning works, which is what this question is about, some may not be persisted, such as Group Modules setting in the maven tool-window.
Nonetheless, to configure the pinning, you need to do 2 simple things, which you can also see in the GIF below:
1) Manually go and unpin all desired windows
2) Open the Windows menu and select Store current layout as default
P.S. If you'll be using tool-windows that you've never opened before, or install new plugins which add their own tool-windows, just follow these steps again.

Temporarily Remove Or Hide Code in Intellij

Is there a way to temporarily hide or remove a file from Intellij? I used to work in c# and I remember there was some way in visual studio to temporarily remove a project from the build then add it back later. I am just trying to figure out what parts of code are necessary for certain features.
This is a perfect use case for git stash.
If you're not using a git repo, hit Ctrl+Shift+A and type "Create Git Repository", then hit enter to initialize git tracking on your current project.
Initially, you'll want to add your important files to git. Hit Alt+1 to navigate to the Project View, then select all the files.
In order to add a file to git, press Ctrl+Alt+A, you should see the filename turn from red to green. It is now being tracked.
Now you'll want to make your first commit. Hit Ctrl+K, and IDEA will guide you through this.
Finally, once everything's all checked in, you can start messing around a little. If you make a few changes, say delete a file, and want to temporarily revert to the last commit, hit Ctrl+Shift+A, then "Stash". Select "Stash changes", write a little message for yourself, and you'll immediately jump back to the last commit.
Now say you want to go back to those changes you stashed. Hit Ctrl+Shift+A again, type "Unstash" then select "Unstash changes". Find the stash, check "Pop stash" and hit Enter.
This is a pretty common workflow for temporarily saving, removing and reverting changes in Git. You can read more about git stash here, and version control on IntelliJ IDEA from Martin Balliauw.

In Intellij IDEA how do I reload file content's from disk?

In vim I can type :e and reload a file's contents from disk overwriting any changes I've made. It's a nice way to reset in case I've gotten lost or just want to undo all my changes. This obviously doesn't take into account any kind of refactoring, I just want to nuke all changes to buffer. Not even closing and reopening a tab will work.
How do I do this with Intellij IDEA? I'm using Intellij IDEA Ultimate 13 and I've disabled any kind of auto save.
File > Synchronize (Ctrl+Alt+Y)
It will load the file from the file system. If you have unsaved changes, it will ask if you want to discard them.
⌥⌘Y - Synchronize for Mac users
What I do in a similar situation:
Simple - Ctrl+Z, Ctrl+Shift+Z many times to quickly navigate the editing history
VCS rollback - either for the whole file or for the area being edited (by clicking green areas on the left)
Local History. Well, yes, for you case it's granularity is not sufficient, so first might be an option
There is also an option to put a label into Local History if you need to rollback to a specific point in time.
For those who use autosave - it is being triggered when code editor loses focus. So doing Alt-Tab during long editing without compiling or running the code makes sense.
Open the file in another editor, make an insignificant change and save it. PHPStorm will ask you what to do because the file system and in memory copies of the file have diverged. Click "Load File System Changes".
Note, I was unable to use my undo history as it had become corrupt.
Since what I want isn't really possible I wrote an extension to do it for me:
https://github.com/btipling/DiskRead/
I'll add it to the Jetbrains plugin repository, it's called "DiskRead".
I wrote a blog post about how I created this if anyone is curious.

Save Aptana Studio 3 project explorer state on close

I'm sure there is a simple option for this but I have as yet been unable to find it. Every time I close and reopen Aptana Studio 3 it collapses all the folders in the project explorer and I have to reopen them all, is there a way to get it to leave them open and save the project explorer's state when I close the program?
Thanks.
I cannot find any way to keep the state of the Project Explorer. However, using the App Explorer, the state of your open folder will be preserved. You can also try the "Navigator" which looks just like the Project Explorer, but appears to keep state. I will add the proviso to that: It kept state when I restarted aptana, but it also developed a GUI glitch where it appears to be scrolled to the right so I only see the right half of all of my file names and I cannot fix it, so this may not be a good option if you get the same glitch.
There is also a method which does not do quite what you ask, but may be a good fix for you anyway. If you click "Link with Editor" picture (two yellow arrows) in the Project Editor, it will automatically expand your project hierarchy to match whichever open file you have active. Since your files stay open when you close Aptana, this would keep the Project Explorer expanded to whatever you are looking at even on restart. See this question
You can also set up working sets for various parts of your code that are buried in the hierarchy and use the Project Explorer to show those working sets instead of you projects. This does not save state, but it does give you easy access to common parts of your code that may be deeply buried.
Hope one of these helps you.