DiffFile plugin 1.2

DiffFile plugin version 1.2 is available at:

http://www.intellij.org/twiki/bin/view/Main/DiffFilePlugin

Note that significant refactoring was done to create utility classes
that should be directly usable by other plugins. Let me know if there
are other changes you'd like. I'll do them as I have time. (Expect a
week or more between releases unless there's a significant bug or a
change in IDEA that requires a change to the plugin code.)

Changes for v 1.2:

- The file from the editor did not reflect
changes made since the last save. There were two
options for fixing this: save before showing, or use
the editor's contents. This version shows the contents
of the editor.
- A "Swap Files" button has been added
to the viewer dialog. Pressing this button will swap
the contents of the two panes.
- Refactored into several classes. This should make it
easier for other plugins to use the same viewing code.
- DiffPanelWrapper: This is a wrapper for the diffPanel
that adds some desireable features such as using
DiffFileTokens to represent the content, and the
ability to swap the pane contents.
- DiffFileToken: This is a simple helper class for
storing information about a file that is going to
be part of the diff.
- DiffViewerFrame: A JFrame that displays the DiffPanel
for two DiffFileTokens.
- DiffViewerDialog: A DialogWrapper that displays the
DiffPanel for two DiffFileTokens.
NOTE: The JFrame and DialogWrapper? options are both
have "quirks". The use of a JFrame (which is what the
DiffFile? plugin uses) allows the diff to be completely
separate from the editor so that you can switch between
them. However, the DiffPanel?'s copy and search buttons
do not work (at least for IDEA build 639) when it is
placed in a JFrame. A DialogWrapper?, however, is
always on top of the editor window even if non-modal.
Focus can be sent to the editor, but the editor window
can not be brought to the front. I can't see any use
for a non-modal dialog if it is going to always be on
top of the other windows and will be posting this as a
bug.

~Mike

4 comments
Comment actions Permalink

Mike Abney wrote:

can not be brought to the front. I can't see any use
for a non-modal dialog if it is going to always be on
top of the other windows and will be posting this as a
bug.

As far as I know, a non-modal dialog by definition is always in
front of its parent window. The difference between a modal and
nonmodal dialog is that with a non-modal dialog you can still mouse
and key into another window.


--

Erb

==============================================================
"The only time I like in the morning is afternoon."
- Russell D. Cooper

"If you do everything, then you're all done."
- Melissa F. Cooper

"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

0
Comment actions Permalink

Right, I wasn't thinking straight or something when I wrote my
changelog. My post just now to the openapi group spells out what I think
the actual problem is: You can't build a DialogWrapper without a parent
window (whereas you can do so for a JDialog).


~Mike

Erb <IDEA@erb.8m.com> wrote:

Mike Abney wrote:

>> can not be brought to the front. I can't see any use
>> for a non-modal dialog if it is going to always be on
>> top of the other windows and will be posting this as a
>> bug.
>>

As far as I know, a non-modal dialog by definition is always in
front of its parent window. The difference between a modal and
nonmodal dialog is that with a non-modal dialog you can still mouse
and key into another window.

0
Comment actions Permalink

I get the following exception after choosing a file with build 642:

2002-08-27 12:09:35,220 ERROR -
com.intellij.ide.q - Error during dispatching of
java.awt.event.MouseEvent[MOUSE_RELEASED,(524,756),button=1,modifiers=
Button1,clickCount=1] on frame0
2002-08-27 12:09:35,220 ERROR -
com.intellij.ide.q - IntelliJ IDEA (Ariadna) 3.0 Build #642
2002-08-27 12:09:35,220 ERROR -
com.intellij.ide.q - JDK: 1.4.0_01
2002-08-27 12:09:35,220 ERROR -
com.intellij.ide.q - VM: Java HotSpot(TM) Client VM
2002-08-27 12:09:35,220 ERROR -
com.intellij.ide.q - Vendor: Sun Microsystems Inc.
2002-08-27 12:09:35,220 ERROR -
com.intellij.ide.q - OS: Windows 2000
2002-08-27 12:09:35,220 ERROR -
com.intellij.ide.q -
java.lang.NoSuchMethodError:
com.intellij.openapi.diff.DiffPanelFactory.createDiffPanel(Ljava/awt/W
indow;Lcom/intellij/openapi/project/Project;Lcom/intellij/openapi/vfs/
VirtualFile;)Lcom/intellij/openapi/diff/DiffPanel;

at
com.michelleandmike.idea.diff.DiffPanelWrapper.getPanel(DiffPanelWrapp
er.java:49)

at
com.michelleandmike.idea.diff.DiffViewerFrame.createCenterPanel(DiffVi
ewerFrame.java:56)

at
com.michelleandmike.idea.diff.DiffViewerFrame.init(DiffViewerFrame.jav
a:34)

at
com.michelleandmike.idea.diff.DiffViewerFrame.]]>(DiffViewerFrame.j
ava:18)

at
com.michelleandmike.idea.diff.DiffFileAction.actionPerformed(DiffFileA
ction.java:56)

at com.intellij.openapi.actionSystem.b.j.actionPerformed(j.java:2)

at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:176
7)

at
com.intellij.openapi.actionSystem.b.z.fireActionPerformed(z.java:45)

at com.intellij.ui.b.a.n.doClick(n.java:160)

at com.intellij.ui.b.a.n.access$300(n.java:230)

at com.intellij.ui.b.a.o.mouseReleased(o.java:5)

at java.awt.Component.processMouseEvent(Component.java:5021)

at java.awt.Component.processEvent(Component.java:4818)

at java.awt.Container.processEvent(Container.java:1525)

at java.awt.Component.dispatchEventImpl(Component.java:3526)

at java.awt.Container.dispatchEventImpl(Container.java:1582)

at java.awt.Component.dispatchEvent(Component.java:3367)

at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3359)

at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3074)

at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3004)

at java.awt.Container.dispatchEventImpl(Container.java:1568)

at java.awt.Window.dispatchEventImpl(Window.java:1581)

at java.awt.Component.dispatchEvent(Component.java:3367)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)

at com.intellij.ide.q.a(q.java:9)

at com.intellij.ide.q.dispatchEvent(q.java:23)

at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThr
ead.java:191)

at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThrea
d.java:144)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)



0
Comment actions Permalink

Yes, they changed the API in the latest builds. I will update as soon as
I can, but I'm having problems getting 642 to work. (Project file
problems and a change to the Ant integration.) It may be build 643
before I can get an update done. Sorry.


~Mike

"Carsten Sch?fer" <ca_schaefer@gmx.de> wrote in
news:akfjc4$44u$1@is.intellij.net:

I get the following exception after choosing a file with build 642:

0

Please sign in to leave a comment.