Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Setting dialog title
Setting dialog title [message #772387] Thu, 29 December 2011 16:44 Go to next message
John Lussmyer is currently offline John LussmyerFriend
Messages: 96
Registered: December 2010
Member
Okay, I have a dialog that extends org.eclipse.jface.dialogs.Dialog

The constructor is:
	
public AccountDialog( Shell parent) {
	super(parent);
	setShellStyle(SWT.DIALOG_TRIM);
	parent.setText("Create Account");
	parent.setMinimumSize(300, 0);
	return;
}


It's just that the setText() and setMinimumSize() don't seem to actually do anything.
The dialog has a blank titlebar, and the width is too small.
Dialog is just barely big enough for the OK/Cancel buttons, text entry fields are way too small. Dialog is a good width in the Window Designer, it's just a lot smaller when it actually runs.
Re: Setting dialog title [message #774509 is a reply to message #772387] Wed, 04 January 2012 03:54 Go to previous messageGo to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

I think if you try a different approach like this it might work: instead setting the text, and minimum size in the AccountDialog() constructor first create a new instance like this myAccountDlg = new AccountDialog(Display.getCurrent().getDisplay()); then you need to call first myAccountDlg.create() once you do that to set the dialog window text which I think you are trying to do you can call myAccountDlg.getShell().setText("Create Account") and do the same for setMinimuimSize() the key part is calling create() method first. Try that, hope it helps. - Duncan

[Updated on: Wed, 04 January 2012 03:55]

Report message to a moderator

Re: Setting dialog title [message #774511 is a reply to message #774509] Wed, 04 January 2012 03:58 Go to previous messageGo to next message
Duncan Krebs is currently offline Duncan KrebsFriend
Messages: 31
Registered: June 2011
Location: Bay Area / Mexico
Member

I was off in the constructor above, you pass in a Shell not a display so it would be .getActiveShell()) but you get the point. - Duncan Krebs
Re: Setting dialog title [message #775420 is a reply to message #774511] Fri, 06 January 2012 00:04 Go to previous message
John Lussmyer is currently offline John LussmyerFriend
Messages: 96
Registered: December 2010
Member
Thanks, that let me do what I needed.
I really wanted to be able to set the title from within the Dialog code, and not require the caller to set it.
So I added this to my Dialog class, and it works!

	public void create() {
		super.create();
		getShell().setText("Create Filter Group");
		return;
	}
Previous Topic:RCP fonts looks weird in one PC
Next Topic:Scrolledcomposite eating up more than half of the inner composite.
Goto Forum:
  


Current Time: Thu Nov 20 23:04:34 GMT 2014

Powered by FUDForum. Page generated in 0.01777 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software