/* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ public void init(IWorkbench workbench) { try { PROSActions actions = Activator.getPROSActions(); IPreferenceStore store = Activator.getDefault().getPreferenceStore(); store.setValue( PreferenceConstants.P_LOCAL_REPOSITORY, actions.getLocalRepositoryPath().toString()); store.setValue(PreferenceConstants.P_UPDATE_SITE, actions.getUpdateSite().toExternalForm()); } catch (IOException e) { e.printStackTrace(); } }
@Override protected void performApply() { super.performApply(); PROSActions actions; try { actions = Activator.getPROSActions(); IPreferenceStore store = Activator.getDefault().getPreferenceStore(); try { actions.setLocalKernelRepository( Paths.get(store.getString(PreferenceConstants.P_LOCAL_REPOSITORY))); } catch (IOException e) { showErrorDialog( "Error saving settings", "There was an error saving the settings. Try again later.", IStatus.ERROR, e); } try { actions.setUpdateSite(new URL(store.getString(PreferenceConstants.P_UPDATE_SITE))); } catch (MalformedURLException e) { showErrorDialog("Bad URL input", "The provided URL is invalid.", IStatus.ERROR, e); } catch (IOException e) { showErrorDialog( "Error saving settings", "There was an error saving the settings. Try again later.", IStatus.ERROR, e); } kernelListEditor.doLoad(); } catch (IOException e) { showErrorDialog( "PROS Error", "There was an error creating the PROS Updater interface.", IStatus.ERROR, e); } }
public WizardPreferencesPage() { super(GRID); setPreferenceStore(Activator.getDefault().getPreferenceStore()); setDescription("Configure settings for interacting with the PROS CLI."); }