SQLDeveloper jump between Package body and Package spec - oracle-sqldeveloper

I'm currently using Oracle SQLDeveloper a lot more that I have ever used and I'm starting to like the tool.
I use Shift+F4 a lot to jump into a package/function/procedure. But one thing that I don't really get is how to jump directly to the package body or as an alternative some kind of shortcut that toggles between the spec and the body of a package.
Toad has something like this and I'm unable to find this feature in SQLDeveloper.
I'm also aware that you have the object tree on the left side of the screen but it's not really the best way to navigate to a package body when you are already looking at its specification. Especially if you have something like 300 packages with similar names...
For someone that uses SQLDeveloper to work everyday and does a lot of development with packages there has to be a way to do this...
I'm hoping for some magical shortcut or some obscure plugin.

see the picture above-- the downward pointing side arrow -- click on it-- it will open up the function defintion.
thanks

After opening the package spec using Shift+F4, press Ctrl+Shift+F12 to open or toggle between body and spec

Go to VIEW menu, click on find DB objects option. In the find db object pane put the name of the package and select the DB.
Both, the spec and body will appear, double click to open.

You have a couple of questions:
how to 'jump into' a pl/sql object AND
how to toggle from spec to body and vice versa
How to 'jump into' a pl/sql object
Ctrl+Mouse Hover+Click
If you don't like this mouse-kung-fu, you can also assign a keyboard shortcut, I show you how to do this here.
How to toggle from spec to body and back
You can use the arrows in the gutter, they point up or down, you can use the toolbar button, or you can use the keyboard shortcut.
If you use the 'arrow' in the gutter, you'll go straight to that item's corresponding bit in the spec or body. Using the toolbar button/kb shortcut will just take you to line 1 of the spec or body.
I talk about these PL/SQL features and more on my blog.

(this is at least with my PLSQL-DEv version (11.0.4.1774), default settings)
The shortcut to view Spec. + Body is SHIFT+ F5, then CTRL+ H to toggle to the "body" tab.
This works if you have certain rights to view the package's body, especially the DEBUG right: ask your DBA to do you a
GRANT DEBUG on <package_you_want_to_view_the_body_of> to <your_user>
or
GRANT DEBUG on <package_you_want_to_view_the_body_of> to PUBLIC
Note sure but you might also need the EXECUTE right just to view. Same thing if needed, ask your DBA similar above grant.
nb:
Another thing I had to do in Oracle 12c for Code assistant to view the packages when typing: check the "Use DBA Views if available" in Tools > preferences:

Related

Folder View Focus Disable Automatic Search

I would like to change the automatic find that happens when the Explorer Folder View is in focus:
Steps to reproduce (provided you have default bindings):
Open a workspace with files
Focus on the folders view
Start typing anything
This is to find files based on what you type (notice the find query in the top right) and the arrow keys skip to them. I would like to remap this feature to something like Ctrl+F (with a 'when expression', if possible) that way I can use other shortcuts for things like adding a new file. If this can not be remapped, I'm ok with disabling it, provided that's allowed.
I used to have the atom keymap extension that changed this but I removed it so I would be forced to learn all the default shortcuts so when I go into work I wouldn't be phased no matter what device I am on
I was looking through the atom keymap repo and found a comment on the main js file about 'new explorer filtration'. Interesting to see documentation being useful :p Anyways, I noticed they added a context setting so I changed the following user setting:
workbench.list.automaticKeyboardNavigation = false
Controls whether keyboard navigation in lists and trees is automatically triggered simply by typing. If set to false, keyboard navigation is only triggered when executing the list.toggleKeyboardNavigation command, for which you can assign a keyboard shortcut
We need either better setting id naming conventions or better ways to find settings, especially now that the list has grown substantially. I would have never guessed this would be the name of the setting, or list.toggleKeyboardNavigation being a trigger, since you aren't actually navigating

is there any eclipse plugin available for writing a memo on any line of code?

Doe anybody know of an eclipse plugin, which can be used to insert short text (in the form of memo) to remember what that line of code does or a block of code does to help me understand the existing code better and i can also refer it back later on.
Just like "Task" can be added on a line of code, although i can use "tasks" for this purpose, but that is not very convenient and intuitive.
If you want to add a short text to "remember what that line of code does or a block of code does to help me understand the existing code better", use comments. That's what they're for, and practically every formal language in the world has them.
If you want the ability to quickly jump to an arbitrary point in the code, using bookmarks is a convenient option - right click the bar immediately left of the text and choose to add a bookmark. You can then easily jump between bookmarks with the "bookmark view", which you can enable from the Window -> Show View menu.
The closest thing I can think of is bookmark support. There is native bookmark support in Eclipse and also several other vendors supply more function.
I'm assuming that there's a very good reason that you don't want to or can't modify the code.

How do I jump to a method in RubyMine?

In Visual Studio, the editor has a drop-down list of functions in the current class; clicking on one will take me to the top of that function. Is there a way to get a similar behaviour from RubyMine?
I suggested this as a feature request to the folks at JetBrains, and within the day they got back to me to tell me about the 'File Structure Popup' on ^F12 which does very nearly what I want; it's an extra keypress but I can live with it.
If you're working on a Rails project, change the project view to Rails (change the View as: dropdown value)
Online help is here.
It looks like this is as close as it gets to the functionality you're looking for.
Ctrl+0 key in editor will show all methods with search capacity.
The same is drop-down menu Navigate -> File structure.

Is it possible to work in Eclipse with keyboard only?

as most of us surely do every now and then, I try to improve my workflow. As Eclipse is my main IDE, I wondered if it may be possible to use it without mouse. I browsed the available shortcuts and tried to use them instead of my mouse. I found interesting features like Ctrl+3 which opens something like the Apple spotlight.
I know there are a lot of questions concerning favorite shortcuts etc. but I'd like to know if it works because at the moment it feels a bit squishy 100% without mouse.
So is anyone out there using Eclipse like that? And are there some hints to ease the change?
Yes, it is possible. For a start, check out 10 Eclipse navigation shortcuts every java programmer should know. When you use these 10 shortcuts and some of the shortcuts of the comments, you will already see a big performance boost.
The "open type" and "open resource" dialogs are CamelCase-sensitive, so when typing "NPE" in the open type dialog, I get two matching items NoPermissionException and NullPointerException. So using good names with consistent spelling is a must.
Ctrl+F11 starts a program, F11 debugs it. Note howewer to check if in Window-Preferences-Run/Debug-Launching the value of "Launch Operation" is set to your needs.
You may want to customize the search dialog (Ctrl+h) to only show the file search (default is to context sensitively present you with different search tabs).
Ctrl+n allows you to create something new (opens a wizard with an initial filter text to filter the possible next pages).
I'm a blind programmer who uses eclipse. While there are plenty of shortcuts I find people often overlook using menus from the keyboard. If there's a function you use a lot that doesn't appear to be supported with keyboard shortcuts you can either create a shortcut to it in prefferences or use keyboard shortcuts such as alt+f to access the file menu and a one letter combination that allows you to access the item. For example hit alt+f then a to access the save as dialog. The underlined letter is the one you want to hit once in the menu.
There are a couple of things you can do to improve your keyboard:mouse usage ratio with Eclipse.
First off, if you push Ctrl-Shift-L, it shows you a master list of all the shortcuts you can use. If you know what you want to do, this is usually a quicker way of doing it without having to dig through menus, and as a bonus, you will learn some shortcuts you didn't know before.
The other thing you can try is a plugin called MouseFeed which looks promising. It tells you the shortcut for any menu item you use and if there isn't one, reminds you to create one. It essentially acts as training wheels until you become as close to 100% keyboard use as possible. I'm not sure how well it works in 3.4, but you can give it a shot.
Hope that helps.
Here you get an Eclipse Shortcut Overview PDF file of all key bindings. This file you can print and put beside your keyboard if you wish.

Useful Eclipse features? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have been using Eclipse as an IDE for a short amount of time (about 3 months of full use) and almost every day I learn about some shortcut or feature that I had absolutely no idea about. For instance, just today I learned that Ctrl+3 was the shortcut for a Quick Access window.
I was wondering what your most useful/favorite Eclipse features are. With the IDE being so big, it would be helpful to learn about the more commonly used parts of the program.
My most commonly used features are
ctrl+1 quick-fix / spell-checker
opening files
ctrl+shift+t load class file by classname
ctrl+shift+r load any file by filename
matches are made on the start of the class/filename. start your search pattern with a * to search anywhere within the filename/classname.
Formatting
ctrl+shift+f Format source file
(set up your formatting style in Window | preferences | java | code style | formatter)
ctrl+shift+o Organise imports
Generated code
alt+s,r to generate getters and setters
alt+s,v to insert method signatures for overidden methods from superclass or interface
Refactorings
alt+shift+l Extract text-selection as local variable (really handy in that it determines and inserts the type for you.
alt+shift+m Extract text-selection as a method
alt+shift+i inline selected method
Running and debugging.
alt+shift+x is a really handy prefix to run stuff in your current file.
alt+shift+x, t run unit tests in current file
alt+shift+x, j run main in current file
alt+shift+x, r run on server
There are more. The options are shown to you in the lower-right popup after hitting alt+shift+x.
alt+shift+x can be switched for alt+shift+d in all the above examples to run in the debugger.
Validation
As of the recent Ganymede release, you can now switch of validation in specified files and folders. I've been waiting for this feature for ages.
Go to Project | Properties | Validation
click on the ... button in the settings column of the validator you want to shut up
Add a rule to the exclude group
code navigation
hold down ctrl to make all variables, methods and classnames hyperlinks to their definitions.
alt+left to navigate back to where you clicked ctrl
alt+right to go "forwards" again
This is cool: If someone has emailed you a stack trace, you can copy and paste the stack trace into Eclipse's Console window. You can then click on class names in the stack trace as if your own code had generated it.
In terms of actual features, rather than shortcuts, I strongly recommend taking a look at Mylyn.
It essentially skins Eclipse with a task focussed view. It tracks the files you touch when working on a task, and focusses many aspects of the UI onto the resources that it decides are relevant to the job in hand. Eclipse can be somewhat busy to look at, especially with a big multi module project, and Mylyn helps cut through the cruft. The connectivity to issue tracking software and source control repositories is also excellent.
In my experience, it polarises opinion amongst those who try working with it, which is probably a sign that it is offering something interesting... Don't mean to sound like a fanboy - it is definitely worth a look though.
A shortcut that I use everyday is Ctrl+K. In your editor (not only Java file), simply select a text (like a variable, a function, etc.), and then use this shortcut to go to the next occurrence of this text in the current editor.
It's faster than using the Ctrl+F shortcut...
Note also that you can use Ctrl+Shift+K to search backwards.
Ctrl-Alt (up/down) Copy selected line(s) above or below current line.
Alt (up/down) Move current (or multiple selected) lines up or down
Ctrl-Shift-R Bring up the resource window, start typing to find class/resource
Ctrl-O Bring up all methods and fields for the current class. Hitting it again will bring up all methods and fields for current class and super classes.
Ctrl-/ or Ctrl-Alt-C Comment single or multiple lines with //
Ctrl-Shift-/ Comment selected lines with /* */
Ctrl-. Take you to the next error or warning line
CTRL+PAGE DOWN / CTRL+PAGE UP to switch between opened editors
CTRL+E to also switch between opened editors (allows to type the name)
CTRL+O is extremely important for me. You don't longer need the Outline View then (you can close it which will give you more space). Then, you can type a method name or just the beginning of it and you quickly can get to it. I also use it to inspect what stuff is available. For example: CTRL+O and then type get ... now I see all getters.
F3 while an element is selected in the code: brings you to its definition or it's source. e.g. used on a method call it brings you into the source code of that method.
CTRL+M to maximize the current window
As already said, CTRL+3 is extremely good. It basically allows you to use Eclipse completely without a mouse. Just type CTRL+3 and then package explorer for example.
CTRL+F8 cycle trough perspectives
CTRL+L allows to type a line number and brings you directly to that line.
CTRL+SHIFT+G searches for all references to the selected element in the workspace.
And not a shortcut: In the project settings under Java Editor you can find Save Actions. This allows you to set up the project so that the code is automatically cleaned up and formatted when you save a file. That's very good it safes you from constantly pressing CTRL+O and CTRL+F.
Eclipse auto refresh isn't on by default so if you make changes to a file outside of eclipse, the change won't be reflected in your build. this is very annoying if you just did an svn/git update/rebase and things aren't working the way they're supposed to.
Turn it on in windows->preferences->workspace and tick Refresh Automatically.
Local History
It's a great feature. Eclipse has its own mini-CVS for all files in a project. If you want to revert some change you made, or even restore deleted file - you can right click on the project and select "Restore from Local History".
Just saved my ass *tears of joy*
CTRL+Shift+P to jump to the matching bracket/parenthesis.
One key feature: Shift+Alt+T for the refactoring menu.
Ctrl-shift-T, but only type the initial characters (and even a few
more) of the class you're looking
for. For example, you can type
"NetLi" to find NetworkListener
In the Search window, Ctrl-. takes you to the first leaf of a tree branch
Alt-/ is Word Completion. Slightly different from Ctrl-space
CTRL+SHIFT+X selected text becomes UPPERCASE
CTRL+SHIFT+Y selected text becomes lowercase
I'd like to add two additional shortcuts:
CTRL+F6 Switch between open editors (CTRL+SHIFT+F6 to scroll through the list in the opposite direction)
CTRL+F11 start program in debug mode
F11 start program in normal mode
A lot of the key bindings depend on the perspective and view currently active.
My most used ones for the Java perspective:
ctrl-shift-r open resource
ctrl-shift-t open type
ctrl-1 quick fix/refactor
ctrl-j incremental search
ctrl-h search in files (select a base directory and set scope to selected resources)
ctrl-o list methods
ctrl-alt-h open call hierarchy
ctrl-shift-l list shortcut keys
hit ctrl-shift-l again to go directly to preferences to change key mappings
I am also a fan of Eclipse, however since I spend a majority of my time in Visual Studio, I will suggest that you read Eric Sink's series of articles "C# to Java" (parts 1-4). Not only is Eric always an entertaining read, but this brief series covers some awesome Eclipse insight for those who have not been into Eclipse or have been away from it for a while:
From C# to Java: Part 1
From C# to Java: Part 2
From C# to Java: Part 3
From C# to Java: Part 4
Ctrl-Shift-M while the cursor is on a class name in your java file, will specifically add that and only that class to your imports. This is different from Ctrl-Shift-O which will not only add those imports not already defined, but will also remove imports not currently needed, something you might not necessarily want to do.
I forgot about [Ctrl+2 -> r] scope variable rename. Place the cursor in the variable you wish to rename, press Ctrl+2, then r, then type the new name watching all instances of that variable get renamed at the same time.
It's awesome at refactoring Hungarian Notation.
alt-shift-a is extremely useful in a few situations.
I use a lot of the above and also like for quick search: CTRL+J then type what I am looking for, then CTRL+K for next occurrence.
Lately I've been using the MouseFeeds plugin to automatically tell me what the key stroke combinations are. That way by repetition I remember them better.
This link has a better picture and description of what it looks like and does.
Shift+Alt+b for the simple navigation row over the editor.
I've just released this blog post about Top 5 Useful Hidden Eclipse Features. It contains:
Favorites: Types and members that will always show up in auto-completion
The awesome block selection mode: For multi-line editing
The EGit staging view: Much better than git itself
Type filters: To remove awt and java.lang.Object stuff from auto-completion
Formatter tags: To delimit code sections that shouldn't be auto-formatted
Alt+left and Alt+ right will navigate you forward and back.
I find the project-specific settings useful in Eclipse 3.3.
For example, if you have several developers working on a project who have different code styles for curly braces, line spacing, number of imports etc. then you can specify the style settings for the project. Then you can configure the save actions so that the code is automatically formatted when a file is saved. The result is everyone's code is formatted the same before it's checked in.