Revision: 1672
          http://svn.sourceforge.net/spring-rich-c/?rev=1672&view=rev
Author:   mathiasbr
Date:     2007-01-15 14:44:01 -0800 (Mon, 15 Jan 2007)

Log Message:
-----------
initial import of vldocking support
thanks to Rogan Dawes (see RCP-421)

Modified Paths:
--------------
    trunk/spring-richclient/pom.xml
    trunk/spring-richclient/samples/pom.xml

Added Paths:
-----------
    trunk/spring-richclient/samples/vldocking/
    trunk/spring-richclient/samples/vldocking/pom.xml
    trunk/spring-richclient/samples/vldocking/src/
    trunk/spring-richclient/samples/vldocking/src/main/
    trunk/spring-richclient/samples/vldocking/src/main/java/
    trunk/spring-richclient/samples/vldocking/src/main/java/org/
    trunk/spring-richclient/samples/vldocking/src/main/java/org/springframework/
    
trunk/spring-richclient/samples/vldocking/src/main/java/org/springframework/richclient/
    
trunk/spring-richclient/samples/vldocking/src/main/java/org/springframework/richclient/samples/
    
trunk/spring-richclient/samples/vldocking/src/main/java/org/springframework/richclient/samples/vldocking/
    
trunk/spring-richclient/samples/vldocking/src/main/java/org/springframework/richclient/samples/vldocking/app/
    
trunk/spring-richclient/samples/vldocking/src/main/java/org/springframework/richclient/samples/vldocking/app/SimpleVLDockingApp.java
    trunk/spring-richclient/samples/vldocking/src/main/resources/
    trunk/spring-richclient/samples/vldocking/src/main/resources/org/
    
trunk/spring-richclient/samples/vldocking/src/main/resources/org/springframework/
    
trunk/spring-richclient/samples/vldocking/src/main/resources/org/springframework/richclient/
    
trunk/spring-richclient/samples/vldocking/src/main/resources/org/springframework/richclient/samples/
    
trunk/spring-richclient/samples/vldocking/src/main/resources/org/springframework/richclient/samples/vldocking/
    
trunk/spring-richclient/samples/vldocking/src/main/resources/org/springframework/richclient/samples/vldocking/ctx/
    
trunk/spring-richclient/samples/vldocking/src/main/resources/org/springframework/richclient/samples/vldocking/ctx/richclient-application-context.xml
    trunk/spring-richclient/samples/vldocking/src/test/
    trunk/spring-richclient/samples/vldocking/src/test/java/
    trunk/spring-richclient/vldocking/
    trunk/spring-richclient/vldocking/pom.xml
    trunk/spring-richclient/vldocking/src/
    trunk/spring-richclient/vldocking/src/main/
    trunk/spring-richclient/vldocking/src/main/java/
    trunk/spring-richclient/vldocking/src/main/java/org/
    trunk/spring-richclient/vldocking/src/main/java/org/springframework/
    
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/
    
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/
    
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingApplicationPage.java
    
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingApplicationPageFactory.java
    
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingLayoutBuilder.java
    
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingLayoutManager.java
    
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingPageDescriptor.java
    
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingViewDescriptor.java
    
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/ViewDescriptorDockable.java
    trunk/spring-richclient/vldocking/src/test/
    trunk/spring-richclient/vldocking/src/test/java/

Modified: trunk/spring-richclient/pom.xml
===================================================================
--- trunk/spring-richclient/pom.xml     2007-01-15 22:32:52 UTC (rev 1671)
+++ trunk/spring-richclient/pom.xml     2007-01-15 22:44:01 UTC (rev 1672)
@@ -502,6 +502,7 @@
         <module>samples</module>
         <module>archetype</module>
         <!-- Module release is delibertly skipped -->
+        <module>vldocking</module>
     </modules>
 
     <dependencies>
@@ -933,6 +934,13 @@
                 <scope>runtime</scope>
             </dependency>
 
+            <!-- VLDocking -->
+            <dependency>
+               <groupId>com.vlsolutions</groupId>
+               <artifactId>vldocking</artifactId>
+               <version>2.1.3</version>
+            </dependency>
+
         </dependencies>
     </dependencyManagement>
 

Modified: trunk/spring-richclient/samples/pom.xml
===================================================================
--- trunk/spring-richclient/samples/pom.xml     2007-01-15 22:32:52 UTC (rev 
1671)
+++ trunk/spring-richclient/samples/pom.xml     2007-01-15 22:44:01 UTC (rev 
1672)
@@ -19,9 +19,10 @@
     <modules>
         <module>petclinic</module>
         <module>simple</module>
-    </modules>
+    <module>vldocking</module>
+  </modules>
 
     <dependencies>
     </dependencies>
 
-</project>
+</project>
\ No newline at end of file


Property changes on: trunk/spring-richclient/samples/vldocking
___________________________________________________________________
Name: svn:ignore
   + target
.classpath
.project


Added: trunk/spring-richclient/samples/vldocking/pom.xml
===================================================================
--- trunk/spring-richclient/samples/vldocking/pom.xml                           
(rev 0)
+++ trunk/spring-richclient/samples/vldocking/pom.xml   2007-01-15 22:44:01 UTC 
(rev 1672)
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<project>
+    <parent>
+        <artifactId>spring-richclient-samples</artifactId>
+        <groupId>org.springframework.richclient.samples</groupId>
+        <version>0.3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.springframework.richclient.samples</groupId>
+    <artifactId>spring-richclient-samples-vldocking</artifactId>
+    <name>Spring richclient vldocking sample application</name>
+    <packaging>jar</packaging>
+    <description>
+        This application provides a example of how to use the vldocking 
features of the Spring Rich Client platform.
+    </description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            
<mainClass>org.springframework.richclient.samples.vldocking.app.SimpleVLDockingApp</mainClass>
+                            <addClasspath>true</addClasspath>
+                            <addExtensions />
+                            <classpathPrefix>../../lib</classpathPrefix>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.richclient.samples.simple</groupId>
+            <artifactId>spring-richclient-samples-simple</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.richclient</groupId>
+            <artifactId>spring-richclient-vldocking</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+    </dependencies>
+</project>

Added: 
trunk/spring-richclient/samples/vldocking/src/main/java/org/springframework/richclient/samples/vldocking/app/SimpleVLDockingApp.java
===================================================================
--- 
trunk/spring-richclient/samples/vldocking/src/main/java/org/springframework/richclient/samples/vldocking/app/SimpleVLDockingApp.java
                                (rev 0)
+++ 
trunk/spring-richclient/samples/vldocking/src/main/java/org/springframework/richclient/samples/vldocking/app/SimpleVLDockingApp.java
        2007-01-15 22:44:01 UTC (rev 1672)
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.richclient.samples.vldocking.app;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.richclient.application.ApplicationLauncher;
+
+/**
+ * This application provides a very simple introduction to the Spring 
Richclient platform. It is intended to highlight
+ * the common models for working with the platform (including configuration 
and runtime access to platform services) and
+ * how to organize the basic pieces of an application using the platform.
+ * <p>
+ * This sample provides an implementation of a&nbsp;<em>trivial</em> address 
book. Trust me when I say trivial :-) It
+ * has no persistence, no security, and no complex business logic. The focus 
of the sample is how to work with the
+ * Spring Rich platform, not about how to build a great address book.
+ * <p>
+ * Other samples will introduce more complex topics like user management 
(security), alternate page/view layouts,
+ * complex data binding, remoting, etc.
+ * <p>
+ * The Spring Rich platform relies on the <a 
href="http://www.springframework.org/";>Spring</a> project to manage the
+ * application context with all the associated benefits it offers.
+ * <p>
+ * A start at the Spring Rich Client documentation can be found on the <a
+ * 
href="http://opensource.atlassian.com/confluence/spring/display/RCP/Home";>wiki</a>.
+ * </p>
+ * @author Larry Streepy
+ * @see The <a href="http://www.springframework.org/";>Spring project</a>
+ * @see The <a 
href="http://opensource.atlassian.com/confluence/spring/display/RCP/Home";>Spring
 Rich Wiki</a>
+ */
+public class SimpleVLDockingApp {
+
+       private static final Log _logger = 
LogFactory.getLog(SimpleVLDockingApp.class);
+
+       /**
+        * Main routine for the simple sample application.
+        * @param args
+        */
+       public static void main(String[] args) {
+               _logger.info("SimpleVLDockingApp starting up");
+
+               // The startup context defines elements that should be available
+               // quickly such as a splash screen image.
+
+               String startupContextPath = 
"/org/springframework/richclient/samples/simple/ctx" + 
"/richclient-startup-context.xml";
+
+               String richclientApplicationContextPath = 
"/org/springframework/richclient/samples/vldocking/ctx" + 
"/richclient-application-context.xml";
+
+               // The ApplicationLauncher is responsible for loading the 
contexts,
+               // presenting the splash screen, initializing the Application
+               // singleton instance, creating the application window to 
display
+               // the initial page.
+
+               try {
+                       new ApplicationLauncher(startupContextPath, new 
String[] { richclientApplicationContextPath });
+               }
+               catch (RuntimeException e) {
+                       _logger.error("RuntimeException during startup", e);
+               }
+       }
+
+}

Added: 
trunk/spring-richclient/samples/vldocking/src/main/resources/org/springframework/richclient/samples/vldocking/ctx/richclient-application-context.xml
===================================================================
--- 
trunk/spring-richclient/samples/vldocking/src/main/resources/org/springframework/richclient/samples/vldocking/ctx/richclient-application-context.xml
                                (rev 0)
+++ 
trunk/spring-richclient/samples/vldocking/src/main/resources/org/springframework/richclient/samples/vldocking/ctx/richclient-application-context.xml
        2007-01-15 22:44:01 UTC (rev 1672)
@@ -0,0 +1,354 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" 
+       "http://www.springframework.org/dtd/spring-beans.dtd";>
+<!-- $Id: richclient-application-context.xml 932 2006-03-12 16:32:49Z ge0ffrey 
$ -->
+<beans>
+
+       <!--
+               The application context is used to configure components and 
services within
+               the platform.  The platform utilizes a number of services at 
runtime, and
+               these must be configured here.  The two key beans for this are 
the serviceLocator
+               and applicationServices.  Many of the services have reasonable 
default
+               implementations, meaning that you probably won't need to define 
them here
+               unless you have specific needs not addressed in the default 
implementation.
+               
+               Beyond the services, you will define the various components 
that make up
+               your application, like the application descriptor, views, 
lifecycle advisor,
+               validation rules, etc.
+               
+               This may look a little daunting at first, but hang in there.  
The good news
+               is that you don't have to change many of the bean 
configurations provided
+               here when you are setting up your application.
+               
+               Typically, you would change the following:
+               
+               1. The startingPageId on the lifecycleAdvisor.
+               2. The eventExceptionHandler on the lifecycleAdvisor (or remove 
it if you
+               don't want to use it).
+               3. Specify the location of your resource bundle in the 
messageSource.
+               4. Specify the mapping properties files for images in 
imageResourcesFactory.
+               5. Specify your rulesSource class, if you're using one.
+               6. Configure your view beans.
+       -->
+
+       <!-- 
+               Bean: application
+               Usage: Platform required
+               Description: This defines the singleton application instance to 
be used.
+               Note that, currently, this object is not pluggable.  You must 
use the
+               class specified below and configure it as needed.
+       -->
+       <bean id="application"
+               class="org.springframework.richclient.application.Application">
+               <constructor-arg index="0" ref="applicationDescriptor" />
+               <constructor-arg index="1" ref="lifecycleAdvisor" />
+       </bean>
+
+       <!-- 
+               Bean: lifecycleAdvisor
+               Usage: Platform required
+               Description: This defines the LifecycleAdvisor instance to be 
used by the
+               Application.  Note the reference to this bean in the constructor
+               args in the application bean.  If you don't need any special 
handling
+               in the application lifecycle, then you could use the provided 
default
+               advisor in
+               
org.springframework.richclient.application.config.DefaultApplicationLifecycleAdvisor
+               
+               Two key properties must be configured, the location of the file 
containing
+               the command definitions for application windows and the bean id 
of the
+               page that should be displayed initially upon application 
startup, you
+               can find the referenced view bean toward the bottom of this 
file.
+               
+               An optional, but highly recommended, property you can set is the
+               eventExceptionHandler.  If specified, this will be registered 
with the
+               AWT event thread as the handler to receive uncaught exceptions 
that occur
+               on the event thread.
+       -->
+       <bean id="lifecycleAdvisor"
+               
class="org.springframework.richclient.samples.simple.app.SimpleLifecycleAdvisor">
+               <property name="windowCommandBarDefinitions"
+                       
value="org/springframework/richclient/samples/simple/ui/commands-context.xml" />
+               <property name="startingPageId" value="initialView" />
+       </bean>
+
+       <!-- 
+               Bean: applicationPageFactory
+               Type: platform optional
+               Description: TODO
+       -->
+       <bean id="applicationPageFactory" depends-on="serviceLocator"
+               
class="org.springframework.richclient.vldocking.VLDockingApplicationPageFactory">
+       </bean>
+
+       <!-- bean id="defaultDesktopPage"
+               
class="org.springframework.richclient.vldocking.VLDockingPageDescriptor">
+               <property name="viewDescriptors">
+                       <list>
+                               <value>initialView</value>
+                               <value>contactView</value>
+                       </list>
+               </property>
+               <property name="initialLayout">
+                       <bean
+                               
class="org.springframework.core.io.ClassPathResource">
+                               <constructor-arg type="java.lang.String">
+                                       <value>/ui/desktopLayout.xml</value>
+                               </constructor-arg>
+                       </bean>
+               </property>
+       </bean -->
+
+       <!-- 
+               Bean: initialView
+               Type: user named
+               Usage: application
+               Description: This specifies the component that describes the 
initial view
+               to present when the application is started.  The application 
window
+               uses a ViewDescriptor to define the view to be presented.  The
+               ViewDescriptor is then configured with the name of the class 
that
+               provides the view and any properties to be configured on the 
view instance
+               when it is created.
+       -->
+       <bean id="initialView"
+               
class="org.springframework.richclient.vldocking.VLDockingViewDescriptor">
+               <property name="viewClass"
+                       
value="org.springframework.richclient.samples.simple.ui.InitialView" />
+               <property name="viewProperties">
+                       <map>
+                               <entry key="firstMessage" 
value="firstMessage.text" />
+                               <entry key="descriptionTextPath"
+                                       
value="org/springframework/richclient/samples/simple/ui/initialViewText.html" />
+                       </map>
+               </property>
+               <property name="autoHideEnabled">
+                       <value>true</value>
+               </property>
+               <property name="closeEnabled">
+                       <value>true</value>
+               </property>
+       </bean>
+
+       <!-- 
+               Bean: contactView
+               Type: user named
+               Usage: application
+               Description: This specifies the component that describes the 
Contact view.
+               As above with the initial view, we configure any view 
properties here.
+               Note the use of the contactTableFactory.  Since the actual 
contactView
+               instance is created by the platform (using data from the view 
descriptor),
+               we need a way to get a new instance of the contactTable plugged 
into each
+               instance of the view.  Using the factory takes care of that.
+       -->
+       <bean id="contactView"
+               
class="org.springframework.richclient.application.support.DefaultViewDescriptor">
+               <property name="viewClass">
+                       <value>
+                               
org.springframework.richclient.samples.simple.ui.ContactView
+                       </value>
+               </property>
+               <property name="viewProperties">
+                       <map>
+                               <entry key="contactDataStore"
+                                       value-ref="contactDataStore" />
+                       </map>
+               </property>
+       </bean>
+
+       <!-- 
+               Bean: contactDataStore
+               Usage: application
+               Description: Defines the data store holding all the contacts.
+       -->
+       <bean id="contactDataStore"
+               
class="org.springframework.richclient.samples.simple.domain.ContactDataStore" />
+
+       <!-- 
+               Bean: serviceLocator
+               Usage: Platform required
+               Description: This defines the singleton application service 
locator instance.
+               This is a trivial singleton object providing access to the 
configured
+               services, as specified on the applicationServices property.
+       -->
+       <bean id="serviceLocator"
+               
class="org.springframework.richclient.application.ApplicationServicesLocator">
+               <property name="applicationServices" ref="applicationServices" 
/>
+       </bean>
+
+       <!-- 
+               Bean: applicationServices
+               Usage: Platform required (unless you set this up 
programmatically)
+               Description: This configures the application services available 
to the platform.
+               There are specific setter methods for all the standard 
services, see the
+               javadoc on the DefaultApplicationServices class for more 
details.
+               NOTE: The use of bean ids (idref) is preferred over using 
direct bean
+               references to avoid startup problems with circular references.
+       -->
+       <bean id="applicationServices"
+               
class="org.springframework.richclient.application.support.DefaultApplicationServices"
 />
+
+       <!-- 
+               Bean: applicationEventMulticaster
+               Type: magic
+               Usage: platform required
+               Description: This defines the object responsible for 
dispatching application events
+               to all interested components.  Unless you really know what 
you're doing,
+               you should just include this as is.
+       -->
+       <bean id="applicationEventMulticaster"
+               
class="org.springframework.context.event.SimpleApplicationEventMulticaster" />
+
+       <!-- 
+               Bean: applicationDescriptor
+               Usage: platform required
+               Description: This defines the Application metadata to be used 
by the
+               Application.  Note the reference to this bean in the constructor
+               args in the application bean.
+       -->
+       <bean id="applicationDescriptor"
+               
class="org.springframework.richclient.application.support.DefaultApplicationDescriptor">
+               <property name="version" value="1.0" />
+               <property name="buildId" value="20060408-001" />
+       </bean>
+
+       <!-- 
+               Bean: applicationObjectConfigurer
+               Usage: platform required (because it is a bean post processor)
+               Description: This defines the object responsible for 
configuring other objects
+               constructed via the platform.  This is a critical part of the 
I18N support.
+       -->
+       <bean id="applicationObjectConfigurer" depends-on="serviceLocator"
+               
class="org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer">
+       </bean>
+
+       <!-- 
+               Bean: lookAndFeelConfigurer
+               Usage: platform optional
+               Description: The platform doesn't specifically make direct use 
of this
+               object (other than instantiating it).  It is expected that the 
object
+               will register itself into the UI Manager when it is 
instantiated in
+               the context.  Take a look at the JGoodiesLooksConfigurer class 
for an
+               example of this.
+       -->
+       <bean id="lookAndFeelConfigurer"
+               
class="org.springframework.richclient.application.config.JGoodiesLooksConfigurer">
+               <property name="popupDropShadowEnabled" value="false" />
+               <property name="theme">
+                       <bean
+                               
class="com.jgoodies.looks.plastic.theme.ExperienceBlue" />
+               </property>
+       </bean>
+
+       <!-- 
+               Bean: messageSource
+               Usage: platform required (not really, but you can't do much 
without it)
+               Description: This specifies the component that is responsible 
for providing
+               messages (all kinds of text) to the platform.  This is a 
critical piece
+               of the I18N support.  Unless your doing something very unusual, 
the
+               ResourceBundleMessageSource used below should be sufficient.  
Just
+               configure it with the base names of the resource bundles you 
want to
+               use in your application.  Unless you want to override the 
default
+               text resources for the platform, you should include
+               org.springframework.richclient.application.messages as the last 
base name.
+       -->
+       <bean id="messageSource"
+               
class="org.springframework.context.support.ResourceBundleMessageSource">
+               <property name="basenames">
+                       <list>
+                               
<value>org.springframework.richclient.samples.simple.ui.messages</value>
+                               
<value>org.springframework.richclient.application.messages</value>
+                       </list>
+               </property>
+       </bean>
+
+       <!-- 
+               Bean: imageResourcesFactory
+               Usage: platform required (if you are using the 
DefaultImageSource, see below)
+               Description: This specifies the component that is responsible 
for providing
+               image resources locations.  This factory uses the specified 
properties
+               files to map image resource keys to image locations.
+       -->
+       <bean id="imageResourcesFactory"
+               
class="org.springframework.context.support.ResourceMapFactoryBean">
+               <property name="locations">
+                       <list>
+                               
<value>classpath:org/springframework/richclient/image/images.properties</value>
+                               
<value>classpath:org/springframework/richclient/samples/simple/ui/images.properties</value>
+                       </list>
+               </property>
+               <property name="resourceBasePath" value="images/" />
+       </bean>
+
+       <!-- 
+               Bean: imageSource
+               Type: user named
+               Usage: platform required
+               Description: This specifies the component that is responsible 
for providing
+               images to the platform.  It makes use of a resource factory 
that converts
+               the image keys to resource locations.  The DefaultImageSource 
also provides
+               a "broken image" image for any requested image that can't be 
found or fails
+               to load.
+       -->
+       <bean id="imageSource"
+               class="org.springframework.richclient.image.DefaultImageSource">
+               <constructor-arg index="0" ref="imageResourcesFactory" />
+               <property name="brokenImageIndicator"
+                       value="images/alert/error_obj.gif" />
+       </bean>
+
+       <!-- 
+               Bean: formComponentInterceptorFactory
+               Usage: platform optional
+               Description: This specifies the list of interceptors to attach 
to controls
+               constructed by the platform.  This allows for a declarative 
model for
+               specifying "additional" functionality to be added to various 
components.
+               The configuration below adds interceptors to overlay validation 
error
+               images and background color changes, provide popup menus in 
text fields, 
+               and autocompletion (as you type) for comboboxes.
+       -->
+       <bean id="formComponentInterceptorFactory"
+               
class="org.springframework.richclient.form.builder.support.ChainedInterceptorFactory">
+               <property name="interceptorFactories">
+                       <list>
+                               <bean
+                                       
class="org.springframework.richclient.form.builder.support.ColorValidationInterceptorFactory">
+                                       <property name="errorColor" 
value="255,245,245" />
+                               </bean>
+                               <bean
+                                       
class="org.springframework.richclient.form.builder.support.OverlayValidationInterceptorFactory"
 />
+                               <bean
+                                       
class="org.springframework.richclient.text.TextComponentPopupInterceptorFactory"
 />
+                               <bean
+                                       
class="org.springframework.richclient.list.ComboBoxAutoCompletionInterceptorFactory"
 />
+                       </list>
+               </property>
+       </bean>
+
+       <!-- 
+               Bean: rulesSource
+               Usage: platform optional
+               Description: This specifies the component that will supply 
validation rules
+               for properties bound into forms.  This allows validation rules 
to be
+               specified separately from the implementation of the business 
domain object.
+       -->
+       <bean id="rulesSource"
+               
class="org.springframework.richclient.samples.simple.domain.SimpleValidationRulesSource"
 />
+
+       <!-- 
+               Bean: conversionService
+               Usage: platform optional
+               Description: This specifies the component that will supply 
converters
+               for property values.  Since we are going to add a special 
formatter
+               for date fields, we need to have a reference to this service
+               in the context configured with a custom formatter factory.
+       -->
+       <bean id="conversionService"
+               
class="org.springframework.richclient.application.DefaultConversionServiceFactoryBean">
+               <property name="formatterFactory">
+                       <bean
+                               
class="org.springframework.richclient.samples.simple.ui.SimpleAppFormatterFactory"
 />
+               </property>
+       </bean>
+
+
+
+</beans>


Property changes on: trunk/spring-richclient/vldocking
___________________________________________________________________
Name: svn:ignore
   + target
.classpath
.project


Added: trunk/spring-richclient/vldocking/pom.xml
===================================================================
--- trunk/spring-richclient/vldocking/pom.xml                           (rev 0)
+++ trunk/spring-richclient/vldocking/pom.xml   2007-01-15 22:44:01 UTC (rev 
1672)
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<project>
+    <parent>
+        <groupId>org.springframework.richclient</groupId>
+        <artifactId>spring-richclient</artifactId>
+        <version>0.3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>spring-richclient-vldocking</artifactId>
+    <name>Spring richclient vldocking</name>
+    <packaging>jar</packaging>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.richclient</groupId>
+            <artifactId>spring-richclient-support</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.richclient</groupId>
+            <artifactId>spring-richclient-sandbox</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.vlsolutions</groupId>
+            <artifactId>vldocking</artifactId>
+        </dependency>
+    </dependencies>
+</project>

Added: 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingApplicationPage.java
===================================================================
--- 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingApplicationPage.java
                              (rev 0)
+++ 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingApplicationPage.java
      2007-01-15 22:44:01 UTC (rev 1672)
@@ -0,0 +1,299 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.richclient.vldocking;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.swing.JComponent;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.springframework.core.io.Resource;
+import org.springframework.richclient.application.ApplicationWindow;
+import org.springframework.richclient.application.PageComponent;
+import org.springframework.richclient.application.PageDescriptor;
+import org.springframework.richclient.application.PageLayoutBuilder;
+import org.springframework.richclient.application.ViewDescriptor;
+import 
org.springframework.richclient.application.support.AbstractApplicationPage;
+import org.xml.sax.SAXException;
+
+import com.vlsolutions.swing.docking.DockKey;
+import com.vlsolutions.swing.docking.Dockable;
+import com.vlsolutions.swing.docking.DockableResolver;
+import com.vlsolutions.swing.docking.DockableState;
+import com.vlsolutions.swing.docking.DockingContext;
+import com.vlsolutions.swing.docking.DockingDesktop;
+import com.vlsolutions.swing.docking.event.DockableStateChangeEvent;
+import com.vlsolutions.swing.docking.event.DockableStateChangeListener;
+import com.vlsolutions.swing.docking.event.DockableStateWillChangeEvent;
+import com.vlsolutions.swing.docking.event.DockableStateWillChangeListener;
+
+/**
+ * @author rdawes
+ *
+ */
+
+public class VLDockingApplicationPage extends AbstractApplicationPage 
implements PageLayoutBuilder {
+
+    private DockingDesktop desktop;
+
+    private DockingContext dockingContext;
+
+    private VLDockingLayoutManager layoutManager = null;
+
+    private boolean resolving = false;
+
+    private Resource initialLayout = null;
+
+    public VLDockingApplicationPage( ApplicationWindow window, PageDescriptor 
pageDescriptor ) {
+        super( window, pageDescriptor );
+        if (pageDescriptor instanceof VLDockingPageDescriptor) {
+            VLDockingPageDescriptor descriptor = (VLDockingPageDescriptor) 
pageDescriptor;
+            setLayoutManager(descriptor.getLayoutManager());
+            setInitialLayout(descriptor.getInitialLayout());
+        }
+    }
+
+    protected PageComponent getPageComponent(Dockable dockable) {
+        if (dockable instanceof ViewDescriptorDockable)
+            return ((ViewDescriptorDockable) dockable).getPageComponent();
+        return null;
+    }
+
+    protected Dockable getDockable(PageComponent pageComponent) {
+        DockableState[] states = desktop.getDockables();
+        for (int i=0; i<states.length; i++) {
+            Dockable dockable = states[i].getDockable();
+            PageComponent pc = getPageComponent(dockable);
+            if (pc == pageComponent)
+                return dockable;
+        }
+        return null;
+    }
+
+    protected boolean giveFocusTo( PageComponent pageComponent ) {
+        Dockable dockable = getDockable(pageComponent);
+        if( dockable == null ) {
+            return false;
+        }
+
+        // FIXME: need some way to tell the desktop to focus on the indicated 
dockable
+        // e.g. if it is hidden, it should be expanded, etc
+        // if another Dockable is maximized, it should be restored, so that the
+        // selected Dockable can be seen
+        // if the specified Dockable is a non-visible tab, it should be 
brought to front, etc
+        return pageComponent.getControl().requestFocusInWindow();
+    }
+
+    public void addView( String viewDescriptorId ) {
+        showView( viewDescriptorId );
+    }
+
+    protected void doAddPageComponent(PageComponent pageComponent) {
+        if (resolving) return;
+        pageComponent.getControl();
+        Dockable dockable = getDockable(pageComponent);
+        if (dockable != null) return;
+        dockable = createDockable( pageComponent );
+        getLayoutManager().addDockable(desktop, dockable);
+    }
+
+    protected Dockable createDockable(PageComponent pageComponent) {
+        return createDockable(getViewDescriptor(pageComponent.getId()), 
pageComponent);
+    }
+
+    protected Dockable createDockable(ViewDescriptor descriptor, PageComponent 
pageComponent) {
+        return new ViewDescriptorDockable(descriptor, pageComponent);
+    }
+
+    protected void doRemovePageComponent(PageComponent pageComponent) {
+        Dockable dockable = getDockable(pageComponent);
+        if( dockable != null ) {
+            getLayoutManager().removeDockable(desktop,dockable);
+        }
+    }
+
+    protected JComponent createControl() {
+       String name = getPageDescriptor().getId();
+               desktop = new DockingDesktop(name, getDockingContext());
+               desktop.setName(name);
+        DockableListener listener = new DockableListener();
+        desktop.addDockableStateChangeListener(listener);
+        desktop.addDockableStateWillChangeListener(listener);
+
+        if (initialLayout != null) {
+            try {
+                InputStream in = initialLayout.getInputStream();
+                desktop.getContext().readXML(in);
+                in.close();
+            } catch (IOException ioe) {
+                logger.warn("Error reading workspace layout " + initialLayout 
+ ", using defaults", ioe);
+                getPageDescriptor().buildInitialLayout( this );
+            } catch (SAXException saxe) {
+                logger.warn("Error parsing workspace layout " + initialLayout 
+ ", using defaults", saxe);
+                getPageDescriptor().buildInitialLayout( this );
+            } catch (ParserConfigurationException pce) {
+                logger.warn("Error parsing workspace layout " + initialLayout 
+ ", using defaults", pce);
+                getPageDescriptor().buildInitialLayout( this );
+            }
+            if (desktop.getDockables().length == 0) {
+                getPageDescriptor().buildInitialLayout( this );
+            }
+        } else {
+            getPageDescriptor().buildInitialLayout( this );
+        }
+        return desktop;
+    }
+
+    protected void updatePageComponentProperties( PageComponent pageComponent 
) {
+        Dockable dockable = getDockable( pageComponent );
+        DockKey dockKey = dockable.getDockKey();
+
+        if( pageComponent.getIcon() != null ) {
+            dockKey.setIcon( pageComponent.getIcon() );
+        }
+        dockKey.setName( pageComponent.getDisplayName() );
+        dockKey.setTooltip( pageComponent.getCaption() );
+    }
+
+       /**
+        * @return the dockingContext
+        */
+       public DockingContext getDockingContext() {
+        if (this.dockingContext == null) {
+            this.dockingContext = new DockingContext();
+            this.dockingContext.setDockableResolver(new 
ViewDescriptorResolver());
+        }
+               return this.dockingContext;
+       }
+
+    /**
+     * @return the layoutManager
+     */
+    private VLDockingLayoutManager getLayoutManager() {
+        if (this.layoutManager == null) {
+            layoutManager = new DefaultLayoutManager();
+        }
+        return this.layoutManager;
+    }
+
+    /**
+     * @param layoutManager the layoutManager to set
+     */
+    public void setLayoutManager(VLDockingLayoutManager layoutManager) {
+        this.layoutManager = layoutManager;
+    }
+
+    /**
+     * @param initialLayout the initialLayout to set
+     */
+    public void setInitialLayout(Resource initialLayout) {
+        this.initialLayout = initialLayout;
+    }
+
+    public boolean close() {
+        // try to save the layout if it came from a file we can write to
+        if (initialLayout != null) {
+            File file = null;
+            try {
+                file = initialLayout.getFile();
+                if (file.canWrite()) {
+                    try {
+                        OutputStream out = new FileOutputStream(file);
+                        desktop.getContext().writeXML(out);
+                        out.close();
+                    } catch (IOException ioe) {
+                        logger.warn("Error saving desktop layout to " + file, 
ioe);
+                    }
+                }
+            } catch (IOException ioe) {
+            }
+        }
+        return super.close();
+    }
+
+    private class DockableListener implements DockableStateChangeListener, 
DockableStateWillChangeListener {
+
+        /* (non-Javadoc)
+         * @see 
com.vlsolutions.swing.docking.event.DockableStateWillChangeListener#dockableStateWillChange(com.vlsolutions.swing.docking.event.DockableStateWillChangeEvent)
+         */
+        public void dockableStateWillChange(DockableStateWillChangeEvent 
event) {
+            DockableState futureState = event.getFutureState();
+            if (futureState.isClosed()) {
+                Dockable dockable = futureState.getDockable();
+                if (dockable instanceof ViewDescriptorDockable) {
+                    ViewDescriptorDockable vdd = (ViewDescriptorDockable) 
dockable;
+                    PageComponent pc = vdd.getPageComponent();
+                    if (!pc.canClose())
+                        event.cancel();
+                }
+            }
+        }
+
+        /* (non-Javadoc)
+         * @see 
com.vlsolutions.swing.docking.event.DockableStateChangeListener#dockableStateChanged(com.vlsolutions.swing.docking.event.DockableStateChangeEvent)
+         */
+        public void dockableStateChanged(DockableStateChangeEvent event) {
+            DockableState previousState = event.getPreviousState();
+            DockableState newState = event.getNewState();
+            Dockable dockable = newState.getDockable();
+            PageComponent pc = getPageComponent(dockable);
+            if (pc == null) return;
+            if ( previousState != null && !previousState.isClosed() && 
newState.isClosed()) {
+                pc.getContext().getPage().close(pc);
+            }
+        }
+
+    }
+
+    private class ViewDescriptorResolver implements DockableResolver {
+
+        public Dockable resolveDockable(String keyName) {
+            ViewDescriptor descriptor = getViewDescriptor(keyName);
+            if (descriptor == null)
+                return null;
+            PageComponent pageComponent = createPageComponent(descriptor);
+            resolving = true;
+            addPageComponent(pageComponent);
+            resolving = false;
+            Dockable dockable = createDockable(descriptor, pageComponent);
+            return dockable;
+        }
+
+    }
+
+    private class DefaultLayoutManager implements VLDockingLayoutManager {
+
+        /* (non-Javadoc)
+         * @see 
org.springframework.richclient.application.vldocking.VLDockingLayoutManager#addDockable(com.vlsolutions.swing.docking.DockingDesktop,
 com.vlsolutions.swing.docking.Dockable)
+         */
+        public void addDockable(DockingDesktop desktop, Dockable dockable) {
+            desktop.addDockable(dockable);
+        }
+
+        /* (non-Javadoc)
+         * @see 
org.springframework.richclient.application.vldocking.VLDockingLayoutManager#removeDockable(com.vlsolutions.swing.docking.DockingDesktop,
 com.vlsolutions.swing.docking.Dockable)
+         */
+        public void removeDockable(DockingDesktop desktop, Dockable dockable) {
+            desktop.remove(dockable);
+        }
+
+    }
+
+}

Added: 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingApplicationPageFactory.java
===================================================================
--- 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingApplicationPageFactory.java
                               (rev 0)
+++ 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingApplicationPageFactory.java
       2007-01-15 22:44:01 UTC (rev 1672)
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.richclient.vldocking;
+
+import org.springframework.richclient.application.ApplicationPage;
+import org.springframework.richclient.application.ApplicationPageFactory;
+import org.springframework.richclient.application.ApplicationWindow;
+import org.springframework.richclient.application.PageDescriptor;
+
+/**
+ * @author rdawes
+ *
+ */
+public class VLDockingApplicationPageFactory implements ApplicationPageFactory 
{
+
+       /* (non-Javadoc)
+        * @see 
org.springframework.richclient.application.ApplicationPageFactory#createApplicationPage(org.springframework.richclient.application.ApplicationWindow,
 org.springframework.richclient.application.PageDescriptor)
+        */
+       public ApplicationPage createApplicationPage(ApplicationWindow window, 
PageDescriptor descriptor) {
+               VLDockingApplicationPage page = new 
VLDockingApplicationPage(window, descriptor);
+        return page;
+       }
+
+}

Added: 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingLayoutBuilder.java
===================================================================
--- 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingLayoutBuilder.java
                                (rev 0)
+++ 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingLayoutBuilder.java
        2007-01-15 22:44:01 UTC (rev 1672)
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.richclient.vldocking;
+
+import com.vlsolutions.swing.docking.Dockable;
+import com.vlsolutions.swing.docking.DockingDesktop;
+
+/**
+ * @author rdawes
+ *
+ */
+public interface VLDockingLayoutBuilder {
+
+       void addDockable(DockingDesktop desktop, Dockable dockable);
+
+       void layoutDockables(DockingDesktop desktop);
+
+}

Added: 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingLayoutManager.java
===================================================================
--- 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingLayoutManager.java
                                (rev 0)
+++ 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingLayoutManager.java
        2007-01-15 22:44:01 UTC (rev 1672)
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.richclient.vldocking;
+
+import com.vlsolutions.swing.docking.Dockable;
+import com.vlsolutions.swing.docking.DockingDesktop;
+
+/**
+ * @author rdawes
+ *
+ */
+public interface VLDockingLayoutManager {
+
+    void addDockable(DockingDesktop desktop, Dockable dockable);
+
+    void removeDockable(DockingDesktop desktop, Dockable dockable);
+
+}

Added: 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingPageDescriptor.java
===================================================================
--- 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingPageDescriptor.java
                               (rev 0)
+++ 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingPageDescriptor.java
       2007-01-15 22:44:01 UTC (rev 1672)
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.richclient.vldocking;
+
+import org.springframework.core.io.Resource;
+import org.springframework.richclient.application.mdi.DesktopPageDescriptor;
+
+/**
+ * @author rdawes
+ *
+ */
+public class VLDockingPageDescriptor extends DesktopPageDescriptor {
+
+    private VLDockingLayoutManager layoutManager;
+
+    private Resource initialLayout;
+
+    /**
+     * @return the layoutManager
+     */
+    public VLDockingLayoutManager getLayoutManager() {
+        return this.layoutManager;
+    }
+
+    /**
+     * @param layoutManager the layoutManager to set
+     */
+    public void setLayoutManager(VLDockingLayoutManager layoutManager) {
+        this.layoutManager = layoutManager;
+    }
+
+    /**
+     * @return the initialLayout
+     */
+    public Resource getInitialLayout() {
+        return this.initialLayout;
+    }
+
+    /**
+     * @param initialLayout the initialLayout to set
+     */
+    public void setInitialLayout(Resource initialLayout) {
+        this.initialLayout = initialLayout;
+    }
+
+}

Added: 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingViewDescriptor.java
===================================================================
--- 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingViewDescriptor.java
                               (rev 0)
+++ 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/VLDockingViewDescriptor.java
       2007-01-15 22:44:01 UTC (rev 1672)
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.richclient.vldocking;
+
+import 
org.springframework.richclient.application.support.DefaultViewDescriptor;
+
+import com.vlsolutions.swing.docking.DockingConstants;
+
+/**
+ * @author rdawes
+ *
+ */
+public class VLDockingViewDescriptor extends DefaultViewDescriptor {
+
+    public static boolean DEFAULT_AUTOHIDEENABLED = false;
+
+    public static DockingConstants.Hide DEFAULT_AUTOHIDEBORDER = 
DockingConstants.HIDE_LEFT;
+
+    public static boolean DEFAULT_CLOSEENABLED = false;
+
+    public static boolean DEFAULT_FLOATENABLED = false;
+
+    public static boolean DEFAULT_MAXIMIZEENABLED = true;
+
+       private DockingConstants.Hide autoHideBorder = DEFAULT_AUTOHIDEBORDER;
+
+       private boolean autoHideEnabled = DEFAULT_AUTOHIDEENABLED;
+
+       private boolean closeEnabled = DEFAULT_CLOSEENABLED;
+
+       private boolean floatEnabled = DEFAULT_FLOATENABLED;
+
+       private boolean maximizeEnabled = DEFAULT_MAXIMIZEENABLED;
+
+       /**
+        * @return the autoHideBorder
+        */
+       public DockingConstants.Hide getAutoHideBorder() {
+               return this.autoHideBorder;
+       }
+
+       /**
+        * @param autoHideBorder the autoHideBorder to set
+        */
+       public void setAutoHideBorder(DockingConstants.Hide autoHideBorder) {
+               this.autoHideBorder = autoHideBorder;
+       }
+
+       /**
+        * @return the autoHideEnabled
+        */
+       public boolean isAutoHideEnabled() {
+               return this.autoHideEnabled;
+       }
+
+       /**
+        * @param autoHideEnabled the autoHideEnabled to set
+        */
+       public void setAutoHideEnabled(boolean autoHideEnabled) {
+               this.autoHideEnabled = autoHideEnabled;
+       }
+
+       /**
+        * @return the closeEnabled
+        */
+       public boolean isCloseEnabled() {
+               return this.closeEnabled;
+       }
+
+       /**
+        * @param closeEnabled the closeEnabled to set
+        */
+       public void setCloseEnabled(boolean closeEnabled) {
+               this.closeEnabled = closeEnabled;
+       }
+
+       /**
+        * @return the floatEnabled
+        */
+       public boolean isFloatEnabled() {
+               return this.floatEnabled;
+       }
+
+       /**
+        * @param floatEnabled the floatEnabled to set
+        */
+       public void setFloatEnabled(boolean floatEnabled) {
+               this.floatEnabled = floatEnabled;
+       }
+
+       /**
+        * @return the maximizeEnabled
+        */
+       public boolean isMaximizeEnabled() {
+               return this.maximizeEnabled;
+       }
+
+       /**
+        * @param maximizeEnabled the maximizeEnabled to set
+        */
+       public void setMaximizeEnabled(boolean maximizeEnabled) {
+               this.maximizeEnabled = maximizeEnabled;
+       }
+
+}

Added: 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/ViewDescriptorDockable.java
===================================================================
--- 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/ViewDescriptorDockable.java
                                (rev 0)
+++ 
trunk/spring-richclient/vldocking/src/main/java/org/springframework/richclient/vldocking/ViewDescriptorDockable.java
        2007-01-15 22:44:01 UTC (rev 1672)
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.richclient.vldocking;
+
+import java.awt.Component;
+
+import org.springframework.core.style.ToStringCreator;
+import org.springframework.richclient.application.PageComponent;
+import org.springframework.richclient.application.ViewDescriptor;
+
+import com.vlsolutions.swing.docking.DockKey;
+import com.vlsolutions.swing.docking.Dockable;
+import com.vlsolutions.swing.docking.DockingConstants.Hide;
+
+/**
+ * @author rdawes
+ *
+ */
+public class ViewDescriptorDockable implements Dockable {
+
+    private ViewDescriptor viewDescriptor;
+
+    private PageComponent pageComponent;
+
+    private DockKey dockKey;
+
+    public ViewDescriptorDockable(ViewDescriptor viewDescriptor) {
+        this(viewDescriptor, null);
+    }
+
+    public ViewDescriptorDockable(ViewDescriptor viewDescriptor,
+            PageComponent pageComponent) {
+        this.viewDescriptor = viewDescriptor;
+        this.pageComponent = pageComponent;
+        this.dockKey = new DockKey(viewDescriptor.getId());
+
+        dockKey.setName(viewDescriptor.getDisplayName());
+        dockKey.setTooltip(viewDescriptor.getCaption());
+        dockKey.setIcon(viewDescriptor.getIcon());
+
+        boolean autoHideEnabled = 
VLDockingViewDescriptor.DEFAULT_AUTOHIDEENABLED;
+        Hide autoHideBorder = VLDockingViewDescriptor.DEFAULT_AUTOHIDEBORDER;
+        boolean closeEnabled = VLDockingViewDescriptor.DEFAULT_CLOSEENABLED;
+        boolean floatEnabled = VLDockingViewDescriptor.DEFAULT_FLOATENABLED;
+        boolean maximizeEnabled = 
VLDockingViewDescriptor.DEFAULT_MAXIMIZEENABLED;
+
+        if (viewDescriptor instanceof VLDockingViewDescriptor) {
+            VLDockingViewDescriptor dockingViewDescriptor = 
(VLDockingViewDescriptor) viewDescriptor;
+            autoHideEnabled = dockingViewDescriptor.isAutoHideEnabled();
+            autoHideBorder = dockingViewDescriptor.getAutoHideBorder();
+            closeEnabled = dockingViewDescriptor.isCloseEnabled();
+            floatEnabled = dockingViewDescriptor.isFloatEnabled();
+            maximizeEnabled = dockingViewDescriptor.isMaximizeEnabled();
+        }
+        dockKey.setAutoHideEnabled(autoHideEnabled);
+        dockKey.setAutoHideBorder(autoHideBorder);
+        dockKey.setCloseEnabled(closeEnabled);
+        dockKey.setFloatEnabled(floatEnabled);
+        dockKey.setMaximizeEnabled(maximizeEnabled);
+    }
+
+    public PageComponent getPageComponent() {
+        if (pageComponent == null)
+            pageComponent = viewDescriptor.createPageComponent();
+        return pageComponent;
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see com.vlsolutions.swing.docking.Dockable#getComponent()
+     */
+    public Component getComponent() {
+        return getPageComponent().getControl();
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see com.vlsolutions.swing.docking.Dockable#getDockKey()
+     */
+    public DockKey getDockKey() {
+        return dockKey;
+    }
+
+    public String toString() {
+        return new ToStringCreator(this).append("viewDescriptor",
+                viewDescriptor.getId()).toString();
+    }
+}


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
spring-rich-c-cvs mailing list
spring-rich-c-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs

Reply via email to