Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: beginner questions

  1. #1

    Default beginner questions

    sorry for that questions, but i am new to spring rcp and although i found the (very good) documentation pdf in this forum, it`s still hard to find information about even the most simple things :-(

    views:
    how can i show a view without its header and that light-blue border arround it?

    forms:
    i built a form using builder and have a problem with validation.. when i change to another view the tiny red X in the lower-left corner is still showing up.. is this a bug?

  2. #2
    Join Date
    Jun 2008
    Location
    Germany
    Posts
    67

    Default

    > it`s still hard to find information about even the most simple things :-(

    Please see:
    http://karussell.wordpress.com/2009/...-client-links/

    > views: how can i show a view without its header and that light-blue border arround it?

    You could try to use the tabbed container. In the application-context.xml you can replace the applicationPageFactory:
    Code:
    <bean id="applicationPageFactory" depends-on="serviceLocator"
                class="de.timefinder.core.ui.tabbed.TabbedApplicationPageFactory">
    </bean>
    and then use the following as startPage:
    Code:
    <bean id="startPage" class="org.springframework.richclient.application.support.MultiViewPageDescriptor">
            <property name="viewDescriptors">
                <list>
                    <value>myView1</value>
                    <value>myView2</value>
                </list>
            </property>
        </bean>
    > is this a bug?

    It seems to be one:
    http://jira.springsource.org/browse/RCP-599

  3. #3

    Default

    thx for your answer and the helpful link, but i still have the problem that i cant find a way to remove header and the blue border arround my view

    application-context.xml:
    Code:
    	<bean id="initialView"
    		class="org.springframework.richclient.application.support.DefaultViewDescriptor">
    		<property name="viewClass" value="rcpTest.gui.InitialView" />
    	</bean>
    initialview.java
    Code:
    public class InitialView extends AbstractView{
    protected JComponent createControl()

    maybe there is another class for views available? or something like a factory where i can define the standard appearence for my views?

  4. #4
    Join Date
    Jun 2008
    Location
    Germany
    Posts
    67

    Default

    Which applicationPageFactory did you try?
    Could you post a screenshot?

    If you don't like the view (which 'returns' JComponent) couldn't you replace it via the createControl method?

  5. #5

    Default

    i already tried to use none(standard), tabbed and desktop.. all worked fine, but the results were not what i was looking for

    if you take a look at the screenshot: all i want is just a "clean start".. i want to see the normal window-header and the menu bar, but i dont want to see the light-blue header of the view below and the light-blue border arround that view

    so what i am looking for is just a view without anything special
    Attached Images Attached Images

  6. #6
    Join Date
    Jun 2008
    Location
    Germany
    Posts
    67

    Default

    Okay. I see.
    You are using a docking manager as I guess from the screenshot.
    And when using a docking manager several windows could be opened and you can drag them around. But if you want to drag them around you have to pick one window at the blue title bar to do so. How would you drag them without this bar?

    I think you can hide this bar (although I am not sure because I am using mydoggy as my docking system), but you should be able to simple return a JPanel (in YourView.createControl) instead of using a full blown docking system.
    Does this help?

  7. #7

    Default

    even if i return an empty panel, the header and border are still there:
    Code:
    public class InitialView extends AbstractView {
    
    	private JPanel panel = new JPanel();
    
    	protected JComponent createControl() {
                 return panel;
            }
    
    }
    hmm if my code really uses a docking manager, then i have no idea where it is defined, cant find anything like that in my application-context.xml

  8. #8
    Join Date
    Aug 2004
    Location
    San Francisco
    Posts
    423

    Default

    Hi,

    what you are seeing is an example of SimpleInternalFrame which is designed to replace JInternalFrame. It is constructed as the control within DefaultPageComponentPane. The DefaultPageComponentPane is constructed in the DefaultPageComponentPaneFactory.

    As these names suggest they are defaults and can be overridden. You can inject your own implementation of PageComponentPaneFactory into ApplicationServices and thus produce your own component panes.

    Seems a little complex but the price you pay for flexibility.

    hope that clears things up.

    Jonny

  9. #9
    Join Date
    Jun 2008
    Location
    Germany
    Posts
    67

    Default

    Ah, okay. Thanks Jonny for this clarification.
    So, this means you have to replace:
    Code:
    <bean id="applicationPageFactory" depends-on="serviceLocator"            
    class="org.springframework.richclient.application.tabbed.TabbedApplicationPageFactory">
    </bean>
    ... with your own implementation.

    So, simply take a look at this class how it is implemented and replace the JTabedPane with a JPanel.

  10. #10
    Join Date
    Aug 2004
    Location
    San Francisco
    Posts
    423

    Default

    Actually to change the implementation of the frame used by the pages you don't need to replace the ApplicationPageFactory but rather the PageComponentPaneFactory. You do this by injecting the replacement into application services:

    Code:
    <bean id="applicationServices"
            class="org.springframework.richclient.application.support.DefaultApplicationServices">
    
    ... various service definitions
    
    <property name="pageComponentPaneFactoryId" value="pageComponentPaneFactory" />
    
    </bean>
    where pageComponentPaneFactory is an implementation of PageComponentPaneFactory.

    In general, looking at application services for injectable beans is a great place to start to look when wanting to override the default behaviour.

    Note there is a class SimplePageComponentPane and associated factory. I've never used them but they look like they might do what was requested. So, following what I mentioned above, injecting a bean of type SimplePageComponentPaneFactory into the application services is all that needs to be done to try this out.

    Jonny

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •