Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "FAQ How do I set the title of a custom dialog?"

 
m
 
Line 1: Line 1:
If you have created your own subclass of the JFace <tt>Dialog</tt> class,
+
If you have created your own subclass of the JFace <tt>Dialog</tt> class, you can set the dialog title by overriding the <tt>configureShell</tt> method:
you can set the dialog title by overriding the <tt>configureShell</tt> method:
+
 
 
<pre>
 
<pre>
 
   protected void configureShell(Shell shell) {
 
   protected void configureShell(Shell shell) {
Line 7: Line 7:
 
   }
 
   }
 
</pre>
 
</pre>
The <tt>configureShell</tt> method can also be used to set the dialog menu bar
+
 
image (<tt>Shell.setImage</tt>), the font (<tt>Shell.setFont</tt>), the cursor
+
The <tt>configureShell</tt> method can also be used to set the dialog menu bar image (<tt>Shell.setImage</tt>), the font (<tt>Shell.setFont</tt>), the cursor (<tt>Shell.setCursor</tt>), and other shell attributes.
(<tt>Shell.setCursor</tt>), and other shell attributes.
+
  
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>

Latest revision as of 22:21, 29 May 2006

If you have created your own subclass of the JFace Dialog class, you can set the dialog title by overriding the configureShell method:

   protected void configureShell(Shell shell) {
      super.configureShell(shell);
      shell.setText("My Dialog");
   }

The configureShell method can also be used to set the dialog menu bar image (Shell.setImage), the font (Shell.setFont), the cursor (Shell.setCursor), and other shell attributes.


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.

Back to the top