[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: plans to provide key board/mouse shortcuts

From: Denny Valliant <valliant_at_unm.edu>
Date: 2005-10-29 23:01:38 CEST

Aaron Digulla wrote:

>Denny Valliant wrote:
>
>
>
>>I've updated my patch so it works with the latest version (0.9.36), but
>>I still get a NPE
>>if I haven't selected something in the navigator. Arragh! :-)
>>
>>
>
>I would expect that commit without any selection should commit the
>current project.
>
>I think you can ask the workbench for the current editor and then query
>the resouce beeing edited and then use that to get the current project.
>
>Is there a way to open the synchronize perspective with a hotkey?
>
>
Yup, you can open the sync perspective with a hotkey out-of-the-box. Nice!
**
I found this snippit:

IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();

which should get me the active editor, but I don't know what to do to
get it as a "resource" and add it to the "selectedResources" var.
Getting rid of the NPE was easy enough, but "getting rid of" != "fixed".
Although no errors are now thrown which *is* kinda nice. Just won't sync
it up if it's not selected.
**
And besides the facts, there is still the issue that, as of now, I've
copied the CommitAction class (for example) and made it " implements
IWorkbenchWindowActionDelegate {" along with a couple of methods you
have to have to implement (an init(), mostly). T'was real easy, but I
hate code bloat and duplication and I'd hate to have
CommitCommandAction,UpdateCommandAction, etc., etc., which are basically
duplicate classes, add clutter.

I'll see if the normal commit action will function the same way if I
just modify it vs. creating a new class. Someone with knowledge might
know right away, but not me. Trial and error, trial and error, wash,
repeat...

I notice CVS is using traversal vs. commands for commit and such, was
looking cuz it has hotkeys. I'd hate for something as simple as hotkey
"hooks" to force a refactor or whatnot of core code. Guess we'll find
out as I putz around. Maybe seperate classes are needed, but at the
least we can chop down the code in them so they're mere shells. That
would be alright-er. If we go with the one class way, it will be harder
to do the "get active editor and add to resource" as I assume there
would need to be some type of logic that knew if it was invoked from the
hotkey in the editor vs. being invoked "the normal way".

As you can see, if I knew more, I would be done already. *sigh* Story of
my life. ;-)

Thanks for the tip, confirms I'm on the right path for active editor
getting... getProject() will be nice when I can getResource()... :-)
:Denny
Received on Sun Oct 30 08:01:38 2005

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.