Announcement Announcement Module
Collapse
No announcement yet.
FlexDock 0.4.0 Integration? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FlexDock 0.4.0 Integration?

    Hello,

    Is anybody working on FlexDock version 0.4.0 integration for Spring RCP? I have seen the code in http://opensource2.atlassian.com/pro.../browse/RCP-98, but it seems this depends on several classes that are removed from current FlexDock version. Is there an updated integration code available somewhere, or any work in progress? I would be willing to contribute.

    with best regards,

    Andrius Šabanas

  • #2
    Hello
    I don't know about the official flexdock 0.4.0 integration stage but I did something based on the "youAdmin" code. There is no suport for multiple application windows for the moment. If it helps you I can send you the code.

    Comment


    • #3
      Hi,

      not a direct response about flexdoc, I've not looked at it much, but there is integration code for the JIDE docking framework (I'm one of the authors) at the java.net project https://jide-springrcp.dev.java.net/

      Personally, I have no association with JIDE, I just think they've got a great product that is well worth the small license fee.

      However, if you're really stuck with having to use flexdoc, I'm sure looking at my integration code with jide would give you a head start in writing similar integration code with flexdoc. They're a very similar product conceptually at least so the integration should be similar.

      Jonny

      Comment


      • #4
        Hi Jonny,

        I see you are one of the author of the spring/jide project, that do interest us.

        Could you tell us what stage you have reached on this project (is it fully functionnal, what have you implemented, what are the plans if not completed).

        Best regards.

        Sylvestre

        Comment


        • #5
          Sylvestre,

          yes, I'm one of the authors. Currently, there's two packages under the project and I'm responsible for the com.jidesoft.spring.richclient.jwray package. I can't comment on the state of the other package.

          The integration is at the state of being able to use the package to provide a multiple page, and multiple view per page implementation using the JIDE docking as the underlying technology. In addition, there's integration of the jide status bar. I'm currently using it in a production application with great success (it's this app. that drives the development of this integration code really) and I know a few more people are also using it.

          Also, I've recently been working on extending the integration. There's two main additions that I'll hopefully commit soon, once I'm happy with the code.
          i) Implementation of declarative editor support much like the current declarative view support.
          ii) Some binding/binders for JIDE components.

          I'm also working on a better demo application. I'll post when I've commited the changes.

          Jonny

          Originally posted by sse
          Hi Jonny,

          I see you are one of the author of the spring/jide project, that do interest us.

          Could you tell us what stage you have reached on this project (is it fully functionnal, what have you implemented, what are the plans if not completed).

          Best regards.

          Sylvestre

          Comment


          • #6
            Hi fanfy,

            I would be interested to see the code, as I am thinking of using FlexDock and Spring RCP in my company's project. It would probably be a good idea to do some integration code and get it added to CVS sandbox.

            One issue though - if I got it correctly, youAdmin code is licenced under GPL, and that's a stopper for commercially developed code.

            Andrius

            Originally posted by fanfy
            I don't know about the official flexdock 0.4.0 integration stage but I did something based on the "youAdmin" code. There is no suport for multiple application windows for the moment. If it helps you I can send you the code.

            Comment


            • #7
              I attached an archive with an some aditions to the spring rcp.
              - custom command manager that expose all the registered commands
              - custom application window that know how to deal with multiple application pages
              - custom page descriptor that knows how to create application pages
              - tabbed application page that presents views in tabs
              - flex application page that presents views in dockables managed by flexdock
              - some aditional classes

              This is just a begining. There are some bugs and more work to be done.
              I removed the libraries from the package but there is a .txt in docs folder with an enumeration.

              Regards
              Fanfy

              Comment


              • #8
                Thanks Fanfy,

                I have also an experience with flexdock-0.4.0, multi-page and multi-view in Spring-RCP, but I am not satisfied from my success.
                I appreciate your code and would be glad to see it in CVS sandbox.

                Thanks to Andrius Šabanas, to renew this hot topic.

                Best regards,
                Miro

                Comment


                • #9
                  First of all I would like to thank you for the effort to integrate flexdock. I was also looking for a solution and I'm glad to have a starting point. I have a problem with your solution though and I would like to know, if you have this problem too. When I start my application using flexdock my application starts at the right size, but is immediately shrinked to a size where it is unusable. Afterwards I can resize the application and work with it.
                  I also always get the following exception:

                  Code:
                  2006-01-22 22:41:51,179 ERROR org.springframework.richclient.application.config.ApplicationLifecycleAdvisor - 3
                  java.lang.ArrayIndexOutOfBoundsException: 3
                  	at java.awt.Container.validateTree(Container.java:1476)
                  	at java.awt.Container.validateTree(Container.java:1480)
                  	at java.awt.Container.validate(Container.java:1448)
                  	at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
                  	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
                  	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                  	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
                  	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
                  	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
                  	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
                  	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
                  	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
                  Any help would be appreciated.

                  Regards
                  Jan

                  Comment


                  • #10
                    Thanks, Fanfy!

                    I wasn't interested in the Flexdock stuff, but I found the TabbedApplicationPage to be quite useful.

                    I extended the idea a bit by adding support for a split pane.
                    Code is below:

                    Code:
                    package org.springframework.richclient.split;
                    
                    import java.awt.BorderLayout;
                    
                    import javax.swing.JComponent;
                    import javax.swing.JPanel;
                    import javax.swing.JSplitPane;
                    
                    import org.springframework.richclient.application.ApplicationWindow;
                    import org.springframework.richclient.application.PageComponent;
                    import org.springframework.richclient.application.PageComponentDescriptor;
                    import org.springframework.richclient.application.PageComponentPane;
                    import org.springframework.richclient.application.PageDescriptor;
                    import org.springframework.richclient.application.PageLayoutBuilder;
                    import org.springframework.richclient.application.support.AbstractApplicationPage;
                    import org.springframework.richclient.application.support.DefaultViewContext;
                    
                    public class SplitApplicationPage extends AbstractApplicationPage implements PageLayoutBuilder {
                    	JSplitPane splitPane;
                    	int orientation = JSplitPane.HORIZONTAL_SPLIT;
                    	
                    	public SplitApplicationPage(ApplicationWindow window, PageDescriptor pageDescriptor) {
                    		super(window, pageDescriptor); 
                    	}
                    
                    	protected boolean giveFocusTo(PageComponent pageComponent) {
                    		return true;
                    	}
                    
                    	protected PageComponent createPageComponent(PageComponentDescriptor descriptor) {
                    		final PageComponent pageComponent = descriptor.createPageComponent();
                    		PageComponentPane pageComponentPane = new PageComponentPane(pageComponent) {		
                    			protected JComponent createControl() {
                    				JPanel panel = new JPanel(true);
                    				panel.setLayout(new BorderLayout());
                    				panel.add(pageComponent.getControl(), BorderLayout.CENTER);
                    				return panel;
                    			}
                    		};
                    		pageComponent.setContext(new DefaultViewContext(this, pageComponentPane));
                    		splitPane.add(pageComponentPane.getControl());
                    		
                    		return pageComponent;
                    	}
                    
                    	public void addView(String viewDescriptorId) {
                    		showView(viewDescriptorId);
                    	}
                    
                    	public JComponent getControl() {
                    		if (splitPane == null) {
                    			splitPane = new JSplitPane(orientation);
                    			getPageDescriptor().buildInitialLayout(this);
                    			setActiveComponent();
                    		}
                    		return splitPane;
                    	}
                    
                    	public int getOrientation() {
                    		return orientation;
                    	}
                    
                    	public void setOrientation(int orientation) {
                    		this.orientation = orientation;
                    	}
                    }
                    I have two issues.

                    the first is a simple one.

                    MultipleViewsPageDescriptor should include a viewProperties property. this will allow me to pass parameters to the application class such as the orientation of the split pane. DefaultViewDescriptora already does this.

                    the second one is more complicated.

                    what I really want is to have a split pane inside one of my tabs. I tried adding a MultipleViewsPageDescriptor to the list of view descriptors in another MultipleViewsPageDescriptor, but that resulted in a ClassCastException because MultipleViewsPageDescriptor is not a view descriptor. any ideas?

                    Comment


                    • #11
                      okay, fixing the first problem was easy enough.

                      Here is the new version of AbstractPageDescriptor :

                      Code:
                      package org.springframework.richclient;
                      
                      import java.lang.reflect.Constructor;
                      import java.util.Map;
                      
                      import org.springframework.beans.BeanUtils;
                      import org.springframework.beans.BeanWrapper;
                      import org.springframework.beans.BeanWrapperImpl;
                      import org.springframework.beans.factory.BeanNameAware;
                      import org.springframework.richclient.application.ApplicationPage;
                      import org.springframework.richclient.application.ApplicationWindow;
                      import org.springframework.richclient.application.PageDescriptor;
                      import org.springframework.richclient.core.LabeledObjectSupport;
                      
                      /**
                       * Page descriptor that extends LabeledObjectSupport (for easy presentation in the menu and page selector)
                       * and includes a list of command ids that will be the commands to be shown when the page will be activated.
                       * Also it acts as a application page factory  (something like ViewDescriptor). The MultipleApplicationPage
                       * uses the page descriptor to create the application page instance. That way we can have multiple application
                       * page implementations in the same rcp application.
                       * @author elvis.ciocoiu Oct 31, 2005, 12:54:57 PM
                       */
                      public abstract class AbstractPageDescriptor extends LabeledObjectSupport implements PageDescriptor, ApplicationPageFactory, BeanNameAware {	
                          private String id;
                          private String[] commandIds;
                          private Class applicationPageClass;
                          private Map viewProperties;
                          
                          public Map getViewProperties() {
                      		return viewProperties;
                      	}
                      
                      	public void setViewProperties(Map viewProperties) {
                      		this.viewProperties = viewProperties;
                      	}
                      
                      	public void setCommandIds(String[] commandIds) {
                          	this.commandIds = commandIds;
                          }
                          
                          public void setApplicationPageClass(Class applicationPageClass) {
                          	this.applicationPageClass = applicationPageClass;
                          }
                          
                          public String[] getCommandIds() {
                          	if (commandIds == null)
                          		commandIds = new String[] {};
                          	return commandIds;
                          }
                          
                          /*
                           * (non-Javadoc)
                           * @see org.springframework.richclient.application.PageDescriptor#getId()
                           */
                          public String getId() {
                              return id;
                          }
                          
                          public void setId(String id) {
                              this.id = id;
                          }
                          
                      	public ApplicationPage createApplicationPage(ApplicationWindow window, PageDescriptor descriptor) {
                      		try {
                      			Constructor ctor = applicationPageClass.getDeclaredConstructor(new Class[]{ApplicationWindow.class, PageDescriptor.class});
                      			ApplicationPage page =  (ApplicationPage) BeanUtils.instantiateClass(ctor, new Object[] {window, descriptor});
                      		
                      			if (viewProperties != null) {
                      	            BeanWrapper wrapper = new BeanWrapperImpl(page);
                      	            wrapper.setPropertyValues(viewProperties);
                      	        }
                      			
                      			return page;
                      		} catch (Exception e) {
                      			logger.debug("Cannot create the application page for the descriptor with id" + descriptor.getId(), e);
                      			return null;
                      		}
                      	}
                      
                      	public void setBeanName(String name) {
                      		setId(name);
                      	}
                      }
                      second problem I'm going to need some help with.

                      Comment


                      • #12
                        Anybody using the flexdock integration successfully?

                        Hi.

                        I was wondering if anybody was able to use the integration of flexdock successfully.
                        I'm still having a lot of problems and there are quite some exceptions.
                        Most of the time it is the following exception:

                        Code:
                        java.lang.ArrayIndexOutOfBoundsException: 3
                        	at java.awt.Container.validateTree(Container.java:1476)
                        	at java.awt.Container.validateTree(Container.java:1480)
                        	at java.awt.Container.validate(Container.java:1448)
                        	at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:379)
                        	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:113)
                        	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
                        	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
                        	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
                        	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
                        	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
                        	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
                        	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
                        Any help would be appreciated.

                        Thanks
                        Jan

                        Comment


                        • #13
                          Is anyone merging all these changing as attaching them
                          http://opensource2.atlassian.com/pro.../browse/RCP-98
                          as described in
                          http://spring-rich-c.sourceforge.net...t/helpOut.html
                          ?

                          If so and no other developer is taking upon this issue, I will take it upon me after the build process is crystalized (in 4-5 weeks)

                          Comment


                          • #14
                            MultiplePages in 0.2.0 Release (Tabbed Panes...)

                            Hello Fanfy,

                            your code for the MuliplePages is very fine. I tried it with the 0.2.0 release of the rcp.
                            Below I want to give some hints to all who want do try fanfy's code with the 0.2.0 release:
                            1. first have a look to this http://spring-rich-c.sourceforge.net...upgrading.html and do the changes as descripted there.
                            2. Change: "Object desc = getServices().getBean(pageDescriptorId);" in MultiplePagesApplicationWindow to "ApplicationContext ctx = Application.instance().getApplicationContext(); Object desc = ctx.getBean(pageDescriptorId);"
                            3. implement the class MultiplePagesApplicationWindowFactory (see below)
                            4. add the MultiplePagesApplicationWindowFactory class to root-context.xml (see below)
                            5. remove the bean with the id applicationWindowPrototype from root-context.xml (this magic names does not work anymore - see also http://www.nabble.com/ApplicationWin...-t1642168.html

                            Code:
                            public class MultiplePagesApplicationWindowFactory implements ApplicationWindowFactory {
                                private static final Log logger = LogFactory.getLog( MultiplePagesApplicationWindowFactory.class );
                            
                                public ApplicationWindow createApplicationWindow() {
                                    logger.info( "Creating new MultiplePagesApplicationWindow" );
                            
                                    return new MultiplePagesApplicationWindow();
                                }
                            }
                            Code:
                            <bean id="applicationWindowFactory" class="org.springframework.richclient.MultiplePagesApplicationWindowFactory">
                                </bean>
                            ....
                            <bean id="applicationServices"
                                    class="org.springframework.richclient.application.support.DefaultApplicationServices">
                                    <property name="imageSourceId"><idref bean="imageSource"/></property>
                            ....
                                            <property name="applicationWindowFactoryId"><idref bean="applicationWindowFactory"/></property>
                                </bean>
                            Hope this helps.

                            Best regards

                            Gerhard

                            Comment


                            • #15
                              Hello Friends,

                              I have a basic question, just now I have started learning docking frame works

                              I got a sample program, I have tried to compile it, bbut its not working.. I got am error, pl help me out


                              package net.eleritec.docking.demos;

                              import java.awt.BorderLayout;
                              import java.awt.Color;
                              import java.awt.Dimension;

                              import javax.swing.JFrame;
                              import javax.swing.JPanel;
                              import net.eleritec.docking.DockingManager;
                              import net.eleritec.docking.DockingPort;
                              import net.eleritec.docking.defaults.DefaultDockingPort;


                              am getting error here, It says this package doesnt found


                              public class SimpleDemo extends JFrame {
                              public static void main(String[] args) {
                              JFrame f = new SimpleDemo();
                              f.setSize(600, 400);
                              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                              f.setVisible(true);
                              }

                              public SimpleDemo() {
                              super("Simple Docking Demo");
                              setContentPane(createContentPane());
                              }

                              private JPanel createContentPane() {
                              JPanel p = new JPanel(new BorderLayout(5, 5));
                              p.add(buildDockingPort(Color.blue, "Blue"), BorderLayout.NORTH);
                              p.add(buildDockingPort(Color.red, "Red"), BorderLayout.SOUTH);
                              p.add(buildDockingPort(Color.green, "Green"), BorderLayout.EAST);
                              p.add(buildDockingPort(Color.yellow, "Yellow"), BorderLayout.WEST);
                              p.add(createDockingPort(), BorderLayout.CENTER);
                              return p;
                              }

                              private DefaultDockingPort buildDockingPort(Color color, String desc) {
                              // create the DockingPort
                              DefaultDockingPort port = createDockingPort();

                              // create and register the Dockable panel
                              JPanel p = new JPanel();
                              p.setBackground(color);
                              DockingManager.registerDockable(p, desc, true);

                              // dock the panel and return the DockingPort
                              port.dock(p, desc, DockingPort.CENTER_REGION, false);
                              return port;
                              }

                              private DefaultDockingPort createDockingPort() {
                              DefaultDockingPort port = new DefaultDockingPort();
                              port.setBackground(Color.gray);
                              port.setPreferredSize(new Dimension(100, 100));
                              return port;
                              }
                              }


                              Please help me for my learning..

                              Comment

                              Working...
                              X