<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>Another Random Developer Blog</title>
	<atom:link href="http://blog.jdevelop.eu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jdevelop.eu</link>
	<description>Under development by Siegfried Bolz</description>
	<pubDate>Sun, 17 Jan 2010 18:01:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use Generators to create boilerplate code in GWT 2.0</title>
		<link>http://blog.jdevelop.eu/2010/01/17/use-generators-to-create-boilerplate-code-in-gwt-20/</link>
		<comments>http://blog.jdevelop.eu/2010/01/17/use-generators-to-create-boilerplate-code-in-gwt-20/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 18:01:47 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[Google Web Toolkit]]></category>

		<category><![CDATA[annotation]]></category>

		<category><![CDATA[boilerplate code]]></category>

		<category><![CDATA[eclipse]]></category>

		<category><![CDATA[field]]></category>

		<category><![CDATA[generate]]></category>

		<category><![CDATA[generators]]></category>

		<category><![CDATA[gwt 2.0]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[label]]></category>

		<category><![CDATA[labelfieldgenerator]]></category>

		<category><![CDATA[printwriter]]></category>

		<category><![CDATA[textbox]]></category>

		<category><![CDATA[textfieldgenerator]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/?p=515</guid>
		<description><![CDATA[

Table of contents


Introduction
A simple Example
Launch the Application
Conclusion



Introduction

A very annoying point in GWT is to write the (same) code to create Widgets and set the Properties. Most lines are filled with these boilerplate code. GWT 2.0 has a solution for this, it is called Generators. Generators are classes that are invoked by the GWT compiler to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://code.google.com/intl/de-DE/webtoolkit/images/gwt-logo.png" alt="google web toolkit" /><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Table of contents<br />
<strong></strong></p>
<ul>
<li><a href="#Introduction">Introduction</a></li>
<li><a href="#Example">A simple Example</a>
<li><a href="#launch">Launch the Application</a></li>
<li><a href="#Conclusion">Conclusion</a></li>
</ul>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="Introduction" name="Introduction"></a>Introduction</strong><br />
<strong></strong><br />
A very annoying point in GWT is to write the (same) code to create Widgets and set the Properties. Most lines are filled with these boilerplate code. GWT 2.0 has a solution for this, it is called <strong>Generators</strong>. Generators are classes that are invoked by the GWT compiler to generate a Java implementation of a class during compilation. Instead of writing:</p>
<pre class="syntax-highlight:java">
TextBox myTextBox = new TextBox();
myTextBox.setText(&quot;Hello World TextBox&quot;);
myTextBox.setName(&quot;blablubb&quot;);
myTextBox.setStyleName(&quot;ihatethis&quot;);
...
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
You can write this:</p>
<pre class="syntax-highlight:java">
@FormField(styleName = &quot;GWTstyleTextBox&quot;, parentAccessor = &quot;verticalPanel&quot;, defaultText= &quot;Hello World TextBox&quot;)
TextBox nameField;
</pre>
<p><strong><span style="text-decoration: underline"></span></strong></p>
<p>What has happened? The boilerplate code was replaced by an Annotation. First the Generator translates the Annotation into a Java class and after that the compiler creates the corresponding JavaScript-Code (very crazy i know). You can use Annotations for nearly everything, but this blog shows you how to create TextBox and Label -fields.</p>
<p><strong></strong><br />
<strong style="font-size: 1.3em"><a title="Example" name="Example"></a>A simple Example</strong><br />
<strong></strong><br />
First, take a look at <em>MyPanel.java</em>, where you can see the <strong>@FormField</strong>-Annotation in action, which generates code for a TextBox (<em>nameField</em>) and a Label (<em>labelField</em>). This is only working when the deferred binding mechanism <em>GWT.create()</em> is encountered while compiling.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>MyPanel.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import eu.jdevelop.gwt.anno.client.ui.forms.FormBinder;
import eu.jdevelop.gwt.anno.client.ui.forms.FormField;

/**
 * Component which contains an annotated TextField and LabelField
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */
public class MyPanel {

	// Create this in every annotated class to support Field-Annotations
	interface InternalFormBinder extends FormBinder&lt;MyPanel&gt; {}
	private static final InternalFormBinder formBinder = GWT.create(InternalFormBinder.class);

	// Parent (Store) for the annotated Fields
	final VerticalPanel verticalPanel = new VerticalPanel();

	// Create a LabelField
	@FormField(styleName = &quot;GWTstyleLabel&quot;, parentAccessor = &quot;verticalPanel&quot;, defaultText= &quot;Hello World Label&quot;)
	Label labelField;

	// Create a TextField
	@FormField(styleName = &quot;GWTstyleTextBox&quot;, parentAccessor = &quot;verticalPanel&quot;, defaultText= &quot;Hello World TextBox&quot;)
	TextBox nameField;

	public MyPanel() {
		// Bind this instance to the FormBinder
		formBinder.bind(this);
	}

	public VerticalPanel getPanel() {
		return verticalPanel;
	}
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
The <strong>FormField</strong>-Annotation has only 3 parameters, which are set on every Field. If you want specific parameters you can create more Annotations or enhance this one with an intelligent system to activate them.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>FormField.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.client.ui.forms;

import java.lang.annotation.*;

/**
 * Annotation for all Field-Types
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface FormField {
  String styleName() default &quot;&quot;;
  String parentAccessor();
  String defaultText() default &quot;&quot;;
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
The FormBinder-Interface is used for the deferred binding operation, the parameter can be accessed in the <em>FormBinderGenerator</em>-class.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>FormBinder.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.client.ui.forms;

import eu.jdevelop.gwt.anno.client.MyPanel;

/**
 * Simple Interface for binding operations
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */
public interface FormBinder&lt;T&gt; {

  // Make &quot;bind&quot; generic to support more components
  void bind(MyPanel component);
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
The Generators are creating the Java-files. I have splitted this operation in three main and two sub files. <em>BaseGenerator</em> is used to create an empty File with imports, <em>FormBinderGenerator</em> adds some default actions like <em>Field instantiation, setStyleName..</em> and implementations of <em>FieldGenerator</em> adds Field specific operations.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>BaseGenerator.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.ui;

import com.google.gwt.core.ext.Generator;
import com.google.gwt.core.ext.GeneratorContext;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.typeinfo.JClassType;
import com.google.gwt.core.ext.typeinfo.JParameter;
import com.google.gwt.core.ext.typeinfo.NotFoundException;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.uibinder.rebind.IndentedWriter;

import java.io.PrintWriter;

/**
 * Create the Implementation-Class and add a basic header data for ALL
 * generated Annotations.
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */
public abstract class BaseGenerator extends Generator {
  protected static final String IMPORT = &quot;import %1$s;&quot;;
  protected static final String PACKAGE = &quot;package %s;&quot;;

  protected JClassType interfaceType(TypeOracle oracle, String s, TreeLogger treeLogger) throws UnableToCompleteException {
    JClassType interfaceType;
    try {
      interfaceType = oracle.getType(s);
    } catch (NotFoundException e) {
      treeLogger.log(TreeLogger.ERROR, String.format(&quot;%s: Could not find the interface [%s]. %s&quot;, e.getClass().getName(), s, e.getMessage()));
      throw new UnableToCompleteException();
    }
    return interfaceType;
  }

  @Override
  public String generate(TreeLogger treeLogger, GeneratorContext generatorContext, String s) throws UnableToCompleteException {
    JClassType interfaceType = interfaceType(generatorContext.getTypeOracle(), s, treeLogger);

    String packageName = interfaceType.getPackage().getName();
    PrintWriterManager writers = new PrintWriterManager(generatorContext, treeLogger, packageName);
    String implName = interfaceType.getName().replace(&quot;.&quot;, &quot;_&quot;) + &quot;Impl&quot;;
    PrintWriter printWriter = writers.tryToMakePrintWriterFor(implName);
    if (printWriter != null) {
      IndentedWriter writer = new IndentedWriter(printWriter);
      writer.write(String.format(PACKAGE, packageName));
      writer.newline();
      doGenerate(interfaceType, implName, writer);
      writers.commit();
    }
    return packageName + &quot;.&quot; + implName;
  }

  protected abstract void doGenerate(JClassType interfaceType, String implName, IndentedWriter writer);

  protected void writeClassIntro(JClassType interfaceType, String implName, IndentedWriter writer) {
    writer.write(&quot;public class %1$s implements %2$s {&quot;, implName, interfaceType.getName());
    writer.indent();
    writer.newline();
  }

  protected JParameter[] extractInterfaceMethodParams(JClassType interfaceType) {
    return interfaceType.getImplementedInterfaces()[0].getMethods()[0].getParameters();
  }

  protected void writeOutro(IndentedWriter writer) {
    writer.outdent();
    writer.write(&quot;}&quot;);
    writer.outdent();
    writer.write(&quot;}&quot;);
  }
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>FormBinderGenerator.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.ui.forms.generator;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.ext.typeinfo.JClassType;
import com.google.gwt.core.ext.typeinfo.JField;
import com.google.gwt.core.ext.typeinfo.JParameter;
import com.google.gwt.uibinder.rebind.IndentedWriter;
import eu.jdevelop.gwt.anno.client.ui.forms.FormField;
import eu.jdevelop.gwt.anno.ui.BaseGenerator;

/**
 * Generate the Class-Framework for all Annotations
 * which are implementing the FormBinder-interface.
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */
public class FormBinderGenerator extends BaseGenerator {

  @Override
  protected void doGenerate(JClassType interfaceType, String implName, IndentedWriter writer) {
    JParameter[] methodParams = extractInterfaceMethodParams(interfaceType);
    writeImports(writer, methodParams);
    writeClassIntro(interfaceType, implName, writer);
    writeFieldsIntro(writer);
    writeMethodIntro(writer, methodParams);
    writeFieldsBinding(interfaceType, writer);
    writeOutro(writer);
  }

  /**
   * Generate default code for all generated Components
   *
   * @param interfaceType
   * @param writer
   */
  private void writeFieldsBinding(JClassType interfaceType, IndentedWriter writer) {
    for (JField jField : interfaceType.getEnclosingType().getFields()) {
      FormField annotation = jField.getAnnotation(FormField.class);
      if(annotation != null) {
        writer.write(&quot;component.%1$s = new %2$s();&quot;, jField.getName(), jField.getType().getQualifiedSourceName());
        writer.write(&quot;component.%1$s.setStyleName(&quot;%2$s&quot;);&quot;, jField.getName(), annotation.styleName());
        writer.write(&quot;GWT.log(&quot;Adding Field: %1$s of Type: %2$s to: %3$s&quot;,null);&quot;, jField.getName(), jField.getType().getQualifiedSourceName(), annotation.parentAccessor());
        writer.write(&quot;component.%1$s.add(component.%2$s);&quot;, annotation.parentAccessor(), jField.getName());
        FieldGeneratorFactory.getInstance().createFor(jField).write(jField, annotation, writer);
      }
    }
  }

  private void writeMethodIntro(IndentedWriter writer, JParameter[] parameters) {
    writer.write(&quot;public void bind(%1$s component) {&quot;, parameters[0].getType().getQualifiedSourceName());
    writer.indent();
  }

  private void writeFieldsIntro(IndentedWriter writer) {
    // nothing to do now
    writer.newline();
  }

  private void writeImports(IndentedWriter writer, JParameter[] parameters) {
    writer.write(IMPORT, GWT.class.getName());
    //writer.write(IMPORT, parameters[1].getType().getQualifiedSourceName());
    writer.newline();
  }

}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>FieldGenerator.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.ui.forms.generator;

import com.google.gwt.core.ext.typeinfo.JField;
import com.google.gwt.uibinder.rebind.IndentedWriter;
import eu.jdevelop.gwt.anno.client.ui.forms.FormField;

/**
 * Extend this abstract class to create a FieldGenerator.
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */
public abstract class FieldGenerator {
  public abstract void write(JField jField, FormField annotation, IndentedWriter writer);

}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
In this class i am adding a specific operation only for the <em>TextBox</em>.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>TextFieldGenerator.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.ui.forms.generator;

import com.google.gwt.core.ext.typeinfo.JField;
import com.google.gwt.uibinder.rebind.IndentedWriter;
import eu.jdevelop.gwt.anno.client.ui.forms.FormField;

/**
 * Generates additional Code only for the TextBox
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */
public class TextFieldGenerator extends FieldGenerator {

  @Override
  public void write(JField jField, FormField annotation, IndentedWriter writer) {
    writer.write(&quot;component.%1$s.setEnabled(true);&quot;, jField.getName());
    writer.write(&quot;component.%1$s.setText(&quot;%2$s&quot;);&quot;, jField.getName(), annotation.defaultText());
    writer.write(&quot;component.%1$s.setName(&quot;%1$s&quot;);&quot;, jField.getName());
  }

  private boolean isInstanceOf(JField jField, final Class&lt;?&gt; aClass) {
    try {
      return aClass.isAssignableFrom(Class.forName(jField.getType().getQualifiedSourceName(), false, this.getClass().getClassLoader()));
    } catch (ClassNotFoundException e) {
      throw new RuntimeException(e);
    }
  }
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
In this class i am adding a specific operation only for the <em>Label</em>.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>LabelFieldGenerator.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.ui.forms.generator;

import com.google.gwt.core.ext.typeinfo.JField;
import com.google.gwt.uibinder.rebind.IndentedWriter;

import eu.jdevelop.gwt.anno.client.ui.forms.FormField;

/**
 * Generates additional Code only for the Label
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */
public class LabelFieldGenerator extends FieldGenerator {

	@Override
	public void write(JField jField, FormField annotation, IndentedWriter writer) {
		writer.write(&quot;component.%1$s.setText(&quot;%2$s&quot;);&quot;, jField.getName(), annotation.defaultText());
	}

	private boolean isInstanceOf(JField jField, final Class&lt;?&gt; aClass) {
		try {
			return aClass.isAssignableFrom(Class.forName(jField.getType()
					.getQualifiedSourceName(), false, this.getClass().getClassLoader()));
		} catch (ClassNotFoundException e) {
			throw new RuntimeException(e);
		}
	}
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
To create a relation between the Fields and the Generators, i am using the <em>FieldGeneratorFactory</em>.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>FieldGeneratorFactory.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.ui.forms.generator;

import com.google.gwt.core.ext.typeinfo.JField;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;

import java.util.HashMap;
import java.util.Map;

/**
 * Register all Generators.
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */

public class FieldGeneratorFactory {
  private static final FieldGeneratorFactory INSTANCE = new FieldGeneratorFactory();
  private static final Map&lt;String, FieldGenerator&gt; generators = new HashMap&lt;String, FieldGenerator&gt;();
  static {
    generators.put(TextBox.class.getName(), new TextFieldGenerator());
    generators.put(Label.class.getName(), new LabelFieldGenerator());
  }

  private FieldGeneratorFactory() {
  }

  public static FieldGeneratorFactory getInstance() {
    return INSTANCE;
  }

  public FieldGenerator createFor(JField jField) {
    String className = jField.getType().getQualifiedSourceName();
    FieldGenerator generator = generators.get(className);
    if(generator == null) {
      throw new IllegalArgumentException(&quot;Did not find any generator for the [&quot; + className +&quot;].&quot;);
    }
    return generator;
  }

}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
The last class is used to write the Java-Files.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>PrintWriterManager.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.ui;

import com.google.gwt.core.ext.GeneratorContext;
import com.google.gwt.core.ext.TreeLogger;

import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;

/**
 * Write the generated Java files.
 *
 * @author Siegfried Bolz
 * @since 09.01.2010
 */
public class PrintWriterManager {
  private final GeneratorContext genCtx;
  private final String packageName;
  private final TreeLogger logger;
  private final Set&lt;PrintWriter&gt; writers = new HashSet&lt;PrintWriter&gt;();

  public PrintWriterManager(GeneratorContext genCtx, TreeLogger logger,
      String packageName) {
    this.genCtx = genCtx;
    this.packageName = packageName;
    this.logger = logger;
  }

  /**
   * Commit all writers we have vended.
   */
  public void commit() {
    for (PrintWriter writer : writers) {
      genCtx.commit(logger, writer);
    }
  }

  /**
   * @param name classname
   * @return the printwriter
   * @throws RuntimeException if this class has already been written
   */
  public PrintWriter makePrintWriterFor(String name) {
    PrintWriter writer = tryToMakePrintWriterFor(name);
    if (writer == null) {
      throw new RuntimeException(String.format(&quot;Tried to write %s.%s twice.&quot;, packageName, name));
    }
    return writer;
  }

  /**
   * @param name classname
   * @return the printwriter, or null if this class has already been written
   */
  public PrintWriter tryToMakePrintWriterFor(String name) {
    PrintWriter writer = genCtx.tryCreate(logger, packageName, name);
    if (writer != null) {
      writers.add(writer);
    }
    return writer;
  }
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
The last thing to do, is to create the module-file <em>FormBinder.gwt.xml</em> and insert it into the project module file <em>GwtAnnotations.gwt.xml</em><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>FormBinder.gwt.xml</strong></p>
<pre class="syntax-highlight:xml">
&lt;module&gt;
    &lt;inherits name=&quot;com.google.gwt.resources.Resources&quot; /&gt;

    &lt;generate-with class=&quot;eu.jdevelop.gwt.anno.ui.forms.generator.FormBinderGenerator&quot;&gt;
        &lt;when-type-assignable class=&quot;eu.jdevelop.gwt.anno.client.ui.forms.FormBinder&quot; /&gt;
    &lt;/generate-with&gt;
&lt;/module&gt;
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong></strong><br />
Here you can see the whole project opened in Eclipse.<br />
<div id="attachment_531" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2010/01/open_eclipse_project.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2010/01/open_eclipse_project-150x150.png" alt="Eclipse Project" title="Eclipse Project" width="150" height="150" class="size-thumbnail wp-image-531" /></a><p class="wp-caption-text">Open Eclipse Project</p></div><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="launch" name="launch"></a>Launch the Application</strong><br />
<strong></strong><br />
The compiled view is very simple, you can see only the generated Label and TextBox -Fields.<br />
<strong></strong><br />
<div id="attachment_529" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2010/01/browser_running.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2010/01/browser_running-150x150.png" alt="Launched Application in Chrome" title="Launched Application in Chrome" width="150" height="150" class="size-thumbnail wp-image-529" /></a><p class="wp-caption-text">Launched Application in Chrome</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Inside the Hosted Mode Debug Window, you can see some info dropped from the <em>FormBinderGenerator</em>.<br />
<strong></strong><br />
<div id="attachment_535" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2010/01/hostedmode_info_window.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2010/01/hostedmode_info_window-150x150.png" alt="Debug Window" title="Debug Window" width="150" height="150" class="size-thumbnail wp-image-535" /></a><p class="wp-caption-text">Debug Window</p></div><br />
<strong></strong><br />
This is the generated Java-file with the boilerplate code. Every line has been moved from the Project into this file. Imagine how many lines this file contains if you create 10, 100 or more Fields?<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>Generated MyPanel file</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.gwt.anno.client;

import com.google.gwt.core.client.GWT;

public class MyPanel_InternalFormBinderImpl implements MyPanel.InternalFormBinder {

  public void bind(eu.jdevelop.gwt.anno.client.MyPanel component) {
    component.labelField = new com.google.gwt.user.client.ui.Label();
    component.labelField.setStyleName(&quot;GWTstyleLabel&quot;);
    GWT.log(&quot;Adding Field: labelField of Type: com.google.gwt.user.client.ui.Label to: verticalPanel&quot;,null);
    component.verticalPanel.add(component.labelField);
    component.labelField.setText(&quot;Hello World Label&quot;);
    component.nameField = new com.google.gwt.user.client.ui.TextBox();
    component.nameField.setStyleName(&quot;GWTstyleTextBox&quot;);
    GWT.log(&quot;Adding Field: nameField of Type: com.google.gwt.user.client.ui.TextBox to: verticalPanel&quot;,null);
    component.verticalPanel.add(component.nameField);
    component.nameField.setEnabled(true);
    component.nameField.setText(&quot;Hello World TextBox&quot;);
    component.nameField.setName(&quot;nameField&quot;);
  }
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="Conclusion" name="Conclusion"></a>Conclusion</strong><br />
<strong></strong><br />
Using Generators can help you to clean up your code by getting rid of boilerplate code. Don&#8217;t waste time by writing the same stuff, just generate it. One positive aspect is, that you have one point to make changes and don&#8217;t have to refactor the whole project. Ok you could use a factory with static methods (like <em>WidgetsCreatorHelper.createLabelField(String name, String styleName)</em> ), but this is old school and not so beautiful like Annotations.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/annotation' rel='tag' target='_self'>annotation</a>, <a class='technorati-link' href='http://technorati.com/tag/boilerplate+code' rel='tag' target='_self'>boilerplate code</a>, <a class='technorati-link' href='http://technorati.com/tag/eclipse' rel='tag' target='_self'>eclipse</a>, <a class='technorati-link' href='http://technorati.com/tag/field' rel='tag' target='_self'>field</a>, <a class='technorati-link' href='http://technorati.com/tag/generate' rel='tag' target='_self'>generate</a>, <a class='technorati-link' href='http://technorati.com/tag/generators' rel='tag' target='_self'>generators</a>, <a class='technorati-link' href='http://technorati.com/tag/gwt+2.0' rel='tag' target='_self'>gwt 2.0</a>, <a class='technorati-link' href='http://technorati.com/tag/Java' rel='tag' target='_self'>Java</a>, <a class='technorati-link' href='http://technorati.com/tag/label' rel='tag' target='_self'>label</a>, <a class='technorati-link' href='http://technorati.com/tag/labelfieldgenerator' rel='tag' target='_self'>labelfieldgenerator</a>, <a class='technorati-link' href='http://technorati.com/tag/printwriter' rel='tag' target='_self'>printwriter</a>, <a class='technorati-link' href='http://technorati.com/tag/textbox' rel='tag' target='_self'>textbox</a>, <a class='technorati-link' href='http://technorati.com/tag/textfieldgenerator' rel='tag' target='_self'>textfieldgenerator</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2010/01/17/use-generators-to-create-boilerplate-code-in-gwt-20/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Experiences with the migration from GWT 1.7.1 to 2.0</title>
		<link>http://blog.jdevelop.eu/2009/12/10/experiences-with-the-migration-from-gwt-171-to-20/</link>
		<comments>http://blog.jdevelop.eu/2009/12/10/experiences-with-the-migration-from-gwt-171-to-20/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 12:29:48 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[Google Web Toolkit]]></category>

		<category><![CDATA[compilation time]]></category>

		<category><![CDATA[draftcompile]]></category>

		<category><![CDATA[experience]]></category>

		<category><![CDATA[gin]]></category>

		<category><![CDATA[Guice]]></category>

		<category><![CDATA[gwt 1.7.1]]></category>

		<category><![CDATA[gwt 2.0]]></category>

		<category><![CDATA[gwt-log]]></category>

		<category><![CDATA[gxt]]></category>

		<category><![CDATA[migrating]]></category>

		<category><![CDATA[presenter]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/?p=493</guid>
		<description><![CDATA[


With the release of GWT 2.0 there are several new features (like Code Splitting, Compiler improvements, faster development mode) introduced and i decided to make a test run on my current enterprise project to see what have changed in this points: 

Compilation time
API changes
Startup time of the new Development Mode
Problems with other libraries


My enterprise project [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://code.google.com/intl/de-DE/webtoolkit/images/gwt-logo.png" alt="google web toolkit" /><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
With the release of GWT 2.0 there are several new <a href="http://googlewebtoolkit.blogspot.com/2009/12/introducing-google-web-toolkit-20-now.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/googlewebtoolkit.blogspot.com');">features </a>(like Code Splitting, Compiler improvements, faster development mode) introduced and i decided to make a test run on my current enterprise project to see what have changed in this points: </p>
<ul>
<li>Compilation time</li>
<li>API changes</li>
<li>Startup time of the new Development Mode</li>
<li>Problems with other libraries</li>
</ul>
<p><strong><span style="text-decoration: underline"></span></strong><br />
My enterprise project currently needs 66 seconds to build 8 permutations and is using this technologies:</p>
<ul>
<li>GWT 1.7.1</li>
<li>GXT 2.1.0</li>
<li>GIN 1.0 (with Guice 2.0)</li>
<li>GWT-Presenter 1.0.0</li>
<li>GWT-Log 2.6.2</li>
<li>gwtrpc-spring 1.01</li>
<li>Spring Framework 2.5.6</li>
<li>Spring Security 2.0.5</li>
<li>Hibernate Libs 3.x (core, annotation, validator&#8230;)</li>
</ul>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.2em"><a title="project" name="project"></a>GWT 2.0</strong><br />
<strong></strong><br />
After i have replaced the old gwt-jar files with the new files, cleaned the project, i started the build target and launched the application. Here are the results:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.1em"><a title="com" name="com"></a>Compilation time</strong><br />
Without compiler optimization the build need 107 seconds for 8 permutations. Using the <em>draftCompile</em> parameter the build needs &#8220;only&#8221; 82 seconds. These are not the results i have awaited.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.1em"><a title="api" name="api"></a>API changes</strong><br />
Due to the fact that my build runs through without any errors or warnings, i think the major switch from listener to handler was done with the migration vom GWT 1.5 to 1.6 . So i think there aren&#8217;t any critical showstoppers waiting for me.</p>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.1em"><a title="dev" name="dev"></a>Startup time of the new Development Mode</strong><br />
Changing from <em>com.google.gwt.dev.HostedMode</em> to <em>com.google.gwt.dev.DevMode</em> was a great speedup! Using any browser you want, instead of this old Hosted Mode-Browser is a useful improvement. I can strongly recommend google Chrome 4 with the new Speed Tracer for development.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.1em"><a title="lib" name="lib"></a>Problems with other libraries</strong><br />
In the technology-list above you can see that i use a wide range of gwt-technologies. I had some doubts about GXT, because i am using many widgets from it like the TabPanel, Drag and Drop, special Layouts, TreePanels, Accordion Window, Grids&#8230; , but i did not noticed any errors! I launched my Selenium-Tests many times and every result was green. The people from GXT have done a good job with the recently released version 2.1.0 .<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.1em"><a title="lib" name="lib"></a>Conclusion</strong><br />
Overall i think that migration could be possible with less effort if you have implemented an extensive test-suite. I see the most problems in Widget libraries like GXT, SmartGwt.. which are using <em>listeners</em> from API 1.5 .<br />
<strong><span style="text-decoration: underline"></span></strong><br />
If you have any comments, drop a line below.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/compilation+time' rel='tag' target='_self'>compilation time</a>, <a class='technorati-link' href='http://technorati.com/tag/draftcompile' rel='tag' target='_self'>draftcompile</a>, <a class='technorati-link' href='http://technorati.com/tag/experience' rel='tag' target='_self'>experience</a>, <a class='technorati-link' href='http://technorati.com/tag/gin' rel='tag' target='_self'>gin</a>, <a class='technorati-link' href='http://technorati.com/tag/Google+Web+Toolkit' rel='tag' target='_self'>Google Web Toolkit</a>, <a class='technorati-link' href='http://technorati.com/tag/Guice' rel='tag' target='_self'>Guice</a>, <a class='technorati-link' href='http://technorati.com/tag/gwt+1.7.1' rel='tag' target='_self'>gwt 1.7.1</a>, <a class='technorati-link' href='http://technorati.com/tag/gwt+2.0' rel='tag' target='_self'>gwt 2.0</a>, <a class='technorati-link' href='http://technorati.com/tag/gwt-log' rel='tag' target='_self'>gwt-log</a>, <a class='technorati-link' href='http://technorati.com/tag/gxt' rel='tag' target='_self'>gxt</a>, <a class='technorati-link' href='http://technorati.com/tag/migrating' rel='tag' target='_self'>migrating</a>, <a class='technorati-link' href='http://technorati.com/tag/presenter' rel='tag' target='_self'>presenter</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2009/12/10/experiences-with-the-migration-from-gwt-171-to-20/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fixed the Plugin &#8220;EclipseMode&#8221; for IntelliJ IDEA 9</title>
		<link>http://blog.jdevelop.eu/2009/12/01/fixed-the-plugin-eclipsemode-for-intellij-idea-9/</link>
		<comments>http://blog.jdevelop.eu/2009/12/01/fixed-the-plugin-eclipsemode-for-intellij-idea-9/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 22:39:36 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[intellij idea]]></category>

		<category><![CDATA[bug fixed]]></category>

		<category><![CDATA[eclipse mode]]></category>

		<category><![CDATA[EclipseMode]]></category>

		<category><![CDATA[incremental compilation]]></category>

		<category><![CDATA[intellij idea 9]]></category>

		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/?p=472</guid>
		<description><![CDATA[


The IDEA-Plugin EclipseMode, originally developed by Alexey Efimov for the Java-IDE IntelliJ IDEA, is useful for activating incremental compilation (well-known from Eclipse). It is working fine for IDEA 8 but not for IDEA 9. So i have fixed a bug in this plugin and it is now working with IDEA 9.0 Beta and IDEA 92.65.

Installation

Download [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jdevelop.eu/uploads/idea9betalogo.png" /><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
The IDEA-Plugin <strong>EclipseMode</strong>, originally developed by Alexey Efimov for the Java-IDE <a href="http://www.jetbrains.com/idea/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.jetbrains.com');">IntelliJ IDEA</a>, is useful for activating <strong>incremental compilation</strong> (well-known from Eclipse). It is working fine for IDEA 8 but not for IDEA 9. So i have fixed a bug in this plugin and it is now working with <strong>IDEA 9.0 Beta</strong> and <strong>IDEA 92.65</strong>.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.3em"><a title="project" name="project"></a>Installation</strong><br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/downloads/idea9_eclipse_plugin/EclipseMode_v0.1.2.zip" onclick="javascript:pageTracker._trackPageview ('/downloads/zip/eclipsemode_v0.1.2.zip');">Download</a> and extract the plugin-archive into the IDEA 9-Subdirectory <strong>plugins</strong>.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_473" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/12/bild1.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/12/bild1-150x150.png" alt="Plugins-Directory" title="Plugins-Directory" width="150" height="150" class="size-thumbnail wp-image-473" /></a><p class="wp-caption-text">Plugins-Directory</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Start IDEA 9 and open the <strong>Application Settings</strong> (press STRG+ALT+S). Navigate to <strong>plugins</strong> and search there for <strong>EclipseMode</strong>. Activate it and restart IDEA.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_479" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/12/bild2.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/12/bild2-150x150.png" alt="IDEA 9 Settings" title="IDEA 9 Settings" width="150" height="150" class="size-thumbnail wp-image-479" /></a><p class="wp-caption-text">IDEA 9 Settings</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Open again the <strong>Application Settings</strong> and you see inside the <strong>IDE Settings</strong> the new entry <strong>Eclipse Mode</strong>. Activate it.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_480" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/12/bild3.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/12/bild3-150x150.png" alt="Enable incremental compilation" title="Enable incremental compilation" width="150" height="150" class="size-thumbnail wp-image-480" /></a><p class="wp-caption-text">Enable incremental compilation</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
When you now change any class and save it, it will be immediately compiled. Errors are shown inside the Messages-Window.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_481" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/12/bild4.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/12/bild4-150x150.png" alt="Plugin Example" title="Plugin Example" width="150" height="150" class="size-thumbnail wp-image-481" /></a><p class="wp-caption-text">Plugin Example</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
That&#8217;s it. If you have any comments, drop a line below.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/bug+fixed' rel='tag' target='_self'>bug fixed</a>, <a class='technorati-link' href='http://technorati.com/tag/eclipse+mode' rel='tag' target='_self'>eclipse mode</a>, <a class='technorati-link' href='http://technorati.com/tag/EclipseMode' rel='tag' target='_self'>EclipseMode</a>, <a class='technorati-link' href='http://technorati.com/tag/incremental+compilation' rel='tag' target='_self'>incremental compilation</a>, <a class='technorati-link' href='http://technorati.com/tag/intellij+idea+9' rel='tag' target='_self'>intellij idea 9</a>, <a class='technorati-link' href='http://technorati.com/tag/plugin' rel='tag' target='_self'>plugin</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2009/12/01/fixed-the-plugin-eclipsemode-for-intellij-idea-9/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Create a GWT Application from Scratch</title>
		<link>http://blog.jdevelop.eu/2009/11/11/create-a-gwt-application-from-scratch/</link>
		<comments>http://blog.jdevelop.eu/2009/11/11/create-a-gwt-application-from-scratch/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 21:14:00 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[Google Web Toolkit]]></category>

		<category><![CDATA[NetBeans]]></category>

		<category><![CDATA[create project]]></category>

		<category><![CDATA[eclipse]]></category>

		<category><![CDATA[gwt]]></category>

		<category><![CDATA[i18n]]></category>

		<category><![CDATA[import]]></category>

		<category><![CDATA[intellij idea]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/?p=400</guid>
		<description><![CDATA[


Many people are asking (especially in the GWT Group) how to create a GWT Application for their favourite IDE. In this blog i will show you how to do this for Eclipse, NetBeans and IntelliJ IDEA.

Table of contents


Create the Project-files
Using Eclipse
Using NetBeans
Using IntelliJ IDEA



Create the Project-files

During my growing experience with GWT i learned that it [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jdevelop.eu/uploads/googlecode.png" /><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Many people are asking (especially in the <a href="http://groups.google.com/group/google-web-toolkit/topics" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/groups.google.com');">GWT Group</a>) how to create a GWT Application for their favourite IDE. In this blog i will show you how to do this for Eclipse, NetBeans and IntelliJ IDEA.</p>
<p><strong><span style="text-decoration: underline"></span></strong><br />
Table of contents<br />
<strong></strong></p>
<ul>
<li><a href="#project">Create the Project-files</a></li>
<li><a href="#eclipse">Using Eclipse</a>
<li><a href="#netbeans">Using NetBeans</a></li>
<li><a href="#idea">Using IntelliJ IDEA</a></li>
</ul>
<p><strong></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="project" name="project"></a>Create the Project-files</strong><br />
<strong></strong><br />
During my growing experience with GWT i learned that it is better to create the project from scratch and import it into the IDE rather then using a IDE-wizard which often creates not all files you need. So let&#8217;s start bei downloading the <a href="http://code.google.com/intl/de-DE/webtoolkit/download.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">Google Web Toolkit Archive</a> and extract it. Open a shell (Windows-User run &#8220;<strong>cmd</strong>&#8220;) and navigate to the directory where you have extracted the GWT-archive. Run the following commands:</p>
<ul>
<li>webAppCreator.cmd -out MyProjectDirectory eu.jdevelop.gwt.MyApp</li>
<li>i18nCreator.cmd -eclipse MyGwtProject -createMessages -out MyProjectDirectory eu.jdevelop.gwt.client.constants.i18n.MyLanguageConstants</li>
</ul>
<p>So what have you done? You have created a GWT-Project and added support for Eclipse and internationalization (i18n).<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_406" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/1_create_project.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/1_create_project-150x150.png" alt="Create the Project" title="Create the Project" width="150" height="150" class="aligncenter size-thumbnail wp-image-405" /></a><p class="wp-caption-text">Create the Project</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Change into the created directory <strong>MyProjectDirectory </strong>and run the following commands to see that all is working:</p>
<ul>
<li>ant build</li>
<li>ant hosted</li>
</ul>
<p><div id="attachment_407" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/2_ant.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/2_ant-150x150.png" alt="Running Ant targets" title="Running Ant targets" width="150" height="150" class="aligncenter size-thumbnail wp-image-407" /></a><p class="wp-caption-text">Running Ant targets</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_408" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/3_hosted.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/3_hosted-150x150.png" alt="Hosted Mode" title="Hosted Mode" width="150" height="150" class="size-thumbnail wp-image-408" /></a><p class="wp-caption-text">Hosted Mode</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Well done, now it is time to import this project into your favourite IDE.<br />
<strong></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="eclipse" name="eclipse"></a>Using Eclipse</strong><br />
<strong></strong><br />
Open Eclipse (i am using version 3.5) and point it to an empty directory for your Workspace. In the menu open &#8220;<strong>Help</strong>&#8220;->&#8221;<strong>Install New Software</strong>&#8221; and install the <a href="http://code.google.com/intl/de-DE/eclipse/docs/download.html" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">plugin</a> for your Eclipse version. Restart Eclipse after Installation.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_413" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/4_eclipse_plugin.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/4_eclipse_plugin-150x150.png" alt="Eclipse Plugin" title="Eclipse Plugin" width="150" height="150" class="size-thumbnail wp-image-413" /></a><p class="wp-caption-text">Eclipse Plugin</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Now import the previously created project. Click on &#8220;<strong>File</strong>&#8220;->&#8221;<strong>Import</strong>&#8220;:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_414" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/5_import.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/5_import-150x150.png" alt="Import GWT Project" title="Import GWT Project" width="150" height="150" class="size-thumbnail wp-image-414" /></a><p class="wp-caption-text">Import GWT Project</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
..and select &#8220;<strong>General</strong>&#8220;->&#8221;<strong>Existing Projects into Workspace</strong>&#8220;.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_416" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/6_import_project.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/6_import_project-150x150.png" alt="Import project" title="Import project" width="150" height="150" class="size-thumbnail wp-image-416" /></a><p class="wp-caption-text">Import project</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Choose the directory where your project is located. After importing, you should see something like this:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_418" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/7_eclipse_project.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/7_eclipse_project-150x150.png" alt="Eclipse with GWT-Project" title="Eclipse with GWT-Project" width="150" height="150" class="size-thumbnail wp-image-418" /></a><p class="wp-caption-text">Eclipse with GWT-Project</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
At last you have to activate the GWT-Plugin. Open the project properties and navigate to &#8220;<strong>Google</strong>&#8220;->&#8221;<strong>Web Toolkit</strong>&#8220;. Activate the plugin. That&#8217;s it!<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_419" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/8_properties.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/8_properties-150x150.png" alt="Project properties" title="Project properties" width="150" height="150" class="size-thumbnail wp-image-419" /></a><p class="wp-caption-text">Project properties</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
You can use Ant targets or the Eclipse commands to run the application.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_420" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/9_run.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/9_run-150x150.png" alt="Launch the application" title="Launch the application" width="150" height="150" class="size-thumbnail wp-image-420" /></a><p class="wp-caption-text">Launch the application</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="netbeans" name="netbeans"></a>Using NetBeans</strong><br />
<strong></strong><br />
Using NetBeans and GWT is not very difficult. Here i am using NetBeans v6.7.1 . First open in the menu &#8220;<strong>Tools</strong>&#8220;->&#8221;<strong>Plugins</strong>&#8221; and install the <a href="http://gwt4nb.dev.java.net/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/gwt4nb.dev.java.net');">GWT4NB</a>-Plugin.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_423" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/10_netbeans_plugin.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/10_netbeans_plugin-150x150.png" alt="Install the NetBeans Plugin" title="Install the NetBeans Plugin" width="150" height="150" class="size-thumbnail wp-image-423" /></a><p class="wp-caption-text">Install the NetBeans Plugin</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Create a new &#8220;<strong>Web Application</strong>&#8220;-Project:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_425" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/11_webapp.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/11_webapp-150x150.png" alt="Web Application" title="Web Application" width="150" height="150" class="size-thumbnail wp-image-425" /></a><p class="wp-caption-text">Web Application</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Choose a directory for it:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_426" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/12_directory.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/12_directory-150x150.png" alt="Directory" title="Directory" width="150" height="150" class="size-thumbnail wp-image-426" /></a><p class="wp-caption-text">Directory</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Select a Server:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_427" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/13_server.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/13_server-150x150.png" alt="Server" title="Server" width="150" height="150" class="size-thumbnail wp-image-427" /></a><p class="wp-caption-text">Server</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Select the &#8220;<strong>Google Web Toolkit</strong>&#8220;-Framework in the next page and insert in the &#8220;<strong>GWT Module</strong>&#8220;-Textfield this: &#8220;<strong>eu.jdevelop.gwt.MyApp</strong>&#8220;. Notice the missing &#8220;<strong>client</strong>&#8220;-subpackage? It will be automatically created by the GWT4NB-Plugin.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_428" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/14_framework.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/14_framework-150x150.png" alt="GWT Framework" title="GWT Framework" width="150" height="150" class="size-thumbnail wp-image-428" /></a><p class="wp-caption-text">GWT Framework</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
After that you will see the created project from the GWT4NB-Plugin:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_429" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/15_netbeans_project.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/15_netbeans_project-150x150.png" alt="GWT4NB Project" title="GWT4NB Project" width="150" height="150" class="size-thumbnail wp-image-429" /></a><p class="wp-caption-text">GWT4NB Project</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
When you launch the application you can see that it is deployed into your previously selected Server:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_432" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/16_running_server.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/16_running_server-150x150.png" alt="Running in Tomcat" title="Running in Tomcat" width="150" height="150" class="size-thumbnail wp-image-432" /></a><p class="wp-caption-text">Running in Tomcat</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_433" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/17_chrome.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/17_chrome-150x150.png" alt="App in Chrome" title="App in Chrome" width="150" height="150" class="size-thumbnail wp-image-433" /></a><p class="wp-caption-text">App in Chrome</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Where is now the &#8220;<strong>hosted mode</strong>&#8221; ? To use it, only click on the <strong>Debug</strong>-Button in the menu. To use Ant-Targets you have to make some changes. First open the &#8220;<strong>project properties</strong>&#8221; and change the &#8220;<strong>web page folder</strong>&#8221; from &#8220;<strong>web</strong>&#8221; to &#8220;<strong>war</strong>&#8220;:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_434" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/18_war.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/18_war-150x150.png" alt="Change the directory" title="Change the directory" width="150" height="150" class="size-thumbnail wp-image-434" /></a><p class="wp-caption-text">Change the directory</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Open the file &#8220;<strong>build.xml</strong>&#8220;, located inside your GWT-Project (created in <a href="#project">Create the Project-files</a>):<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_436" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/19_original_buildxml.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/19_original_buildxml-150x150.png" alt="Original build.xml" title="Original build.xml" width="150" height="150" class="size-thumbnail wp-image-436" /></a><p class="wp-caption-text">Original build.xml</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Copy the content inside the &#8220;<strong>&lt;project&gt;&lt;/project&gt;</strong>&#8220;-tags and insert it into the &#8220;<strong>build.xml</strong>&#8220;-file, located in your NetBeans-Project directory:<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_437" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/20_changed_buildxml.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/20_changed_buildxml-150x150.png" alt="Changed build.xml" title="Changed build.xml" width="150" height="150" class="size-thumbnail wp-image-437" /></a><p class="wp-caption-text">Changed build.xml</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Replace all appearances of &#8220;<strong>src</strong>&#8221; with &#8220;<strong>src/java</strong>&#8220;, because source files are located in a different directory.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_440" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/21_replace_content.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/21_replace_content-150x150.png" alt="Search and replace" title="Search and replace" width="150" height="150" class="size-thumbnail wp-image-440" /></a><p class="wp-caption-text">Search and replace</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
You are now able to run the new ant targets &#8220;<strong>gwtc</strong>&#8221; and &#8220;<strong>hosted</strong>&#8220;:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_442" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/22_new_targets.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/22_new_targets-150x150.png" alt="new ant targets" title="new ant targets" width="150" height="150" class="size-thumbnail wp-image-442" /></a><p class="wp-caption-text">new ant targets</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
The last step is the integration of i18n. Copy the whole &#8220;<strong>&#8230;gwt-windows-1.7.1\MyProjectDirectory\src\eu\jdevelop\gwt\client\<em><span style="color: red">constants\</span></em></strong>&#8220;-directory into the corresponding directory of your NetBeans-project.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_445" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/23_i18n.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/23_i18n-150x150.png" alt="Copied content" title="Copied content" width="150" height="150" class="size-thumbnail wp-image-445" /></a><p class="wp-caption-text">Copied content</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Don&#8217;t forget to copy the file &#8220;<strong>MyLanguageConstants-i18n.cmd</strong>&#8220;, you need it to create the i18n-java-file! You have to open it in NetBeans and update the source-directory (there are two!) to &#8220;<strong>src/java</strong>&#8220;:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_446" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/24_i18nfile.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/24_i18nfile-150x150.png" alt="Edit the i18n-file" title="Edit the i18n-file" width="150" height="150" class="size-thumbnail wp-image-446" /></a><p class="wp-caption-text">Edit the i18n-file</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_448" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/25_netbeans_hostedmode.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/25_netbeans_hostedmode-150x150.png" alt="Hosted mode in NetBeans" title="Hosted mode in NetBeans" width="150" height="150" class="size-thumbnail wp-image-448" /></a><p class="wp-caption-text">Hosted mode in NetBeans</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="idea" name="idea"></a>Using IntelliJ IDEA</strong><br />
<strong></strong><br />
First create an empty directory (i am using &#8220;<strong>C:\Temp\IdeaGWT</strong>&#8221; in this example) and copy the contents from the created GWT-Project (&#8221;<strong>…gwt-windows-1.7.1\MyProjectDirectory</strong>&#8221; into it.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_451" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/26_ideagwt_directory.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/26_ideagwt_directory-150x150.png" alt="IDEA Project" title="IDEA Project" width="150" height="150" class="size-thumbnail wp-image-451" /></a><p class="wp-caption-text">IDEA Project</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Open IDEA (i am using version 8.1.3) and click on &#8220;<strong>Create New Project</strong>&#8220;. Select &#8220;<strong>Import project from external model</strong>&#8220;:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_452" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/27_create_project.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/27_create_project-150x150.png" alt="Import project" title="Import project" width="150" height="150" class="size-thumbnail wp-image-452" /></a><p class="wp-caption-text">Import project</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Follow now the next pictures and select the same options:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_453" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/28_select_eclipse.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/28_select_eclipse-150x150.png" alt="Select Eclipse" title="Select Eclipse" width="150" height="150" class="size-thumbnail wp-image-453" /></a><p class="wp-caption-text">Select Eclipse</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_454" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/29_eclipse_directory.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/29_eclipse_directory-150x150.png" alt="Eclipse directory" title="Eclipse directory" width="150" height="150" class="size-thumbnail wp-image-454" /></a><p class="wp-caption-text">Eclipse directory</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_455" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/30_choose_project.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/30_choose_project-150x150.png" alt="Choose project" title="Choose project" width="150" height="150" class="size-thumbnail wp-image-455" /></a><p class="wp-caption-text">Choose project</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_456" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/31_same_directory.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/31_same_directory-150x150.png" alt="Use the same directory" title="Use the same directory" width="150" height="150" class="size-thumbnail wp-image-456" /></a><p class="wp-caption-text">Use the same directory</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_457" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/32_created_idea_project.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/32_created_idea_project-150x150.png" alt="Created IDEA project" title="Created IDEA project" width="150" height="150" class="size-thumbnail wp-image-457" /></a><p class="wp-caption-text">Created IDEA project</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Open the &#8220;<strong>Edit configurations</strong>&#8220;-screen and create a new &#8220;<strong>Tomcat Server</strong>&#8220;-configuration:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_459" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/33_tomcat_server.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/33_tomcat_server-150x150.png" alt="Tomcat Server" title="Tomcat Server" width="150" height="150" class="size-thumbnail wp-image-459" /></a><p class="wp-caption-text">Tomcat Server</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Click on the &#8220;<strong>FIX</strong>&#8220;-Button and choose your deployment source:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_460" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/34_fix_button.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/34_fix_button-150x150.png" alt="Fix the problem" title="Fix the problem" width="150" height="150" class="size-thumbnail wp-image-460" /></a><p class="wp-caption-text">Fix the problem</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
You can now launch the Tomcat Server and see your Application working.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_461" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/35_launched.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/35_launched-150x150.png" alt="Launched Tomcat" title="Launched Tomcat" width="150" height="150" class="size-thumbnail wp-image-461" /></a><p class="wp-caption-text">Launched Tomcat</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_462" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/36_tomcat_chrome.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/36_tomcat_chrome-150x150.png" alt="Tomcat and Chrome 4" title="Tomcat and Chrome 4" width="150" height="150" class="size-thumbnail wp-image-462" /></a><p class="wp-caption-text">Tomcat and Chrome 4</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Where is now the hosted mode? This famous question can be answered! Open on the right side of IDEA the &#8220;<strong>Ant Build</strong>&#8220;-Panel and add the &#8220;<strong>build.xml</strong>&#8221; -file. You will see all Ant targets and there you can launch &#8220;<strong>hosted</strong>&#8220;.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_464" class="wp-caption aligncenter" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/11/37_hostedmode.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/11/37_hostedmode-150x150.png" alt="hosted mode target" title="hosted mode target" width="150" height="150" class="size-thumbnail wp-image-464" /></a><p class="wp-caption-text">hosted mode target</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
That&#8217;s it. If you have any improvements, drop a line below.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/create+project' rel='tag' target='_self'>create project</a>, <a class='technorati-link' href='http://technorati.com/tag/eclipse' rel='tag' target='_self'>eclipse</a>, <a class='technorati-link' href='http://technorati.com/tag/Google+Web+Toolkit' rel='tag' target='_self'>Google Web Toolkit</a>, <a class='technorati-link' href='http://technorati.com/tag/gwt' rel='tag' target='_self'>gwt</a>, <a class='technorati-link' href='http://technorati.com/tag/i18n' rel='tag' target='_self'>i18n</a>, <a class='technorati-link' href='http://technorati.com/tag/import' rel='tag' target='_self'>import</a>, <a class='technorati-link' href='http://technorati.com/tag/intellij+idea' rel='tag' target='_self'>intellij idea</a>, <a class='technorati-link' href='http://technorati.com/tag/NetBeans' rel='tag' target='_self'>NetBeans</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2009/11/11/create-a-gwt-application-from-scratch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Solve the circular reference problem with Guice and Spring</title>
		<link>http://blog.jdevelop.eu/2009/10/15/solve-the-circular-reference-problem-with-guice-and-spring/</link>
		<comments>http://blog.jdevelop.eu/2009/10/15/solve-the-circular-reference-problem-with-guice-and-spring/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 19:46:01 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[Guice]]></category>

		<category><![CDATA[Spring]]></category>

		<category><![CDATA[circular reference dependencies]]></category>

		<category><![CDATA[google guice]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/?p=382</guid>
		<description><![CDATA[&#160;&#160;


The problem

Just imagine you run into a case where two objects are dependent on each other. The following picture and code snippet shows one such relationship.

Server.java

public class Server {
  private final Client client;

  public Server(Client client) {
  	this.client = client;
  }
}



Client.java

public class Client {
  private final Server server;

  public [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jdevelop.eu/uploads/googlecode.png" />&nbsp;&nbsp;<img src="http://blog.jdevelop.eu/uploads/spring.gif" /><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.3em"><a title="problem" name="problem"></a>The problem</strong><br />
<strong></strong><br />
Just imagine you run into a case where two objects are dependent on each other. The following picture and code snippet shows one such relationship.<br />
<div id="attachment_385" class="wp-caption aligncenter" style="width: 280px"><a href="http://blog.jdevelop.eu/uploads/2009/10/problem.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/10/problem.png" alt="Circular reference problem" title="Circular reference problem" width="270" height="191" class="size-full wp-image-385" /></a><p class="wp-caption-text">Circular reference problem</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>Server.java</strong></p>
<pre class="syntax-highlight:java">
public class Server {
  private final Client client;

  public Server(Client client) {
  	this.client = client;
  }
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>Client.java</strong></p>
<pre class="syntax-highlight:java">
public class Client {
  private final Server server;

  public Client(Server server) {
  	this.server = server;
  }
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
Both <strong>Server</strong> and <strong>Client</strong> refer to the same instances of each other, using Constructor-Injection. <strong>Server</strong> refers to <strong>Client</strong>, which refers back to <strong>Server</strong> in a circle.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.3em"><a title="springsolution" name="springsolution"></a>The solution for Spring</strong><br />
<strong></strong><br />
As you can see, you can&#8217;t directly use constructor wiring to make circular referents point to one another. To break the circularity without affecting the overall semantic of interdependence, is to introduce a <strong>proxy</strong>. First you have to decouple the <strong>Server</strong> and <strong>Client</strong> with interfaces.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>Server.java</strong></p>
<pre class="syntax-highlight:java">
public interface Server{
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>Client.java</strong></p>
<pre class="syntax-highlight:java">
public interface Client {
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>ServerImpl.java</strong></p>
<pre class="syntax-highlight:java">
public class ServerImpl implements Server {
  private final Client client;

  public ServerImpl(Client client) {
  	this.client = client;
  }
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>ClientImpl.java</strong></p>
<pre class="syntax-highlight:java">
public class ClientImpl implements Client {
  private final Server server;

  public ClientImpl(Server server) {
  	this.server = server;
  }
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
The dependencies of <strong>ServerImpl</strong> and <strong>ClientImpl</strong> are now on a contract (interface) of each other, rather than a concrete class. This is where the <strong>proxy</strong> comes in:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>ServerProxy.java</strong></p>
<pre class="syntax-highlight:java">
public class ServerProxy implements Server {
  private Server delegate;

  public void setDelegate(Server delegate) {
    this.delegate = delegate;
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
The <strong>ServerProxy</strong> is wired with setter injection, allowing <strong>ServerImpl</strong> and <strong>ClientImpl</strong> to declare their fields immutable and use constructor injection.<br />
<a href="http://blog.jdevelop.eu/uploads/2009/10/solution.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/10/solution.png" alt="solution" title="solution" width="269" height="246" class="aligncenter size-full wp-image-395" /></a><br />
<strong><span style="text-decoration: underline"></span></strong><br />
This is the corresponding Spring-Configuration:<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>applicationContext.xml</strong></p>
<pre class="syntax-highlight:xml">
&lt;beans&gt;
		&lt;bean id=&quot;serverProxy&quot; class=&quot;ServerProxy&quot;&gt;
				&lt;property name=&quot;delegate&quot; ref=&quot;host&quot; /&gt;
	  &lt;/bean&gt;

	  &lt;bean id=&quot;server&quot; class=&quot;ServerImpl&quot;&gt;
				&lt;constructor-arg ref=&quot;client&quot;/&gt;
	  &lt;/bean&gt;

	  &lt;bean id=&quot;client&quot; class=&quot;ClientImpl&quot;&gt;
				&lt;constructor-arg ref=&quot;serverProxy&quot;/&gt;
	  &lt;/bean&gt;
&lt;/beans&gt;
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong style="font-size: 1.3em"><a title="guicesolution" name="guicesolution"></a>The solution for Guice</strong><br />
<strong></strong><br />
Solving the circular reference problem with Guice is similar to Spring. All you need is to configure your bindings.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong>MyModule.java</strong></p>
<pre class="syntax-highlight:java">
public class MyModule extends AbstractModule {

  @Override
  public void configure() {
    bind(Server.class).to(ServerImpl.class).in(Singleton.class);
    bind(Client.class).to(ClientImpl.class).in(Singleton.class);
  }
}
</pre>
<p><strong><span style="text-decoration: underline"></span></strong><br />
The Guice injector automatically provides the proxy so that the correct order of the construction would be guaranteed.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
That&#8217;s it <img src="http://blog.jdevelop.eu/uploads/smilies/smile.gif" alt="smile" /><br />
<strong></strong><br />
<strong></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/circular+reference+dependencies' rel='tag' target='_self'>circular reference dependencies</a>, <a class='technorati-link' href='http://technorati.com/tag/google+guice' rel='tag' target='_self'>google guice</a>, <a class='technorati-link' href='http://technorati.com/tag/Java' rel='tag' target='_self'>Java</a>, <a class='technorati-link' href='http://technorati.com/tag/Spring' rel='tag' target='_self'>Spring</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2009/10/15/solve-the-circular-reference-problem-with-guice-and-spring/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NetBeans RSS Reader - My first iPhone application released !</title>
		<link>http://blog.jdevelop.eu/2009/05/26/netbeans-rss-reader-my-first-iphone-application-released/</link>
		<comments>http://blog.jdevelop.eu/2009/05/26/netbeans-rss-reader-my-first-iphone-application-released/#comments</comments>
		<pubDate>Tue, 26 May 2009 13:12:50 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[NetBeans]]></category>

		<category><![CDATA[iPhone]]></category>

		<category><![CDATA[app store]]></category>

		<category><![CDATA[free app]]></category>

		<category><![CDATA[glassfish feed]]></category>

		<category><![CDATA[netbeans feed]]></category>

		<category><![CDATA[rss reader]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/?p=293</guid>
		<description><![CDATA[&#160;&#160;


I have developed and released my first iPhone Application in the iTunes-Store for free, it is an RSS Feed Reader for the following two feeds:

NetBeans.org
http://blogs.sun.com/theaquarium/

Now you can read the latest infos when you are on the road 


This application has the following functionalities:

Read the message-description inside the application
Open the message-url inside the application or with [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jdevelop.eu/uploads/2009/05/rsslogoohnehintergrund.png" alt="netbeansrssreaderlogo" title="netbeansrssreaderlogo" width="69" height="64" class="alignnone size-full wp-image-372" />&nbsp;&nbsp;<img src="http://blog.jdevelop.eu/uploads/2009/05/iphone.gif" alt="iphone" /><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
I have developed and released my first iPhone Application in the iTunes-Store for free, it is an RSS Feed Reader for the following two feeds:</p>
<ul>
<li>NetBeans.org</li>
<li>http://blogs.sun.com/theaquarium/</li>
</ul>
<p>Now you can read the latest infos when you are on the road <img src="http://blog.jdevelop.eu/uploads/smilies/smile.gif" alt="" /><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
This application has the following functionalities:</p>
<ul>
<li>Read the message-description inside the application</li>
<li>Open the message-url inside the application or with the safari browser</li>
<li>The possibility to the change the two Feed-URLs</li>
</ul>
<p><strong><span style="text-decoration: underline"></span></strong><br />
You can download this application for free&nbsp;&nbsp;<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=315960147" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/itunes.apple.com');"><img src="http://blog.jdevelop.eu/uploads/appstore.png" alt="" /></a><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Here are some screenshots<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_31x" class="wp-caption alignnone" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/05/das-programmicon.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/das-programmicon.jpg" alt="program icon" title="program icon" width="320" height="480" class="size-thumbnail wp-image-313" /></a><p class="wp-caption-text">Program Icon</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_351" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.jdevelop.eu/uploads/2009/05/der-netbeans-feed.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/der-netbeans-feed.jpg" alt="The NetBeans-Feed" title="The NetBeans-Feed" width="320" height="480" class="size-full wp-image-351" /></a><p class="wp-caption-text">The NetBeans-Feed</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_352" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.jdevelop.eu/uploads/2009/05/beschreibung-einer-nachricht-ansehen.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/beschreibung-einer-nachricht-ansehen.jpg" alt="Read the Message Description" title="Read the Message Description" width="320" height="480" class="size-full wp-image-352" /></a><p class="wp-caption-text">Read the Message Description</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_357" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.jdevelop.eu/uploads/2009/05/nachricht-wird-geladen.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/nachricht-wird-geladen.jpg" alt="Loading the News inside the app" title="Loading the News inside the app" width="320" height="480" class="size-full wp-image-357" /></a><p class="wp-caption-text">Loading News inside the app</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_358" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.jdevelop.eu/uploads/2009/05/nachricht-ist-geladen-in-der-anwendung.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/nachricht-ist-geladen-in-der-anwendung.jpg" alt="News loaded inside the app" title="News loaded inside the app" width="320" height="480" class="size-full wp-image-358" /></a><p class="wp-caption-text">News loaded inside the app</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_360" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.jdevelop.eu/uploads/2009/05/the-aquarium-feed-uebersicht.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/the-aquarium-feed-uebersicht.jpg" alt="The Aquarium Feed" title="The Aquarium Feed" width="320" height="480" class="size-full wp-image-360" /></a><p class="wp-caption-text">The Aquarium Feed</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_361" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.jdevelop.eu/uploads/2009/05/die-einstellungen.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/die-einstellungen.jpg" alt="The Settings View" title="The Settings View" width="320" height="480" class="size-full wp-image-361" /></a><p class="wp-caption-text">The Settings View</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_363" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.jdevelop.eu/uploads/2009/05/aendern-der-netbeans-feed-url.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/aendern-der-netbeans-feed-url.jpg" alt="Change Feed-URL" title="Change Feed-URL" width="320" height="480" class="size-full wp-image-363" /></a><p class="wp-caption-text">Change Feed-URL</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_364" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.jdevelop.eu/uploads/2009/05/restore-default-settings.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/restore-default-settings.jpg" alt="Restore default Settings" title="Restore default Settings" width="320" height="480" class="size-full wp-image-364" /></a><p class="wp-caption-text">Restore default Settings</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_365" class="wp-caption alignnone" style="width: 330px"><a href="http://blog.jdevelop.eu/uploads/2009/05/about-screen.jpg" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/about-screen.jpg" alt="About View" title="About View" width="320" height="480" class="size-full wp-image-365" /></a><p class="wp-caption-text">About View</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/app+store' rel='tag' target='_self'>app store</a>, <a class='technorati-link' href='http://technorati.com/tag/free+app' rel='tag' target='_self'>free app</a>, <a class='technorati-link' href='http://technorati.com/tag/glassfish+feed' rel='tag' target='_self'>glassfish feed</a>, <a class='technorati-link' href='http://technorati.com/tag/iPhone' rel='tag' target='_self'>iPhone</a>, <a class='technorati-link' href='http://technorati.com/tag/netbeans+feed' rel='tag' target='_self'>netbeans feed</a>, <a class='technorati-link' href='http://technorati.com/tag/rss+reader' rel='tag' target='_self'>rss reader</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2009/05/26/netbeans-rss-reader-my-first-iphone-application-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Create iPhone-apps with a Mac OS X VMware Machine</title>
		<link>http://blog.jdevelop.eu/2009/05/17/create-iphone-apps-with-a-mac-os-x-vmware-machine/</link>
		<comments>http://blog.jdevelop.eu/2009/05/17/create-iphone-apps-with-a-mac-os-x-vmware-machine/#comments</comments>
		<pubDate>Sun, 17 May 2009 13:57:45 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[iPhone]]></category>

		<category><![CDATA[apple]]></category>

		<category><![CDATA[apps]]></category>

		<category><![CDATA[developer]]></category>

		<category><![CDATA[interface builder]]></category>

		<category><![CDATA[leopard]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[os x]]></category>

		<category><![CDATA[sdk]]></category>

		<category><![CDATA[settings]]></category>

		<category><![CDATA[simulator]]></category>

		<category><![CDATA[virtual machine]]></category>

		<category><![CDATA[vista]]></category>

		<category><![CDATA[VMware]]></category>

		<category><![CDATA[windows]]></category>

		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/?p=297</guid>
		<description><![CDATA[&#160;&#160;&#160;


Normally you need an Apple Mac with the Leopard Operating System to program iPhone applications, but it is possible to do this with a Windows or Linux PC. All you need is to install Mac OS X 10.5.x in a Virtual Machine (i used VMware) and install there the iPhone SDK


You need at least 2 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jdevelop.eu/uploads/iphonesimulator.png" alt="" />&nbsp;&nbsp;&nbsp;<img src="http://blog.jdevelop.eu/uploads/vmware.png" alt="" /><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong></p>
<p>Normally you need an <a href="http://www.apple.com/de/mac/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.apple.com');">Apple Mac</a> with the <a href="http://www.apple.com/de/macosx/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.apple.com');">Leopard Operating System</a> to program iPhone applications, but it is possible to do this with a Windows or Linux PC. All you need is to install Mac OS X 10.5.x in a Virtual Machine (i used VMware) and install there the <a href="http://developer.apple.com/iphone/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/developer.apple.com');">iPhone SDK</a><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_313" class="wp-caption alignnone" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/05/iphonesdk.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/iphonesdk-150x150.png" alt="iPhone SDK" title="iPhone SDK" width="150" height="150" class="size-thumbnail wp-image-313" /></a><p class="wp-caption-text">iPhone SDK</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
You need at least 2 GB RAM and 30 GB HDD for the Virtual Machine. The Host-CPU should be a Dual Core with 2 GHz or OS X would run very slowly.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
The following screenshots are taken from my Sony Notebook with Windows Vista (1600&#215;900 Resolution), where i programmed my first iPhone app, a NetBeans RSS Feed Reader. </p>
<p><strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_304" class="wp-caption alignnone" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_einstellungen.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_einstellungen-150x150.png" alt="VMware Settings" title="VMware Settings" width="150" height="150" class="size-thumbnail wp-image-304" /></a><p class="wp-caption-text">VMware Settings</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_306" class="wp-caption alignnone" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_launching.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_launching-150x150.png" alt="Launching Mac OS X" title="Launching Mac OS X" width="150" height="150" class="size-thumbnail wp-image-306" /></a><p class="wp-caption-text">Launching Mac OS X</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_308" class="wp-caption alignnone" style="width: 410px"><a href="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_fullscreen.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_fullscreen-150x150.png" alt="VMware running in Fullscreen (1440x900)" title="VMware running in Fullscreen (1440x900)" width="150" height="150" class="size-thumbnail wp-image-308" /></a><p class="wp-caption-text">VMware running in Fullscreen (1440x900)</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_315" class="wp-caption alignnone" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_running.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_running-150x150.png" alt="Safari Browser" title="Safari Browser" width="150" height="150" class="size-thumbnail wp-image-315" /></a><p class="wp-caption-text">Safari Browser</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_317" class="wp-caption alignnone" style="width: 160px"><a href="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_xcode_launching.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_xcode_launching-150x150.png" alt="Launching XCode 3.1" title="Launching XCode 3.1" width="150" height="150" class="size-thumbnail wp-image-317" /></a><p class="wp-caption-text">Launching XCode 3.1</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_319" class="wp-caption alignnone" style="width: 460px"><a href="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_interface_builder.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_interface_builder-150x150.png" alt="The Interface Builder for iPhone apps" title="The Interface Builder for iPhone apps" width="150" height="150" class="size-thumbnail wp-image-319" /></a><p class="wp-caption-text">The Interface Builder for iPhone apps</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_322" class="wp-caption alignnone" style="width: 460px"><a href="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_xcode_nbrssreader.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_xcode_nbrssreader-150x150.png" alt="Opened XCode Project &quot;NetBeans RSS Reader&quot;" title="Open XCode Project &quot;NetBeans RSS Reader&quot;" width="150" height="150" class="size-thumbnail wp-image-322" /></a><p class="wp-caption-text">Opened XCode Project 'NetBeans RSS Reader'</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<div id="attachment_325" class="wp-caption alignnone" style="width: 360px"><a href="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_iphone_simulator_with_nbrssreader.png" target="_blank"><img src="http://blog.jdevelop.eu/uploads/2009/05/vmware_macosx_iphone_simulator_with_nbrssreader-150x150.png" alt="iPhone Simulator with running app" title="iPhone Simulator with running app" width="150" height="150" class="size-thumbnail wp-image-325" /></a><p class="wp-caption-text">iPhone Simulator with running app</p></div><br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/apple' rel='tag' target='_self'>apple</a>, <a class='technorati-link' href='http://technorati.com/tag/apps' rel='tag' target='_self'>apps</a>, <a class='technorati-link' href='http://technorati.com/tag/developer' rel='tag' target='_self'>developer</a>, <a class='technorati-link' href='http://technorati.com/tag/interface+builder' rel='tag' target='_self'>interface builder</a>, <a class='technorati-link' href='http://technorati.com/tag/iPhone' rel='tag' target='_self'>iPhone</a>, <a class='technorati-link' href='http://technorati.com/tag/leopard' rel='tag' target='_self'>leopard</a>, <a class='technorati-link' href='http://technorati.com/tag/mac' rel='tag' target='_self'>mac</a>, <a class='technorati-link' href='http://technorati.com/tag/os+x' rel='tag' target='_self'>os x</a>, <a class='technorati-link' href='http://technorati.com/tag/sdk' rel='tag' target='_self'>sdk</a>, <a class='technorati-link' href='http://technorati.com/tag/settings' rel='tag' target='_self'>settings</a>, <a class='technorati-link' href='http://technorati.com/tag/simulator' rel='tag' target='_self'>simulator</a>, <a class='technorati-link' href='http://technorati.com/tag/virtual+machine' rel='tag' target='_self'>virtual machine</a>, <a class='technorati-link' href='http://technorati.com/tag/vista' rel='tag' target='_self'>vista</a>, <a class='technorati-link' href='http://technorati.com/tag/VMware' rel='tag' target='_self'>VMware</a>, <a class='technorati-link' href='http://technorati.com/tag/windows' rel='tag' target='_self'>windows</a>, <a class='technorati-link' href='http://technorati.com/tag/xcode' rel='tag' target='_self'>xcode</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2009/05/17/create-iphone-apps-with-a-mac-os-x-vmware-machine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>An easy way to connect JSF with Adobe FLEX</title>
		<link>http://blog.jdevelop.eu/2009/02/03/an-easy-way-to-connect-jsf-with-adobe-flex/</link>
		<comments>http://blog.jdevelop.eu/2009/02/03/an-easy-way-to-connect-jsf-with-adobe-flex/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 15:54:37 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[JSF/MyFaces/Facelets]]></category>

		<category><![CDATA[adobe flex]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[connect]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[javaserver faces]]></category>

		<category><![CDATA[jsf]]></category>

		<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/?p=267</guid>
		<description><![CDATA[ 


Using Adobe Flex together with other technologys like JavaServer Faces, Struts or Spring Web Flow is not an easy task, because the embedded Flash-file interacts in its own world and from the sight of its surrounding JSF/JSP/HTML-Code, it is an foreign object. There exists some approaches to connect these different worlds like the jsf-flex [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jdevelop.eu/uploads/flex.png" alt="" /> <img src="http://blog.jdevelop.eu/uploads/jsflogo.png" alt="" /><br />
<strong></strong><br />
<strong></strong><br />
Using Adobe Flex together with other technologys like JavaServer Faces, Struts or Spring Web Flow is not an easy task, because the embedded Flash-file interacts in its own world and from the sight of its surrounding JSF/JSP/HTML-Code, it is an foreign object. There exists some approaches to connect these different worlds like the <a href="http://code.google.com/p/jsf-flex/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">jsf-flex project</a> or the <a href="http://www.exadel.com/web/portal/fiji" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.exadel.com');">Exadel Fiji</a>.<br />
<strong></strong><br />
I am now showing you an another way, how you can connect Flex with JavaServer Faces. You are able to develop each Project (Flex and Java) separately.<br />
<strong></strong><br />
<strong></strong><br />
Let&#8217;s take a look at this picture (click on the picture to enlarge it):<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/02/bild1.png" target="_blank"><img class="alignnone size-thumbnail wp-image-273" title="bild1" src="http://blog.jdevelop.eu/uploads/2009/02/bild1-150x150.png" alt="bild1" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
This is what we have. JSF-Code with an embedded Flex-Object. You can insert the <em>firstname</em> and the <em>lastname</em> with JSF-inputText -Fields, and the fields <em>city</em> and <em>country</em> with Flex. If you click <em>submit</em>, alle four values are saved inside the managed-bean.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/02/bild2.png" target="_blank"><img class="alignnone size-thumbnail wp-image-274" title="bild2" src="http://blog.jdevelop.eu/uploads/2009/02/bild2-150x150.png" alt="bild2" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
Ok how is this possible? The solution is JavaScript! In some few words - if you enter some values for the <em>city</em> and <em>country</em> inside the Flash-Object, the ActionScript code is writing these values into JavaScript-Variables (which are declared in the JSF Code). If you hit <em>submit</em>, a JavaScript-Function is writing the values into the hidden tomahawk-inputFields which are bonded to the corresponding managed-bean (<em>Page1Bean</em>).<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/02/jsfwithflexdiagram.png" target="_blank"><img class="alignnone size-thumbnail wp-image-272" title="jsfwithflexdiagram" src="http://blog.jdevelop.eu/uploads/2009/02/jsfwithflexdiagram-150x150.png" alt="jsfwithflexdiagram" width="150" height="150" /></a> <a href="http://blog.jdevelop.eu/uploads/2009/02/bild4.png" style="margin-left:30px;" target="_blank"><img class="alignnone size-thumbnail wp-image-285" title="bild4" src="http://blog.jdevelop.eu/uploads/2009/02/bild4-150x150.png" alt="bild4" width="150" height="150" /></a><a href="http://blog.jdevelop.eu/uploads/2009/02/bild3.png" style="margin-left:30px" target="_blank"><img class="alignnone size-thumbnail wp-image-279" title="bild3" src="http://blog.jdevelop.eu/uploads/2009/02/bild3-150x150.png" alt="bild3" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
In ActionScript, you have to extend the class <em>Proxy</em> and overwrite <em>flash_proxy function setProperty(..)</em>. You can see this here:<br />
<strong></strong><br />
<strong>JSVariableProxy.as</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.blog.jsfandflex
{
	import flash.external.ExternalInterface;
	import flash.utils.Proxy;
	import flash.utils.flash_proxy;

	public dynamic class JavascriptVariableProxy extends Proxy
	{

		/**
		 * The method that's invoked when a property is set on this object. Passes the variable through
		 * to the javascript environment.
		 *
		 * @private
		 */
		override flash_proxy function setProperty(name:*, value:*):void
		{
			ExternalInterface.call(&quot;function() { &quot; + name + &quot; = '&quot; + value.toString() + &quot;'; }&quot;);
		}

	}
}
</pre>
<p><strong></strong><br />
You can call the function like this:<br />
<strong></strong><br />
<strong>JSFandFlex.mxml</strong></p>
<pre class="syntax-highlight:xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!--
	JSF and FLEX
	@author Siegfried Bolz
--&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; color=&quot;#FFFFFF&quot; layout=&quot;absolute&quot; borderColor=&quot;#FDFEFF&quot; backgroundGradientAlphas=&quot;[1.0, 1.0]&quot; backgroundGradientColors=&quot;[#205CF6, #01013D]&quot; width=&quot;400&quot; height=&quot;242&quot;&gt;

	&lt;mx:Script&gt;
		&lt;![CDATA[
			import eu.jdevelop.blog.jsfandflex.JavascriptVariableProxy;

			/**
			 * Write content from TextField into JavaScript-Variable which can be
			 * accessed by JSF.
			 */
			private function writeJavascriptVariable(jVariable:String, text:String):void
			{
				var proxy : JavascriptVariableProxy = new JavascriptVariableProxy();
				proxy[jVariable] = text;
			}
		]]&gt;
	&lt;/mx:Script&gt;	

	&lt;mx:Label x=&quot;149&quot; y=&quot;24&quot; text=&quot;JSF and Flex&quot; fontSize=&quot;14&quot; fontWeight=&quot;bold&quot;/&gt;
	&lt;mx:Label x=&quot;31&quot; y=&quot;79&quot; text=&quot;Insert some data&quot; fontWeight=&quot;bold&quot; fontSize=&quot;11&quot;/&gt;
	&lt;mx:Label x=&quot;31&quot; y=&quot;109&quot; text=&quot;City&quot; fontWeight=&quot;bold&quot;/&gt;
	&lt;mx:TextInput x=&quot;31&quot; y=&quot;125&quot; id=&quot;txtCity&quot; change=&quot;writeJavascriptVariable('city',txtCity.text)&quot; color=&quot;#000000&quot;/&gt;
	&lt;mx:Label x=&quot;31&quot; y=&quot;167&quot; text=&quot;Country&quot; fontWeight=&quot;bold&quot;/&gt;
	&lt;mx:TextInput x=&quot;31&quot; y=&quot;184&quot; id=&quot;txtCountry&quot; change=&quot;writeJavascriptVariable('country',txtCountry.text)&quot; color=&quot;#000000&quot;/&gt;

&lt;/mx:Application&gt;
</pre>
<p><strong></strong><br />
In Java, insert the whole Flex Code into the JSF file, add some JavaScript-Variables (<em>city</em> and <em>country</em>) and map them to the ActionScript-Code. Don&#8217;t forget to write the content of these Variables into the hidden inputFields when the <em>submit</em> is executed.<br />
<strong></strong><br />
As you can see, it is possible to create JSF-Projects which are using the advantages of the Flex Technology. Try it and design astounding Web-GUIs with Adobe Flex and use the power of JSF (or something else) in the backend.<br />
<strong></strong><br />
<strong></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/actionscript' rel='tag' target='_self'>actionscript</a>, <a class='technorati-link' href='http://technorati.com/tag/adobe+flex' rel='tag' target='_self'>adobe flex</a>, <a class='technorati-link' href='http://technorati.com/tag/connect' rel='tag' target='_self'>connect</a>, <a class='technorati-link' href='http://technorati.com/tag/javascript' rel='tag' target='_self'>javascript</a>, <a class='technorati-link' href='http://technorati.com/tag/javaserver+faces' rel='tag' target='_self'>javaserver faces</a>, <a class='technorati-link' href='http://technorati.com/tag/jsf' rel='tag' target='_self'>jsf</a>, <a class='technorati-link' href='http://technorati.com/tag/NetBeans' rel='tag' target='_self'>NetBeans</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2009/02/03/an-easy-way-to-connect-jsf-with-adobe-flex/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Create Flex Applications with NetBeans 6.5 and FlexBean</title>
		<link>http://blog.jdevelop.eu/2009/01/30/create-flex-applications-with-netbeans-65-and-flexbean/</link>
		<comments>http://blog.jdevelop.eu/2009/01/30/create-flex-applications-with-netbeans-65-and-flexbean/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 22:36:58 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[NetBeans]]></category>

		<category><![CDATA[adobe flex]]></category>

		<category><![CDATA[adobe]]></category>

		<category><![CDATA[flex]]></category>

		<category><![CDATA[flexbean]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[servlet]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/?p=227</guid>
		<description><![CDATA[

In this Blog i will show you how to develop Adobe Flex Applications with the NetBeans 6.5 IDE. The used plugin FlexBean is still under development by Arnaud Vincent . Many features are missing in the Version 1.0.1 used in this Blog, for example syntax highlighting and a GUI-Designer.


Please note:
I have contributed this blog to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jdevelop.eu/uploads/flex.png" alt="" /><img src="http://blog.jdevelop.eu/uploads/netbeanslogo.gif" alt="" /><img src="http://blog.jdevelop.eu/uploads/flexbean.jpg" alt="" /><br />
<strong></strong><br />
In this Blog i will show you how to develop Adobe Flex Applications with the NetBeans 6.5 IDE. The used plugin <a href="http://sourceforge.net/projects/flexbean/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/sourceforge.net');">FlexBean</a> is still under development by Arnaud Vincent . Many features are missing in the Version 1.0.1 used in this Blog, for example syntax highlighting and a GUI-Designer.<br />
<strong></strong><br />
<strong></strong><br />
<span style="color: red; font-size: 1.3em">Please note:</span><br />
I have contributed this blog to the <a href="http://wiki.netbeans.org/FlexApplicationsWithNetBeans" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/wiki.netbeans.org');">NetBeans Community</a>.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Table of contents<br />
<strong></strong></p>
<ul>
<li><a href="#Introduction">Introduction</a></li>
<li><a href="#FlexBean">FlexBean Plugin</a></li>
<li><a href="#Flex">Create the Flex Application</a></li>
<li><a href="#Servlet">Java Servlet</a></li>
<li><a href="#Start">Start the Application</a></li>
<li><a href="#Downloads">Downloads</a></li>
</ul>
<p><strong></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="Introduction" name="Introduction"></a>Introduction</strong><br />
<strong></strong><br />
In this &#8220;proof-of-concept&#8221; you will create a Flex Application which sends Login-Data to a Java-Servlet (also created with NetBeans 6.5). The Servlet returns an answer which will be interpreted by the Flex Application. It is a <strong>very simple</strong> Application, you should only see how easy it is to go productive with FlexBean.<br />
<strong></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="Flex-bean" name="FlexBean"></a>FlexBean Plugin</strong><br />
<strong></strong><br />
Before you can create Flex Applications with NetBeans, you have to install the <a href="http://sourceforge.net/projects/flexbean/" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/sourceforge.net');">FlexBean Plugin</a>. Follow the <a href="http://sourceforge.net/project/platformdownload.php?group_id=226609" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/sourceforge.net');">Instructions</a> for the Installation.<br />
<strong></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="Flex" name="Flex"></a>Create the Flex Application</strong><br />
<strong></strong><br />
Create a new &#8220;Flex Application&#8221;-Project.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild1.png" target="_blank"><img class="alignnone size-thumbnail wp-image-235" title="bild1" src="http://blog.jdevelop.eu/uploads/2009/01/bild1-150x150.png" alt="bild1" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
Name the Project &#8220;<strong>SimpleFlexApp</strong>&#8221; and hit &#8220;<em>Finish</em>&#8220;.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild2.png" target="_blank"><img class="alignnone size-thumbnail wp-image-237" title="bild2" src="http://blog.jdevelop.eu/uploads/2009/01/bild2-150x150.png" alt="bild2" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
You see now the new Project with the opened MXML-File.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild3.png" target="_blank"><img class="alignnone size-thumbnail wp-image-239" title="bild3" src="http://blog.jdevelop.eu/uploads/2009/01/bild3-150x150.png" alt="bild3" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
Replace the Content of &#8220;<strong>Main.mxml</strong>&#8221; with this Code:<br />
<strong></strong><br />
<strong></strong><br />
<strong>Main.mxml</strong></p>
<pre class="syntax-highlight:xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- Simple Flex App which sends login-data to a Servlet
	 located at: http://localhost:8084//simplelogin/loginservlet

	 @author Siegfried Bolz
--&gt;

&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; applicationComplete=&quot;&quot; color=&quot;#FFFFFF&quot; layout=&quot;absolute&quot; borderColor=&quot;#FDFEFF&quot; backgroundGradientAlphas=&quot;[1.0, 1.0]&quot; backgroundGradientColors=&quot;[#205CF6, #01013D]&quot; width=&quot;400&quot; height=&quot;300&quot;&gt;

	&lt;mx:Script&gt;
		&lt;![CDATA[

			import mx.events.ValidationResultEvent;
			import mx.controls.Alert;
 			import mx.rpc.events.FaultEvent;
         	import mx.rpc.events.ResultEvent;

			private function validateID(event:MouseEvent):Boolean{
				 if (idValidator.validate().type == ValidationResultEvent.VALID) {
				 	return true;
			     } else{
				 	Alert.show(&quot;Please insert an ID !&quot;);
				 	return false;
				 }
			}

			private function validatePassword(event:MouseEvent):Boolean {
				 if (passValidator.validate().type == ValidationResultEvent.VALID){
				 	return true;
			     } else{
				 	Alert.show(&quot;Please insert a Password !&quot;);
				 	return false;
				 }
			}

			private function checkLoginData(event:MouseEvent):void {
			     if (validateID(event)==true &amp;&amp; validatePassword(event)==true) {
			 		submitLoginData(txtID.text,txtPassword.text);
			 	 }
			}

			private function submitLoginData(id:String, password:String):void {
				lblError.visible = false;
				var login:LoginVO = new LoginVO(id,password);
				loginService.cancel();
				loginService.send(login);
			}

			private function onResult(event:ResultEvent):void{
				var resultObj:Object = event.result;
			 	var result:String = resultObj.message;

			 	if (result==&quot;true&quot;) {
			 		Alert.show('Login successful!');
			 	} else {
			 		Alert.show('Login denied!');
			 	}

			}

	        private function serverFault(evt:FaultEvent):void {
				lblError.visible = true;
	        }

		]]&gt;
	&lt;/mx:Script&gt;

    &lt;!-- Connection to the Server --&gt;
    &lt;mx:HTTPService id=&quot;loginService&quot; useProxy=&quot;false&quot; method=&quot;POST&quot; resultFormat=&quot;object&quot;
    	url=&quot;http://localhost:8084//simplelogin/loginservlet&quot; result=&quot;onResult(event)&quot;
    	fault=&quot;serverFault(event);&quot; /&gt;

   	&lt;!-- Validators --&gt;
    &lt;mx:StringValidator id=&quot;idValidator&quot; source=&quot;{txtID}&quot; property=&quot;text&quot; triggerEvent=&quot;&quot;/&gt;
    &lt;mx:StringValidator id=&quot;passValidator&quot; source=&quot;{txtPassword}&quot; property=&quot;text&quot; triggerEvent=&quot;&quot;/&gt;

    &lt;!-- GUI Elements --&gt;
    &lt;mx:Label text=&quot;Please insert your Login data&quot; fontWeight=&quot;bold&quot; x=&quot;122.5&quot; y=&quot;32&quot; fontSize=&quot;12&quot;/&gt;
    &lt;mx:Label text=&quot;ID&quot; x=&quot;72&quot; y=&quot;71&quot; fontSize=&quot;11&quot; fontWeight=&quot;bold&quot;/&gt;
    &lt;mx:Label text=&quot;Password&quot; x=&quot;72&quot; y=&quot;129&quot; fontSize=&quot;11&quot; fontWeight=&quot;bold&quot;/&gt;
    &lt;mx:TextInput x=&quot;72&quot; y=&quot;87&quot; editable=&quot;true&quot; color=&quot;#010000&quot; id=&quot;txtID&quot;/&gt;
    &lt;mx:TextInput x=&quot;72&quot; y=&quot;144&quot; color=&quot;#020000&quot; displayAsPassword=&quot;true&quot; id=&quot;txtPassword&quot; editable=&quot;true&quot;/&gt;
    &lt;mx:Button x=&quot;72&quot; y=&quot;195&quot; label=&quot;Submit&quot; id=&quot;cmdSubmit&quot; click=&quot;checkLoginData(event)&quot;/&gt;
    &lt;mx:Label x=&quot;72&quot; y=&quot;242&quot; text=&quot;Error, wrong login data!&quot; width=&quot;222&quot; id=&quot;lblError&quot; color=&quot;#FF0000&quot; fontSize=&quot;16&quot; fontWeight=&quot;bold&quot; visible=&quot;false&quot;/&gt;

&lt;/mx:Application&gt;
</pre>
<p><strong></strong><br />
Create a new ActionScript-File, name it &#8220;<strong>LoginVO</strong>&#8221; and paste this code into it:<br />
<strong></strong><br />
<strong></strong><br />
<strong>LoginVO.as</strong></p>
<pre class="syntax-highlight:xml">
/**
 * Transfer-Object for the HTTPService-call.
 *
 * @author Siegfried Bolz
 */
package
{
	public class LoginVO {

		public var id:String;
		public var password:String;

		// Konstruktor
		public function LoginVO(id:String,password:String) {

			this.id = id;
			this.password = password;

		}

	}
}
</pre>
<p><strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild5a1.png" target="_blank"><img class="alignnone size-thumbnail wp-image-242" title="bild5a1" src="http://blog.jdevelop.eu/uploads/2009/01/bild5a1-150x150.png" alt="bild5a1" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
Your Project have to look like this:<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild4.png" target="_blank"><img class="alignnone size-thumbnail wp-image-240" title="bild4" src="http://blog.jdevelop.eu/uploads/2009/01/bild4-150x150.png" alt="bild4" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
Build the Project to see that everything is working.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild5c.png" target="_blank"><img class="alignnone size-thumbnail wp-image-244" title="bild5c" src="http://blog.jdevelop.eu/uploads/2009/01/bild5c-150x150.png" alt="bild5c" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
If you get this error: &#8220;<strong style="color: red">Error: could not find a JVM</strong>&#8220;:<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild5d.png" target="_blank"><img class="alignnone size-thumbnail wp-image-246" title="bild5d" src="http://blog.jdevelop.eu/uploads/2009/01/bild5d-150x150.png" alt="bild5d" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
your Flex SDK Configuration File is invalid. Open the file &#8220;<strong>jvm.config</strong>&#8221; located in your &#8220;<strong>&lt;SDK&gt;/BIN</strong>&#8221; -directory and check that the variable &#8220;<strong>java.home=</strong>&#8221; is set to a valid Java JRE directory (remove the last slash!). Here is an example:<br />
<strong></strong></p>
<pre class="syntax-highlight:xml">
java.home=C:/Program Files/Java/jre1.6.0_07
</pre>
<p><strong></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="Servlet" name="Servlet"></a>Java Servlet</strong><br />
<strong></strong><br />
Create a new Java Web Application Project, name it &#8220;<strong>SimpleLogin</strong>&#8221; and add a Servlet (LoginServlet.java) with URL-Pattern &#8220;<strong>/loginservlet</strong>&#8220;.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild5b.png" target="_blank"><img class="alignnone size-thumbnail wp-image-249" title="bild5b" src="http://blog.jdevelop.eu/uploads/2009/01/bild5b-150x150.png" alt="bild5b" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
Paste this Code into the file:<br />
<strong></strong><br />
<strong>LoginServlet.java</strong></p>
<pre class="syntax-highlight:java">
package eu.jdevelop.blog.flexbean;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Login Servlet
 *
 * @author Siegfried Bolz
 */
public class LoginServlet extends HttpServlet {

    /**
     * Processes requests for both HTTP &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt; methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType(&quot;text/html;charset=UTF-8&quot;);
        PrintWriter out = response.getWriter();
        try {

            String id = request.getParameter(&quot;id&quot;);
            String password = request.getParameter(&quot;password&quot;);

            System.out.println(&quot;received data from the Flex Application: id=&quot; + id + &quot; password=&quot; + password);

            if (id==null || password==null) {
                out.println(&quot;&lt;message&gt;false&lt;/message&gt;&quot;);
            } else {
                out.println(&quot;&lt;message&gt;true&lt;/message&gt;&quot;);
            }

        } catch (Exception x) {
            System.out.println(&quot;Error: &quot; + x.getMessage());
        } finally {
            out.close();
        }
    } 

    // &lt;editor-fold defaultstate=&quot;collapsed&quot; desc=&quot;HttpServlet methods. Click on the + sign on the left to edit the code.&quot;&gt;
    /**
     * Handles the HTTP &lt;code&gt;GET&lt;/code&gt; method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    } 

    /**
     * Handles the HTTP &lt;code&gt;POST&lt;/code&gt; method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return &quot;Short description&quot;;
    }// &lt;/editor-fold&gt;

}
</pre>
<p><strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild6.png" target="_blank"><img class="alignnone size-thumbnail wp-image-250" title="bild6" src="http://blog.jdevelop.eu/uploads/2009/01/bild6-150x150.png" alt="bild6" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="Start" name="Start"></a>Start the Application</strong><br />
<strong></strong><br />
First start the Java Servlet and than the Flex Application.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild7.png" target="_blank"><img class="alignnone size-thumbnail wp-image-253" title="bild7" src="http://blog.jdevelop.eu/uploads/2009/01/bild7-150x150.png" alt="bild7" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
The Flash Player opens.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild8.png" target="_blank"><img class="alignnone size-thumbnail wp-image-254" title="bild8" src="http://blog.jdevelop.eu/uploads/2009/01/bild8-150x150.png" alt="bild8" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
Insert some data and click on &#8220;<strong>Submit</strong>&#8221; to send the input to the Java Servlet.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild9.png" target="_blank"><img class="alignnone size-thumbnail wp-image-255" title="bild9" src="http://blog.jdevelop.eu/uploads/2009/01/bild9-150x150.png" alt="bild9" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
If the connection is set up alright (check the <em>HTTPService</em> in &#8220;<em>Main.mxml</em>&#8220;) you will receive a positive answer.<br />
<strong></strong><br />
<a href="http://blog.jdevelop.eu/uploads/2009/01/bild10.png" target="_blank"><img class="alignnone size-thumbnail wp-image-256" title="bild10" src="http://blog.jdevelop.eu/uploads/2009/01/bild10-150x150.png" alt="bild10" width="150" height="150" /></a><br />
<strong></strong><br />
<strong></strong><br />
As you can see, it is possible to work with NetBeans in the Flex Environment, but there are many improvements necessary to replace the Adobe Flex Builder with the FlexBean-Plugin. Arnaud Vincent has enriched the NetBeans-Community with a new way, how NetBeans can be used for the Development today. It shows how flexible the NetBeans-Platform is, to fit the needs of the future.<br />
<strong></strong><br />
<strong></strong><br />
<strong style="font-size: 1.3em"><a title="Downloads" name="Downloads"></a>Downloads</strong><br />
<strong></strong><br />
NetBeans 6.5 Flex Project: <a href="http://blog.jdevelop.eu/downloads/flexbean/SimpleFlexApp_NetBeans65.zip" target="_blank" onclick="javascript:pageTracker._trackPageview ('/downloads/zip/simpleflexapp_netbeans65.zip');">download</a><br />
NetBeans 6.5 Java Servlet Project: <a href="http://blog.jdevelop.eu/downloads/flexbean/SimpleLogin_NetBeans65.zip" target="_blank" onclick="javascript:pageTracker._trackPageview ('/downloads/zip/simplelogin_netbeans65.zip');">download</a><br />
Adobe Flex Builder 3 Project: <a href="http://blog.jdevelop.eu/downloads/flexbean/SimpleFlexApp_Flex.zip" target="_blank" onclick="javascript:pageTracker._trackPageview ('/downloads/zip/simpleflexapp_flex.zip');">download</a><br />
<strong></strong><br />
<strong></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/adobe' rel='tag' target='_self'>adobe</a>, <a class='technorati-link' href='http://technorati.com/tag/flex' rel='tag' target='_self'>flex</a>, <a class='technorati-link' href='http://technorati.com/tag/flexbean' rel='tag' target='_self'>flexbean</a>, <a class='technorati-link' href='http://technorati.com/tag/Java' rel='tag' target='_self'>Java</a>, <a class='technorati-link' href='http://technorati.com/tag/NetBeans' rel='tag' target='_self'>NetBeans</a>, <a class='technorati-link' href='http://technorati.com/tag/servlet' rel='tag' target='_self'>servlet</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2009/01/30/create-flex-applications-with-netbeans-65-and-flexbean/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Useful books for learning SAP NetWeaver</title>
		<link>http://blog.jdevelop.eu/2008/10/22/useful-books-for-learning-sap-netweaver/</link>
		<comments>http://blog.jdevelop.eu/2008/10/22/useful-books-for-learning-sap-netweaver/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 20:29:29 +0000</pubDate>
		<dc:creator>Siegfried Bolz</dc:creator>
		
		<category><![CDATA[SAP]]></category>

		<category><![CDATA[abap]]></category>

		<category><![CDATA[adobe flex]]></category>

		<category><![CDATA[books]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[netweaver]]></category>

		<category><![CDATA[nwds]]></category>

		<category><![CDATA[portal]]></category>

		<category><![CDATA[sap press]]></category>

		<category><![CDATA[visual composer]]></category>

		<category><![CDATA[web dynpro]]></category>

		<category><![CDATA[xapps]]></category>

		<guid isPermaLink="false">http://blog.jdevelop.eu/2008/10/22/useful-books-for-learning-sap-netweaver/</guid>
		<description><![CDATA[

On my stressful way learning how to be a great SAP NetWeaver Developer, i am reading many books and online-tutorials. In this blog i want to show you some good books which i recommend. All books are available in German too.


SAP NetWeaver: The Official Guide

Link to SAP Press

All you want to know about SAP NetWeaver [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jdevelop.eu/uploads/sapnetweaverlogo.png" /><br />
<strong><span style="text-decoration: underline"></span></strong><br />
On my stressful way learning how to be a great <strong>SAP NetWeaver Developer</strong>, i am reading many books and online-tutorials. In this blog i want to show you some good books which i recommend. All books are available in German too.<br />
<span style="text-decoration: underline"></span><br />
<span style="text-decoration: underline"></span></p>
<h3>SAP NetWeaver: The Official Guide</h3>
<p><img src="http://blog.jdevelop.eu/uploads/book_sapnetweaverog.gif" /><br />
<a href="https://ssl.galileo-press.de/international?titelID=1734" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/ssl.galileo-press.de');">Link to SAP Press</a><br />
<strong><span style="text-decoration: underline"></span></strong><br />
All you want to know about SAP NetWeaver can you read in this book, it is a <u>must</u> for beginners. Learn on 4 detailed Customer examples which technologies can be included in NetWeaver. This book is mostly theoretically, there is no difficult program code included. If you want to program stuff for SAP NetWeaver, first read this book to understand what NetWeaver can do.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong></p>
<h3>Developer’s Guide to SAP NetWeaver Portal Applications</h3>
<p><img src="http://blog.jdevelop.eu/uploads/book_sapnetweaverportalapp.gif" /><br />
<a href="https://ssl.galileo-press.de/international?titelID=1847" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/ssl.galileo-press.de');">Link to SAP Press</a><br />
<strong><span style="text-decoration: underline"></span></strong><br />
Developing Components for SAP NetWeaver Portal is not an easy task. If you want to know how to do this, i recommend this book. For a quick-start head to chapter 10, there are some good examples with many screenshots and good instructions. You learn to work with the <a href="https://www.sdn.sap.com/irj/sdn/nw-devstudio" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.sdn.sap.com');">SAP NetWeaver Developer Studio</a>, create Components and deploy them to the SAP NetWeaver Portal.<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong><br />
To be continued&#8230;<br />
<strong><span style="text-decoration: underline"></span></strong><br />
<strong><span style="text-decoration: underline"></span></strong></p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/abap' rel='tag' target='_self'>abap</a>, <a class='technorati-link' href='http://technorati.com/tag/adobe+flex' rel='tag' target='_self'>adobe flex</a>, <a class='technorati-link' href='http://technorati.com/tag/books' rel='tag' target='_self'>books</a>, <a class='technorati-link' href='http://technorati.com/tag/Java' rel='tag' target='_self'>Java</a>, <a class='technorati-link' href='http://technorati.com/tag/netweaver' rel='tag' target='_self'>netweaver</a>, <a class='technorati-link' href='http://technorati.com/tag/nwds' rel='tag' target='_self'>nwds</a>, <a class='technorati-link' href='http://technorati.com/tag/portal' rel='tag' target='_self'>portal</a>, <a class='technorati-link' href='http://technorati.com/tag/SAP' rel='tag' target='_self'>SAP</a>, <a class='technorati-link' href='http://technorati.com/tag/sap+press' rel='tag' target='_self'>sap press</a>, <a class='technorati-link' href='http://technorati.com/tag/visual+composer' rel='tag' target='_self'>visual composer</a>, <a class='technorati-link' href='http://technorati.com/tag/web+dynpro' rel='tag' target='_self'>web dynpro</a>, <a class='technorati-link' href='http://technorati.com/tag/xapps' rel='tag' target='_self'>xapps</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.jdevelop.eu/2008/10/22/useful-books-for-learning-sap-netweaver/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
