mirror of
https://github.com/Minres/RDL-Editor.git
synced 2025-01-10 13:58:16 +01:00
Added preferences store and UI
This commit is contained in:
parent
93646a3ad0
commit
dc6577b2b9
@ -97,6 +97,16 @@
|
|||||||
name="Templates">
|
name="Templates">
|
||||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||||
</page>
|
</page>
|
||||||
|
<page category="com.minres.rdl.RDL"
|
||||||
|
class="com.minres.rdl.ui.preferences.RdlPreferencePage"
|
||||||
|
id="com.minres.rdl.ui.preferences.TextPreferencePage"
|
||||||
|
name="Generator">
|
||||||
|
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||||
|
</page>
|
||||||
|
</extension>
|
||||||
|
<extension point="org.eclipse.core.runtime.preferences">
|
||||||
|
<initializer class="com.minres.rdl.preferences.PreferenceInitializer">
|
||||||
|
</initializer>
|
||||||
</extension>
|
</extension>
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.ui.propertyPages">
|
point="org.eclipse.ui.propertyPages">
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.minres.rdl.ui.preferences
|
||||||
|
|
||||||
|
import org.eclipse.jface.preference.FieldEditorPreferencePage
|
||||||
|
import org.eclipse.ui.IWorkbenchPreferencePage
|
||||||
|
import org.eclipse.ui.IWorkbench
|
||||||
|
import org.eclipse.jface.preference.BooleanFieldEditor
|
||||||
|
import com.minres.rdl.preferences.PreferenceConstants
|
||||||
|
import org.eclipse.ui.preferences.ScopedPreferenceStore
|
||||||
|
import org.eclipse.core.runtime.preferences.InstanceScope
|
||||||
|
import org.eclipse.jface.preference.ComboFieldEditor
|
||||||
|
|
||||||
|
class RdlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||||
|
|
||||||
|
new() {
|
||||||
|
super(GRID)
|
||||||
|
val store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "com.minres.rdl.rdl");
|
||||||
|
setPreferenceStore(store);
|
||||||
|
setDescription("Code generator configuration options");
|
||||||
|
}
|
||||||
|
|
||||||
|
override createFieldEditors() {
|
||||||
|
addField(new BooleanFieldEditor(PreferenceConstants.P_GENERATE_CSV, "Generate CSV:", getFieldEditorParent()));
|
||||||
|
addField(new ComboFieldEditor(PreferenceConstants.P_ADDRESSUNIT, "Address unit size", #[#["Byte (8bit)","byte"], #["Word (16bit)","word"], #["DWord (32bit)","dword"]], getFieldEditorParent()))
|
||||||
|
}
|
||||||
|
|
||||||
|
override init(IWorkbench workbench) {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.minres.rdl.ui.preferences;
|
||||||
|
|
||||||
|
import com.minres.rdl.preferences.PreferenceConstants;
|
||||||
|
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||||
|
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||||
|
import org.eclipse.jface.preference.ComboFieldEditor;
|
||||||
|
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||||
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.ui.IWorkbench;
|
||||||
|
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||||
|
import org.eclipse.ui.preferences.ScopedPreferenceStore;
|
||||||
|
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
public class RdlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||||
|
public RdlPreferencePage() {
|
||||||
|
super(FieldEditorPreferencePage.GRID);
|
||||||
|
final ScopedPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "com.minres.rdl.rdl");
|
||||||
|
this.setPreferenceStore(store);
|
||||||
|
this.setDescription("Code generator configuration options");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createFieldEditors() {
|
||||||
|
Composite _fieldEditorParent = this.getFieldEditorParent();
|
||||||
|
BooleanFieldEditor _booleanFieldEditor = new BooleanFieldEditor(PreferenceConstants.P_GENERATE_CSV, "Generate CSV:", _fieldEditorParent);
|
||||||
|
this.addField(_booleanFieldEditor);
|
||||||
|
Composite _fieldEditorParent_1 = this.getFieldEditorParent();
|
||||||
|
ComboFieldEditor _comboFieldEditor = new ComboFieldEditor(PreferenceConstants.P_ADDRESSUNIT, "Address unit size", new String[][] { new String[] { "Byte (8bit)", "byte" }, new String[] { "Word (16bit)", "word" }, new String[] { "DWord (32bit)", "dword" } }, _fieldEditorParent_1);
|
||||||
|
this.addField(_comboFieldEditor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(final IWorkbench workbench) {
|
||||||
|
}
|
||||||
|
}
|
@ -16,15 +16,16 @@ Require-Bundle: org.eclipse.xtext,
|
|||||||
org.eclipse.emf.common,
|
org.eclipse.emf.common,
|
||||||
org.eclipse.equinox.preferences
|
org.eclipse.equinox.preferences
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||||
Export-Package: com.minres.rdl.parser.antlr,
|
Export-Package: com.minres.rdl,
|
||||||
com.minres.rdl,
|
com.minres.rdl.generator,
|
||||||
com.minres.rdl.rdl.util,
|
com.minres.rdl.parser.antlr,
|
||||||
com.minres.rdl.rdl,
|
|
||||||
com.minres.rdl.serializer,
|
|
||||||
com.minres.rdl.parser.antlr.internal,
|
com.minres.rdl.parser.antlr.internal,
|
||||||
com.minres.rdl.scoping,
|
com.minres.rdl.preferences,
|
||||||
|
com.minres.rdl.rdl,
|
||||||
com.minres.rdl.rdl.impl,
|
com.minres.rdl.rdl.impl,
|
||||||
com.minres.rdl.validation,
|
com.minres.rdl.rdl.util,
|
||||||
|
com.minres.rdl.scoping,
|
||||||
|
com.minres.rdl.serializer,
|
||||||
com.minres.rdl.services,
|
com.minres.rdl.services,
|
||||||
com.minres.rdl.generator
|
com.minres.rdl.validation
|
||||||
Import-Package: org.apache.log4j
|
Import-Package: org.apache.log4j
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext 2.12.0" modelDirectory="/com.minres.rdl/src-gen"
|
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext 2.12.0" modelDirectory="/com.minres.rdl/src-gen"
|
||||||
modelPluginID="com.minres.rdl" forceOverwrite="true" modelName="RDL" updateClasspath="false"
|
modelPluginID="com.minres.rdl" forceOverwrite="true" modelName="RDL" updateClasspath="false"
|
||||||
rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" complianceLevel="6.0"
|
rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" complianceLevel="6.0"
|
||||||
copyrightFields="false" runtimeVersion="2.13">
|
copyrightFields="false" runtimeVersion="2.12">
|
||||||
<genPackages prefix="Rdl" basePackage="com.minres.rdl" disposableProviderFactory="true"
|
<genPackages prefix="Rdl" basePackage="com.minres.rdl" disposableProviderFactory="true"
|
||||||
fileExtensions="rdl" ecorePackage="RDL.ecore#/">
|
fileExtensions="rdl" ecorePackage="RDL.ecore#/">
|
||||||
<genEnums typeSafeEnumCompatible="false" ecoreEnum="RDL.ecore#//PropertyTypeName">
|
<genEnums typeSafeEnumCompatible="false" ecoreEnum="RDL.ecore#//PropertyTypeName">
|
||||||
|
@ -7,4 +7,8 @@
|
|||||||
class = "com.minres.rdl.rdl.RdlPackage"
|
class = "com.minres.rdl.rdl.RdlPackage"
|
||||||
genModel = "model/generated/RDL.genmodel" />
|
genModel = "model/generated/RDL.genmodel" />
|
||||||
</extension>
|
</extension>
|
||||||
|
<extension point="org.eclipse.core.runtime.preferences">
|
||||||
|
<initializer class="com.minres.rdl.preferences.PreferenceInitializer">
|
||||||
|
</initializer>
|
||||||
|
</extension>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user