Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

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

2008/06/26

Maven Integration for Eclipse and ClassNotFound exception

I have been using Maven Integration for Eclipse plugin for some time and I am very fond of it. It is awesome. I imagine there is no a single solution to the problem of bridging two java project meta-descriptors - maven's represented by pom.xml and eclipse's represented by artifacts like .classpath and .project. The way it is implemented in this plugin is just awesome.

There was only one problem I have encountered while using m2eclipse plugin. After upgrade to 0.9.4 release, my eclipse-maven projects stopped working with ClassNotFound exception when being run from eclipse as whether Applications or JUnit tests. It was caused by a change introduced in default eclipse output folders for maven projects. It use to be target-eclipse/classes and is target/classes now - just like standard maven output directory. There is a rationale behind this change.

In order to fix the problem just select a project and choose Maven > Update Project Configuration from context menu. I've spent some time trying to understand what is going on - probably some kind of warning should be shown in case of projects with legacy paths. I hope this entry could help someone having similar problem.

m2eclipse plugin is on a good way to become a project under eclipse umbrella, great.

2008/06/18

Eclipse Ganymede - rejoicing in virility

Origins of the meme

The phrase "rejoicing in virility" is translated etymology of term ganymede. Ganymedes was the most handsome among mortals - a mythical hero of ancient Greek cluture.

Term ganymede is associated with some memes - probably quite selfish ones. As long as they are referred in this post and as they are understood by readers of this post I assume the last statement being proved. :) In evolution of culture some old memes die, some other are born, some other gain a new life.

Memes of ancient Greek culture often influence birth of new memes and then persist somehow within new ideas. Soon after Galileo discovered moons of Jupiter, one of them was named Ganymede.

A new meme associated with term Ganymede has been born recently. I suppose it's life will be relatively short (about year), although very intensive. For sure it will cause creation of new memes.

If I was asked some time ago what eclipse is, I would not have much problem with the answer - another Java IDE. Now eclipse is much more. We can call it a platform for hosting different development components. Every day connotations of the term eclipse grow like branches of a big tree.

As eclipse is astronomical term, the ganymede used for naming software follows this convention. If I was asked what this Ganymede is I would say: it is an attempt to steer some specific evolutionary process associated with software development. An attempt to stop this evolution for a while. An attempt to match different software projects in the shape they interoperate the best. There is a reason the platform is called ecosystem.

It is not the first time that Eclipse Foundation freezes the evolution at some specific stage. It is called "simultaneous releases" and so far we had two previous releases of this kind also named after moons of Jupiter - Calisto and Europa.

This introduction was long and boring. :) What really interest me as [not-so-]pragmatic programmer, and probably interests you who is reading this post right now, is a comparison between Ganymede and Europa.

Downloading

Ganymede could be downloaded from a new site. What is nice here - special link for downloading Linux AMD64 version. Finding proper version for this platform was a pain in the past. I have downloaded Mac OS X version numbered as RC3.

Launching

I have checked that the Mac OS X version comes with eclipse.ini file adjusted for more realistic usage scenario

-Xms40m
-Xmx512m
-XX:MaxPermSize=256m

Good, I won't have to tweak it by hand. It was probably fixed also in the latest Europa bundles, but for sure not in the initial ones.

During eclipse start I spotted new splash screen, quite interesting to see what else could be arranged with the same conceptual graphical elements and the same color scheme.

My workspace seems to be upgraded quite smoothly. From the first sight I cannot see anything new in eclipse appearance. Although generally being liberal I tend to be conservative on some topics. One of them is look and behavior of tools I am using and I got use to. It is not about software only. It could be about hammer or screwdriver, any extension of human body or human mind. :)

Installing plugins

Although version Eclipse IDE for Java EE Developers provides quite comprehensive development environment there are still some missing futures I use on day to day basis.

Installation of eclipse plugins has been completely redesigned. Now it is simpler and clearer and works without much ambiguity as it use to be. New option of Automatic Updates was added to general eclipse preferences, nice. However there seems to be some software update related bug in RC3, eclipse is trying to install the same upgrades forever. Fortunately when I came back to eclipse.org there was RC4 release available which upgrades without any problem.

I see only one drawback comparing to previous Software Updates functionality. Selecting plugin to install will not show brief description. The description could be find in General Information after right clicking and choosing Properties.

Ganymede comes with dozens of new features comparing to Europa. Some of them I have been using already however specifying Update Site manually. Now these releases are synchronized available from predefined sources. I will just name things important to me:

  • Remot System Explorer (included by default in Java EE bundle)
  • SVN Team Provider
  • Usage Data Collector (included by default)

The last feature is quite interesting:

The Usage Data Collector collects information about how individuals are using the Eclipse platform. This information is periodically uploaded to servers hosted by The Eclipse Foundation (though this is configurable). The intent is to use this data to help committers and organizations better understand how developers are using Eclipse.

Target Users of the Data:

  • Users of Eclipse
  • Committers working on Eclipse projects
  • ISVs and organization creating Eclipse based software
  • Enterprise IT departments that make extensive use of Eclipse Foundation
  • Academic researchers that want to study how developer work Data to Be Collected

Captured data is associated with a user through a combination of workstation and workspace ids that are automatically generated by the collector. This identification is not tied to any personal information about the user.

The usage data monitors:

  • Start up and shutdown times of a workspace
  • What is being used and when (timestamp), including
    1. Loaded bundles
    2. Commands accessed via keyboard shortcuts
    3. Actions invoked via menus or toolbars
    4. Perspective changes
    5. View usage
    6. Editor usage

Where possible, the usage data collector also capture the symbolic name and version of the bundle contributing the command/action/perspective/view/editor.

This functionality reminds me Debian Popularity Contents. Did I say something about evolution. It is definitely a kind of convergence.

Subversive plugin is now part of the distribution. Unfortunately it still depends on connectors provided by Polarion. I added:

http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/

to my Update Sites, nice feature here (or rather lack of annoyance :) ) - I am not longer forced to provide Site Name - just URL.

I installed SVNKit 1.1.7.

Now it is a time for Maven Integration Plugin plugin, I installed:

  • Maven Integration for Eclipse
  • Maven POM XML Editor
  • Maven: The Definitive Guide book

BTW there is a proposal to create Eclipse Integration for Apache Maven (IAM) under the umbrella of the Eclipse Foundation, great.

I installed additional plugins without any problem:

And now a little bit about new features I can see from the first sight:

New features and other remarks

Unfortunately the most annoying bug (at least for Mac OS X users) of the latest Europa updates remains in Ganymede (I suppose it is connected with SWT). :(

I can see italics text in case of attributes shown in XML editor, interesting.

While browsing available views and perspectives I spotted some interesting things I hadn't tried.

  • Palette - I suppose it is available to support diagram editin
  • Snippets - something new
  • Templates - looks like new interface to the old functionality
  • TCP/IP Monitor - it is from Debug Perspective, great I hope it will replace external sniffer for debugging networking code
  • JPA related views
  • Execution Plan in SQL Development perspective

That's all for now. I hope to write more when I will start using these new features. So far ganymede looks very promising and interesting.

Conclusion

Valueable memes never die. :) Eclipse Foundation is quite good in spreading own memes. It is very interesting to see what kind of "social engineering" is used in order to attract mass attention for products of open source movement . Firefox is a perfect example with todays Download Day 2008.

2008/06/07

Sharing GWT project

The Google Web Toolkit distribution comes with very handy tools for seeding new projects. The drawback of this utility is that produced project stub will reference local GWT distribution directory. In case of homogenous development environment like every developer using windows machine, some common convention of keeping GWT distribution on C:\gwt-windows-x.y.z could be introduced. There is still problem when new GWT is released, because path to GWT home is hardcoded in project configuration.

I want to propose a solution based on some eclipse configuration, which will not only ease GWT upgrades, but also allows developers working on different operating systems to share GWT projects. Here is a quick how to:

In eclipse preferences add Classpath Variable named GWT_HOME, and point it to your GWT distribution directory.

Run GWT project creation scripts as usual:

$ projectCreator -eclipse foo-project
$ applicationCreator -eclipse foo-project org.foo.client.FooApp

Edit .classpath and replace:

<classpathentry kind="lib" path="/foo/bar/gwt-mac-x.y.z/gwt-user.jar"/>

with:

<classpathentry kind="var" path="GWT_HOME/gwt-user.jar"/>

Now in eclipse:

  • choose Open Run Dialog
  • select FooApp Java Application
  • go to Classpath tab
  • from User Entries remove reference to gwt-dev-platform.jar
  • click Advanced...
  • choose Add Classpath Variables
  • select GWT_HOME and Extend... to gwt-dev-platform.jar

The FooApp launch configuration should work now. However as you can see it is still platform dependent. To overcome this just duplicate FooApp Java Application twice in Run Dialog, every time renaming it according to destination platform. It should be something like:

  • FooApp-win
  • FooApp-linux
  • FooApp-mac

Each of above launch configurations should have GWT_HOME/gwt-dev-platform.jar in User Entries where platform should be set according to launch configuration suffix.

That's all. You can share the project in your source code repository and enjoy abstract configuration which is not limited to your environment.

Just remember to add -XstartOnFirstThread VM argument in case of mac launch configuration.

2008/02/01

Java2Html converter

In the future I will post some java source codes here. Thus I am testing Java2Html converter. There is eclipse plugin as well. Here is an example of generated html:

/*
* Copyright (c) Xemantic
*/
package foo;

/**
* Test class.
*
<p>
* Created on Feb 1, 2008
*
*
@author Kazimierz Pogoda
*
@version $Id$
*/
public class Foo {

 
/**
   * Test static field.
   */
 
public static final String STATIC_FIELD = "42";

 
/**
   * Test method
   */
 
public void bar() {
   
System.out.println("Hello world");
 
}

}