Boards.ie uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Click here to find out more x
Post Reply  
 
Thread Tools Search this Thread
03-07-2006, 15:38   #1
pjfogarty
Registered User
 
Join Date: Jun 2006
Posts: 36
java simple problem

Hi,
I am using a FileDialog dialog and i am wondering if there is a way of changing the text on the buttons,eg change open to something else.I am just using it for selecting a files path by browsing.I am not opening the file,just grabing the path,so something like select would be better.

eg:
import org.eclipse.swt.widgets.FileDialog;

FileDialog out = new FileDialog(shell,SWT.OPEN);
out.setText("Find or create a file to save output of xslt transform");
out.setFilterPath("C:/");
String[] filterExt = { "*.xml" };
out.setFilterExtensions(filterExt);

Thanks
Pj
pjfogarty is offline  
Advertisement
05-07-2006, 15:36   #2
timeout
Registered User
 
timeout's Avatar
 
Join Date: Nov 2001
Location: Galway - Dublin
Posts: 904
Well you could subclass it, add a new constructorer and implement that instead. Somebody might have done this already or there might be an alternative method. Just can't think of any right now.
timeout is offline  
05-07-2006, 15:42   #3
Hobbes
Moderator
 
Hobbes's Avatar
 
Join Date: Feb 1998
Location: Dublin
Posts: 20,768
Mod: Korean
You would be quicker creating your own dialog.
Hobbes is offline  
05-07-2006, 16:45   #4
Dr Pepper
Registered User
 
Dr Pepper's Avatar
 
Join Date: Nov 2003
Location: Dunboyne, Meath
Posts: 800
JFileChooser has a method called setApproveButtonText for the very thing. Is is possible you could use that instead?
I'm not familiar with org.eclipse.swt.widgets.FileDialog so couldn't tell ya how to do it with that dialog!
Dr Pepper is offline  
06-07-2006, 16:32   #5
GreeBo
Moderator
 
GreeBo's Avatar
 
Join Date: Oct 2003
Posts: 11,877
Mod: Golf
yeah, nothing obvious in org.eclipse.swt.widgets.FileDialog or its parents..
I'd set about extending it, I dont have the code but Im sure the Open button is just some sort of Button object contained within FileDialog, should be easy to entend FileDialog, maybe with a constructor that takes in the button label as a param or something?
GreeBo is online now  
Post Reply

Quick Reply
Message:
Remove Text Formatting
Bold
Italic
Underline

Insert Image
Wrap [QUOTE] tags around selected text
 
Decrease Size
Increase Size
Please sign up or log in to join the discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Share Tweet