|
From: Ernest O. <er...@wi...> - 2010-10-30 15:59:55
|
Thank you! And thank you Dale! With the info from you both I now have a macro that can let me see what I've changed between the file in jEdit and the file in the Perforce depot. Sweet!
Thanks,
Ernest
On Oct 21, 2010, at 12:51 AM, Tom Gutwin wrote:
> Here is the JDiff part of what I use in a svn macro I wrote...
>
> // Compares, using JDiff, the current buffer with another file that
> jEdit will open
>
> boolean useJDiff = false;
>
> // check if the plugin is installed.
> if(jEdit.getPlugin("jdiff.JDiffPlugin", true) != null)
> {
> useJDiff = true;
> }
>
> String currBufferPath = buffer.getPath();
> name = buffer.getName();
> WorkingDir = buffer.getDirectory();
> StringBuffer fullFilename = new StringBuffer(buffer.getPath());
>
> // Change this to a filename or take it from your editPanes or a call
> to JOptionPane.showInputDialog
> String anotherFilename ="/etc/fstab";
>
> if (useJDiff)
> {
> Buffer newBuffer = jEdit.openFile(view, anotherFilename.toString());
> EditPane[] editPanes = view.getEditPanes();
> if (editPanes.length != 2)
> {
> if (editPanes.length > 2)
> {
> view.unsplit();
> }
> view.splitVertically();
> editPanes = view.getEditPanes();
> }
> editPanes[0].setBuffer(buffer);
> editPanes[1].setBuffer(newBuffer);
> if (!jdiff.DualDiffManager.isEnabledFor(view))
> {
> jdiff.DualDiffManager.toggleFor(view);
> }
> }
>
>
> tom
>
>
> On Wed, Oct 20, 2010 at 3:38 PM, Ernest Obusek <er...@wi...> wrote:
>>
>> I want to launch a diff using jDiff from a Beanshell macro. How would I go about doing this? I didn't see anything helpful in the jEdit help section for macros nor in the jDiff section.
>>
>> Thanks,
>>
>> Ernest
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
>> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
>> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
>> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
>> http://p.sf.net/sfu/nokia-dev2dev
>> --
>> -----------------------------------------------
>> jEdit Users' List
>> jEd...@li...
>> https://lists.sourceforge.net/lists/listinfo/jedit-users
>
>
>
> --
> --
> ------------------------------------------------------
> Tom Gutwin
> tg...@we...
|