« Return to Thread: Spring Rich and FlexDock

Re: Spring Rich and FlexDock

by Peter De Bruycker-2 :: Rate this Message:

Reply to Author | View in Thread

you have to set the initial view(s) in your perspective:

public class SamplePerspectiveFactory implements PerspectiveFactory {

       public Perspective getPerspective(String persistentId) {
               Perspective perspective = new Perspective(persistentId,
"Perspective1");
               LayoutSequence sequence = perspective.getInitialSequence(true);

               // add the view with id "initialView-1"
               sequence.add("initialView-1");
               // add the view with id "initialView-2" to the ease of
"initialView-1"
               sequence.add("initialView-2", "initialView-1,
DockingConstants.EAST_REGION, .3f);

               return perspective;
       }
}


hope this helps,

Peter

2006/9/21, Rogan Dawes <rogan@...>:

> Rogan Dawes wrote:
> > Hi folks,
> >
> > I see that some code for using FlexDock with Spring Rich was contributed
> > recently. Is there any chance of some example code, showing how it
> > should be used?
> >
> > Many thanks
> >
> > Rogan
> >
>
> So, this is what I have so far, added on to the Archetype:
>
> In the richclient-application-context.xml, add the following bean:
>
> <bean id="flexdockApplicationPageFactory" depends-on="serviceLocator"
> class="org.springframework.richclient.application.flexdock.FlexDockApplicationPageFactory"
>
>
> lazy-init="false">
>      <property name="floatingEnabled"><value>true</value></property>
>      <property name="perspectiveFactory">
>          <bean class="za.net.dawes.SamplePerspectiveFactory"></bean>
>      </property>
> </bean>
>
> and reference it in the application services bean:
>
> <property name="applicationPageFactoryId">
>      <idref bean="flexdockApplicationPageFactory"/>
> </property>
>
> Create an implementation of the PerspectiveFactory:
>
> net.za.dawes.SamplePerspectiveFactory.java:
>
> package za.net.dawes;
>
> import org.flexdock.perspective.LayoutSequence;
> import org.flexdock.perspective.Perspective;
> import org.flexdock.perspective.PerspectiveFactory;
>
> public class SamplePerspectiveFactory implements PerspectiveFactory {
>
>         public Perspective getPerspective(String persistentId) {
>                 Perspective perspective = new Perspective(persistentId, "Perspective1");
>                 LayoutSequence sequence = perspective.getInitialSequence(true);
>                 return perspective;
>         }
> }
>
> Note, this is just taken from a random site on the Internet, so I have
> no idea whether it is correct.
>
> Unfortunately, at this stage, I get the following exception:
>
> Sep 20, 2006 11:16:03 PM
> org.springframework.richclient.application.ApplicationLauncher
> launchMyRichClient
> SEVERE: Exception occured initializing Application bean
> java.lang.NullPointerException
>         at
> org.springframework.richclient.application.flexdock.FlexDockApplicationPage.loadLayout(FlexDockApplicationPage.java:185)
>         at
> org.springframework.richclient.application.flexdock.FlexDockApplicationPageFactory.createApplicationPage(FlexDockApplicationPageFactory.java:66)
>         at
> org.springframework.richclient.application.support.AbstractApplicationWindow.createPage(AbstractApplicationWindow.java:226)
>         at
> org.springframework.richclient.application.support.AbstractApplicationWindow.createPage(AbstractApplicationWindow.java:212)
>         at
> org.springframework.richclient.application.support.AbstractApplicationWindow.showPage(AbstractApplicationWindow.java:161)
>         at
> org.springframework.richclient.application.Application.openWindow(Application.java:148)
>         at
> org.springframework.richclient.application.Application.start(Application.java:210)
>         at
> org.springframework.richclient.application.ApplicationLauncher.launchMyRichClient(ApplicationLauncher.java:223)
>         at
> org.springframework.richclient.application.ApplicationLauncher.<init>(ApplicationLauncher.java:103)
>         at za.net.dawes.SimpleApp.main(SimpleApp.java:74)
>
> Which is happening because in the following line in loadLayout():
>
>          // mark the view associated with the active component as active
>          View view = getView( getActiveComponent().getId() );
>
> getActiveComponent() is returning null.
>
> I assume that I want this to be set to my InitialView, but I can't
> figure out where to set this.
>
> Here is one route:
>
> org.springframework.richclient.application.support.AbstractApplicationPage.setActiveComponent(PageComponent)
> org.springframework.richclient.application.support.AbstractApplicationPage.showView(ViewDescriptor)
> org.springframework.richclient.application.support.AbstractApplicationPage.showView(String)
> org.springframework.richclient.application.flexdock.FlexDockApplicationPage.getDockable(String)
>
> and here is another:
>
> org.springframework.richclient.application.support.AbstractApplicationPage.setActiveComponent(PageComponent)
> org.springframework.richclient.application.flexdock.new
> PropertyChangeListener() {...}.propertyChange(PropertyChangeEvent)
>
> but neither of them seem to make any sense.
>
> Peter? Any help you can give would be much appreciated!
>
> Thanks
>
> Rogan
>
>
>
> -------------------------------------------------------------------------
> 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
> _______________________________________________
> Springframework-rcp-dev mailing list
> Springframework-rcp-dev@...
> https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev
>

-------------------------------------------------------------------------
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
_______________________________________________
Springframework-rcp-dev mailing list
Springframework-rcp-dev@...
https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev

 « Return to Thread: Spring Rich and FlexDock