Eclipse Plugin to show Windows Explorer context menu - windows

I am looking for a good plugin showing Windows Explorer context menu directly from editor window in Eclipse. Does anybody know such plugin?

I'm a little late to the game with this answer, however since I found this article when trying to find a solution to this i'll post it here. There's an answer over at http://www.eclipsezone.com/eclipse/forums/t77655.html that solves this simply.
under Window -> External Tools -> External Tools Configuration
(1) Create a new Program (select Program in the tree)
(2) name it shell (or whatever you want)
(3) set the location to ${env_var:SystemRoot}\explorer.exe
(4) set the arguments to /select,${resource_loc}
(5) run it
for me it appears up in the tool bar at the top in it the little external tool run (run with a toolbox)
simple, effective and doesn't require any installation especially when all i really needed was to have a file focused, and rapidly get to the windows folder that contains it.

For people who don't want to install Aptana (It's kinda huge), here are a few plugins for a windows context menu in eclipse(and more):
contextmenu
Basic
Eclipse Navigator Extension
Basic + copy path
StartExplorer
Only opens explorer, but also does it on selected text (if it's a path) and has custom commands.
Some more info on Eclipse explorer menu's after trying them:
Failed to install (Some error with osgi)
Has 2 Eclipse context menu's:
Copy path (full, file, parent)
Show Context Menu (it's the basic version though, some of the context menu items that I can see in real Explorer don't show up here)
Has 1 Eclipse context menu (StartExplorer) with submenu's:
Show in File manager
Start Shell here
Open file with default application
Copy resource path to clipboard
Custom commands, which you can set in preferences and default ones:
Edit in notepad
echo to temp file
So, although (3) StartExplorer doesn't really have a context menu and everything sits in a submenu, the custom commands dominates in my opinion. It should allow a contextmenu through it (command to be found) or achieve what you want by cloning the behavior you want from your context menu.
It also seems like the code has been updated more recently than the others (and it supports multiple platforms)

For my custom paste I am not using the Paste from eclipse , I have created a new context menu Paste Objects by adding a new command .
I have added the handler : PasteObjectsHandler for the command which extends AbstractHandler .
Command
<command
categoryId="org.eclipse.ui.category.edit"
description="%pasteobjectscommand.description_xmsg"
id="com.test.pasteobjectscommand"
name="%pasteobjectscommand.name_xtit">
</command>
Handler
<handler
class="com.test.PasteObjectsHandler"
commandId=" com.test.pasteobjectscommand ">
</handler>
public class PasteObjectsHandler extends AbstractHandler {
#Override
public Object execute(ExecutionEvent event) {
Clipboard clipBoard = new Clipboard(Display.getDefault());
LocalTransfer instance = LocalTransfer.getInstance();
IResource clipboardData = (IResource) clipBoard.getContents(instance);
}
}
And in the handler I try to access the clipboard in the execute method . And I get null here .

I have written a plug-in that can open the Windows Explorer context menu:
ContextMenuPlugin
I wrote it a long time ago, but I still maintain it.

I will add EasyShell plugin for Eclipse, it has that functionality and more.
Have a look at that:
https://anb0s.github.io/EasyShell/

Aptana, it will give you context menu.

Related

How do I write to the CommandPrompt from Windows GUI?

Operating Environment: Windows 7, Visual Studio 2010, CLR GUI.
So I've been given the unglorious task of enhancing a GUI application that is started from a command prompt. Because it is. Because poor design decisions by previous implementers. Anyway, it launches one of several GUIs depending upon the input arguments.
I'd like to be able to print back to the same command prompt window if (when) the user types something that the code doesn't understand.
Here's what I've tried (none of which output anything):
int main( array<System::String^>^ args )
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
OutputDebugString("hello");
Trace::WriteLine("hello");
Debug::Trace::WriteLine("hello");
Console::WriteLine("hello");
std::cout << "hello";
printf("hello");
return 0;
}
Thanks in advance!
Update: I don't want to use AllocConsole(), as that opens a new console that disappears along with all of the data when the application exits. Similarly, a pop-up message box won't work. I'm looking for a way to make the output persistent.
The only way I can get output from the application to date is via a message box (non-persistent) or opening a new console that disappears when the application exits (via AllocConsole() ). And I'm running from a command prompt, not the debugger's "Play" button.
Update
Why the down-vote for not doing research? I spent a day trying to solve this, looking through dozens of posts trying to find a solution, and to date I've found others looking for the same answer, but not finding it. AllocConsole() or changing the project type is always the solution, but neither is a solution for me.
Update
I added the "full code", which is the 2 statements. THAT IS ALL THE CODE. So simple. I'm skipping the start of the GUI because I don't care about that right now, I just want it to print back to the console where the application was started. The most basic HelloWorld. If there are project settings I need to post, I don't know which ones would be relevant. This is where I want to print to the console, before the GUI is ever up. I can't show the GUI if there is an error in the user input.
Right click on the project, select Properties
Under Linker -> System, Change Subsystem from Windows to Console.
A Windows subsystem application cannot write to console, but by changing the subsystem to Console (which can write to the calling console), the Form part of the application can still work (tested in Visual Studio 2010).

Crash when calling getOpenFileName from QItemDelegate's custom editor

Prerequisites:
I have a custom QItemDelegate which creates custom editor for treeview items.
The editor consists of a QLineEdit and QToolButton. The button is used to open the file dialog for selecting the file and placing it's path into line edit.
I use a call to QFileDialog::getOpenFileName to open the file dialog. The dialog is native Windows file dialog (this is important).
When the editor is created the first time, everything works ok no matter how often I press that button. But after the editor is closed and reopened again the first press on the button results in a crash. The reason of the crash is that my custom editor eventually gets deleted.
Here is some code:
void CCustomEditor::on_RunSetupBtn_clicked()
{
auto qFilename = QFileDialog::getOpenFileName(this,
"Select application to run",
QString(),
"Executable files (*.exe)");
if (qFilename.isEmpty())
return;
SetCommandLine(QDir::toNativeSeparators(qFilename), m_qParameters);
}
I have made some digging and found out that calling WinAPI function GetOpenFileName results in the very same way: my editor gets deleted (although crash doesn't happen). It seems that Qt calls it also internally.
I have tracked down the reason of why my editor gets deleted and found out that when getOpenFileName is called, active window changes and focus changes with it.
In the first case the focus is moved from TreeView item, but in the second case it is moved from the editor itself!
This results in the deletion of editor because of 'focus out' event.
It is important to say that this situation doesn't happen if 'DontUseNativeDialog' flag is set when file dialog is created. Therefore this should be a bug in Qt's window management between native windows and Qt widgets.
As a workaround of this bug I suggest the following solution: before making a call to getOpenFileName set the focus to the button itself.
m_pUI->RunSetupBtn->setFocus();
auto qFilename = QFileDialog::getOpenFileName(this,
"Select application to run",
QString(),
"Executable files (*.exe)");
The other workaround is to use 'DontUseNativeDialog' flag, but the resulting file dialog doesn't look native, in fact it is quite ugly.
If someone has a better solution, feel free to share.
I have a similar problem with getOpenFileName and getSaveFileName. My solution is, after getOpenFileName, getSaveFileName or at the end of the function set the windows as active with activateWindow().

code for creating context menu does not works properly

when i install an application it should add an item to windows explorer context menu using system registry.
but it gives an error that "SOME OR ALL IDENTITY REFERENCES COULD NOT BE RESOLVED"
KINDLY HELP
I achieved it but not fully.......
with the help of creating keys in registry i added an item to windows explorer context menu using c#.the context menu item appears for foleders like mycomp etc but not for files say abc.txt...just as winrar does...
waiting fr reply................
You need to start your application using
"Run as Administrator"
Then this error wont come up,i think its a problem with Windows-7

Problem debugging shell extension in Vista (IShellFolder)

I have created a Windows Shell Extension using ATL (Visual Studio 2008). It has the following modules and each module is a separate ATL Simple Object with its own .rgs file for registration:-
IShellFolder/IShellView -> For a virtual drive in windows explorer
IContextMenu/IShellExtInit -> For a popup menu files and folders
IShellIconOverlayIdentifier - To display overlay icons on files and folders
IShellPropSheetExt/IShellExtInit -> For a custom property page in File & Folder's properties
The above work fine in WinXP and I am able to debug this shell extension in WinXP. But a soon as I switch to Vista, I only get method calls for (2) and (4). The drive gets created in Windows Explorer but the underlying methods are not called when I click it.
Although when I right click I get called for (2) and when I select "Properties" for a file or folder I get into the code for (4).
Is there some interface that I am missing for (1) and (3) on Vista. I could not find full and detailed documentation on writing Shell Extensions for Vista on MSDN. I had already gone through the CodeProject articles on shell extensions.
The problem was because of a Xml SMART Pointer usage. It was has problems when Release() was called on it.
Check this link
Internet Explorer crashes when MSXML2::IXMLDOMDocumentPtr -> Release() is called
Make sure that your extensions are handling the initialization properly, otherwise the verclsid.exe won't let your extension getting loaded.
verclsid.exe first loads the shell extensions and does a quick check on them before it sends an 'ok' to the shell indicating that it's safe to load the extension.
See here for some details about verclsid.exe.

"SVN Blame" plugin for VisualStudio

I found this question but the referenced options don't say anything about supporting "blame". What I'm looking for is an integrated way to ask "Who edited the line under the cursor last?".
I know most/all SVN clients give this in some form but I'd like something that makes it easy enough that I can do it on a whim: "Humm, who wrote that? [tap tap] Oh him."
The daily builds of AnkhSVN 2.0 have a completely new annotate (blame) implementation inspired by the TFS annotate feature.
(source: qqn.nl)
Not really visible in these screenshots, but it uses the Visual Studio editor for syntax coloring, etc. (You can see the sizeof() in the right bottom of the next image is blue). As you can see in the second picture it also allows several commands on the revision regions in the left bar.
It currently doesn't implement the jump to active line. But you can use the Visual Studio goto line (Ctrl+G) command in it. (You might be able to script this in a macro)
The easiest way to start annotate is right click on the editor ->Subversion->Annotate.
(source: qqn.nl)
[Update 2009-02-03: This feature is now commonly available in the new Stable release]
I wrote a Visual Studio macro to get line number info and pass it to tortoiseproc.exe (which is part of TortoiseSVN)
Take a look at the parameter info:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-automation.html
Here is my macro:
Sub Blame()
sCurrFileFull = DTE.ActiveDocument.FullName
Dim activeDoc As Document
activeDoc = DTE.ActiveDocument
Dim nLine As Integer
nLine = activeDoc.Selection.CurrentLine
sShellCommand = sTorEXE & " /command:blame /startrev:1 /endrev:-1 /path:""" &
sCurrFileFull & """ /notempfile /line:" & nLine.ToString()
Shell(sShellCommand, AppWinStyle.MaximizedFocus, False)
End Sub
I use a set of external tools wired to TortoiseProc.exe to perform SVN operations like log, diff, blame, revert, commit, update, etc. Then I create toolbar shortcuts to these external tools so that I have all the basic SVN operations accessible within the IDE.
Here are the steps to create a button to do a blame on the current file:
Go to tools -> external tools and click "Add"
Enter whatever title you want (e.g. "Blame")
For the command, enter the following (the path will be different if you installed TortoiseSVN to a different directory): c:\Program Files\TortoiseSVN\bin\TortoiseProc.exe
For the arguments, enter the following: /command:blame /path:"$(ItemPath)" /notempfile
For the initial directory, enter:$(ItemDir)
Now, whenever you have a file open, simply go to tools -> Blame and it should generate the Blame in a popup window. You can also customize the toolbar and create a shortcut for this external tool to make it even easier.
In VisualSVN supports blame to some extent - you can right-click on a file and select "Blame". However, it pops up a new window, which may not be as integrated as you want.
Here's a working version of crashmstr's and Derek Dahmer's macro code:
Sub Blame()
Dim sCurrFileFull = DTE.ActiveDocument.FullName
Dim activeDoc = DTE.ActiveDocument
Dim nLine = activeDoc.Selection.CurrentLine
Dim sTorEXE = "TortoiseProc.exe"
' Add path if you don't have TortoiseSVN on your PATH
Dim sShellCommand = sTorEXE & " /command:blame /startrev:1 /endrev:-1 /path:""" & sCurrFileFull & """ /notempfile /line:" & nLine.ToString()
Shell(sShellCommand, AppWinStyle.MaximizedFocus, False)
End Sub
As per Derek Dahmer's instructions, add it to a new or existing macro module using the Tools > Macros > Macro IDE.
For easy access, I added the macro to my code window context menu:
Customize > Commands > Context menu > Editor Context Menus | Code Window
Add Command > Macros > Find your macro
Modify Selection > Name: Bla&me
Having it in the context menu enables easy keyboard access, but you can, of course, add a keyboard shortcut to it as well. I have it on Ctrl-Shift-M, which is not used by anything useful by default :).

Resources