DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Frameworks
  4. Customizing the Eclipse About Dialog

Customizing the Eclipse About Dialog

Prakash  user avatar by
Prakash
·
Feb. 20, 09 · Interview
Like (0)
Save
Tweet
Share
14.38K Views

Join the DZone community and get the full member experience.

Join For Free

In the About Dialog, the image, text etc, can be customized by the extension point org.eclipse.core.runtime.products (or PDE's product editor). But with few changes into the nightly build of 3.5, the About Dialog sports a new look and is much more customizable. In this tip, lets see how to extend it.

The new Eclipse About Dialog (for the RCP mail sample) looks like this:
image


If you click the "Installation Details" button, you will get this Dialog:
image

How about adding our own tab here? You need to extend the new org.eclipse.ui.installationPages extension point.

<extension 
      point="org.eclipse.ui.installationPages"> 
   <page 
         class="com.eclipse_tips.rcp.mail.MailInstallationpage" 
         id="com.eclipse-tips.rcp.mail.Installationpage" 
         name="RCP Mail"> 
   </page> 
</extension>

 



The class should extend org.eclipse.ui.about.InstallationPage, which has the createControl() method. Create all the UI you want there:
image
If you see the Plug-ins tab or Configuration tab, there are few buttons. How to add a new button in our RCP Mail Tab? I was looking for a createButtons() method to override, but its not that way. The buttons are contributed thru Command Framework:

<extension 
      point="org.eclipse.ui.commands"> 
   <command 
         defaultHandler="com.eclipse_tips.rcp.mail.ShowRegistrationHandler" 
         id="com.eclipse-tips.rcp.mail.showRegistrationCommand" 
         name="Registration Details"> 
   </command> 
</extension> 
<extension 
      point="org.eclipse.ui.menus"> 
   <menuContribution 
         locationURI="toolbar:org.eclipse.ui.installationDialog.buttonbar"> 
      <command 
            commandId="com.eclipse-tips.rcp.mail.showRegistrationCommand" 
            style="push"> 
         <visibleWhen> 
            <with 
                  variable="org.eclipse.ui.installationPage.activePage.id"> 
               <equals 
                     value="com.eclipse-tips.rcp.mail.InstallationPage"> 
               </equals> 
            </with> 
         </visibleWhen> 
      </command> 
   </menuContribution> 
</extension>



If you don't understand the above extension, you need to refer to my earlier tips on Command Framework :-P
Result:
image

Why can't it be as simple as extending a createButtons() method? Well, flexibility for other plugins to extend. Say if we want to add a button to the existing Plug-ins tab, all we have to do is add a menuContribution:

<extension 
      point="org.eclipse.ui.menus"> 
   <menuContribution 
         locationURI="toolbar:org.eclipse.ui.installationDialog.buttonbar"> 
      <command 
            commandId="com.eclipse-tips.rcp.mail.showRegistrationCommand" 
            style="push"> 
         <visibleWhen> 
            <with 
                  variable="org.eclipse.ui.installationPage.activePage.id"> 
               <equals 
                     value="30.PluginPage"> 
               </equals> 
            </with> 
         </visibleWhen> 
      </command> 
   </menuContribution> 
</extension> 




See. Extending it is now simple!
image

The id of the Plug-ins tab is "30.PluginPage" and the id of the Configuration tab is "31.SystemPage". Did you notice something odd there? The ids are prefixed with some numbers. These numbers decide the order of the tabs appearing in the dialog. This is not a documented behaviour, so don't expect to work the same in future versions, but for now it works. So if we prefix our ids with a lower number like "10.com.eclipse-tips.rcp.mail.InstallationPage", our tab will be shown first:
image 

The Configuration lists out all the configuration details, so if you want to add your own configuration to it, you need to extend org.eclipse.ui.systemSummarySections:

<extension 
      point="org.eclipse.ui.systemSummarySections"> 
   <section 
         class="com.eclipse_tips.rcp.mail.MailSummarySection" 
         id="com.eclipse_tips.rcp.mail.mailSummarySection" 
         sectionTitle="RCP Mail Details"> 
   </section> 
</extension>



The class should implement org.eclipse.ui.about.ISystemSummarySection, which has a single method write(PrintWriter writer). You can add all the configuration details to the writer:

public class MailSummarySection implements ISystemSummarySection { 
    @Override 
    public void write(PrintWriter writer) { 
        writer.println("User Name=Prakash G.R."); 
        writer.println("Mail Server=GMail"); 
        writer.println("Protocol=POP3"); 
    } 
}



image
This has been there for a while, thought I'll add it for completeness :-)

From http://blog.eclipse-tips.com/

Dialog (software) Eclipse

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Handle Secrets in Docker
  • HTTP vs Messaging for Microservices Communications
  • Reliability Is Slowing You Down
  • Cloud Performance Engineering

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: