summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-04-06 16:18:09 (EDT)
committer pelder2006-04-06 16:18:09 (EDT)
commitc794adbf5ebf413090d5545afd7425978463a85b (patch)
tree22bfc7469757b8716656ff4710de725ffde4520d
parent910d9fe11d9b1d5bf94c65852a269e18bab05b96 (diff)
downloadorg.eclipse.jet-c794adbf5ebf413090d5545afd7425978463a85b.zip
org.eclipse.jet-c794adbf5ebf413090d5545afd7425978463a85b.tar.gz
org.eclipse.jet-c794adbf5ebf413090d5545afd7425978463a85b.tar.bz2
[131193] Add preference storage, project properties, and preferences pages.
-rw-r--r--plugins/org.eclipse.jet.ui/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.jet.ui/plugin.properties7
-rw-r--r--plugins/org.eclipse.jet.ui/plugin.xml25
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java24
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties12
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/CompilePreferencePage.java168
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/ExtensionListEditor.java70
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/JETPreferencePage.java85
-rw-r--r--plugins/org.eclipse.jet/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.jet/plugin.xml4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/CompileOptionsManager.java97
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java123
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java60
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferences.java38
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java17
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/JET2CompilerState.java34
16 files changed, 722 insertions, 52 deletions
diff --git a/plugins/org.eclipse.jet.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jet.ui/META-INF/MANIFEST.MF
index 4e2b013..3b1addc 100644
--- a/plugins/org.eclipse.jet.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jet.ui/META-INF/MANIFEST.MF
@@ -15,4 +15,10 @@ Require-Bundle: org.eclipse.core.resources,
org.eclipse.ui.ide,
org.eclipse.jdt.core
Eclipse-AutoStart: true
-Export-Package: org.eclipse.jet.ui.newproject
+Export-Package: org.eclipse.jet.internal.ui.filters;x-internal:=true,
+ org.eclipse.jet.internal.ui.l10n;x-internal:=true,
+ org.eclipse.jet.internal.ui.launch;x-internal:=true,
+ org.eclipse.jet.internal.ui.popup.actions;x-internal:=true,
+ org.eclipse.jet.internal.ui.prefs;x-internal:=true,
+ org.eclipse.jet.ui,
+ org.eclipse.jet.ui.newproject
diff --git a/plugins/org.eclipse.jet.ui/plugin.properties b/plugins/org.eclipse.jet.ui/plugin.properties
index 14f4274..19a983e 100644
--- a/plugins/org.eclipse.jet.ui/plugin.properties
+++ b/plugins/org.eclipse.jet.ui/plugin.properties
@@ -28,4 +28,9 @@ popupMenus.group.jet2Debug = JET Debug
popupMenus.action.unload = Unload
launchShortcut.label = JET Transform
-launchShortcut.contextLabel = Input for JET Transform \ No newline at end of file
+launchShortcut.contextLabel = Input for JET Transform
+
+prefPage.jet.title = JET
+prefpage.jet.compilerOptions.title = Compiler Options
+
+propPage.jet.title = JET Compiler \ No newline at end of file
diff --git a/plugins/org.eclipse.jet.ui/plugin.xml b/plugins/org.eclipse.jet.ui/plugin.xml
index afa6095..eb300d7 100644
--- a/plugins/org.eclipse.jet.ui/plugin.xml
+++ b/plugins/org.eclipse.jet.ui/plugin.xml
@@ -125,5 +125,30 @@
verticalRulerPreferenceKey="jetErrorVerticalRuler"
verticalRulerPreferenceValue="true"/>
</extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.jet.ui.jet"
+ class="org.eclipse.jet.internal.ui.prefs.CompilePreferencePage"
+ id="org.eclipse.jet.ui.compiler"
+ name="%prefpage.jet.compilerOptions.title"/>
+ <page
+ class="org.eclipse.jet.internal.ui.prefs.JETPreferencePage"
+ id="org.eclipse.jet.ui.jet"
+ name="%prefPage.jet.title"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ adaptable="true"
+ class="org.eclipse.jet.internal.ui.prefs.CompilePreferencePage"
+ id="org.eclipse.jet.ui.project.jet"
+ name="%propPage.jet.title"
+ objectClass="org.eclipse.core.resources.IProject">
+ <filter
+ name="nature"
+ value="org.eclipse.jet.jet2Nature"/>
+ </page>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java
index 9ba1121..da2d8fc 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java
@@ -13,6 +13,30 @@ public class Messages extends NLS {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
+ public static String CompilePreferencePage_DeriveJavaFiles;
+
+ public static String CompilePreferencePage_Description;
+
+ public static String CompilePreferencePage_EnableProjectSettings;
+
+ public static String CompilePreferencePage_FileExtensions;
+
+ public static String CompilePreferencePage_JavaPackage;
+
+ public static String CompilePreferencePage_SourceFolder;
+
+ public static String ExtensionListEditor_AddDialogErrorMsg;
+
+ public static String ExtensionListEditor_AddDialogPrompt;
+
+ public static String ExtensionListEditor_AddDialogTitle;
+
+ public static String JETPreferencePage_Description;
+
+ public static String JETPreferencePage_LocationsAddDialogTitle;
+
+ public static String JETPreferencePage_LocationsLabel;
+
public static String JETTransformMainTab_BrowseButtonLabel;
public static String JETTransformMainTab_DescriptionLabel;
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties
index cc8d99e..8762169 100644
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties
@@ -29,6 +29,18 @@ UnloadAction_NotLoaded=Bundle is not loaded "{0}". No action was taken.
JETTransformMainTab_TransformGroupLabel=Transform
JETTransformMainTab_DescriptionLabel=Description:
JETTransformMainTab_NameLabel=Name:
+JETPreferencePage_Description=JET General options
JETTransformMainTab_IdLabel=ID:
JETTransformMainTab_TransformInputGroup=Transform Input
JETTransformMainTab_BrowseButtonLabel=Browse...
+CompilePreferencePage_Description=JET Compiler options
+CompilePreferencePage_EnableProjectSettings=&Enable Project specific settings
+CompilePreferencePage_JavaPackage=&Package for generated Java classes:
+CompilePreferencePage_FileExtensions=&File extensions for templates:
+CompilePreferencePage_SourceFolder=&Source folder for generated Java classes:
+CompilePreferencePage_DeriveJavaFiles=&Hide compiled Java from Team system (mark .java files derived)
+ExtensionListEditor_AddDialogTitle=Add extension
+ExtensionListEditor_AddDialogPrompt=Enter an extension
+ExtensionListEditor_AddDialogErrorMsg=Extension must be a sequence of letters and/or digits
+JETPreferencePage_LocationsLabel=Additional locations for JET Transforms
+JETPreferencePage_LocationsAddDialogTitle=Select a Folder
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/CompilePreferencePage.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/CompilePreferencePage.java
new file mode 100644
index 0000000..0bcecdf
--- /dev/null
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/CompilePreferencePage.java
@@ -0,0 +1,168 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.ui.prefs;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.compiler.JET2Compiler;
+import org.eclipse.jet.internal.JETPreferences;
+import org.eclipse.jet.internal.ui.l10n.Messages;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbenchPropertyPage;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+
+/**
+ * @author pelder
+ *
+ */
+public class CompilePreferencePage extends FieldEditorPreferencePage implements
+ IWorkbenchPreferencePage, IWorkbenchPropertyPage {
+
+ private IProject element;
+ private StringFieldEditor packageFieldEditor;
+ private ExtensionListEditor extFieldEditor;
+ private StringFieldEditor srcFolderFieldEditor;
+ private BooleanFieldEditor derivedJavaFieldEditor;
+ private BooleanFieldEditor projectSpecificSettingsEditor = null;
+
+ /**
+ * @param style
+ */
+ public CompilePreferencePage() {
+ super(GRID);
+ setDescription(Messages.CompilePreferencePage_Description);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+ */
+ protected void createFieldEditors() {
+
+ if(element == null) {
+ setPreferenceStore(new ScopedPreferenceStore(new InstanceScope(), JET2Platform.PLUGIN_ID));
+ } else {
+ setPreferenceStore(new ScopedPreferenceStore(new ProjectScope(element), JET2Platform.PLUGIN_ID));
+ projectSpecificSettingsEditor = new BooleanFieldEditor(JETPreferences.PROJECT_SPECIFIC_SETTINGS,
+ Messages.CompilePreferencePage_EnableProjectSettings, getFieldEditorParent());
+ addField(projectSpecificSettingsEditor);
+ }
+
+
+ packageFieldEditor = new StringFieldEditor(JET2Compiler.OPTION_COMPILED_TEMPLATE_PACKAGE,
+ Messages.CompilePreferencePage_JavaPackage, getFieldEditorParent());
+ addField(packageFieldEditor);
+
+ extFieldEditor = new ExtensionListEditor(JET2Compiler.OPTION_TEMPLATE_EXT,
+ Messages.CompilePreferencePage_FileExtensions, getFieldEditorParent());
+ addField(extFieldEditor);
+
+ srcFolderFieldEditor = new StringFieldEditor(JET2Compiler.OPTION_COMPILED_TEMPLATE_SRC_DIR,
+ Messages.CompilePreferencePage_SourceFolder, getFieldEditorParent());
+ addField(srcFolderFieldEditor);
+
+ derivedJavaFieldEditor = new BooleanFieldEditor(JET2Compiler.OPTION_SET_JAVA_FILES_AS_DERIVED,
+ Messages.CompilePreferencePage_DeriveJavaFiles, getFieldEditorParent());
+ addField(derivedJavaFieldEditor);
+
+ }
+
+ /**
+ *
+ */
+ private void updateControlEnablement() {
+ boolean enabled = projectSpecificSettingsEditor.getBooleanValue();
+ packageFieldEditor.setEnabled(enabled, getFieldEditorParent());
+ extFieldEditor.setEnabled(enabled, getFieldEditorParent());
+ srcFolderFieldEditor.setEnabled(enabled, getFieldEditorParent());
+ derivedJavaFieldEditor.setEnabled(enabled, getFieldEditorParent());
+ if(!enabled) {
+ packageFieldEditor.loadDefault();
+ extFieldEditor.loadDefault();
+ srcFolderFieldEditor.loadDefault();
+ derivedJavaFieldEditor.loadDefault();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ }
+
+ public IAdaptable getElement() {
+ return element;
+ }
+
+ public void setElement(IAdaptable element) {
+ this.element = (IProject)element;
+ }
+
+ protected void initialize() {
+ super.initialize();
+ if(projectSpecificSettingsEditor != null)
+ {
+ updateControlEnablement();
+ }
+ }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ super.propertyChange(event);
+ if(event.getSource() == projectSpecificSettingsEditor && FieldEditor.VALUE.equals(event.getProperty())) {
+ updateControlEnablement();
+ }
+ }
+
+ protected void performDefaults() {
+ super.performDefaults();
+ if (projectSpecificSettingsEditor != null) {
+ updateControlEnablement();
+ }
+
+ }
+
+ public boolean performOk() {
+ final boolean ok = super.performOk();
+ if(ok) {
+ try {
+ if(element != null)
+ {
+ element.build(IncrementalProjectBuilder.CLEAN_BUILD, null);
+ }
+ else
+ {
+ ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.CLEAN_BUILD, null);
+ }
+ } catch (CoreException e) {
+ // build failed, we don't care
+ }
+ }
+ return ok;
+ }
+}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/ExtensionListEditor.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/ExtensionListEditor.java
new file mode 100644
index 0000000..2130113
--- /dev/null
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/ExtensionListEditor.java
@@ -0,0 +1,70 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.ui.prefs;
+
+import java.util.regex.Pattern;
+
+import org.eclipse.jet.internal.ui.l10n.Messages;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.preference.ListEditor;
+import org.eclipse.swt.widgets.Composite;
+
+
+/**
+ * @author pelder
+ *
+ */
+public class ExtensionListEditor extends ListEditor {
+
+ /**
+ *
+ */
+ public ExtensionListEditor(String name, String labelText, Composite parent) {
+ init(name, labelText);
+ createControl(parent);
+ }
+
+ protected String createList(String[] items) {
+ StringBuffer buffer = new StringBuffer();
+ for (int i = 0; i < items.length; i++) {
+ if(i != 0)
+ {
+ buffer.append(","); //$NON-NLS-1$
+ }
+ buffer.append(items[i]);
+ }
+ return buffer.toString();
+ }
+
+ protected String getNewInputObject() {
+ InputDialog dialog = new InputDialog(getShell(), Messages.ExtensionListEditor_AddDialogTitle, Messages.ExtensionListEditor_AddDialogPrompt, "", new IInputValidator() { //$NON-NLS-1$
+
+ public String isValid(String newText) {
+ return !Pattern.matches("(\\p{L}|\\d)+", newText) ? //$NON-NLS-1$
+ Messages.ExtensionListEditor_AddDialogErrorMsg : null;
+ }});
+ final int result = dialog.open();
+ return result == InputDialog.OK ? dialog.getValue() : null;
+ }
+
+ protected String[] parseString(String stringList) {
+ return stringList.split(","); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/JETPreferencePage.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/JETPreferencePage.java
new file mode 100644
index 0000000..c4b24cc
--- /dev/null
+++ b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/JETPreferencePage.java
@@ -0,0 +1,85 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+
+package org.eclipse.jet.internal.ui.prefs;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.internal.JETPreferences;
+import org.eclipse.jet.internal.ui.l10n.Messages;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.PathEditor;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbenchPropertyPage;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+
+/**
+ * @author pelder
+ *
+ */
+public class JETPreferencePage extends FieldEditorPreferencePage implements
+ IWorkbenchPreferencePage, IWorkbenchPropertyPage {
+
+ private IAdaptable element;
+
+ /**
+ * @param style
+ */
+ public JETPreferencePage() {
+ super(GRID);
+
+ setDescription(Messages.JETPreferencePage_Description);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+ */
+ protected void createFieldEditors() {
+ if(element != null)
+ {
+ setPreferenceStore(new ScopedPreferenceStore(new ProjectScope((IProject)element), JET2Platform.PLUGIN_ID));
+ }
+ else {
+ setPreferenceStore(new ScopedPreferenceStore(new InstanceScope(), JET2Platform.PLUGIN_ID));
+ }
+ addField(new PathEditor(JETPreferences.ADDITIONAL_TEMPLATE_JAR_LOCATIONS,
+ Messages.JETPreferencePage_LocationsLabel,
+ Messages.JETPreferencePage_LocationsAddDialogTitle,
+ getFieldEditorParent()));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public IAdaptable getElement() {
+ return element;
+ }
+
+ public void setElement(IAdaptable element) {
+ this.element = element;
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/META-INF/MANIFEST.MF b/plugins/org.eclipse.jet/META-INF/MANIFEST.MF
index 40c9f10..a43c4dd 100644
--- a/plugins/org.eclipse.jet/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jet/META-INF/MANIFEST.MF
@@ -24,6 +24,8 @@ Export-Package: org.eclipse.jet,
org.eclipse.jet.internal.builder;x-friends:="org.eclipse.jet.tests",
org.eclipse.jet.internal.compiler;x-friends:="org.eclipse.jet.tests",
org.eclipse.jet.internal.compiler.templates;x-friends:="org.eclipse.jet.tests",
+ org.eclipse.jet.internal.extensionpoints;x-internal:=true,
+ org.eclipse.jet.internal.l10n;x-internal:=true,
org.eclipse.jet.internal.launch;x-friends:="org.eclipse.jet.tests,org.eclipse.jet.ui",
org.eclipse.jet.internal.parser;x-friends:="org.eclipse.jet.tests",
org.eclipse.jet.internal.runtime;x-friends:="org.eclipse.jet.tests,org.eclipse.jet.ui",
diff --git a/plugins/org.eclipse.jet/plugin.xml b/plugins/org.eclipse.jet/plugin.xml
index a2f719d..8e98c3c 100644
--- a/plugins/org.eclipse.jet/plugin.xml
+++ b/plugins/org.eclipse.jet/plugin.xml
@@ -1243,5 +1243,9 @@ if 'length' is specified, convert only the specified number of characters, other
name="%contentTypes.template.name"
priority="normal"/>
</extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.jet.internal.JETPreferenceInitializer"/>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/CompileOptionsManager.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/CompileOptionsManager.java
new file mode 100644
index 0000000..d3da9d6
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/CompileOptionsManager.java
@@ -0,0 +1,97 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.compiler;
+
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.ConfigurationScope;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IPreferencesService;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jet.JET2Platform;
+
+
+/**
+ * A singleton that managers JET project compile options.
+ */
+public class CompileOptionsManager
+{
+
+ private static CompileOptionsManager manager = null;
+ private final IEclipsePreferences configurationNode;
+ private final IEclipsePreferences instanceNode;
+ private final IEclipsePreferences defaultsNode;
+
+ public static CompileOptionsManager getInstance()
+ {
+ if (manager == null)
+ {
+ manager = new CompileOptionsManager();
+ }
+ return manager;
+ }
+
+ /**
+ *
+ */
+ private CompileOptionsManager()
+ {
+ super();
+ defaultsNode = new DefaultScope().getNode(JET2Platform.PLUGIN_ID);
+ configurationNode = new ConfigurationScope().getNode(JET2Platform.PLUGIN_ID);
+ instanceNode = new InstanceScope().getNode(JET2Platform.PLUGIN_ID);
+
+ }
+
+ public Map getOptionsForProject(IProject project)
+ {
+ IScopeContext projectScope = new ProjectScope(project);
+ final IEclipsePreferences projectNode = projectScope.getNode(JET2Platform.PLUGIN_ID);
+ IEclipsePreferences[] searchList = new IEclipsePreferences[] {
+ projectNode,
+ instanceNode,
+ configurationNode,
+ defaultsNode,
+ };
+ final IPreferencesService service = Platform.getPreferencesService();
+
+ Set keys = JET2Compiler.getDefaultCompilerOptions().keySet();
+ Map result = new HashMap(keys.size());
+ for (Iterator i = keys.iterator(); i.hasNext();)
+ {
+ String key = (String)i.next();
+ final String value = service.get(key, null, searchList);
+ result.put(key, value);
+ }
+ return result;
+ }
+
+ public static Map getOptions(IProject project)
+ {
+ return getInstance().getOptionsForProject(project);
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java
index df842a7..305d599 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Compiler.java
@@ -20,10 +20,12 @@ package org.eclipse.jet.compiler;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
-import java.util.Properties;
+import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -59,40 +61,68 @@ public class JET2Compiler
public static final String RUNTIME_PROBLEM_MARKER = JET2Platform.PLUGIN_ID + ".runtimeProblem"; //$NON-NLS-1$
/**
- * Compiler option specifying which extensions are recognized as extensions; value: "templateExt".
+ * The Marker created by the compiler on all identified problems.
*/
- public static final String OPTION_TEMPLATE_EXT = "templateExt"; //$NON-NLS-1$
+ public static final String COMPILE_PROBLEM_MARKER = JET2Platform.PLUGIN_ID + ".compileProblem"; //$NON-NLS-1$
/**
- * Compiler option specifying the package to which compiled templates are written; value: "compiledTemplatePackage".
+ * The default value of the {@link #OPTION_COMPILED_TEMPLATE_PACKAGE} option; value: "org.eclipse.jet2.internal.compiled".
*/
- public static final String OPTION_COMPILED_TEMPLATE_PACKAGE = "compiledTemplatePackage"; //$NON-NLS-1$
+ public static final String DEFAULT_COMPILED_TEMPLATE_PACKAGE = "org.eclipse.jet.compiled"; //$NON-NLS-1$
/**
- * Compiler option specifying the Java project source directory to which compiled templates are written; value: "compiledTemplateSrcDir".
+ * The default value of the {@link #OPTION_COMPILED_TEMPLATE_SRC_DIR} option; value: "jet2java".
*/
- public static final String OPTION_COMPILED_TEMPLATE_SRC_DIR = "compiledTemplateSrcDir"; //$NON-NLS-1$
+ public static final String DEFAULT_COMPILED_TEMPLATE_SRC_DIR = "jet2java"; //$NON-NLS-1$
/**
- * The default value of the {@link #OPTION_COMPILED_TEMPLATE_PACKAGE} option; value: "org.eclipse.jet2.internal.compiled".
+ * The default value of the {@link #OPTION_TEMPLATE_EXT} option; value: "jet".
*/
- public static final String DEFAULT_COMPILED_TEMPLATE_PACKAGE = "org.eclipse.jet.compiled"; //$NON-NLS-1$
+ public static final String DEFAULT_TEMPLATE_EXT = "jet"; //$NON-NLS-1$
+
+ public static final Boolean DEFAULT_SET_JAVA_FILES_AS_DERIVED = Boolean.TRUE;
+
+ private static final String NS = "org.eclipse.jet."; //$NON-NLS-1$
/**
- * The default value of the {@link #OPTION_TEMPLATE_EXT} option; value: "jet".
+ * Compiler option specifying the package to which compiled templates are written; value: "compiledTemplatePackage".
*/
- public static final String DEFAULT_TEMPLATE_EXT = "jet"; //$NON-NLS-1$
+ public static final String OPTION_COMPILED_TEMPLATE_PACKAGE = NS + "compiledTemplatePackage"; //$NON-NLS-1$
/**
- * The default value of the {@link #OPTION_COMPILED_TEMPLATE_SRC_DIR} option; value: "jet2java".
+ * Compiler option specifying the Java project source directory to which compiled templates are written; value: "compiledTemplateSrcDir".
*/
- public static final String DEFAULT_COMPILED_TEMPLATE_SRC_DIR = "jet2java"; //$NON-NLS-1$
+ public static final String OPTION_COMPILED_TEMPLATE_SRC_DIR = NS + "compiledTemplateSrcDir"; //$NON-NLS-1$
/**
- * The Marker created by the compiler on all identified problems.
+ * Compiler option specifying which extensions are recognized as extensions; value: "templateExt".
*/
- public static final String COMPILE_PROBLEM_MARKER = JET2Platform.PLUGIN_ID + ".compileProblem"; //$NON-NLS-1$
-
+ public static final String OPTION_TEMPLATE_EXT = NS + "templateExt"; //$NON-NLS-1$
+
+ public static final String OPTION_SET_JAVA_FILES_AS_DERIVED = NS + "setJavaDerived"; //$NON-NLS-1$
+
+ private static Map defaultCompileOptions = null;
+ private static final Object defaultCompileOptionsLock = new Object();
+
+ // Return the default compile options...
+ public static Map getDefaultCompilerOptions()
+ {
+ if(defaultCompileOptions == null)
+ {
+ Map map = new HashMap();
+ map.put(OPTION_COMPILED_TEMPLATE_PACKAGE, DEFAULT_COMPILED_TEMPLATE_PACKAGE);
+ map.put(OPTION_COMPILED_TEMPLATE_SRC_DIR, DEFAULT_COMPILED_TEMPLATE_SRC_DIR);
+ map.put(OPTION_TEMPLATE_EXT, DEFAULT_TEMPLATE_EXT);
+ map.put(OPTION_SET_JAVA_FILES_AS_DERIVED, DEFAULT_SET_JAVA_FILES_AS_DERIVED);
+
+ synchronized(defaultCompileOptionsLock)
+ {
+ defaultCompileOptions = Collections.unmodifiableMap(map);
+ }
+ }
+ return defaultCompileOptions;
+ }
+
private final IProgressMonitor monitor;
private final IProject project;
@@ -101,27 +131,29 @@ public class JET2Compiler
private int noCompiles;
- private final Properties options;
+ private final Map options;
private final Map predefinedLibraryMap;
private final String templateLoaderPackage;
private final String templateLoaderClassName;
+
+ private Set sourceExtensions = null;
/**
* Create an instance
* @param project the project upon which the compiler will act
* @param monitor a progress monitor for compiler actions
- * @param options TODO
+ * @param options a map of compiler options
*
*/
- public JET2Compiler(IProject project, IProgressMonitor monitor, Properties options)
+ public JET2Compiler(IProject project, IProgressMonitor monitor, Map options)
{
super();
this.project = project;
this.monitor = monitor;
- this.options = options == null ? new Properties() : options;
+ this.options = options == null ? getDefaultCompilerOptions() : options;
this.compilerState = InternalJET2Platform.getCompilerState(project);
this.noCompiles = 0;
@@ -176,7 +208,7 @@ public class JET2Compiler
final LoaderGenerationParameters args = new LoaderGenerationParameters(templateLoaderPackage, templateLoaderClassName, compilerState.getTemplateMap());
String src = new JET2TransformGenerator().generate(args);
- IPath targetPath = new Path(options.getProperty(OPTION_COMPILED_TEMPLATE_SRC_DIR, DEFAULT_COMPILED_TEMPLATE_SRC_DIR)).append(
+ IPath targetPath = new Path(getOption(JET2Compiler.OPTION_COMPILED_TEMPLATE_SRC_DIR, JET2Compiler.DEFAULT_COMPILED_TEMPLATE_SRC_DIR)).append(
templateLoaderPackage.replace('.', '/')).append(templateLoaderClassName).addFileExtension("java"); //$NON-NLS-1$
try
@@ -194,6 +226,32 @@ public class JET2Compiler
}
}
+ private String getOption(String key, String defaultValue)
+ {
+ Object value = options.get(key);
+ return value == null ? defaultValue : value.toString();
+ }
+
+ private boolean getBooleanOption(String key, boolean defaultValue)
+ {
+ Object value = options.get(key);
+ return value == null ? defaultValue :
+ value instanceof Boolean ? ((Boolean)value).booleanValue() :
+ Boolean.valueOf(value.toString()).booleanValue();
+ }
+
+ private boolean isJETSource(IPath path)
+ {
+ if(sourceExtensions == null) {
+ sourceExtensions = new HashSet();
+ final String[] extensions = getOption(OPTION_TEMPLATE_EXT, DEFAULT_TEMPLATE_EXT).split(","); //$NON-NLS-1$
+ for (int i = 0; i < extensions.length; i++)
+ {
+ sourceExtensions.add(extensions[i]);
+ }
+ }
+ return sourceExtensions.contains(path.getFileExtension());
+ }
/**
* Test whether the supplied resource is a compilable JET2 source file.
* @param resource
@@ -201,11 +259,7 @@ public class JET2Compiler
*/
public boolean isJET2SourceFile(IResource resource)
{
- String ext = resource.getFileExtension();
- // TODO Figure out whether the resource is in a templates directory or not.
-
- return resource.getType() == IResource.FILE && ext != null
- && ext.endsWith(options.getProperty(OPTION_TEMPLATE_EXT, DEFAULT_TEMPLATE_EXT));
+ return resource.getType() == IResource.FILE && isJETSource(resource.getFullPath());
}
/**
@@ -321,7 +375,7 @@ public class JET2Compiler
private void writeCompiledOutput(IFile file, JET2CompilationUnit cu)
{
- ensureJavaOutputSet(file, cu);
+ boolean inferedJavaPackageName = ensureJavaOutputSet(file, cu);
final String templatePath = file.getProjectRelativePath().toString();
final String qualifiedClassName = makeFullyQualifiedJavaName(cu.getOutputJavaPackage(), cu.getOutputJavaClassName());
@@ -346,8 +400,7 @@ public class JET2Compiler
try
{
writeFile(javaSrc, targetFile, file.getCharset());
- targetFile.setDerived(true);
- compilerState.mapTemplate(templatePath, qualifiedClassName);
+ compilerState.mapTemplate(templatePath, qualifiedClassName, inferedJavaPackageName);
}
catch (CoreException e)
{
@@ -366,8 +419,9 @@ public class JET2Compiler
* @param file
* @param cu
*/
- private void ensureJavaOutputSet(IFile file, JET2CompilationUnit cu)
+ private boolean ensureJavaOutputSet(IFile file, JET2CompilationUnit cu)
{
+ boolean inferedJavaPackage = false;
final String templatePath = file.getProjectRelativePath().toString();
// See if we already have a name for this...
@@ -376,9 +430,11 @@ public class JET2Compiler
if (existingQualifiedClass == null)
{
// we haven't generated a name before, do it now...
+
if (cu.getOutputJavaPackage() == null)
{
- cu.setOutputJavaPackage(options.getProperty(OPTION_COMPILED_TEMPLATE_PACKAGE, DEFAULT_COMPILED_TEMPLATE_PACKAGE));
+ cu.setOutputJavaPackage(getOption(JET2Compiler.OPTION_COMPILED_TEMPLATE_PACKAGE, JET2Compiler.DEFAULT_COMPILED_TEMPLATE_PACKAGE));
+ inferedJavaPackage = true;
}
if (cu.getOutputJavaClassName() == null)
{
@@ -413,7 +469,7 @@ public class JET2Compiler
cu.setOutputJavaClassName(existingClass);
}
}
-
+ return inferedJavaPackage;
}
/**
@@ -422,7 +478,7 @@ public class JET2Compiler
*/
private IPath javaClassProjectPath(String javaClassName)
{
- IPath targetPath = new Path(DEFAULT_COMPILED_TEMPLATE_SRC_DIR).append(javaClassName.replace('.', '/')).addFileExtension("java"); //$NON-NLS-1$
+ IPath targetPath = new Path(JET2Compiler.DEFAULT_COMPILED_TEMPLATE_SRC_DIR).append(javaClassName.replace('.', '/')).addFileExtension("java"); //$NON-NLS-1$
return targetPath;
}
@@ -453,6 +509,7 @@ public class JET2Compiler
}
targetFile.setContents(new ByteArrayInputStream(javaSrc.getBytes(charset)), true, false, new SubProgressMonitor(monitor, 1));
+ targetFile.setDerived(getBooleanOption(OPTION_SET_JAVA_FILES_AS_DERIVED, DEFAULT_SET_JAVA_FILES_AS_DERIVED.booleanValue()));
}
private void ensureDirsExist(IContainer container) throws CoreException
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java
new file mode 100644
index 0000000..ec87a15
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferenceInitializer.java
@@ -0,0 +1,60 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.jet.JET2Platform;
+import org.eclipse.jet.compiler.JET2Compiler;
+
+/**
+ * Preference initializer
+ */
+public class JETPreferenceInitializer extends AbstractPreferenceInitializer
+{
+
+ /**
+ *
+ */
+ public JETPreferenceInitializer()
+ {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ public void initializeDefaultPreferences()
+ {
+ final IEclipsePreferences node = new DefaultScope().getNode(JET2Platform.PLUGIN_ID);
+
+ // save the compiler defaults...
+ Map compilerOptions = JET2Compiler.getDefaultCompilerOptions();
+ for (Iterator i = compilerOptions.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String key = (String)entry.getKey();
+ node.put(key, entry.getValue().toString());
+ }
+
+ node.putBoolean(JETPreferences.PROJECT_SPECIFIC_SETTINGS, false);
+ }
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferences.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferences.java
new file mode 100644
index 0000000..f078b60
--- /dev/null
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/JETPreferences.java
@@ -0,0 +1,38 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jet.internal;
+
+import org.eclipse.jet.JET2Platform;
+
+/**
+ * Utility class defining JET Preference default values and keys
+ */
+public class JETPreferences
+{
+
+ private static final String NS = JET2Platform.PLUGIN_ID + "."; //$NON-NLS-1$
+ public static final String PROJECT_SPECIFIC_SETTINGS = NS + "projectPrefs"; //$NON-NLS-1$
+ public static final String ADDITIONAL_TEMPLATE_JAR_LOCATIONS = NS + "additionalJarLocations"; //$NON-NLS-1$
+ /**
+ *
+ */
+ private JETPreferences()
+ {
+ super();
+ }
+
+}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java
index 920f823..dbd4c6a 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2Builder.java
@@ -33,6 +33,7 @@ import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jet.compiler.CompileOptionsManager;
import org.eclipse.jet.compiler.JET2Compiler;
import org.eclipse.jet.internal.InternalJET2Platform;
import org.eclipse.jet.internal.compiler.JET2CompilerState;
@@ -69,14 +70,20 @@ public class JET2Builder extends IncrementalProjectBuilder
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException
{
- if (kind == IncrementalProjectBuilder.FULL_BUILD)
+ if(kind == IncrementalProjectBuilder.CLEAN_BUILD)
{
+ InternalJET2Platform.setCompilerState(getProject(), null);
+ // TODO remove generated files
+ }
+ else if (kind == IncrementalProjectBuilder.FULL_BUILD)
+ {
+ InternalJET2Platform.setCompilerState(getProject(), null);
fullBuild(monitor);
}
else
{
IResourceDelta delta = getDelta(getProject());
- if (delta == null)
+ if (delta == null || InternalJET2Platform.getCompilerState(getProject()) == null)
{
fullBuild(monitor);
}
@@ -96,7 +103,8 @@ public class JET2Builder extends IncrementalProjectBuilder
*/
private void incrementalBuild(IResourceDelta mainDelta, final IProgressMonitor monitor) throws CoreException
{
- final JET2Compiler compiler = new JET2Compiler(getProject(), monitor, null);
+ final JET2Compiler compiler = new JET2Compiler(getProject(), monitor,
+ CompileOptionsManager.getOptions(getProject()));
filesToCompileCount = 0;
// figure out how much work we must do (for the progress monitor).
mainDelta.accept(new IResourceDeltaVisitor()
@@ -165,7 +173,8 @@ public class JET2Builder extends IncrementalProjectBuilder
*/
private void fullBuild(final IProgressMonitor monitor) throws CoreException
{
- final JET2Compiler compiler = new JET2Compiler(getProject(), monitor, null);
+ final JET2Compiler compiler = new JET2Compiler(getProject(), monitor,
+ CompileOptionsManager.getOptions(getProject()));
filesToCompileCount = 0;
// figure out how much work we must do (for the progress monitor).
getProject().accept(new IResourceVisitor()
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/JET2CompilerState.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/JET2CompilerState.java
index fd34cf9..f41d6bf 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/JET2CompilerState.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/JET2CompilerState.java
@@ -21,7 +21,9 @@ package org.eclipse.jet.internal.compiler;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import org.eclipse.core.resources.IProject;
@@ -40,9 +42,11 @@ public class JET2CompilerState implements Serializable
private transient IProject project = null;
- private final Map templateMap = new HashMap();
+ private final Map qualifiedNameByTemplatePath = new HashMap();
- private final Map classNameToTemplatePath = new HashMap();
+ private final Map templatePathByQualifiedName = new HashMap();
+
+ private Set templatesWithInferedPackageName = new HashSet();
public JET2CompilerState()
{
@@ -64,17 +68,20 @@ public class JET2CompilerState implements Serializable
public Map getTemplateMap()
{
- return Collections.unmodifiableMap(templateMap);
+ return Collections.unmodifiableMap(qualifiedNameByTemplatePath);
}
- public void mapTemplate(String templatePath, String outputJavaClassName)
+ public void mapTemplate(String templatePath, String outputJavaClassName, boolean inferedPackageName)
{
- if (templateMap.containsKey(templatePath))
+ if (qualifiedNameByTemplatePath.containsKey(templatePath))
{
unmapTemplate(templatePath);
}
- templateMap.put(templatePath, outputJavaClassName);
- classNameToTemplatePath.put(outputJavaClassName, templatePath);
+ qualifiedNameByTemplatePath.put(templatePath, outputJavaClassName);
+ if(inferedPackageName) {
+ templatesWithInferedPackageName.add(templatePath);
+ }
+ templatePathByQualifiedName.put(outputJavaClassName, templatePath);
}
/**
@@ -92,20 +99,21 @@ public class JET2CompilerState implements Serializable
public void unmapTemplate(String templatePath)
{
- String javaClass = (String)templateMap.get(templatePath);
- templateMap.remove(templatePath);
- classNameToTemplatePath.remove(javaClass);
+ String javaClass = (String)qualifiedNameByTemplatePath.get(templatePath);
+ qualifiedNameByTemplatePath.remove(templatePath);
+ templatesWithInferedPackageName.remove(templatePath);
+ templatePathByQualifiedName.remove(javaClass);
}
public void clear()
{
- templateMap.clear();
- classNameToTemplatePath.clear();
+ qualifiedNameByTemplatePath.clear();
+ templatePathByQualifiedName.clear();
}
public String getTemplateFromClass(String qualifiedName)
{
- return (String)classNameToTemplatePath.get(qualifiedName);
+ return (String)templatePathByQualifiedName.get(qualifiedName);
}
}