This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Execute some random code, but disabled due to weird interaction between amven and glassfish asadmin command. | |
| Question asked on StackOverflow : http://stackoverflow.com/questions/6942759/batch-creation-of-domain-working-in-command-line-but-not-through-exec-maven-plug --> | |
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>exec-maven-plugin</artifactId> | |
| <version>1.2</version> | |
| <executions> | |
| <execution> | |
| <id>create start and configure domain</id> | |
| <phase>package</phase> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.beans.PropertyChangeEvent; | |
| import java.beans.PropertyChangeListener; | |
| import java.beans.PropertyChangeSupport; | |
| import java.util.ArrayList; | |
| import java.util.Collection; | |
| import java.util.Iterator; | |
| import java.util.List; | |
| import java.util.Set; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Bean { | |
| /** | |
| * Avec le PropertyChangeSupport, vous n'avez aps besoin d'envoyer vous-même les événements, | |
| * il s'en occupe (et il le fait mieux que vous, croyez-moi) | |
| */ | |
| private PropertyChangeSupport support = new PropertyChangeSupport(this); | |
| /** | |
| * Notre champ name ne change pas d'un iota | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Bean { | |
| private String name; | |
| public String getName() { return name; } | |
| public void setName(String name) { this.name = name; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Bean { | |
| /** | |
| * Avec le PropertyChangeSupport, vous n'avez aps besoin d'envoyer vous-même les événements, | |
| * il s'en occupe (et il le fait mieux que vous, croyez-moi) | |
| */ | |
| private PropertyChangeSupport support = new PropertyChangeSupport(this); | |
| /** | |
| * Notre champ name ne change pas d'un iota | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(myObject.canAdapt(JComponent.class)) { | |
| myPanel.add(myObject.getAdapter(JComponent.class)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface Adapter { | |
| /** | |
| * Check if this adapter can adapt from source class to target one | |
| * @param from class to adapt | |
| * @param to class to create | |
| * @return isn't it obvious ? true if this adapter can transform an object of "from" class into an object of "to" class | |
| */ | |
| public boolean canAdapt(Class<?> from, Class<?> to); | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Shamelessely borrowed from Eclipse concepts, as this article explains the | |
| * interest of this approach : | |
| * http://www.manageability.org/blog/stuff/adaptor-oriented-programming/view | |
| * There is also an article in Eclipse site : | |
| * http://www.eclipse.org/articles/article.php?file=Article-Adapters/index.html | |
| * but it is a little too much Eclipse centric for me | |
| */ | |
| public interface Adaptable { | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <build> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.sonatype.flexmojos</groupId> | |
| <artifactId>flexmojos-maven-plugin</artifactId> | |
| <extensions>true</extensions> | |
| <configuration> | |
| <resourceBundlePath>${basedir}/src/main/locale/{locale}</resourceBundlePath> | |
| <compiledLocales> | |
| <locale>en_US</locale> |