Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to access Path from preference page and use it in Button Programming(Fetch path from preference page and use it in Button program to run)
How to access Path from preference page and use it in Button Programming [message #707359] Mon, 01 August 2011 14:53
SHUBHAM is currently offline SHUBHAMFriend
Messages: 4
Registered: July 2011
Junior Member
I have made a preference page in Eclipse and that is using FileFieldEditor to select ".bat" and ".exe" file. I want to fetch path from the selected FileFieldEditor and use it in different plugin to run that file when a button is pressed on workbench.

The preference page programming is

public SAML() {
setDescription("Browse Appropriate files");

public FileFieldEditor f;
public FileFieldEditor f1;
public void createFieldEditors() {
f=new FileFieldEditor(PreferenceConstants.P_PATH,
"&Prism.bat File:", getFieldEditorParent());

f1=new FileFieldEditor(PreferenceConstants.P_PATH1,
"&NuSMV Application File:", getFieldEditorParent());

and Button programming is

IPreferenceStore store = plugin.getPreferenceStore();

ProcessBuilder pb=new ProcessBuilder(store.getString(PreferenceConstants.P_PATH)); File(store.getString(PreferenceConstants.P_PATH)));
Process p=pb.start();

BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));

String in;
while((in = input.readLine()) != null) {

int exitVal=p.waitFor();

out.println("Printing on console");

out.println("Process failed");
catch (Exception e)


When i am setting the file from preference page, and clicking on the button on workbench then it says that file not found.

Please suggest me how to fix it.
Any effort would be appreciated.
Thank You

Button programming is in different package and PreferencePage programming is in different package.
Previous Topic:(no subject)
Next Topic:(no subject)
Goto Forum:

Current Time: Sun Oct 25 10:52:16 GMT 2020

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

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

Back to the top