Is there a way to reset the perspective in Eclipse and avoid the dialog that confirms it? - eclipse

Is there a way to reset the perspective in Eclipse and avoid the dialog that confirms it? I often reset my layout and map this action to a set of keys. It would be great if I can reset the perspective without it asking me "ARE YOU SURE" every time.

The current implementation always shows the confirmation dialog. You have to implement your own command that calls IWorkbenchPage.html#resetPerspective().

Related

How to customize the "Save Resource" dialog of an ISaveablePart in Eclipse?

I have an Eclipse application that uses a ViewPart as a floating window with buttons/options for what is happening in the editor.
It looks similar to the floating tool windows in GIMP.
Implementing ISaveablePart in the ViewPart provides a default dialog upon closing the ViewPart with everything I want: a Yes button for saving, a No button and a Cancel button.
However, I would like to customize that default dialog.
Is that possible? If so how?
I looked into ISaveablePart2, but I just end up with my own custom dialog PLUS the default. Is there a way to suppress the default dialog in ISaveablePart2? If so, that would also be a solution.
For clarity: I'm not married to either of these ideas. What I ultimately want is a custom dialog box to come up when someone closes the ViewPart to ask the user if they want to save the contents of the editor ---> with an option to cancel the closing of the ViewPart.
If you use ISaveablePart2 you should only get your own dialog as long as your promptToSaveOnClose method does not return ISaveablePart2.DEFAULT. So there should be no other dialog if you return ISaveablePart2.YES, ISaveablePart2.NO or ISaveablePart2.CANCEL.
The standard Save Prompt dialog is not customizable.
The code for this is org.eclipse.ui.internal.SaveableHelper.

Console disappear in Eclipse Juno

I am using Eclipse Juno. I was working in Java perspective and suddenly I minimized the console. I don't know where it went but I am unable to get it back. I even tried to get it from Windows>Show View>Console but I didn't get my console back.
It happened the same thing to me. Just click Window->Reset Perspective and everything will be back as it was when you installed eclipse.
Sure you'll have to customize it back to how you like it, but at least you'll have the console back.
If console is not visible, just search for "Console" in QuickAccess box on the right hand top of menu bar. you can get it back!
Stupid Eclipse. Are there no interface designers volunteering on this project? Why minimize something and make it hard to see where to bring it back? Probably all you have to do is hit Shift-Control-Tab-F9 with one hand while right-double-clicking the lower left hand corner. Hmm, how about a popup when you click a minimized Console that says "We see you've minimized your Console and you are clearly trying to switch to it. Would you like us to restore that so you can actually see it?" followed by "Are you really sure? Cuz ya know, you may be using this click path by accident."
The reset perspective works. Also, you can "Save Perspective" so it's not so hard to go back to your preferred Perspective.
Thanks for the tip.
Bring console to the front from Window -> Show View -> Console. Apparently the console remains invisible (that was the issue indeed), but it is virtually active in the foreground.
Close the current view (i.e. the invisible console) by going to the "Quick Access" box at the toolbar, typing "Close Part", and selecting the respective option on the drop-down.
Reopen console form Window -> Show View -> Console and voilà, it will appear. Drag it to your preferred location on the workbench.
This works for me under the following situation:
I had been previously playing with detaching several views (console included) and editors to a separate window on a different monitor; I have updated my workspace from Neon to Oxygen and I have had a hard reset at my computer. (So, not sure which among those was the reason that made it go wrong).
I wanted to avoid resetting my perspective, as it is highly customised, so I discarded that solution.
Other solutions herein proposed had not worked.
The console was working and the view became visible if I chose a different perspective (e.g. Debug) or a duplicate Eclipse window (which effectively provides a duplicate of a factory-reset perspective).
you could click the small icon on the bottom left and choose console. it will appear.

Gtk GUI - Select next control

When Gtk GUI is started seems that Gtk sets "optimal" focus order to his controls which can be switched (beside usual way) with arrows. Then we can easily move (modify) focus order with "grab" to whatever enabled widget.
In case of GtkEntry, after pressing enter key "activated" event raises where I do validation and then I would like to jump to next control, like I was pressed "down arrow".
For now I transfer focus with "grab" and explicit name of wanted control but I would like to jump to "next" control of gtk's order without referencing it.
Also I transfer focus manually in keypress event of entry but this is also too fixed and unwanted way.
If I woud be able to set focus to "next control" this can make later modification in GUI much simpler.
Is this possible and how?
Thanks.
The PyGTK FAQ has one way to set tab order and two different ways to traverse it. These are likely the same in whatever language you're using.

Flash Builder keeps changing perspectives. Need to reset

I have accidentally setup my Flash Builder to change to the Debug Perspective when debugging my applications. This is useful when the application crashes, but not every run.
I can´t seem to find the settings to change it back to default. Anyone know where to look?
Under Window --> Preferences in Run/Debug --> Perspectives there is an option there "Open the associated perspective when an application suspends". The default is "Prompt" which is what will ask you if you want to switch to the Debug Perspective when the application encounters something. Alternatively you could set it to Never which means you will always have to switch perspectives manually.
Cheers

Faster way (keyboard shortcuts?) to use quick fixes in Eclipse?

I often use the Eclipse feature (Galileo) of suggested error corrections to automatically create code stubs or to refactor things. For example, I would write a method that calls other methods which don't exist yet, then move the mouse over the error message and click on "create method". Or, change this to the class name and choose "add static modifier" from the quick fixes.
I think this is very convenient because it lets me stay in one place in my code and sort of "remotely" wire up what's not currently visible on my screen. What I think is annoying though, is that I have to leave the keyboard, hover my mouse over the error symbol, wait for the tooltip to pop up, and click on the option (doing that, I sometimes move the mouse a little over the edge and the tooltip goes away again - very annoying).
Am I missing a faster method here? I can't seem to find a keyboard shortcut, but then I have overlooked stuff from the huge preference dialog before.
Ctrl+1 : Quick Fix.
(Cmd+1 on Mac)
Just put your cursor on the part you suspect you can perform an action (correction, refactoring, ...) and hit the Quick Fix shortcut. The same popup will be displayed, and you can select the right option with the up and down keys.
That, combined with Ctrl+3 (Quick Access) gives you most of eclipse features at your fingertips ;)
See also:
Eclipse Tip: Shortcut to Quick Fix
My Favorite Eclipse Shortcut: Quick Fix
Eclipse hotkeys: eclipse shortcuts gold mine.
As an additional tip, a specific type of quick fix I use all the time has a dedicated shortcut:
Alt+Shift+J: Add Javadoc comment stub for current method.
After using ctrl+1 like mentioned in the top answer, press ctrl + enter to apply the selected fix all to problems of the same category.
In general, keyboard shortcuts in IDEs (and code tools in general) are coming from a user principle that holds that the more your hands/fingers can remain poised over the keyboard (as in the f-j centered "touch typist" position), the more productive you can become. This is probably why the use of the number keypad is not encouraged, or other keys, less common to the most basic layout keyboard, are not used. Many hold that useful keyboard shortcuts should be easily reachable from this position.
One thing I will say about eclipse keyboard shortcuts is that if you use a popular Windows presentation utility called Zoom-it, you need to turn that off when using eclipse. There are several show-stopper conflicts between the two, such as Ctrl-1 and Ctrl-3.