Announcement Announcement Module
Collapse
No announcement yet.
How to add tab icon in TabbedApplicationPage Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to add tab icon in TabbedApplicationPage

    I wanted to add icon in tabs of my TabbedApplicationPage, I looked at the source of doAddPageComponent method, it looks like
    Code:
    tabbedPane.addTab(pageComponent.getDisplayName(),
    	pageComponent.getIcon(), pageComponent.getControl());
    Now I can manually set the icon via 'descriptor.image' property of the view class:
    Code:
    <bean id="audioDirView" class="org.springframework.richclient.application.support.DefaultViewDescriptor">
    	<property name="viewClass">
    		<value>mycompany.AudioDirView</value>
    	</property>
    	<property name="viewProperties">
    		<map>
    			<entry key="descriptor.image">
    				<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    					<property name="targetObject" ref="imageSource"></property>
    					<property name="targetMethod" value="getImage"></property>
    					<property name="arguments">
    						<list>
    							<value>middle.icon</value>
    						</list>
    					</property>
    				</bean>
    			</entry>	
    		</map>
    	</property>
    </bean>
    This code looks a bit ugly, and I think we should be able to set the icon via images.properties file, as all action command can read icon definition from this file automatically. Can we do the same thing for view classes?

  • #2
    You have to provide an icon for your View in the images.properties. Then it will be picked up by the TabbedApplicationPage.

    Hope this helps,

    Peter

    Comment


    • #3
      Didn't work

      I've put an icon property like this:

      audioDirView.icon=middle.gif

      in the images.properties, and I didn't see the icon. The image definitly exists.

      Comment


      • #4
        You have to use audioDirView.image=middle.gif

        This should in fact be icon instead of image. I'll create a jira issue for this.

        Peter

        Comment

        Working...
        X