2009/11/30

XMind as eclipse plugin

About XMind

Have you tried XMind? It is very nice, open source mind mapping tool. If you have not tried mind mapping at all, maybe it is a good time to start as it helps a lot to visualize any conceptualization and then conceptualize some complex matters even better.

XMind is built on top of Eclipse RCP and so far has been distributed also as eclipse plugin. However now this option is no longer supported. As I spend a lot of time in eclipse it is much more convenient to me, to have mind maps and code in the same tool.

Installation

I found the solution. Here is the script install-as-eclipse-plugin.sh:

#/bin/bash -e

if [ ! $2 ]; then
 echo "Usage ./install-as-eclipse-plugin.sh xmind_path eclipse_path"
 exit 1
fi

XMIND_PATH="$1"
ECLIPSE_PATH="$2"

if [ ! -d $XMIND_PATH/plugins ]; then
 echo "Error - no /plugins directory in $XMIND_PATH - probably not XMind directory"
 exit 2
fi

if [ ! -d $ECLIPSE_PATH/plugins ]; then
 echo "Error - no /plugins directory in $ECLIPSE_PATH - probably not eclipse directory"
 exit 3
fi

echo "Copying XMind plugins from $XMIND_PATH to eclipse at $ECLIPSE_PATH"

# remove old xmind plugins (if they exist)
rm -fr $ECLIPSE_PATH/dropins/xmind
mkdir -p $ECLIPSE_PATH/dropins/xmind/plugins

# exclude language variants, and os specific stuff
PLUGINS=`ls $XMIND_PATH/plugins | grep -v nl_ | grep -v linux | grep -v win32 | grep -v macos`
for PLUGIN in $PLUGINS; do
 PLUGIN_NAME=`echo $PLUGIN | cut -d "_" -f 1`
 FOUND=`find "${ECLIPSE_PATH}/plugins" -name "${PLUGIN_NAME}_*"`
 if [ "$FOUND" == "" ]; then
  echo "Copying: $PLUGIN"
  cp -r $XMIND_PATH/plugins/$PLUGIN $ECLIPSE_PATH/dropins/xmind/plugins
 else
  echo "Plugin already installed: $PLUGIN_NAME"
 fi
done

This script will compare XMind plugins with plugins already available on eclipse installation and copy only these missing. It will also exclude all localization resources (I don't need them) and macosx stuff. Adjust these lines according to your needs.

All the plugins will be copied to dropins/xmind directory - it will ease the upgrade, if you want to remove xmind functionality from eclipse just remove this directory.

The only problem I have encountered so far is that on fresh eclipse installation, when new node is added to the map, there is exception from spell checker. Opening and closing xmind spell checking preferences in eclipse fixes this.

Update: I updated the script not to copy specific plugins, even if their version do not match. All the platform dependent stuff is excluded by default. The solution is tested with eclipse helios (3.6) and XMind 3.2.0.

How to use XMind in eclipse

Thanks to some comments I realized it could be not obvious how to use XMind inside eclipse. If you already have XMind file in one of your eclpse projects you can just click on it and it should open inside eclipse. Apparently you can also use File > Open File... from pull down menu to open any .xmind file. However you will not see all the Markers and Overview windows unless you open so called Mind Mapping perspective. You have only one default perspective in XMind, but several perspectives in default eclipse installation. Use Windows > Open Perspective > Other... > Mind Mapping from the pull down menu. You can also open separate windows specific to this perspective - just use Window > Show View. In order to create new XMind file, just open File > New File > Other... > Mind Mapping > Mind Map Workbook

16 comments:

  1. Looks interesting actually. Just checking it out. Do you have an account there?

    ReplyDelete
  2. Just a note, but this script is designed to work with a specific distribution and not the portable version. The portable download stores it's plugins in a different directory structure.

    BTW this worked fine for me also.

    ReplyDelete
  3. I can also confirm this works nicely. Well done!

    ReplyDelete
  4. This worked in Windows by simply copying all the files and directories from xmind_install_path\XMind\plugins to eclipse_install_path\dropins\xmind

    ReplyDelete
  5. dziekuje bardzo :-)

    thanks for pointing out the "dropins" directory! I decided to take a slightly different route that seems to work for me:

    - I installed the Xmind .deb package on my Ubuntu machine (installed in /usr/local/xmind)
    - then I created a symlink to that location in dropins (ln -s /usr/local/xmind $ECLIPSE_PATH/dropins/xmind)

    (so relying on Eclipse to only use the latest version of any plugin)

    ReplyDelete
  6. Anonymous6/10/10 15:43

    works fine in windows, but all themes, styles and markers are gone. does anybody know how to get them back?

    ReplyDelete
  7. Hi all, I did copy the plug-ins into the dropins/xmind of eclipse but how to create diagrams in eclipse. it doesn't show up in projects or new menu. thank you.

    ReplyDelete
  8. @Prasad

    I updated this post. Please take a look at the final section.

    ReplyDelete
  9. Anonymous5/12/10 08:01

    Under my Ubuntu, niether bash/zsh accept [ "$var" == "" ], but it works to change it to [ "$var" = "" ]. The != operator works, too. On my system, man test does not document an == operator.

    Doing man zshall for test, I find mostly examples using [[ ]] syntax. This works with either = or ==.

    After all, what could be more portable that a "pair of parallels".

    ReplyDelete
  10. Anonymous5/12/10 08:42

    Urf. [[ ]] worked at the command line, but then didn't work in the script itself. Huh? When I emerged from the ikebana, it actually worked. Much appreciated.

    ReplyDelete
  11. Anonymous6/1/11 05:06

    thanks very much :)

    ReplyDelete
  12. Anonymous16/2/11 13:26

    In case of M$ Windows distribution, you can activate markers and styles by following processes:
    1. open xmind install programme with 7zip or other archive programmes.
    2. copy 'plugin' folder in the zipped file into 'dropin' folder of eclipse. (I think everyone done this)
    3. open '$_OUTDIR' folder in the zipped file copy org.xmind.* folders into the plugin folder that has copied above.

    Thank you very much Kazik, I am enjoying xmind with eclipse because of you.

    ReplyDelete
  13. So unbelievably grateful for this! Thank you!

    ReplyDelete
  14. Hmmm... I just did the brute-force copy my eclipse directory overtop of the 'common' directory in the xmind-portable distro, and it seems to work. Of course, no backout option, but I don't care...

    ReplyDelete
  15. Followed gman's instructions, but with one clarification: I copied the xmind_install_path\XMind\plugins directory (and all of the contents within it) and pasted it within the eclipse_install_path\dropins\xmind directory. Which is to say I now have an eclipse_install_path\dropins\xmind\plugins directory, and all works as hoped: XMind functionality within Eclipse!

    ReplyDelete
  16. Anonymous9/7/12 15:03

    Same method as garence use also works with Juno 4.2 and XMind 3.2.1

    ReplyDelete