summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Laner <Stefan.Laner@partner.bmw.de>2014-03-05 17:13:03 +0100
committerGerrit Code Review <qqmthk1@lpmodthk02.bmwgroup.net>2014-03-05 17:13:03 +0100
commit65eea7c550e20173897282db14b18570d1d05c19 (patch)
treebf862e334951969c55e938d4f30f90f5ca944886
parent4a64be6f11647240b74bda82020b1865deaefb34 (diff)
parented342aa553ba479a18f0c39e18d0911bd799ebc6 (diff)
downloadgenivi-common-api-runtime-65eea7c550e20173897282db14b18570d1d05c19.tar.gz
Merge "new feature to generate proxies and stubs into seperate target directories"
-rw-r--r--org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/handler/GenerationCommand.java8
-rw-r--r--org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/CommonAPIPreferencePage.java49
-rwxr-xr-xorg.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/FieldEditorOverlayPage.java256
-rw-r--r--org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/PreferenceInitializer.java3
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGenerator.xtend195
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/FPreferences.java27
-rw-r--r--org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/PreferenceConstants.java28
7 files changed, 371 insertions, 195 deletions
diff --git a/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/handler/GenerationCommand.java b/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/handler/GenerationCommand.java
index 4513b74..ec6fe7f 100644
--- a/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/handler/GenerationCommand.java
+++ b/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/handler/GenerationCommand.java
@@ -261,9 +261,11 @@ public class GenerationCommand extends AbstractHandler {
IProject project) {
IPreferenceStore store = CommonApiUiPlugin.getDefault()
.getPreferenceStore();
- String outputDir = store.getString(PreferenceConstants.P_OUTPUT);
- if (FPreferences.getInstance().getPreference(project, PreferenceConstants.P_OUTPUT, null) != null)
- outputDir = FPreferences.getInstance().getPreference(project, PreferenceConstants.P_OUTPUT, null);
+ String outputDir = store.getString(PreferenceConstants.P_OUTPUT_PROXIES);
+ if (FPreferences.getInstance().getPreference(project, PreferenceConstants.P_OUTPUT_PROXIES, null) != null)
+ {
+ outputDir = FPreferences.getInstance().getPreference(project, PreferenceConstants.P_OUTPUT_PROXIES, null);
+ }
final EclipseResourceFileSystemAccess2 fsa = fileAccessProvider.get();
fsa.setOutputPath(outputDir);
diff --git a/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/CommonAPIPreferencePage.java b/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/CommonAPIPreferencePage.java
index 2f37a3a..9afa5f6 100644
--- a/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/CommonAPIPreferencePage.java
+++ b/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/CommonAPIPreferencePage.java
@@ -23,17 +23,19 @@ import org.genivi.commonapi.core.ui.CommonApiUiPlugin;
* can use the field support built into JFace that allows us to create a page
* that is small and knows how to save, restore and apply itself.
* <p>
- * This page is used to modify preferences only. They are stored in the
- * preference store that belongs to the main plug-in class. That way,
+ * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way,
* preferences can be accessed directly via the preference store.
*/
-public class CommonAPIPreferencePage extends FieldEditorOverlayPage implements IWorkbenchPreferencePage {
+public class CommonAPIPreferencePage extends FieldEditorOverlayPage implements IWorkbenchPreferencePage
+{
- private FieldEditor lizense = null;
- private FieldEditor output = null;
+ private FieldEditor license = null;
+ private FieldEditor proxyOutput = null;
+ private FieldEditor stubOutput = null;
- public CommonAPIPreferencePage() {
+ public CommonAPIPreferencePage()
+ {
super(GRID);
setDescription("Preferences for CommonAPI");
}
@@ -43,34 +45,45 @@ public class CommonAPIPreferencePage extends FieldEditorOverlayPage implements I
* GUI blocks needed to manipulate various types of preferences. Each field
* editor knows how to save and restore itself.
*/
- public void createFieldEditors() {
- lizense = new MultiLineTextField(PreferenceConstants.P_LICENSE, "The header to insert for all generated files",
- 60, getFieldEditorParent());
- addField(lizense);
- output = new StringFieldEditor(PreferenceConstants.P_OUTPUT, "Output directory inside project", 30,
+ public void createFieldEditors()
+ {
+ license = new MultiLineTextField(PreferenceConstants.P_LICENSE, "The header to insert for all generated files", 60,
getFieldEditorParent());
- addField(output);
+ addField(license);
+ proxyOutput = new StringFieldEditor(PreferenceConstants.P_OUTPUT_PROXIES, "Output directory for proxies inside project", 30,
+ getFieldEditorParent());
+ addField(proxyOutput);
+ stubOutput = new StringFieldEditor(PreferenceConstants.P_OUTPUT_STUBS, "Output directory for stubs inside project", 30,
+ getFieldEditorParent());
+ addField(stubOutput);
}
@Override
- protected void performDefaults() {
- DefaultScope.INSTANCE.getNode(PreferenceConstants.SCOPE).put(PreferenceConstants.P_OUTPUT,
+ protected void performDefaults()
+ {
+ DefaultScope.INSTANCE.getNode(PreferenceConstants.SCOPE).put(PreferenceConstants.P_OUTPUT_PROXIES,
PreferenceConstants.DEFAULT_OUTPUT);
+ DefaultScope.INSTANCE.getNode(PreferenceConstants.SCOPE)
+ .put(PreferenceConstants.P_OUTPUT_STUBS, PreferenceConstants.DEFAULT_OUTPUT);
super.performDefaults();
}
- public void init(IWorkbench workbench) {
+ public void init(IWorkbench workbench)
+ {
if (!isPropertyPage())
setPreferenceStore(CommonApiUiPlugin.getDefault().getPreferenceStore());
}
@Override
- protected String getPageId() {
+ protected String getPageId()
+ {
return PreferenceConstants.PROJECT_PAGEID;
}
+
@Override
- protected IPreferenceStore doGetPreferenceStore() {
+ protected IPreferenceStore doGetPreferenceStore()
+ {
return CommonApiUiPlugin.getDefault().getPreferenceStore();
}
-} \ No newline at end of file
+}
diff --git a/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/FieldEditorOverlayPage.java b/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/FieldEditorOverlayPage.java
index 3492234..aad4ba0 100755
--- a/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/FieldEditorOverlayPage.java
+++ b/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/FieldEditorOverlayPage.java
@@ -42,7 +42,8 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbenchPropertyPage;
import org.genivi.commonapi.core.preferences.PreferenceConstants;
-public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage {
+public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage implements IWorkbenchPropertyPage
+{
/***
* Name of resource property for the selection of workbench or project
@@ -50,54 +51,59 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
***/
// public static final String USEPROJECTSETTINGS = "useProjectSettings"; //$NON-NLS-1$
- private static final String FALSE = "false"; //$NON-NLS-1$
- private static final String TRUE = "true"; //$NON-NLS-1$
+ private static final String FALSE = "false"; //$NON-NLS-1$
+ private static final String TRUE = "true"; //$NON-NLS-1$
// Stores all created field editors
- private List<FieldEditor> editors = new ArrayList<FieldEditor>();
+ private List<FieldEditor> editors = new ArrayList<FieldEditor>();
- private List<Button> buttons = new ArrayList<Button>();
+ private List<Button> buttons = new ArrayList<Button>();
- private Button checkboxproxy = null;
- private Button checkboxstub = null;
+ private Button checkboxproxy = null;
+ private Button checkboxstub = null;
// Stores owning element of properties
- private IAdaptable element;
+ private IAdaptable element;
// Additional buttons for property pages
- private Button useWorkspaceSettingsButton, useProjectSettingsButton, configureButton;
+ private Button useWorkspaceSettingsButton, useProjectSettingsButton, configureButton;
// Overlay preference store for property pages
- private IPreferenceStore overlayStore;
+ private IPreferenceStore overlayStore;
// The image descriptor of this pages title image
- private ImageDescriptor image;
+ private ImageDescriptor image;
// Cache for page id
- private String pageId;
+ private String pageId;
/**
* Constructor
+ *
* @param style
* - layout style
*/
- public FieldEditorOverlayPage(int style) {
+ public FieldEditorOverlayPage(int style)
+ {
super(style);
}
/**
* Constructor
+ *
* @param title
* - title string
* @param style
* - layout style
*/
- public FieldEditorOverlayPage(String title, int style) {
+ public FieldEditorOverlayPage(String title, int style)
+ {
super(title, style);
}
/**
* Constructor
+ *
* @param title
* - title string
* @param image
@@ -105,7 +111,8 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
* @param style
* - layout style
*/
- public FieldEditorOverlayPage(String title, ImageDescriptor image, int style) {
+ public FieldEditorOverlayPage(String title, ImageDescriptor image, int style)
+ {
super(title, image, style);
this.image = image;
}
@@ -113,45 +120,55 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
/**
* Returns the id of the current preference page as defined in plugin.xml
* Subclasses must implement.
+ *
* @return - the qualifier
*/
protected abstract String getPageId();
/**
* Receives the object that owns the properties shown in this property page.
+ *
* @see org.eclipse.ui.IWorkbenchPropertyPage#setElement(org.eclipse.core.runtime.IAdaptable)
*/
- public void setElement(IAdaptable element) {
+ public void setElement(IAdaptable element)
+ {
this.element = element;
}
/**
* Delivers the object that owns the properties shown in this property page.
+ *
* @see org.eclipse.ui.IWorkbenchPropertyPage#getElement()
*/
- public IAdaptable getElement() {
+ public IAdaptable getElement()
+ {
return element;
}
/**
* Returns true if this instance represents a property page
+ *
* @return - true for property pages, false for preference pages
*/
- public boolean isPropertyPage() {
+ public boolean isPropertyPage()
+ {
return getElement() != null;
}
/**
* We override the addField method. This allows us to store each field
* editor added by subclasses in a list for later processing.
+ *
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#addField(org.eclipse.jface.preference.FieldEditor)
*/
- protected void addField(FieldEditor editor) {
+ protected void addField(FieldEditor editor)
+ {
editors.add(editor);
super.addField(editor);
}
- protected void addButton(Button button) {
+ protected void addButton(Button button)
+ {
buttons.add(button);
}
@@ -159,28 +176,36 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
* We override the createControl method. In case of property pages we create
* a new PropertyStore as local preference store. After all control have
* been create, we enable/disable these controls.
+ *
* @see org.eclipse.jface.preference.PreferencePage#createControl()
*/
- public void createControl(Composite parent) {
+ public void createControl(Composite parent)
+ {
// Special treatment for property pages
- if (isPropertyPage()) {
+ if (isPropertyPage())
+ {
// Cache the page id
pageId = getPageId();
// Create an overlay preference store and fill it with properties
- try {
+ try
+ {
IResource res = (IResource) element;
- if (res instanceof IFolder) {
+ if (res instanceof IFolder)
+ {
res = res.getProject();
setElement(res);
}
overlayStore = new PropertyStore(res, super.getPreferenceStore(), pageId);
- } catch (IOException e) {
+ }
+ catch (IOException e)
+ {
e.printStackTrace();
}
// Set overlay store as current preference store
setPreferenceStore(overlayStore);
}
- if (parent != null) {
+ if (parent != null)
+ {
super.createControl(parent);
// Update state of all subclass controls
if (isPropertyPage())
@@ -191,13 +216,17 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
/**
* We override the createContents method. In case of property pages we
* insert two radio buttons at the top of the page.
+ *
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
- protected Control createContents(Composite parent) {
- if (isPropertyPage()) {
+ protected Control createContents(Composite parent)
+ {
+ if (isPropertyPage())
+ {
createSelectionGroup(parent);
updateFieldEditors();
- } else
+ }
+ else
createButtons(parent);
return super.createContents(parent);
}
@@ -205,10 +234,12 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
/**
* Creates and initializes a selection group with two choice buttons and one
* push button.
+ *
* @param parent
* - the parent composite
*/
- private void createSelectionGroup(Composite parent) {
+ private void createSelectionGroup(Composite parent)
+ {
Composite comp = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 0;
@@ -232,32 +263,40 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
if (element instanceof IFile)
msg = Messages.getString("OverlayPage.Configure_Project_Settings");
configureButton.setText(msg); //$NON-NLS-1$
- configureButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ configureButton.addSelectionListener(new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent e)
+ {
configureWorkspaceSettings();
}
});
createButtons(parent);
// Set workspace/project radio buttons
- try {
- String use = ((IResource) element).getPersistentProperty(new QualifiedName(pageId,
- PreferenceConstants.USEPROJECTSETTINGS));
- if (use == null) {
- ((IResource) element).setPersistentProperty(new QualifiedName(pageId,
- PreferenceConstants.USEPROJECTSETTINGS), Boolean.FALSE.toString());
+ try
+ {
+ String use = ((IResource) element).getPersistentProperty(new QualifiedName(pageId, PreferenceConstants.USEPROJECTSETTINGS));
+ if (use == null)
+ {
+ ((IResource) element).setPersistentProperty(new QualifiedName(pageId, PreferenceConstants.USEPROJECTSETTINGS),
+ Boolean.FALSE.toString());
use = FALSE;
}
- if (TRUE.equals(use)) {
+ if (TRUE.equals(use))
+ {
useProjectSettingsButton.setSelection(true);
configureButton.setEnabled(false);
- } else
+ }
+ else
useWorkspaceSettingsButton.setSelection(true);
- } catch (CoreException e) {
+ }
+ catch (CoreException e)
+ {
useWorkspaceSettingsButton.setSelection(true);
}
}
- public void createButtons(Composite parent) {
+ public void createButtons(Composite parent)
+ {
Composite comp = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 0;
@@ -271,57 +310,69 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
checkboxproxy.setText(Messages.getString("OverlayPage.Generate_Proxy"));
checkboxstub = new Button(radioGroup, SWT.CHECK);
checkboxstub.setText(Messages.getString("OverlayPage.Generate_Stub"));
- if (isPropertyPage()) {
- try {
- String use = ((IResource) getElement()).getPersistentProperty(new QualifiedName(pageId,
- PreferenceConstants.P_GENERATEPROXY));
+ if (isPropertyPage())
+ {
+ try
+ {
+ String use = ((IResource) getElement())
+ .getPersistentProperty(new QualifiedName(pageId, PreferenceConstants.P_GENERATEPROXY));
if (TRUE.equals(use))
checkboxproxy.setSelection(true);
- } catch (CoreException e) {
+ }
+ catch (CoreException e)
+ {
checkboxproxy.setSelection(true);
}
- try {
- String use = ((IResource) getElement()).getPersistentProperty(new QualifiedName(pageId,
- PreferenceConstants.P_GENERATESTUB));
+ try
+ {
+ String use = ((IResource) getElement())
+ .getPersistentProperty(new QualifiedName(pageId, PreferenceConstants.P_GENERATESTUB));
if (TRUE.equals(use))
checkboxstub.setSelection(true);
- else if (!checkboxproxy.getSelection()) {
+ else if (!checkboxproxy.getSelection())
+ {
checkboxproxy.setSelection(true);
checkboxstub.setSelection(true);
}
- } catch (CoreException e) {
+ }
+ catch (CoreException e)
+ {
checkboxstub.setSelection(true);
}
- } else {
- String use = DefaultScope.INSTANCE.getNode(PreferenceConstants.SCOPE).get(
- PreferenceConstants.P_GENERATEPROXY, "");
- use = InstanceScope.INSTANCE.getNode(PreferenceConstants.SCOPE).get(PreferenceConstants.P_GENERATEPROXY,
- use);
+ }
+ else
+ {
+ String use = DefaultScope.INSTANCE.getNode(PreferenceConstants.SCOPE).get(PreferenceConstants.P_GENERATEPROXY, "");
+ use = InstanceScope.INSTANCE.getNode(PreferenceConstants.SCOPE).get(PreferenceConstants.P_GENERATEPROXY, use);
if (TRUE.equals(use))
checkboxproxy.setSelection(true);
use = DefaultScope.INSTANCE.getNode(PreferenceConstants.SCOPE).get(PreferenceConstants.P_GENERATESTUB, "");
- use = InstanceScope.INSTANCE.getNode(PreferenceConstants.SCOPE)
- .get(PreferenceConstants.P_GENERATESTUB, use);
+ use = InstanceScope.INSTANCE.getNode(PreferenceConstants.SCOPE).get(PreferenceConstants.P_GENERATESTUB, use);
if (TRUE.equals(use))
checkboxstub.setSelection(true);
- if (!checkboxproxy.getSelection() && !checkboxstub.getSelection()) {
+ if (!checkboxproxy.getSelection() && !checkboxstub.getSelection())
+ {
checkboxproxy.setSelection(true);
checkboxstub.setSelection(true);
}
}
- checkboxproxy.addSelectionListener(new SelectionAdapter() {
+ checkboxproxy.addSelectionListener(new SelectionAdapter()
+ {
@Override
- public void widgetSelected(SelectionEvent e) {
+ public void widgetSelected(SelectionEvent e)
+ {
if (!checkboxproxy.getSelection() && !checkboxstub.getSelection())
checkboxstub.setSelection(true);
}
});
- checkboxstub.addSelectionListener(new SelectionAdapter() {
+ checkboxstub.addSelectionListener(new SelectionAdapter()
+ {
@Override
- public void widgetSelected(SelectionEvent e) {
+ public void widgetSelected(SelectionEvent e)
+ {
if (!checkboxproxy.getSelection() && !checkboxstub.getSelection())
checkboxproxy.setSelection(true);
}
@@ -332,17 +383,21 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
/**
* Convenience method creating a radio button
+ *
* @param parent
* - the parent composite
* @param label
* - the button label
* @return - the new button
*/
- private Button createRadioButton(Composite parent, String label) {
+ private Button createRadioButton(Composite parent, String label)
+ {
final Button button = new Button(parent, SWT.RADIO);
button.setText(label);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ button.addSelectionListener(new SelectionAdapter()
+ {
+ public void widgetSelected(SelectionEvent e)
+ {
configureButton.setEnabled(button == useWorkspaceSettingsButton);
updateFieldEditors();
}
@@ -353,9 +408,11 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
/**
* Returns in case of property pages the overlay store, in case of
* preference pages the standard preference store
+ *
* @see org.eclipse.jface.preference.PreferencePage#getPreferenceStore()
*/
- public IPreferenceStore getPreferenceStore() {
+ public IPreferenceStore getPreferenceStore()
+ {
if (isPropertyPage())
return overlayStore;
return super.getPreferenceStore();
@@ -364,7 +421,8 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
/*
* Enables or disables the field editors and buttons of this page
*/
- private void updateFieldEditors() {
+ private void updateFieldEditors()
+ {
// We iterate through all field editors
boolean enabled = useProjectSettingsButton.getSelection();
updateFieldEditors(enabled);
@@ -373,17 +431,21 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
/**
* Enables or disables the field editors and buttons of this page Subclasses
* may override.
+ *
* @param enabled
* - true if enabled
*/
- protected void updateFieldEditors(boolean enabled) {
+ protected void updateFieldEditors(boolean enabled)
+ {
Composite parent = getFieldEditorParent();
Iterator<FieldEditor> it = editors.iterator();
- while (it.hasNext()) {
+ while (it.hasNext())
+ {
FieldEditor editor = it.next();
editor.setEnabled(enabled, parent);
}
- for (Button button : buttons) {
+ for (Button button : buttons)
+ {
button.setEnabled(enabled);
}
}
@@ -392,23 +454,31 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
* We override the performOk method. In case of property pages we copy the
* values in the overlay store into the property values of the selected
* project. We also save the state of the radio buttons.
+ *
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
- public boolean performOk() {
+ public boolean performOk()
+ {
boolean result = super.performOk();
- if (result && isPropertyPage()) {
+ if (result && isPropertyPage())
+ {
// Save state of radio buttons in project properties
IResource resource = (IResource) getElement();
- try {
+ try
+ {
String value = (useProjectSettingsButton.getSelection()) ? TRUE : FALSE;
resource.setPersistentProperty(new QualifiedName(pageId, PreferenceConstants.USEPROJECTSETTINGS), value);
value = (checkboxproxy.getSelection()) ? TRUE : FALSE;
resource.setPersistentProperty(new QualifiedName(pageId, PreferenceConstants.P_GENERATEPROXY), value);
value = (checkboxstub.getSelection()) ? TRUE : FALSE;
resource.setPersistentProperty(new QualifiedName(pageId, PreferenceConstants.P_GENERATESTUB), value);
- } catch (CoreException e) {
}
- } else if (result) {
+ catch (CoreException e)
+ {
+ }
+ }
+ else if (result)
+ {
String value = (checkboxproxy.getSelection()) ? TRUE : FALSE;
InstanceScope.INSTANCE.getNode(PreferenceConstants.SCOPE).put(PreferenceConstants.P_GENERATEPROXY, value);
value = (checkboxstub.getSelection()) ? TRUE : FALSE;
@@ -420,10 +490,13 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
/**
* We override the performDefaults method. In case of property pages we
* switch back to the workspace settings and disable the field editors.
+ *
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
- protected void performDefaults() {
- if (isPropertyPage()) {
+ protected void performDefaults()
+ {
+ if (isPropertyPage())
+ {
useWorkspaceSettingsButton.setSelection(true);
useProjectSettingsButton.setSelection(false);
configureButton.setEnabled(true);
@@ -436,10 +509,13 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
/**
* Creates a new preferences page and opens it
+ *
* @see com.bdaum.SpellChecker.preferences.SpellCheckerPreferencePage#configureWorkspaceSettings()
*/
- protected void configureWorkspaceSettings() {
- try {
+ protected void configureWorkspaceSettings()
+ {
+ try
+ {
// create a new instance of the current class
FieldEditorOverlayPage page = (FieldEditorOverlayPage) this.getClass().newInstance();
page.setTitle(getTitle());
@@ -448,27 +524,35 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
page.setImageDescriptor(image);
// and show it
showPreferencePage(pageId, page);
- } catch (InstantiationException e) {
+ }
+ catch (InstantiationException e)
+ {
e.printStackTrace();
- } catch (IllegalAccessException e) {
+ }
+ catch (IllegalAccessException e)
+ {
e.printStackTrace();
}
}
/**
* Show a single preference pages
+ *
* @param id
* - the preference page identification
* @param page
* - the preference page
*/
- protected void showPreferencePage(String id, IPreferencePage page) {
+ protected void showPreferencePage(String id, IPreferencePage page)
+ {
final IPreferenceNode targetNode = new PreferenceNode(id, page);
PreferenceManager manager = new PreferenceManager();
manager.addToRoot(targetNode);
final PreferenceDialog dialog = new PreferenceDialog(getControl().getShell(), manager);
- BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
- public void run() {
+ BusyIndicator.showWhile(getControl().getDisplay(), new Runnable()
+ {
+ public void run()
+ {
dialog.create();
dialog.setMessage(targetNode.getLabelText());
dialog.open();
diff --git a/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/PreferenceInitializer.java b/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/PreferenceInitializer.java
index 65dfdc3..eea41a1 100644
--- a/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/PreferenceInitializer.java
+++ b/org.genivi.commonapi.core.ui/src/org/genivi/commonapi/core/ui/preferences/PreferenceInitializer.java
@@ -28,7 +28,8 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
IPreferenceStore store = CommonApiUiPlugin.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.USEPROJECTSETTINGS, true);
store.setDefault(PreferenceConstants.P_LICENSE, PreferenceConstants.DEFAULT_LICENSE);
- store.setDefault(PreferenceConstants.P_OUTPUT, PreferenceConstants.DEFAULT_OUTPUT);
+ store.setDefault(PreferenceConstants.P_OUTPUT_PROXIES, PreferenceConstants.DEFAULT_OUTPUT);
+ store.setDefault(PreferenceConstants.P_OUTPUT_STUBS, PreferenceConstants.DEFAULT_OUTPUT);
store.setDefault(PreferenceConstants.P_GENERATEPROXY, true);
store.setDefault(PreferenceConstants.P_GENERATESTUB, true);
}
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGenerator.xtend b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGenerator.xtend
index 6f7b8c6..22142ed 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGenerator.xtend
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FrancaGenerator.xtend
@@ -11,11 +11,18 @@ import java.util.HashSet
import java.util.LinkedList
import java.util.List
import javax.inject.Inject
+import org.eclipse.core.resources.IResource
import org.eclipse.core.resources.ResourcesPlugin
import org.eclipse.core.runtime.Path
+import org.eclipse.core.runtime.QualifiedName
+import org.eclipse.core.runtime.preferences.DefaultScope
+import org.eclipse.core.runtime.preferences.IEclipsePreferences
+import org.eclipse.core.runtime.preferences.InstanceScope
import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2
import org.eclipse.xtext.generator.IFileSystemAccess
import org.eclipse.xtext.generator.IGenerator
+import org.eclipse.xtext.generator.JavaIoFileSystemAccess
import org.franca.core.franca.FArrayType
import org.franca.core.franca.FEnumerationType
import org.franca.core.franca.FInterface
@@ -33,20 +40,14 @@ import org.franca.deploymodel.dsl.FDeployPersistenceManager
import org.franca.deploymodel.dsl.fDeploy.FDInterface
import org.genivi.commonapi.core.deployment.DeploymentInterfacePropertyAccessor
import org.genivi.commonapi.core.deployment.DeploymentInterfacePropertyAccessorWrapper
-
-import static com.google.common.base.Preconditions.*
import org.genivi.commonapi.core.preferences.FPreferences
import org.genivi.commonapi.core.preferences.PreferenceConstants
-import org.eclipse.core.runtime.preferences.InstanceScope
-import org.eclipse.core.runtime.preferences.DefaultScope
-import org.eclipse.core.runtime.QualifiedName
-import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2
-import org.eclipse.core.resources.IResource
-import org.eclipse.xtext.generator.JavaIoFileSystemAccess
import org.osgi.framework.FrameworkUtil
-import org.eclipse.core.runtime.preferences.IEclipsePreferences
-class FrancaGenerator implements IGenerator {
+import static com.google.common.base.Preconditions.*
+
+class FrancaGenerator implements IGenerator
+{
@Inject private extension FTypeCollectionGenerator
@Inject private extension FInterfaceGenerator
@Inject private extension FInterfaceProxyGenerator
@@ -56,17 +57,20 @@ class FrancaGenerator implements IGenerator {
@Inject private MyFrancaPersistenceManager francaPersistenceManager
@Inject private FDeployPersistenceManager fDeployPersistenceManager
-
- override doGenerate(Resource input, IFileSystemAccess fileSystemAccess) {
+ override doGenerate(Resource input, IFileSystemAccess fileSystemAccess)
+ {
var FModel fModel
var List<FDInterface> deployedInterfaces
var IResource res = null
- if (input.URI.fileExtension.equals(francaPersistenceManager.fileExtension)) {
+ if(input.URI.fileExtension.equals(francaPersistenceManager.fileExtension))
+ {
fModel = francaPersistenceManager.loadModel(input.filePath)
deployedInterfaces = new LinkedList<FDInterface>()
- } else if (input.URI.fileExtension.equals("fdepl"/* fDeployPersistenceManager.fileExtension */)) {
+ }
+ else if(input.URI.fileExtension.equals("fdepl"/* fDeployPersistenceManager.fileExtension */))
+ {
var fDeployedModel = fDeployPersistenceManager.loadModel(input.URI, input.URI);
val fModelExtender = new FDModelExtender(fDeployedModel);
@@ -74,58 +78,77 @@ class FrancaGenerator implements IGenerator {
fModel = fModelExtender.getFDInterfaces().get(0).target.model
deployedInterfaces = fModelExtender.getFDInterfaces()
- } else {
+ }
+ else
+ {
checkArgument(false, "Unknown input: " + input)
}
- try {
+ try
+ {
var pathfile = input.URI.toPlatformString(false);
- if (pathfile == null) {
+ if(pathfile == null)
+ {
pathfile = FPreferences::instance.getModelPath(fModel)
}
- if (pathfile.startsWith("platform:/")) {
+ if(pathfile.startsWith("platform:/"))
+ {
pathfile = pathfile.substring(pathfile.indexOf("platform") + 10)
pathfile = pathfile.substring(pathfile.indexOf(System.getProperty("file.separator")))
}
res = ResourcesPlugin.workspace.root.findMember(pathfile)
FPreferences::instance.addPreferences(res)
- if (FPreferences::instance.useModelSpecific(res)) {
- var output = res.getPersistentProperty(new QualifiedName(PreferenceConstants::PROJECT_PAGEID, PreferenceConstants::P_OUTPUT))
- if (output != null && output.length != 0) {
- if (fileSystemAccess instanceof EclipseResourceFileSystemAccess2) {
+ if(FPreferences::instance.useModelSpecific(res))
+ {
+ var output = res.getPersistentProperty(
+ new QualifiedName(PreferenceConstants::PROJECT_PAGEID, PreferenceConstants::P_OUTPUT_PROXIES))
+ if(output != null && output.length != 0)
+ {
+ if(fileSystemAccess instanceof EclipseResourceFileSystemAccess2)
+ {
(fileSystemAccess as EclipseResourceFileSystemAccess2).setOutputPath(output)
- } else if (fileSystemAccess instanceof JavaIoFileSystemAccess) {
+ }
+ else if(fileSystemAccess instanceof JavaIoFileSystemAccess)
+ {
(fileSystemAccess as JavaIoFileSystemAccess).setOutputPath(output)
}
}
}
doGenerateComponents(fModel, deployedInterfaces, fileSystemAccess, res)
- } catch (IllegalStateException e) {
+ }
+ catch(IllegalStateException e)
+ {
//happens only when the cli calls the francagenerator
}
doGenerateComponents(fModel, deployedInterfaces, fileSystemAccess, res)
- if (res != null) {
- var defaultValue = DefaultScope::INSTANCE.getNode(PreferenceConstants::SCOPE).get(PreferenceConstants::P_OUTPUT, PreferenceConstants::DEFAULT_OUTPUT);
- defaultValue = InstanceScope::INSTANCE.getNode(PreferenceConstants::SCOPE).get(PreferenceConstants::P_OUTPUT, defaultValue)
- defaultValue = FPreferences::instance.getPreference(res, PreferenceConstants::P_OUTPUT, defaultValue)
+ if(res != null)
+ {
+ var defaultValue = DefaultScope::INSTANCE.getNode(PreferenceConstants::SCOPE).get(PreferenceConstants::P_OUTPUT_PROXIES,
+ PreferenceConstants::DEFAULT_OUTPUT);
+ defaultValue = InstanceScope::INSTANCE.getNode(PreferenceConstants::SCOPE).get(PreferenceConstants::P_OUTPUT_PROXIES,
+ defaultValue)
+ defaultValue = FPreferences::instance.getPreference(res, PreferenceConstants::P_OUTPUT_PROXIES, defaultValue)
- if (fileSystemAccess instanceof EclipseResourceFileSystemAccess2) {
+ if(fileSystemAccess instanceof EclipseResourceFileSystemAccess2)
+ {
(fileSystemAccess as EclipseResourceFileSystemAccess2).setOutputPath(defaultValue)
- } else if (fileSystemAccess instanceof JavaIoFileSystemAccess) {
+ }
+ else if(fileSystemAccess instanceof JavaIoFileSystemAccess)
+ {
(fileSystemAccess as JavaIoFileSystemAccess).setOutputPath(defaultValue)
}
}
}
- def private doGenerateComponents(FModel fModel, List<FDInterface> deployedInterfaces, IFileSystemAccess fileSystemAccess, IResource res) {
+ def private doGenerateComponents(FModel fModel, List<FDInterface> deployedInterfaces, IFileSystemAccess fileSystemAccess, IResource res)
+ {
val allReferencedFTypes = fModel.allReferencedFTypes
val allFTypeTypeCollections = allReferencedFTypes.filter[eContainer instanceof FTypeCollection].map[
eContainer as FTypeCollection]
- val allFTypeFInterfaces = allReferencedFTypes.filter[eContainer instanceof FInterface].map[
- eContainer as FInterface]
+ val allFTypeFInterfaces = allReferencedFTypes.filter[eContainer instanceof FInterface].map[eContainer as FInterface]
val generateTypeCollections = fModel.typeCollections.toSet
generateTypeCollections.addAll(allFTypeTypeCollections)
@@ -142,10 +165,13 @@ class FrancaGenerator implements IGenerator {
generateInterfaces.forEach [
val currentInterface = it
var DeploymentInterfacePropertyAccessor deploymentAccessor
- if (deployedInterfaces.exists[it.target == currentInterface]) {
+ if(deployedInterfaces.exists[it.target == currentInterface])
+ {
deploymentAccessor = new DeploymentInterfacePropertyAccessor(
new FDeployedInterface(deployedInterfaces.filter[it.target == currentInterface].last))
- } else {
+ }
+ else
+ {
deploymentAccessor = defaultDeploymentAccessor
}
generate(it, fileSystemAccess, defaultDeploymentAccessor, res)
@@ -154,18 +180,20 @@ class FrancaGenerator implements IGenerator {
fModel.interfaces.forEach [
val currentInterface = it
var DeploymentInterfacePropertyAccessor deploymentAccessor
- if (deployedInterfaces.exists[it.target == currentInterface]) {
+ if(deployedInterfaces.exists[it.target == currentInterface])
+ {
deploymentAccessor = new DeploymentInterfacePropertyAccessor(
new FDeployedInterface(deployedInterfaces.filter[it.target == currentInterface].last))
- } else {
+ }
+ else
+ {
deploymentAccessor = defaultDeploymentAccessor
}
-
val booleanTrue = Boolean.toString(true)
var IEclipsePreferences node
-
var String finalValue = booleanTrue
- if (FrameworkUtil::getBundle(this.getClass()) != null) {
+ if(FrameworkUtil::getBundle(this.getClass()) != null)
+ {
node = DefaultScope::INSTANCE.getNode(PreferenceConstants::SCOPE)
finalValue = node.get(PreferenceConstants::P_GENERATEPROXY, booleanTrue)
@@ -173,36 +201,42 @@ class FrancaGenerator implements IGenerator {
finalValue = node.get(PreferenceConstants::P_GENERATEPROXY, finalValue)
}
finalValue = FPreferences::instance.getPreference(res, PreferenceConstants::P_GENERATEPROXY, finalValue)
- if (finalValue.equals(booleanTrue)) {
+ if(finalValue.equals(booleanTrue))
+ {
+ fileSystemAccess.setFileAccessOutputPathForPreference(PreferenceConstants.P_OUTPUT_PROXIES, res)
it.generateProxy(fileSystemAccess, deploymentAccessor, res)
}
-
finalValue = booleanTrue
- if (FrameworkUtil::getBundle(this.getClass()) != null) {
+ if(FrameworkUtil::getBundle(this.getClass()) != null)
+ {
node = DefaultScope::INSTANCE.getNode(PreferenceConstants::SCOPE)
finalValue = node.get(PreferenceConstants::P_GENERATESTUB, booleanTrue)
node = InstanceScope::INSTANCE.getNode(PreferenceConstants::SCOPE)
finalValue = node.get(PreferenceConstants::P_GENERATESTUB, finalValue)
}
-
finalValue = FPreferences::instance.getPreference(res, PreferenceConstants::P_GENERATESTUB, finalValue)
- if (finalValue.equals(booleanTrue)) {
+ if(finalValue.equals(booleanTrue))
+ {
+ fileSystemAccess.setFileAccessOutputPathForPreference(PreferenceConstants.P_OUTPUT_STUBS, res)
it.generateStub(fileSystemAccess, res)
}
]
-
+
return;
}
private var String filePrefix = "file://"
- def getFilePathUrl(Resource resource) {
+ def getFilePathUrl(Resource resource)
+ {
val filePath = resource.filePath
return filePrefix + filePath
}
- def private getFilePath(Resource resource) {
- if (resource.URI.file) {
+ def private getFilePath(Resource resource)
+ {
+ if(resource.URI.file)
+ {
return resource.URI.toFileString
}
@@ -212,21 +246,25 @@ class FrancaGenerator implements IGenerator {
return file.location.toString
}
- def private getAllReferencedFInterfaces(FModel fModel) {
+ def private getAllReferencedFInterfaces(FModel fModel)
+ {
val referencedFInterfaces = fModel.interfaces.toSet
fModel.interfaces.forEach[base?.addFInterfaceTree(referencedFInterfaces)]
fModel.interfaces.forEach[managedInterfaces.forEach[addFInterfaceTree(referencedFInterfaces)]]
return referencedFInterfaces
}
- def private void addFInterfaceTree(FInterface fInterface, Collection<FInterface> fInterfaceReferences) {
- if (!fInterfaceReferences.contains(fInterface)) {
+ def private void addFInterfaceTree(FInterface fInterface, Collection<FInterface> fInterfaceReferences)
+ {
+ if(!fInterfaceReferences.contains(fInterface))
+ {
fInterfaceReferences.add(fInterface)
fInterface.base?.addFInterfaceTree(fInterfaceReferences)
}
}
- def private getAllReferencedFTypes(FModel fModel) {
+ def private getAllReferencedFTypes(FModel fModel)
+ {
val referencedFTypes = new HashSet<FType>
fModel.typeCollections.forEach[types.forEach[addFTypeDerivedTree(referencedFTypes)]]
@@ -246,53 +284,78 @@ class FrancaGenerator implements IGenerator {
return referencedFTypes
}
- def private void addDerivedFTypeTree(FTypeRef fTypeRef, Collection<FType> fTypeReferences) {
+ def private void addDerivedFTypeTree(FTypeRef fTypeRef, Collection<FType> fTypeReferences)
+ {
fTypeRef.derived?.addFTypeDerivedTree(fTypeReferences)
}
- def private dispatch void addFTypeDerivedTree(FTypeDef fTypeDef, Collection<FType> fTypeReferences) {
- if (!fTypeReferences.contains(fTypeDef)) {
+ def private dispatch void addFTypeDerivedTree(FTypeDef fTypeDef, Collection<FType> fTypeReferences)
+ {
+ if(!fTypeReferences.contains(fTypeDef))
+ {
fTypeReferences.add(fTypeDef)
fTypeDef.actualType.addDerivedFTypeTree(fTypeReferences)
}
}
- def private dispatch void addFTypeDerivedTree(FArrayType fArrayType, Collection<FType> fTypeReferences) {
- if (!fTypeReferences.contains(fArrayType)) {
+ def private dispatch void addFTypeDerivedTree(FArrayType fArrayType, Collection<FType> fTypeReferences)
+ {
+ if(!fTypeReferences.contains(fArrayType))
+ {
fTypeReferences.add(fArrayType)
fArrayType.elementType.addDerivedFTypeTree(fTypeReferences)
}
}
- def private dispatch void addFTypeDerivedTree(FMapType fMapType, Collection<FType> fTypeReferences) {
- if (!fTypeReferences.contains(fMapType)) {
+ def private dispatch void addFTypeDerivedTree(FMapType fMapType, Collection<FType> fTypeReferences)
+ {
+ if(!fTypeReferences.contains(fMapType))
+ {
fTypeReferences.add(fMapType)
fMapType.keyType.addDerivedFTypeTree(fTypeReferences)
fMapType.valueType.addDerivedFTypeTree(fTypeReferences)
}
}
- def private dispatch void addFTypeDerivedTree(FStructType fStructType, Collection<FType> fTypeReferences) {
- if (!fTypeReferences.contains(fStructType)) {
+ def private dispatch void addFTypeDerivedTree(FStructType fStructType, Collection<FType> fTypeReferences)
+ {
+ if(!fTypeReferences.contains(fStructType))
+ {
fTypeReferences.add(fStructType)
fStructType.base?.addFTypeDerivedTree(fTypeReferences)
fStructType.elements.forEach[type.addDerivedFTypeTree(fTypeReferences)]
}
}
- def private dispatch void addFTypeDerivedTree(FEnumerationType fEnumerationType, Collection<FType> fTypeReferences) {
- if (!fTypeReferences.contains(fEnumerationType)) {
+ def private dispatch void addFTypeDerivedTree(FEnumerationType fEnumerationType, Collection<FType> fTypeReferences)
+ {
+ if(!fTypeReferences.contains(fEnumerationType))
+ {
fTypeReferences.add(fEnumerationType)
fEnumerationType.base?.addFTypeDerivedTree(fTypeReferences)
}
}
- def private dispatch void addFTypeDerivedTree(FUnionType fUnionType, Collection<FType> fTypeReferences) {
- if (!fTypeReferences.contains(fUnionType)) {
+ def private dispatch void addFTypeDerivedTree(FUnionType fUnionType, Collection<FType> fTypeReferences)
+ {
+ if(!fTypeReferences.contains(fUnionType))
+ {
fTypeReferences.add(fUnionType)
fUnionType.base?.addFTypeDerivedTree(fTypeReferences)
fUnionType.elements.forEach[type.addDerivedFTypeTree(fTypeReferences)]
}
}
+ def void setFileAccessOutputPathForPreference(IFileSystemAccess access, String preference, IResource res)
+ {
+ switch (access)
+ {
+ EclipseResourceFileSystemAccess2:
+ access.setOutputPath(
+ FPreferences::instance.getPreference(res, preference, PreferenceConstants::DEFAULT_OUTPUT))
+ JavaIoFileSystemAccess:
+ access.setOutputPath(
+ FPreferences::instance.getPreference(res, preference, PreferenceConstants::DEFAULT_OUTPUT))
+ }
+ }
}
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/FPreferences.java b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/FPreferences.java
index 980ee46..598e38a 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/FPreferences.java
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/FPreferences.java
@@ -53,8 +53,11 @@ public class FPreferences {
if (!preferences.get(null).containsKey(PreferenceConstants.USEPROJECTSETTINGS)) {
map.put(PreferenceConstants.USEPROJECTSETTINGS, Boolean.FALSE.toString());
}
- if (!preferences.get(null).containsKey(PreferenceConstants.P_OUTPUT)) {
- map.put(PreferenceConstants.P_OUTPUT, PreferenceConstants.DEFAULT_OUTPUT);
+ if (!preferences.get(null).containsKey(PreferenceConstants.P_OUTPUT_PROXIES)) {
+ map.put(PreferenceConstants.P_OUTPUT_PROXIES, PreferenceConstants.DEFAULT_OUTPUT);
+ }
+ if (!preferences.get(null).containsKey(PreferenceConstants.P_OUTPUT_STUBS)) {
+ map.put(PreferenceConstants.P_OUTPUT_STUBS, PreferenceConstants.DEFAULT_OUTPUT);
}
if (!preferences.get(null).containsKey(PreferenceConstants.P_LICENSE)) {
map.put(PreferenceConstants.P_LICENSE, PreferenceConstants.DEFAULT_LICENSE);
@@ -77,8 +80,11 @@ public class FPreferences {
QualifiedName useProjectSettingsIdentifier = new QualifiedName(PreferenceConstants.PROJECT_PAGEID, PreferenceConstants.USEPROJECTSETTINGS);
map.put(PreferenceConstants.USEPROJECTSETTINGS, res.getPersistentProperty(useProjectSettingsIdentifier));
- QualifiedName outputPathIdentifier = new QualifiedName(PreferenceConstants.PROJECT_PAGEID, PreferenceConstants.P_OUTPUT);
- map.put(PreferenceConstants.P_OUTPUT, res.getPersistentProperty(outputPathIdentifier));
+ QualifiedName outputPathIdentifier = new QualifiedName(PreferenceConstants.PROJECT_PAGEID, PreferenceConstants.P_OUTPUT_PROXIES);
+ map.put(PreferenceConstants.P_OUTPUT_PROXIES, res.getPersistentProperty(outputPathIdentifier));
+
+ QualifiedName outputPathStubsIdentifier = new QualifiedName(PreferenceConstants.PROJECT_PAGEID, PreferenceConstants.P_OUTPUT_STUBS);
+ map.put(PreferenceConstants.P_OUTPUT_STUBS, res.getPersistentProperty(outputPathStubsIdentifier));
QualifiedName licenseIdentifier = new QualifiedName(PreferenceConstants.PROJECT_PAGEID, PreferenceConstants.P_LICENSE);
map.put(PreferenceConstants.P_LICENSE, res.getPersistentProperty(licenseIdentifier));
@@ -171,8 +177,11 @@ public class FPreferences {
}
instance.preferences.get(project).put(PreferenceConstants.USEPROJECTSETTINGS, Boolean.toString(true));
- String outputFolder = store.getString(PreferenceConstants.P_OUTPUT);
- instance.preferences.get(project).put(PreferenceConstants.P_OUTPUT, outputFolder);
+ String outputFolderProxies = store.getString(PreferenceConstants.P_OUTPUT_PROXIES);
+ instance.preferences.get(project).put(PreferenceConstants.P_OUTPUT_PROXIES, outputFolderProxies);
+
+ String outputFolderStubs = store.getString(PreferenceConstants.P_OUTPUT_STUBS);
+ instance.preferences.get(project).put(PreferenceConstants.P_OUTPUT_STUBS, outputFolderStubs);
String licenseHeader = store.getString(PreferenceConstants.P_LICENSE);
instance.preferences.get(project).put(PreferenceConstants.P_LICENSE, licenseHeader);
@@ -186,8 +195,10 @@ public class FPreferences {
if (instance.preferences.get(project) == null) {
instance.preferences.put(project, new HashMap<String, String>());
}
- instance.preferences.get(project).put(PreferenceConstants.P_OUTPUT,
- defaultstore.getString(PreferenceConstants.P_OUTPUT));
+ instance.preferences.get(project).put(PreferenceConstants.P_OUTPUT_PROXIES,
+ defaultstore.getString(PreferenceConstants.P_OUTPUT_PROXIES));
+ instance.preferences.get(project).put(PreferenceConstants.P_OUTPUT_STUBS,
+ defaultstore.getString(PreferenceConstants.P_OUTPUT_STUBS));
instance.preferences.get(project).put(PreferenceConstants.P_LICENSE,
defaultstore.getString(PreferenceConstants.P_LICENSE));
instance.preferences.get(project).put(PreferenceConstants.P_GENERATEPROXY,
diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/PreferenceConstants.java b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/PreferenceConstants.java
index 717d15a..ef8af66 100644
--- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/PreferenceConstants.java
+++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/preferences/PreferenceConstants.java
@@ -11,18 +11,20 @@ package org.genivi.commonapi.core.preferences;
/**
* Constant definitions for plug-in preferences
*/
-public class PreferenceConstants {
- public static final String SCOPE = "org.genivi.commonapi.core.ui";
- public static final String P_LICENSE = "licenseHeader";
- public static final String P_OUTPUT = "outputDir";
+public class PreferenceConstants
+{
+ public static final String SCOPE = "org.genivi.commonapi.core.ui";
+ public static final String P_LICENSE = "licenseHeader";
+ public static final String P_OUTPUT_PROXIES = "outputDirProxies";
+ public static final String P_OUTPUT_STUBS = "outputDirStubs";
public static final String USEPROJECTSETTINGS = "useProjectSettings";
- public static final String DEFAULT_OUTPUT = "./src-gen/";
- public static final String DEFAULT_LICENSE = "This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.\n" +
- "If a copy of the MPL was not distributed with this file, You can obtain one at\n" +
- "http://mozilla.org/MPL/2.0/.";
- public static final String P_GENERATEPROXY = "generateproxy";
- public static final String P_GENERATESTUB = "generatestub";
- public static final String PROJECT_PAGEID = "org.genivi.commonapi.core.ui.preferences.CommonAPIPreferencePage";
- public static final String FRANCA_VERSION = "francaversion";
- public static final String CORE_VERSION = "coreversion";
+ public static final String DEFAULT_OUTPUT = "./src-gen/";
+ public static final String DEFAULT_LICENSE = "This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.\n"
+ + "If a copy of the MPL was not distributed with this file, You can obtain one at\n"
+ + "http://mozilla.org/MPL/2.0/.";
+ public static final String P_GENERATEPROXY = "generateproxy";
+ public static final String P_GENERATESTUB = "generatestub";
+ public static final String PROJECT_PAGEID = "org.genivi.commonapi.core.ui.preferences.CommonAPIPreferencePage";
+ public static final String FRANCA_VERSION = "francaversion";
+ public static final String CORE_VERSION = "coreversion";
}