diff options
author | 2021-08-03 18:42:39 +0900 | |
---|---|---|
committer | 2021-08-06 19:32:38 +0900 | |
commit | be4f78978faba3d3ceb88df02a7f93a2e09ff1e0 (patch) | |
tree | 1f3f1a96251ac4f655c8a96fc33d5d4ee779cd06 /rba.tool.editor.ui/src/rba/tool/editor/ui/recordandplay/RBASimulationRecordPage.java | |
parent | 71ca7c6cab863767ef30c8bd05b2bbfda8731cb5 (diff) |
Initial commit
Bug-AGL: SPEC-4033
Signed-off-by: Kenji Hosokawa <khosokawa@jp.adit-jv.com>
Diffstat (limited to 'rba.tool.editor.ui/src/rba/tool/editor/ui/recordandplay/RBASimulationRecordPage.java')
-rw-r--r-- | rba.tool.editor.ui/src/rba/tool/editor/ui/recordandplay/RBASimulationRecordPage.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/rba.tool.editor.ui/src/rba/tool/editor/ui/recordandplay/RBASimulationRecordPage.java b/rba.tool.editor.ui/src/rba/tool/editor/ui/recordandplay/RBASimulationRecordPage.java new file mode 100644 index 0000000..c55581d --- /dev/null +++ b/rba.tool.editor.ui/src/rba/tool/editor/ui/recordandplay/RBASimulationRecordPage.java @@ -0,0 +1,50 @@ +package rba.tool.editor.ui.recordandplay; + +import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.jface.preference.DirectoryFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.preferences.ScopedPreferenceStore; + +public class RBASimulationRecordPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { + + private DirectoryFieldEditor recordPathBrowser; + + private IPreferenceStore preferenceStore; + + private RBASimulationRecordSettingManager manager = RBASimulationRecordSettingManager.INSTANCE; + + private static final String DESCRIPTION = "RBA Simulation Record Path"; //$NON-NLS-1$ + + public RBASimulationRecordPage() { + super(GRID); + } + + @Override + protected void createFieldEditors() { + recordPathBrowser = new DirectoryFieldEditor("RbaToolRecordPath", "", getFieldEditorParent()); + addField(recordPathBrowser); + } + + @Override + public boolean performOk() { + manager.saveRecordFilePath(recordPathBrowser.getStringValue()); + return super.performOk(); + } + + @Override + public void init(IWorkbench workbench) { + setDescription(DESCRIPTION); + } + + @Override + public IPreferenceStore getPreferenceStore() { + if (preferenceStore == null) { + preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, manager.ID_PREFERENCE_NODE); + } + return preferenceStore; + } + +} |