List of usage examples for org.eclipse.jface.preference DirectoryFieldEditor DirectoryFieldEditor
public DirectoryFieldEditor(String name, String labelText, Composite parent)
From source file:at.medevit.elexis.ehc.ui.preference.PreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { FieldEditor editor;/*from w w w . ja v a2s. com*/ editor = new DirectoryFieldEditor(EHC_OUTPUTDIR, "Standard Ausgabeverzeichnis", getFieldEditorParent()); addField(editor); editor = new DirectoryFieldEditor(EHC_INPUTDIR, "Standard Eingangsverzeichnis", getFieldEditorParent()); addField(editor); }
From source file:autobackup.preferences.AutoBackupPreferencesPage.java
License:Open Source License
public void createFieldEditors() { localPath = new DirectoryFieldEditor(AutoBackupPreferenceNames.P_LOCALPATH, "Local Path to Store Backups: ", getFieldEditorParent());//w w w . j a v a 2s .com useRemote = new BooleanFieldEditor(AutoBackupPreferenceNames.P_USEREMOTE, "Use &Remote Backup: ", getFieldEditorParent()); remoteService = new RadioGroupFieldEditor(AutoBackupPreferenceNames.P_SERVICE, "Select your Backup Service", 1, new String[][] { { "SCP", "ssh" } }, getFieldEditorParent()); user = new StringFieldEditor(AutoBackupPreferenceNames.P_USER, "&User:", getFieldEditorParent()); hostname = new StringFieldEditor(AutoBackupPreferenceNames.P_HOSTNAME, "&Hostname:", getFieldEditorParent()); remotePath = new StringFieldEditor(AutoBackupPreferenceNames.P_REMOTEPATH, "Remote Path to Store Backups: ", getFieldEditorParent()); addField(localPath); addField(useRemote); addField(remoteService); addField(user); addField(hostname); addField(remotePath); }
From source file:ch.docbox.elexis.UserDocboxPreferences.java
License:Open Source License
@Override protected void createFieldEditors() { oldSha1Password = getSha1DocboxPassword(); oldLoginId = getDocboxLoginID(true); oldAppointmentsEmergencyService = isAppointmentsEmergencyService(); oldAppointmentsPharmaVisits = isAppointmentsPharmaVisits(); oldAppointmentsTerminvereinbarung = isAppointmentsTerminvereinbarung(); oldAppointmentsBereich = getAppointmentsBereich(); oldUseHCard = useHCard();//from ww w . j av a2s . c om oldUseProxy = useProxy(); oldProxyHost = getProxyHost(); oldProxyPort = getProxyPort(); oldSecretKey = getSha1DocboxSecretKey(); boolean enableForMandant = CoreHub.acl.request(AccessControlDefaults.ACL_USERS); loginIdFieldEditor = new StringFieldEditor(WsClientConfig.USR_DEFDOCBXLOGINID, Messages.UserDocboxPreferences_LoginId, getFieldEditorParent()); addField(loginIdFieldEditor); loginIdFieldEditor.setEnabled(enableForMandant, getFieldEditorParent()); passwordFieldEditor = new StringFieldEditor(WsClientConfig.USR_DEFDOCBOXPASSWORD, Messages.UserDocboxPreferences_Password, getFieldEditorParent()); passwordFieldEditor.getTextControl(getFieldEditorParent()).setEchoChar('*'); //$NON-NLS-1$ passwordFieldEditor.setEnabled(enableForMandant, getFieldEditorParent()); addField(passwordFieldEditor); if (showSha1SecretKey) { secretkeyFieldEditor = new StringFieldEditor(WsClientConfig.USR_SECRETKEY, Messages.UserDocboxPreferences_SecretKey, getFieldEditorParent()); secretkeyFieldEditor.getTextControl(getFieldEditorParent()).setEchoChar('*'); //$NON-NLS-1$ secretkeyFieldEditor.setEnabled(enableForMandant, getFieldEditorParent()); addField(secretkeyFieldEditor); } buttonConfigureCert = new Button(getFieldEditorParent(), SWT.PUSH); buttonConfigureCert.setText("Zertifikat konfigurieren"); buttonConfigureCert.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); buttonConfigureCert.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { CertificateConfigDialog dlg = new CertificateConfigDialog(getShell()); dlg.open(); } }); if (WsClientUtil.isMedelexisCertAvailable()) { buttonConfigureCert.setEnabled(false); } buttonUseHCard = new Button(getFieldEditorParent(), SWT.CHECK); buttonUseHCard.setText(Messages.UserDocboxPreferences_UseHCard); buttonUseHCard.setSelection(useHCard()); buttonUseHCard.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); buttonUseHCard.setEnabled(enableForMandant); directoryhCardEditor = new DirectoryFieldEditor(USR_DEFDOCBOXPATHHCARDAPI, Messages.UserDocboxPreferences_PathHCardAPI, getFieldEditorParent()); directoryhCardEditor.setEnabled(enableForMandant, getFieldEditorParent()); addField(directoryhCardEditor); buttonUseProxy = new Button(getFieldEditorParent(), SWT.CHECK); buttonUseProxy.setText(Messages.UserDocboxPreferences_UseProxy); buttonUseProxy.setSelection(useProxy()); buttonUseProxy.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); buttonUseProxy.setEnabled(enableForMandant); proxyHostFieldEditor = new StringFieldEditor(USR_PROXYHOST, Messages.UserDocboxPreferences_UseProxyHost, getFieldEditorParent()); addField(proxyHostFieldEditor); proxyHostFieldEditor.setEnabled(enableForMandant, getFieldEditorParent()); proxyPortFieldEditor = new StringFieldEditor(USR_PROXYPORT, Messages.UserDocboxPreferences_UseProxyPort, getFieldEditorParent()); addField(proxyPortFieldEditor); proxyPortFieldEditor.setEnabled(enableForMandant, getFieldEditorParent()); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL) .setLayoutData(SWTHelper.getFillGridData(3, true, 1, false)); Button docboxConnectionTestButton = new Button(getFieldEditorParent(), SWT.PUSH); docboxConnectionTestButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent arg0) { String sha1Password = (passwordFieldEditor.getStringValue().equals(oldSha1Password) ? oldSha1Password : CDACHServicesClient.getSHA1(passwordFieldEditor.getStringValue())); CoreHub.mandantCfg.set(WsClientConfig.USR_DEFDOCBXLOGINID, loginIdFieldEditor.getStringValue()); CoreHub.mandantCfg.set(WsClientConfig.USR_DEFDOCBOXPASSWORD, sha1Password); if (showSha1SecretKey && secretkeyFieldEditor != null) { CoreHub.mandantCfg.set(WsClientConfig.USR_SECRETKEY, secretkeyFieldEditor.getStringValue()); } setUseHCard(buttonUseHCard.getSelection()); setUseProxy(buttonUseProxy.getSelection()); setProxyHost(proxyHostFieldEditor.getStringValue()); setProxyPort(proxyPortFieldEditor.getStringValue()); if (getSha1DocboxSecretKey() == null || "".equals(getSha1DocboxSecretKey())) { MessageBox box = new MessageBox(UiDesk.getDisplay().getActiveShell(), SWT.ICON_ERROR); box.setText(Messages.UserDocboxPreferences_NoSecretKeyTitle); box.setMessage(Messages.UserDocboxPreferences_NoSecretKey); box.open(); } else { javax.xml.ws.Holder<java.lang.String> message = new javax.xml.ws.Holder<java.lang.String>(); boolean isOk = performConnectionTest(message); MessageBox box = new MessageBox(UiDesk.getDisplay().getActiveShell(), (isOk ? SWT.ICON_WORKING : SWT.ICON_ERROR)); box.setText(Messages.UserDocboxPreferences_ConnectionTestWithDocbox); box.setMessage(message.value); box.open(); } } }); docboxConnectionTestButton.setText(Messages.UserDocboxPreferences_ConnectionTest); docboxConnectionTestButton.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL) .setLayoutData(SWTHelper.getFillGridData(3, true, 1, false)); directoryFieldEditor = new DirectoryFieldEditor(USR_DEFDOCBOXPATHFILES, Messages.UserDocboxPreferences_PathFiles, getFieldEditorParent()); addField(directoryFieldEditor); directoryFieldEditor.setEnabled(enableForMandant, getFieldEditorParent()); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL) .setLayoutData(SWTHelper.getFillGridData(3, true, 1, false)); if (hasAgendaPlugin() && enableForMandant) { buttonAgendaSettingsPerUser = new Button(getFieldEditorParent(), SWT.CHECK); buttonAgendaSettingsPerUser.setText(Messages.UserDocboxPreferences_AgendaSettingsPerUser); buttonAgendaSettingsPerUser.setSelection(getAgendaSettingsPerUser()); buttonAgendaSettingsPerUser.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); } if (hasAgendaPlugin()) { boolean enabled = getAgendaSettingsPerUser() || enableForMandant; Label textLabel = new Label(getFieldEditorParent(), SWT.NONE); textLabel.setText(Messages.UserDocboxPreferences_AgendaBerich); textLabel.setLayoutData(SWTHelper.getFillGridData(1, false, 1, false)); agendaBereichCombo = new Combo(getFieldEditorParent(), SWT.READ_ONLY | SWT.SINGLE); agendaBereichCombo.setItems(bereiche); agendaBereichCombo.select(getAgendaIndex()); agendaBereichCombo.setEnabled(enabled); textLabel.setLayoutData(SWTHelper.getFillGridData(2, false, 1, false)); buttonGetAppointmentsEmergencyService = new Button(getFieldEditorParent(), SWT.CHECK); buttonGetAppointmentsEmergencyService .setText(Messages.UserDocboxPreferences_GetAppointmentsEmergencyService); buttonGetAppointmentsEmergencyService.setSelection(isAppointmentsEmergencyService()); buttonGetAppointmentsEmergencyService.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); buttonGetAppointmentsEmergencyService.setEnabled(enabled); buttonGetAppointmentsPharmaVisits = new Button(getFieldEditorParent(), SWT.CHECK); buttonGetAppointmentsPharmaVisits.setText(Messages.UserDocboxPreferences_GetAppointmentsPharmaVisits); buttonGetAppointmentsPharmaVisits.setSelection(isAppointmentsPharmaVisits()); buttonGetAppointmentsPharmaVisits.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); buttonGetAppointmentsPharmaVisits.setEnabled(enabled); buttonGetAppointmentsTerminvereinbarung = new Button(getFieldEditorParent(), SWT.CHECK); buttonGetAppointmentsTerminvereinbarung .setText(Messages.UserDocboxPreferences_GetAppointmentsTerminvereinbarungen); buttonGetAppointmentsTerminvereinbarung.setSelection(isAppointmentsTerminvereinbarung()); buttonGetAppointmentsTerminvereinbarung.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); buttonGetAppointmentsTerminvereinbarung.setEnabled(enabled); } if (enableForMandant) { new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL) .setLayoutData(SWTHelper.getFillGridData(3, true, 1, false)); buttonClearDocboxInbox = new Button(getFieldEditorParent(), SWT.PUSH); buttonClearDocboxInbox.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent selectionEvent) { MessageBox box = new MessageBox(UiDesk.getDisplay().getActiveShell(), SWT.ICON_WARNING | SWT.YES | SWT.NO); box.setText(Messages.UserDocboxPreferences_ClearDocboxInbox); box.setMessage(Messages.UserDocboxPreferences_ClearDocboxInboxConfirm); if (box.open() == SWT.YES) { CdaMessage.deleteCdaMessages(CoreHub.actMandant); } } }); buttonClearDocboxInbox.setText(Messages.UserDocboxPreferences_ClearDocboxInbox); buttonClearDocboxInbox.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); } Button btnConvertDocboxIds = new Button(getFieldEditorParent(), SWT.PUSH); btnConvertDocboxIds.setText(Messages.UserDocboxPreferences_ConvertDocboxIds); btnConvertDocboxIds.setToolTipText(Messages.UserDocboxPreferences_ConvertDocboxIds_Tooltip); btnConvertDocboxIds.setLayoutData(SWTHelper.getFillGridData(3, false, 1, false)); btnConvertDocboxIds.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent arg0) { IProgressService progService = PlatformUI.getWorkbench().getProgressService(); try { progService.runInUI(progService, new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { DocboxContact.importDocboxIdsFromKontaktExtinfo(monitor); } }, null); } catch (Exception e) { e.printStackTrace(); } } }); }
From source file:ch.elexis.extdoc.preferences.ExterneDokumente.java
License:Open Source License
@Override protected void createFieldEditors() { DirectoryFieldEditor dfe;//from w w w . j av a 2 s . com StringFieldEditor sfe; FileFieldEditor ffe; PreferenceConstants.PathElement[] prefElems = PreferenceConstants.getPrefenceElements(); for (int j = 0; j < prefElems.length; j++) { sfe = new StringFieldEditor(prefElems[j].prefName, String.format(Messages.ExterneDokumente_shorthand_for_path, j), getFieldEditorParent()); sfe.setTextLimit(8); addField(sfe); dfe = new DirectoryFieldEditor(prefElems[j].prefBaseDir, Messages.ExterneDokumente_path_name_preference, getFieldEditorParent()); addField(dfe); } sfe = new StringFieldEditor(PreferenceConstants.CONCERNS, Messages.ExterneDokumente_Concerns, getFieldEditorParent()); sfe.setTextLimit(60); addField(sfe); Composite composite = getFieldEditorParent(); ffe = new FileFieldEditor(PreferenceConstants.EMAIL_PROGRAM, Messages.ExterneDokumente_email_app, getFieldEditorParent()); ffe.getLabelControl(composite).setToolTipText( "Programm das zum Verschicken von E-Mails verwendet werden soll, falls leer wird dir URL mailto: verwendet, welche keine Anhnge untersttzt"); addField(ffe); }
From source file:ch.elexis.laborimport.bioanalytica.PreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new FileFieldEditor(JAR_PATH, "OpenMedical Bibliothek (JMedTransferO.jar)", getFieldEditorParent()));/*from w ww.j a v a 2s .co m*/ addField(new FileFieldEditor(INI_PATH, "OpenMedical Konfiguration (MedTransfer.ini)", getFieldEditorParent())); addField(new DirectoryFieldEditor(DL_DIR, "Download Verzeichnis", getFieldEditorParent())); }
From source file:ch.elexis.laborimport.hl7.universal.Preferences.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new DirectoryFieldEditor(CFG_DIRECTORY, Messages.Prefs_ImportDirectory, getFieldEditorParent())); addField(new BooleanFieldEditor(HL7Parser.CFG_IMPORT_ENCDATA, Messages.Prefs_ImportAttachedFiles, getFieldEditorParent()));//from www. j a v a 2 s .c om addField(new BooleanFieldEditor(CFG_DIRECTORY_AUTOIMPORT, "Verzeichnis berwachen und automatisch importieren", getFieldEditorParent())); }
From source file:ch.elexis.laborimport.labtop.PreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new FileFieldEditor(JAR_PATH, Messages.PreferencePage_JMedTrasferJar, getFieldEditorParent())); addField(new FileFieldEditor(INI_PATH, Messages.PreferencePage_JMedTrasferJni, getFieldEditorParent())); addField(new DirectoryFieldEditor(DL_DIR, Messages.PreferencePage_DownloadDir, getFieldEditorParent())); }
From source file:ch.elexis.molemax.views.MolemaxPrefs.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new DirectoryFieldEditor(BASEDIR, Messages.MolemaxPrefs_basedir, getFieldEditorParent())); }
From source file:ch.elexis.notes.Preferences.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new DirectoryFieldEditor(CFGTREE, Messages.Preferences_basedir, getFieldEditorParent())); }
From source file:ch.elexis.omnivore.ui.preferences.PreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { // I'd like to place ALL groups in this preference dialog one under another, // so that each group completely occupies the available horizontal space. // But the default behaviour is to put the groups next to each other :-( // For instructions, see: // http://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html // I can't use any other layout but GridLayout. // Otherwise some adjustGridLayout() somewhere else will invariably throw: // "The currently displayed page contains invalid values." at runtime. 201304110439js // Besides, RowLayout() wouldn't make sense here. // ---//from w ww .j a va2 s . c o m // Nachdem ich aussenrum einmal eine globale Gruppe installiere, // bekomme ich wenigstens die nachfolgend tieferen Gruppen untereinander in einer Spalte, // und nicht mehr nebeneinander. // Offenbar hat die Zuweisung eines Layouts zu getFieldEditorParent() keinen Effekt gehabt. // Warum auch immer... Group gAllOmnivorePrefs = new Group(getFieldEditorParent(), SWT.NONE); // getFieldEditorParent().setLayoutData(SWTHelper.getFillGridData(1,false,0,false)); GridLayout gOmnivorePrefsGridLayout = new GridLayout(); gOmnivorePrefsGridLayout.numColumns = 1; // this is sadly and apparently ignored. gOmnivorePrefsGridLayout.makeColumnsEqualWidth = true; gAllOmnivorePrefs.setLayout(gOmnivorePrefsGridLayout); // getFieldEditorParent().setLayout(gOmnivorePrefsGridLayout); GridData gOmnivorePrefsGridLayoutData = new GridData(); gOmnivorePrefsGridLayoutData.grabExcessHorizontalSpace = true; gOmnivorePrefsGridLayoutData.horizontalAlignment = GridData.FILL; gAllOmnivorePrefs.setLayoutData(gOmnivorePrefsGridLayoutData); Group gGeneralOptions = new Group(gAllOmnivorePrefs, SWT.NONE); GridData gGeneralOptionsGridLayoutData = new GridData(); gGeneralOptionsGridLayoutData.grabExcessHorizontalSpace = true; gGeneralOptionsGridLayoutData.horizontalAlignment = GridData.FILL; gGeneralOptions.setLayoutData(gGeneralOptionsGridLayoutData); addField(new BooleanFieldEditor(DATE_MODIFIABLE, Messages.Preferences_dateModifiable, gGeneralOptions)); Group gPathForDocs = new Group(gGeneralOptions, SWT.NONE); gPathForDocs.setLayout(new FillLayout()); bStoreFSGlobal = new BooleanFieldEditor(STOREFSGLOBAL, "Dateisystem Einstellungen global speichern", gPathForDocs) { @Override protected void fireValueChanged(String property, Object oldValue, Object newValue) { super.fireValueChanged(property, oldValue, newValue); if ((Boolean) newValue) { Preferences.setFsSettingStore(new SettingsPreferenceStore(CoreHub.globalCfg)); updateFSSettingsStore(); } else { Preferences.setFsSettingStore(new SettingsPreferenceStore(CoreHub.localCfg)); updateFSSettingsStore(); } } }; addField(bStoreFSGlobal); bStoreFS = new BooleanFieldEditor(STOREFS, Messages.Preferences_storeInFS, gPathForDocs); addField(bStoreFS); Preferences.storeInFilesystem(); dfStorePath = new DirectoryFieldEditor(BASEPATH, Messages.Preferences_pathForDocs, gPathForDocs); Preferences.getBasepath(); dfStorePath.setEmptyStringAllowed(true); addField(dfStorePath); Label label = new Label(gAllOmnivorePrefs, SWT.NONE); label.setText("Datenbankeintrge auf Filesystem auslagern"); outsource = new Button(gAllOmnivorePrefs, SWT.PUSH); outsource.setText("Auslagern"); outsource.setEnabled(false); outsource.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { OutsourceUiJob job = new OutsourceUiJob(); job.execute(getShell()); } }); Group gPathForMaxChars = new Group(gGeneralOptions, SWT.NONE); gPathForMaxChars.setLayout(new FillLayout()); IPreferenceStore preferenceStore = new SettingsPreferenceStore(CoreHub.localCfg); preferenceStore.setDefault(PREF_MAX_FILENAME_LENGTH, OmnivoreMax_Filename_Length_Default); IntegerFieldEditor maxCharsEditor = new IntegerFieldEditor(PREF_MAX_FILENAME_LENGTH, Messages.Preferences_MAX_FILENAME_LENGTH, gPathForMaxChars); maxCharsEditor.setValidRange(OmnivoreMax_Filename_Length_Min, OmnivoreMax_Filename_Length_Max); addField(maxCharsEditor); // --- // For automatic archiving of incoming files: // add field groups for display or editing of rule sets. // First, we define a new group (that will visually appear as an outlined box) and give it a // header like setText("Regel i"); // Then, within this group, we add one StringFieldEditor for the search pattern to be // matched, and a DirectoryFieldEditor for the auto archiving target to be used. Integer nAutoArchiveRules = Preferences.getOmnivorenRulesForAutoArchiving(); Group gAutoArchiveRules = new Group(gAllOmnivorePrefs, SWT.NONE); // Group gAutoArchiveRules = new Group(getFieldEditorParent(), SWT.NONE); // gAutoArchiveRules.setLayoutData(SWTHelper.getFillGridData(1,true,nAutoArchiveRules,false)); GridLayout gAutoArchiveRulesGridLayout = new GridLayout(); gAutoArchiveRulesGridLayout.numColumns = 1; // bestimmt die Anzahl der Spalten, in denen die // Regeln innerhab des AutoArchiveRules containers angeordnet werden. gAutoArchiveRules.setLayout(gAutoArchiveRulesGridLayout); GridData gAutoArchiveRulesGridLayoutData = new GridData(); gAutoArchiveRulesGridLayoutData.grabExcessHorizontalSpace = true; gAutoArchiveRulesGridLayoutData.horizontalAlignment = GridData.FILL; gAutoArchiveRules.setLayoutData(gAutoArchiveRulesGridLayoutData); gAutoArchiveRules.setText(Messages.Preferences_automatic_archiving_of_processed_files); for (int i = 0; i < nAutoArchiveRules; i++) { // Just to check whether the loop is actually used, even if nothing appears in the // preference dialog: log.debug(PREF_SRC_PATTERN[i] + " : " + Messages.Preferences_SRC_PATTERN); log.debug(PREF_DEST_DIR[i] + " : " + Messages.Preferences_DEST_DIR); Group gAutoArchiveRule = new Group(gAutoArchiveRules, SWT.NONE); GridLayout gAutoArchiveRuleGridLayout = new GridLayout(); gAutoArchiveRuleGridLayout.numColumns = 1; // bestimmt die Anzahl der Spalten fr jede // Regel: links label, rechts eingabefeld (ggf. mit Knopf), but: 1, 2, 3: no change. gAutoArchiveRule.setLayout(gAutoArchiveRuleGridLayout); GridData gAutoArchiveRuleGridLayoutData = new GridData(); gAutoArchiveRuleGridLayoutData.grabExcessHorizontalSpace = true; // damit die Gruppe der // Rules so breit ist, wie oben Label und Max_Filename_Length Eingabefeld zusammen. gAutoArchiveRuleGridLayoutData.horizontalAlignment = GridData.FILL; gAutoArchiveRule.setLayoutData(gAutoArchiveRuleGridLayoutData); // Cave: The labels show 1-based rule numbers, although the actual array indizes are 0 // based. gAutoArchiveRule.setText(Messages.Preferences_Rule + " " + (i + 1)); // The brackets are // needed, or the string representations of i and 1 will both be added... addField( new StringFieldEditor(PREF_SRC_PATTERN[i], Messages.Preferences_SRC_PATTERN, gAutoArchiveRule)); addField(new DirectoryFieldEditor(PREF_DEST_DIR[i], Messages.Preferences_DEST_DIR, gAutoArchiveRule)); } // --- // Make the temporary filename configurable // which is generated to extract the document from the database for viewing. // Thereby, simplify tasks like adding a document to an e-mail. // For most elements noted below, we can set the maximum number of digits // to be used (taken from the source from left); which character to add thereafter; // and whether to fill leading digits by a given character. // This makes a large number of options, so I construct the required preference store keys // from arrays. // Originally, I would have preferred a simple tabular matrix: // columns: element name, fill_lead_char, num_digits, add_trail_char // lines: each of the configurable elements of the prospective temporary filename. // But such a simple thing is apparently not so simple to make using the PreferencePage // class. // So instead, I add a new group for each configurable element, including each of the 3 // parameters. Integer nCotfRules = PREFERENCE_cotf_elements.length; Group gCotfRules = new Group(gAllOmnivorePrefs, SWT.NONE); // Group gCotfRules = new Group(getFieldEditorParent(), SWT.NONE); // gCotfRules.setLayoutData(SWTHelper.getFillGridData(6,false,nCotfRules,false)); //This // would probably make groups-within-group completely disappear. GridLayout gCotfRulesGridLayout = new GridLayout(); gCotfRulesGridLayout.numColumns = nCotfRules; // at least this one is finally honoured... gCotfRules.setLayout(gCotfRulesGridLayout); GridData gCotfRulesGridLayoutData = new GridData(); gCotfRulesGridLayoutData.grabExcessHorizontalSpace = true; gCotfRulesGridLayoutData.horizontalAlignment = GridData.FILL; gCotfRules.setLayoutData(gCotfRulesGridLayoutData); gCotfRules.setText(Messages.Preferences_construction_of_temporary_filename); for (int i = 0; i < nCotfRules; i++) { Group gCotfRule = new Group(gCotfRules, SWT.NONE); gCotfRule.setLayout(new FillLayout()); GridLayout gCotfRuleGridLayout = new GridLayout(); gCotfRuleGridLayout.numColumns = 6; gCotfRule.setLayout(gCotfRuleGridLayout); GridData gCotfRuleGridLayoutData = new GridData(); gCotfRuleGridLayoutData.grabExcessHorizontalSpace = true; gCotfRuleGridLayoutData.horizontalAlignment = GridData.FILL; gCotfRule.setLayoutData(gCotfRuleGridLayoutData); gCotfRule.setText(PREFERENCE_cotf_elements_messages[i]); if (PREFERENCE_cotf_elements[i].contains("constant")) { addField(new StringFieldEditor("", "", 10, gCotfRule)); addField(new StringFieldEditor( PREFBASE + PREFERENCE_COTF + PREFERENCE_cotf_elements[i] + "_" + PREFERENCE_cotf_parameters[1], PREFERENCE_cotf_elements_messages[i], 10, gCotfRule)); addField(new StringFieldEditor("", "", 10, gCotfRule)); } else { addField(new StringFieldEditor( PREFBASE + PREFERENCE_COTF + PREFERENCE_cotf_elements[i] + "_" + PREFERENCE_cotf_parameters[0], PREFERENCE_cotf_parameters_messages[0], 10, gCotfRule)); addField(new StringFieldEditor( PREFBASE + PREFERENCE_COTF + PREFERENCE_cotf_elements[i] + "_" + PREFERENCE_cotf_parameters[1], PREFERENCE_cotf_parameters_messages[1], 10, gCotfRule)); addField(new StringFieldEditor( PREFBASE + PREFERENCE_COTF + PREFERENCE_cotf_elements[i] + "_" + PREFERENCE_cotf_parameters[2], PREFERENCE_cotf_parameters_messages[2], 10, gCotfRule)); } } enableOutsourceButton(); }