[SCM] Lisaac eclipse plugin branch, master, updated. ccdfb844cc92fcf04ff7f8122ccb106df4a150c7
Damien Bouvarel
dams.bouvarel at wanadoo.fr
Thu May 21 18:46:07 UTC 2009
The following commit has been merged in the master branch:
commit b7f53078742afffc4d84f480462cc8175eac4793
Author: Damien Bouvarel <dams.bouvarel at wanadoo.fr>
Date: Mon May 4 17:36:34 2009 +0200
incremental builder ok + string internalization
diff --git a/.classpath b/.classpath
index 802fbdb..0e539ac 100644
--- a/.classpath
+++ b/.classpath
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="/usr/lib/jvm/java-1.5.0-sun-1.5.0.15"/>
</attributes>
</classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
index c8c3ae9..32e5317 100644
--- a/META-INF/MANIFEST.MF
+++ b/META-INF/MANIFEST.MF
@@ -1,10 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Damien Bouvarel
Bundle-SymbolicName: org.eclipse.lisaac; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.eclipse.lisaac.LisaacPlugin
-Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Vendor: Damien Bouvarel
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
@@ -18,8 +17,7 @@ Require-Bundle: org.eclipse.ui,
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
-Import-Package: org.eclipse.ant.core,
- org.eclipse.debug.core,
+Import-Package: org.eclipse.debug.core,
org.eclipse.debug.core.model,
org.eclipse.debug.ui,
org.eclipse.ui.texteditor.templates,
@@ -41,3 +39,4 @@ Export-Package: org.eclipse.lisaac,
org.eclipse.lisaac.views,
org.eclipse.lisaac.wizards
Bundle-Localization: plugin
+Bundle-Name: %Bundle-Name.0
diff --git a/build.properties b/build.properties
index e8721c8..20609d8 100644
--- a/build.properties
+++ b/build.properties
@@ -6,7 +6,9 @@ bin.includes = plugin.xml,\
icons/,\
*.xml,\
plugin.properties,\
- help/
+ help/,\
+ bin/,\
+ plugin_fr.properties
src.includes = src/,\
help/,\
icons/,\
@@ -14,4 +16,7 @@ src.includes = src/,\
plugin.xml,\
build.properties,\
META-INF/,\
- README
+ README,\
+ plugin_fr.properties
+bin.excludes = icons/Thumbs.db
+src.excludes = icons/Thumbs.db
diff --git a/plugin.xml b/plugin.xml
index 381b340..2cb4f0c 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -162,7 +162,7 @@
</run>
</runtime>
<builder
- id="org.lisaac.builder">
+ id="org.eclipse.lisaac.builder">
</builder>
</extension>
<extension
diff --git a/src/org/eclipse/lisaac/LisaacMessages.java b/src/org/eclipse/lisaac/LisaacMessages.java
new file mode 100644
index 0000000..1fbbbcb
--- /dev/null
+++ b/src/org/eclipse/lisaac/LisaacMessages.java
@@ -0,0 +1,22 @@
+package org.eclipse.lisaac;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class LisaacMessages {
+ private static final String BUNDLE_NAME = "org.eclipse.lisaac.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private LisaacMessages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/src/org/eclipse/lisaac/builder/LisaacBuilder.java b/src/org/eclipse/lisaac/builder/LisaacBuilder.java
index 5307435..dac637f 100644
--- a/src/org/eclipse/lisaac/builder/LisaacBuilder.java
+++ b/src/org/eclipse/lisaac/builder/LisaacBuilder.java
@@ -17,11 +17,8 @@ import org.eclipse.lisaac.model.Position;
public class LisaacBuilder extends IncrementalProjectBuilder {
- private LisaacModel model;
+ public static LisaacModel model = null;
- public LisaacBuilder(LisaacModel model) {
- this.model = model;
- }
class LisaacDeltaVisitor implements IResourceDeltaVisitor {
/*
@@ -123,6 +120,7 @@ public class LisaacBuilder extends IncrementalProjectBuilder {
*/
public IProject[] build(int kind, Map args, IProgressMonitor monitor)
throws CoreException {
+
if (kind == FULL_BUILD) {
fullBuild(monitor);
} else {
@@ -140,6 +138,12 @@ public class LisaacBuilder extends IncrementalProjectBuilder {
if (resource instanceof IFile) {
IFile file = (IFile) resource;
+ if (file.isHidden()) {
+ return;
+ }
+
+ //System.out.println("VISITING => "+file.getName());
+
if (resource.getName().endsWith(".li")) {
deleteMarkers(file);
try {
diff --git a/src/org/eclipse/lisaac/editors/AbstractLisaacEditor.java b/src/org/eclipse/lisaac/editors/AbstractLisaacEditor.java
index fb03946..414ee64 100644
--- a/src/org/eclipse/lisaac/editors/AbstractLisaacEditor.java
+++ b/src/org/eclipse/lisaac/editors/AbstractLisaacEditor.java
@@ -16,6 +16,7 @@ import org.eclipse.jface.text.ITextViewerExtension2;
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.lisaac.LisaacMessages;
import org.eclipse.lisaac.LisaacPlugin;
import org.eclipse.lisaac.model.LisaacModel;
import org.eclipse.lisaac.preferences.PreferenceConstants;
@@ -80,7 +81,7 @@ public class AbstractLisaacEditor extends TextEditor {
static final Object[][] contents = { { "CorrectionAssist", "CorrectionAssist" }, { "ContentAssistProposal", "ContentAssistProposal" }, { "TemplateProposals", "TemplateProposals" }, };
}
-
+
protected void createActions() {
super.createActions();
@@ -89,8 +90,8 @@ public class AbstractLisaacEditor extends TextEditor {
Action action = new ContentAssistAction(ressources, "ContentAssistProposal.", this); //$NON-NLS-1$
String id = ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS;
action.setActionDefinitionId(id);
- setAction("ContentAssistProposal", action);
- markAsStateDependentAction("ContentAssistProposal", true);
+ setAction("ContentAssistProposal", action); //$NON-NLS-1$
+ markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$
}
public void doSave(IProgressMonitor progressMonitor) {
@@ -98,7 +99,7 @@ public class AbstractLisaacEditor extends TextEditor {
LisaacModel model = LisaacModel.getModel(getProject());
if (model != null) {
- model.buildAll();
+ model.incrementalBuild();
}
}
diff --git a/src/org/eclipse/lisaac/editors/LisaacConfiguration.java b/src/org/eclipse/lisaac/editors/LisaacConfiguration.java
index 0aba2e8..841b766 100644
--- a/src/org/eclipse/lisaac/editors/LisaacConfiguration.java
+++ b/src/org/eclipse/lisaac/editors/LisaacConfiguration.java
@@ -18,6 +18,7 @@ import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.lisaac.LisaacPlugin;
+import org.eclipse.lisaac.LisaacMessages;
import org.eclipse.lisaac.model.LisaacModel;
import org.eclipse.lisaac.preferences.PreferenceConstants;
import org.eclipse.lisaac.templates.LisaacTemplateProcessor;
@@ -69,7 +70,7 @@ public class LisaacConfiguration extends SourceViewerConfiguration {
//
contentAssistant.setRepeatedInvocationMode(true);
contentAssistant.setStatusLineVisible(true);
- contentAssistant.setStatusMessage("Lisaac Completion");
+ contentAssistant.setStatusMessage(LisaacMessages.getString("LisaacConfiguration_0")); //$NON-NLS-1$
//
int delay;
@@ -118,7 +119,7 @@ public class LisaacConfiguration extends SourceViewerConfiguration {
* @see SourceViewerConfiguration#getIndentPrefixes(ISourceViewer, String)
*/
public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
- return new String[]{ new String(" "), new String() };
+ return new String[]{ new String(" "), new String() }; //$NON-NLS-1$
}
/**
diff --git a/src/org/eclipse/lisaac/editors/LisaacDocumentProvider.java b/src/org/eclipse/lisaac/editors/LisaacDocumentProvider.java
index 5c2e0f6..64a4130 100644
--- a/src/org/eclipse/lisaac/editors/LisaacDocumentProvider.java
+++ b/src/org/eclipse/lisaac/editors/LisaacDocumentProvider.java
@@ -37,7 +37,7 @@ public class LisaacDocumentProvider extends FileDocumentProvider {
LisaacModel model = LisaacModel.getModel(file.getProject());
if (model != null) {
- model.buildAll();
+ model.incrementalBuild();
}
}
}
diff --git a/src/org/eclipse/lisaac/launch/LaunchConfigurationTab.java b/src/org/eclipse/lisaac/launch/LaunchConfigurationTab.java
index 091b028..b4e1509 100644
--- a/src/org/eclipse/lisaac/launch/LaunchConfigurationTab.java
+++ b/src/org/eclipse/lisaac/launch/LaunchConfigurationTab.java
@@ -13,6 +13,7 @@ import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.lisaac.LisaacMessages;
import org.eclipse.lisaac.LisaacPlugin;
import org.eclipse.lisaac.model.LisaacModel;
import org.eclipse.lisaac.model.lip.LIP;
@@ -45,12 +46,12 @@ import org.eclipse.ui.PlatformUI;
public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
- public static final String LISAAC_LAUNCH_PROJECT = "launchProject";
- public static final String LISAAC_LAUNCH_PROTOTYPE = "mainPrototype";
- public static final String LISAAC_LAUNCH_ARGUMENTS = "programArguments";
- public static final String LISAAC_LAUNCH_LIP = "lipFile";
- public static final String LISAAC_LAUNCH_OPTION = "lipOption";
- public static final String LISAAC_LAUNCH_OPTION_ARG = "lipOptionARG";
+ public static final String LISAAC_LAUNCH_PROJECT = "launchProject"; //$NON-NLS-1$
+ public static final String LISAAC_LAUNCH_PROTOTYPE = "mainPrototype"; //$NON-NLS-1$
+ public static final String LISAAC_LAUNCH_ARGUMENTS = "programArguments"; //$NON-NLS-1$
+ public static final String LISAAC_LAUNCH_LIP = "lipFile"; //$NON-NLS-1$
+ public static final String LISAAC_LAUNCH_OPTION = "lipOption"; //$NON-NLS-1$
+ public static final String LISAAC_LAUNCH_OPTION_ARG = "lipOptionARG"; //$NON-NLS-1$
// Project UI widget.
private Text projectText;
@@ -75,7 +76,7 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
// Project Options
Group projComp = new Group(comp, SWT.SHADOW_IN);
- projComp.setText("Project Options");
+ projComp.setText(LisaacMessages.getString("LaunchConfigurationTab.6")); //$NON-NLS-1$
GridLayout projLayout = new GridLayout();
projLayout.numColumns = 3;
projLayout.marginHeight = 0;
@@ -86,7 +87,7 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
projComp.setFont(font);
Label fProjLabel = new Label(projComp, SWT.NONE);
- fProjLabel.setText("Project: ");
+ fProjLabel.setText(LisaacMessages.getString("LaunchConfigurationTab.7")); //$NON-NLS-1$
gd = new GridData();
gd.horizontalSpan = 1;
fProjLabel.setLayoutData(gd);
@@ -104,7 +105,7 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
});
Label label = new Label(projComp, SWT.NONE);
- label.setText("Main Prototype to run :");
+ label.setText(LisaacMessages.getString("LaunchConfigurationTab.8")); //$NON-NLS-1$
gd = new GridData();
gd.horizontalSpan = 1;
label.setLayoutData(gd);
@@ -121,7 +122,7 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
}
});
Button browseButton = new Button(projComp, SWT.PUSH);
- browseButton.setText("Browse");
+ browseButton.setText(LisaacMessages.getString("LaunchConfigurationTab.9")); //$NON-NLS-1$
gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
gd.horizontalSpan = 1;
browseButton.setLayoutData(gd);
@@ -133,11 +134,11 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
// Program Options
Group programOptions = new Group(comp, SWT.SHADOW_IN);
- programOptions.setText("Program Options");
+ programOptions.setText(LisaacMessages.getString("LaunchConfigurationTab.10")); //$NON-NLS-1$
programOptions.setLayout(new GridLayout());
label = new Label(programOptions, SWT.NONE);
- label.setText("Program Arguments: ");
+ label.setText(LisaacMessages.getString("LaunchConfigurationTab.11")); //$NON-NLS-1$
gd = new GridData();
gd.horizontalSpan = 3;
label.setLayoutData(gd);
@@ -156,13 +157,13 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
// compiler options
Group compilerOptions = new Group(comp, SWT.SHADOW_IN);
- compilerOptions.setText("Compiler Options");
+ compilerOptions.setText(LisaacMessages.getString("LaunchConfigurationTab.12")); //$NON-NLS-1$
GridLayout gl = new GridLayout();
gl.numColumns = 3;
compilerOptions.setLayout(gl);
label = new Label(compilerOptions, SWT.NONE);
- label.setText("Lisaac Path File (default : make.lip): ");
+ label.setText(LisaacMessages.getString("LaunchConfigurationTab.13")); //$NON-NLS-1$
gd = new GridData();
gd.horizontalSpan = 3;
label.setLayoutData(gd);
@@ -179,7 +180,7 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
}
});
browseButton = new Button(compilerOptions, SWT.PUSH);
- browseButton.setText("Browse");
+ browseButton.setText(LisaacMessages.getString("LaunchConfigurationTab.14")); //$NON-NLS-1$
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 1;
browseButton.setLayoutData(gd);
@@ -197,13 +198,13 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
lipTable = new Table(tableGroup, SWT.BORDER | SWT.SINGLE |
SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.CHECK);
final TableColumn c1 = new TableColumn(lipTable, SWT.LEFT);
- c1.setText("Option");
+ c1.setText(LisaacMessages.getString("LaunchConfigurationTab.15")); //$NON-NLS-1$
c1.setWidth(130);
final TableColumn c2 = new TableColumn(lipTable, SWT.LEFT);
- c2.setText("Argument");
+ c2.setText(LisaacMessages.getString("LaunchConfigurationTab.16")); //$NON-NLS-1$
c2.setWidth(60);
final TableColumn c3 = new TableColumn(lipTable, SWT.LEFT);
- c3.setText("Description");
+ c3.setText(LisaacMessages.getString("LaunchConfigurationTab.17")); //$NON-NLS-1$
c3.setWidth(100);
lipTable.setHeaderVisible(true);
lipTable.setLinesVisible(true);
@@ -255,7 +256,7 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
public String getName() {
- return "Main";
+ return LisaacMessages.getString("LaunchConfigurationTab.18"); //$NON-NLS-1$
}
/**
@@ -263,16 +264,16 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
*/
public void initializeFrom(ILaunchConfiguration configuration) {
try {
- String projectName = configuration.getAttribute(LISAAC_LAUNCH_PROJECT, "");
+ String projectName = configuration.getAttribute(LISAAC_LAUNCH_PROJECT, ""); //$NON-NLS-1$
projectText.setText(projectName);
- String mainPrototypeName = configuration.getAttribute(LISAAC_LAUNCH_PROTOTYPE, "");
+ String mainPrototypeName = configuration.getAttribute(LISAAC_LAUNCH_PROTOTYPE, ""); //$NON-NLS-1$
mainPrototypeText.setText(mainPrototypeName);
- String argumentsName = configuration.getAttribute(LISAAC_LAUNCH_ARGUMENTS, "");
+ String argumentsName = configuration.getAttribute(LISAAC_LAUNCH_ARGUMENTS, ""); //$NON-NLS-1$
argumentsText.setText(argumentsName);
- String lipName = configuration.getAttribute(LISAAC_LAUNCH_LIP, "");
+ String lipName = configuration.getAttribute(LISAAC_LAUNCH_LIP, ""); //$NON-NLS-1$
lipText.setText(lipName);
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
@@ -287,10 +288,10 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
if (method.isPublic()) {
String methodComment = method.getComment();
if (methodComment == null) {
- methodComment = "No comment";
+ methodComment = LisaacMessages.getString("LaunchConfigurationTab.23"); //$NON-NLS-1$
}
- methodComment = methodComment.replaceAll("\t", "");
- methodComment = methodComment.replaceAll("\n", "");
+ methodComment = methodComment.replaceAll("\t", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ methodComment = methodComment.replaceAll("\n", ""); //$NON-NLS-1$ //$NON-NLS-2$
if (! lipTable.isDisposed()) {
TableItem item = new TableItem (lipTable, SWT.NONE);
@@ -305,7 +306,7 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
// Log the error to the Eclipse log.
IStatus status = new Status(IStatus.ERROR,
LisaacPlugin.PLUGIN_ID, 0,
- "Error in Lisaac launch: " +
+ "Error in Lisaac launch: " + //$NON-NLS-1$
ce.getMessage(), ce);
LisaacPlugin.log(status);
}
@@ -343,17 +344,17 @@ public class LaunchConfigurationTab extends AbstractLaunchConfigurationTab {
*/
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
IProject project = getSelectedProject(configuration);
- String projectName = "";
- String mainPrototypeName = "";
+ String projectName = ""; //$NON-NLS-1$
+ String mainPrototypeName = ""; //$NON-NLS-1$
if (project != null) {
projectName = project.getName();
- mainPrototypeName = projectName + ".li";
+ mainPrototypeName = projectName + ".li"; //$NON-NLS-1$
}
configuration.setAttribute(LISAAC_LAUNCH_PROJECT, projectName);
configuration.setAttribute(LISAAC_LAUNCH_PROTOTYPE, mainPrototypeName);
- configuration.setAttribute(LISAAC_LAUNCH_ARGUMENTS, "");
- configuration.setAttribute(LISAAC_LAUNCH_LIP, "");
+ configuration.setAttribute(LISAAC_LAUNCH_ARGUMENTS, ""); //$NON-NLS-1$
+ configuration.setAttribute(LISAAC_LAUNCH_LIP, ""); //$NON-NLS-1$
if (lipTable != null) {
TableItem[] options = lipTable.getItems();
diff --git a/src/org/eclipse/lisaac/messages.properties b/src/org/eclipse/lisaac/messages.properties
new file mode 100644
index 0000000..78373dc
--- /dev/null
+++ b/src/org/eclipse/lisaac/messages.properties
@@ -0,0 +1,65 @@
+AbstractNewFileWizardPage_1=Source folder :
+AbstractNewFileWizardPage_2=Browse
+AbstractNewFileWizardPage_3=File name :
+AbstractNewFileWizardPage_4=Select container.
+AbstractNewFileWizardPage_5=Source folder must be specified.
+AbstractNewFileWizardPage_6=File name must be specified.
+AbstractNewFileWizardPage_7=File already exists.
+LaunchConfigurationTab.10=Program Options
+LaunchConfigurationTab.11=Program Arguments:
+LaunchConfigurationTab.12=Compiler Options
+LaunchConfigurationTab.13=Lisaac Path File (default : make.lip):
+LaunchConfigurationTab.14=Browse
+LaunchConfigurationTab.15=Option
+LaunchConfigurationTab.16=Argument
+LaunchConfigurationTab.17=Description
+LaunchConfigurationTab.18=Main
+LaunchConfigurationTab.23=No comment
+LaunchConfigurationTab.6=Project Options
+LaunchConfigurationTab.7=Project:
+LaunchConfigurationTab.8=Main Prototype to run :
+LaunchConfigurationTab.9=Browse
+LisaacColoringPage.0=Lisaac Editor Syntax Coloring preferences :
+LisaacColoringPage.10=\ \ \ \ &Externals:
+LisaacColoringPage.11=\ \ \ \ O&thers:
+LisaacColoringPage.2=\ \ \ \ &Comments:
+LisaacColoringPage.3=\ \ \ \ &Prototype:
+LisaacColoringPage.4=\ \ \ \ &Prototype Style:
+LisaacColoringPage.5=\ \ \ \ &Keywords:
+LisaacColoringPage.6=\ \ \ \ &Characters:
+LisaacColoringPage.7=\ \ \ \ &Strings:
+LisaacColoringPage.8=\ \ \ \ &Numbers:
+LisaacColoringPage.9=\ \ \ \ &Operators:
+LisaacConfiguration_0=Lisaac Completion
+LisaacConsole.1=Lisaac Console
+LisaacEditorPage.0=&Activer Auto-Indentation
+LisaacEditorPage.1=&Activer Hovering
+LisaacEditorPage.2=Content Assist preferences
+LisaacEditorPage.3=&Enable Completion
+LisaacEditorPage.4=Auto-Activation Delay
+LisaacPreferencePage.0=General settings for Lisaac Development
+LisaacPreferencePage.1=&Your name :
+LisaacPreferencePage.2=&Support for Lisaac 0.13
+LisaacProjectPropertyPage.0=Lisaac Environment Path
+LisaacProjectPropertyPage.1=Use default Lisaac Environment
+LisaacProjectPropertyPage.2=Use a project specific Lisaac Environment :
+LisaacProjectPropertyPage.3=Browse
+LisaacProjectPropertyPage.8=Select Lisaac Environment Directory.
+NewProjectWizard_46=New Lisaac Project Wizard
+NewProjectWizard_47=New Lisaac Project
+NewProjectWizard_48=Create a lisaac project
+NewProjectWizard_49=Use default Lisaac Environment
+NewProjectWizard_50=Use a project specific Lisaac Environment :
+NewProjectWizard_51=Browse
+NewPrototypeWizard_0=New Prototype
+NewPrototypeWizard_2=Prototype File
+NewPrototypeWizard_25=Prototype Style :
+NewPrototypeWizard_26=None
+NewPrototypeWizard_27=Expanded
+NewPrototypeWizard_28=Strict
+NewPrototypeWizard_29=Description :
+NewPrototypeWizard_3=Creates a new source file into a project
+NewPrototypeWizard_30=Inheritance :
+NewPrototypeWizard_32=Inheritance Type
+NewPrototypeWizard_34=Add
+NewPrototypeWizard_35=Remove
diff --git a/src/org/eclipse/lisaac/model/AbstractLisaacParser.java b/src/org/eclipse/lisaac/model/AbstractLisaacParser.java
index acb27fe..a20ca75 100644
--- a/src/org/eclipse/lisaac/model/AbstractLisaacParser.java
+++ b/src/org/eclipse/lisaac/model/AbstractLisaacParser.java
@@ -32,7 +32,7 @@ public class AbstractLisaacParser {
public Position getPosition(int len) {
Position result=null;
- while (pos_cur != position) {
+ while (pos_cur < position) {
if (source.charAt(pos_cur) == '\n') {
pos_col = 0;
pos_line++;
diff --git a/src/org/eclipse/lisaac/model/LisaacModel.java b/src/org/eclipse/lisaac/model/LisaacModel.java
index 600ba3a..293bb53 100644
--- a/src/org/eclipse/lisaac/model/LisaacModel.java
+++ b/src/org/eclipse/lisaac/model/LisaacModel.java
@@ -44,9 +44,6 @@ public class LisaacModel implements ILisaacModel{
/** project associated with this model */
private IProject project;
- /** lisaac builder */
- private LisaacBuilder builder;
-
/** error handler */
private ILisaacErrorHandler reporter;
@@ -62,8 +59,6 @@ public class LisaacModel implements ILisaacModel{
prototypes = new HashMap<String,Prototype>();
aliasString = new AliasString();
- builder = new LisaacBuilder(this);
-
// add this model to the model list
if (modelList == null) {
modelList = new HashMap<IProject,LisaacModel>();
@@ -74,7 +69,6 @@ public class LisaacModel implements ILisaacModel{
modelPath = new LisaacPath(project, "make.lip"); // TODO get lip from property page
}
-
public IProject getProject() {
return project;
}
@@ -82,9 +76,6 @@ public class LisaacModel implements ILisaacModel{
this.project = project;
}
- public LisaacBuilder getBuilder() {
- return builder;
- }
public AliasString getAliasString() {
return aliasString;
}
@@ -105,9 +96,10 @@ public class LisaacModel implements ILisaacModel{
return null;
}
- public void buildAll() {
- try {
- builder.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null, null);
+ public void incrementalBuild() {
+ try {
+ LisaacBuilder.model = this;
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
// refresh editor coloring
IWorkbenchWindow w = LisaacPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
@@ -119,6 +111,26 @@ public class LisaacModel implements ILisaacModel{
e.printStackTrace();
}
}
+
+ public void fullBuild() {
+ try {
+ LisaacBuilder.model = this;
+ project.build(IncrementalProjectBuilder.FULL_BUILD, null);
+
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void clean() {
+ try {
+ LisaacBuilder.model = this;
+ project.build(IncrementalProjectBuilder.CLEAN_BUILD, null);
+
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
/** parse and create part of current model */
public Prototype parsePrototype(String name, InputStream contents, ILisaacErrorHandler reporter) {
diff --git a/src/org/eclipse/lisaac/preferences/LisaacColoringPage.java b/src/org/eclipse/lisaac/preferences/LisaacColoringPage.java
index c1ffcb1..016556c 100644
--- a/src/org/eclipse/lisaac/preferences/LisaacColoringPage.java
+++ b/src/org/eclipse/lisaac/preferences/LisaacColoringPage.java
@@ -5,6 +5,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.layout.GridData;
import org.eclipse.jface.preference.*;
+import org.eclipse.lisaac.LisaacMessages;
import org.eclipse.lisaac.LisaacPlugin;
import org.eclipse.lisaac.editors.ILisaacColor;
import org.eclipse.ui.*;
@@ -25,44 +26,44 @@ implements IWorkbenchPreferencePage {
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = 3;
g.setLayoutData(gd);
- g.setText("Lisaac Editor Syntax Coloring preferences :");
+ g.setText(LisaacMessages.getString("LisaacColoringPage.0")); //$NON-NLS-1$
Label l1= new Label(g, SWT.LEFT);
- l1.setText("");
+ l1.setText(""); //$NON-NLS-1$
gd = new GridData();
gd.horizontalSpan = 3;
l1.setLayoutData(gd);
addField(new ColorFieldEditor(
ILisaacColor.PREF_COMMENT,
- " &Comments:", g));
+ LisaacMessages.getString("LisaacColoringPage.2"), g)); //$NON-NLS-1$
addField(new ColorFieldEditor(
ILisaacColor.PREF_PROTOTYPE,
- " &Prototype:", g));
+ LisaacMessages.getString("LisaacColoringPage.3"), g)); //$NON-NLS-1$
addField(new ColorFieldEditor(
ILisaacColor.PREF_PROTOTYPE_STYLE,
- " &Prototype Style:", g));
+ LisaacMessages.getString("LisaacColoringPage.4"), g)); //$NON-NLS-1$
addField(new ColorFieldEditor(
ILisaacColor.PREF_KEYWORD,
- " &Keywords:", g));
+ LisaacMessages.getString("LisaacColoringPage.5"), g)); //$NON-NLS-1$
addField(new ColorFieldEditor(
ILisaacColor.PREF_CHARACTER,
- " &Characters:", g));
+ LisaacMessages.getString("LisaacColoringPage.6"), g)); //$NON-NLS-1$
addField(new ColorFieldEditor(
ILisaacColor.PREF_STRING,
- " &Strings:", g));
+ LisaacMessages.getString("LisaacColoringPage.7"), g)); //$NON-NLS-1$
addField(new ColorFieldEditor(
ILisaacColor.PREF_NUMBER,
- " &Numbers:", g));
+ LisaacMessages.getString("LisaacColoringPage.8"), g)); //$NON-NLS-1$
addField(new ColorFieldEditor(
ILisaacColor.PREF_OPERATOR,
- " &Operators:", g));
+ LisaacMessages.getString("LisaacColoringPage.9"), g)); //$NON-NLS-1$
addField(new ColorFieldEditor(
ILisaacColor.PREF_EXTERNAL,
- " &Externals:", g));
+ LisaacMessages.getString("LisaacColoringPage.10"), g)); //$NON-NLS-1$
addField(new ColorFieldEditor(
ILisaacColor.PREF_DEFAULT_COLOR,
- " O&thers:", g));
+ LisaacMessages.getString("LisaacColoringPage.11"), g)); //$NON-NLS-1$
}
public void init(IWorkbench workbench) {
diff --git a/src/org/eclipse/lisaac/preferences/LisaacEditorPage.java b/src/org/eclipse/lisaac/preferences/LisaacEditorPage.java
index 15cdc4e..15d3c80 100644
--- a/src/org/eclipse/lisaac/preferences/LisaacEditorPage.java
+++ b/src/org/eclipse/lisaac/preferences/LisaacEditorPage.java
@@ -5,6 +5,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.layout.GridData;
import org.eclipse.jface.preference.*;
+import org.eclipse.lisaac.LisaacMessages;
import org.eclipse.lisaac.LisaacPlugin;
import org.eclipse.ui.*;
@@ -27,22 +28,22 @@ implements IWorkbenchPreferencePage {
addField(new BooleanFieldEditor(PreferenceConstants.P_LISAAC_INDENT,
- "&Enable Auto-Indentation", g));
+ LisaacMessages.getString("LisaacEditorPage.0"), g)); //$NON-NLS-1$
addField(new BooleanFieldEditor(PreferenceConstants.P_LISAAC_HOVER,
- "&Enable Hovering", g));
+ LisaacMessages.getString("LisaacEditorPage.1"), g)); //$NON-NLS-1$
Group completionGroup = new Group(g,SWT.SHADOW_ETCHED_IN);
gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = 3;
gd.verticalSpan = 2;
completionGroup.setLayoutData(gd);
- completionGroup.setText("Content Assist preferences");
+ completionGroup.setText(LisaacMessages.getString("LisaacEditorPage.2")); //$NON-NLS-1$
addField(new BooleanFieldEditor(PreferenceConstants.P_LISAAC_COMPLETION,
- "&Enable Completion", completionGroup));
+ LisaacMessages.getString("LisaacEditorPage.3"), completionGroup)); //$NON-NLS-1$
addField(new StringFieldEditor(PreferenceConstants.P_LISAAC_COMPLETION_DELAY,
- "Auto-Activation Delay", completionGroup));
+ LisaacMessages.getString("LisaacEditorPage.4"), completionGroup)); //$NON-NLS-1$
}
public void init(IWorkbench workbench) {
diff --git a/src/org/eclipse/lisaac/preferences/LisaacPreferencePage.java b/src/org/eclipse/lisaac/preferences/LisaacPreferencePage.java
index 2f7e37d..a23f0e0 100644
--- a/src/org/eclipse/lisaac/preferences/LisaacPreferencePage.java
+++ b/src/org/eclipse/lisaac/preferences/LisaacPreferencePage.java
@@ -1,6 +1,7 @@
package org.eclipse.lisaac.preferences;
import org.eclipse.jface.preference.*;
+import org.eclipse.lisaac.LisaacMessages;
import org.eclipse.lisaac.LisaacPlugin;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
@@ -26,7 +27,7 @@ public class LisaacPreferencePage
public LisaacPreferencePage() {
super(GRID);
setPreferenceStore(LisaacPlugin.getDefault().getPreferenceStore());
- setDescription("General settings for Lisaac Development");
+ setDescription(LisaacMessages.getString("LisaacPreferencePage.0")); //$NON-NLS-1$
}
/**
@@ -37,11 +38,11 @@ public class LisaacPreferencePage
*/
public void createFieldEditors() {
addField(new StringFieldEditor(PreferenceConstants.P_LISAAC_USER,
- "&Your name :", getFieldEditorParent()));
+ LisaacMessages.getString("LisaacPreferencePage.1"), getFieldEditorParent())); //$NON-NLS-1$
addField(new BooleanFieldEditor(
PreferenceConstants.P_LISAAC_013_COMPATIBILITY,
- "&Support for Lisaac 0.13",
+ LisaacMessages.getString("LisaacPreferencePage.2"), //$NON-NLS-1$
getFieldEditorParent()));
//addField(new DirectoryFieldEditor(PreferenceConstants.P_LISAAC_PATH,
diff --git a/src/org/eclipse/lisaac/properties/LisaacProjectPropertyPage.java b/src/org/eclipse/lisaac/properties/LisaacProjectPropertyPage.java
index d029685..ee97c3a 100644
--- a/src/org/eclipse/lisaac/properties/LisaacProjectPropertyPage.java
+++ b/src/org/eclipse/lisaac/properties/LisaacProjectPropertyPage.java
@@ -1,212 +1,213 @@
-package org.eclipse.lisaac.properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowData;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-public class LisaacProjectPropertyPage extends PropertyPage {
-
- public static final String LISAAC_PATH = "Lisaac Environment Path";
-
- private Text pathValueText;
-
- private Button browseButton;
-
- /**
- * Constructor for SamplePropertyPage.
- */
- public LisaacProjectPropertyPage() {
- super();
- }
-
- private void addFirstSection(Composite parent) {
- Composite composite = createDefaultComposite(parent);
-
- Group group = new Group(composite, SWT.SHADOW_IN);
- group.setText(LISAAC_PATH);
- group.setLayout(new GridLayout());
-
- final Button b1 = new Button(group, SWT.RADIO);
- b1.setFont(parent.getFont());
- b1.setText("Use default Lisaac Environment");
-
- final Button b2 = new Button(group, SWT.RADIO);
- b2.setFont(parent.getFont());
- b2.setText("Use a project specific Lisaac Environment : ");
-
- Composite envGroup = new Composite(group, SWT.NONE);
- envGroup.setLayout(new RowLayout());
- GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gridData.horizontalSpan = 2;
- gridData.grabExcessHorizontalSpace = true;
- envGroup.setLayoutData(gridData);
-
- // Path text field
- pathValueText = new Text(envGroup, SWT.BORDER/*SWT.WRAP | SWT.READ_ONLY*/);
- pathValueText.setText(getDefaultLisaacPath((IProject)getElement()));
- RowData rowData = new RowData();
- rowData.width = 200;
- pathValueText.setLayoutData(rowData);
-
- //pathValueText.setText(((IResource) getElement()).getFullPath().toString());
- pathValueText.setEnabled(false);
-
- b2.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (b2.getSelection()) {
- pathValueText.setEnabled(true);
- browseButton.setEnabled(true);
- } else {
- pathValueText.setEnabled(false);
- browseButton.setEnabled(false);
- }
- }
- });
- browseButton = new Button(envGroup, SWT.PUSH);
- browseButton.setText("Browse");
- browseButton.setEnabled(false);
- browseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleBrowse();
- }
- });
- }
-
- private void addSeparator(Composite parent) {
- Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- separator.setLayoutData(gridData);
- }
-
- private void addSecondSection(Composite parent) {
-/*
- Composite composite = createDefaultComposite(parent);
- // Label for owner field
- Label ownerLabel = new Label(composite, SWT.NONE);
- ownerLabel.setText(OWNER_TITLE);
-
- // Owner text field
- ownerText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- GridData gd = new GridData();
- gd.widthHint = convertWidthInCharsToPixels(TEXT_FIELD_WIDTH);
- ownerText.setLayoutData(gd);
-
- // Populate owner text field
- try {
- String owner =
- ((IResource) getElement()).getPersistentProperty(
- new QualifiedName("", OWNER_PROPERTY));
- ownerText.setText((owner != null) ? owner : DEFAULT_OWNER);
- } catch (CoreException e) {
- ownerText.setText(DEFAULT_OWNER);
- }*/
- }
-
- /**
- * @see PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL);
- data.grabExcessHorizontalSpace = true;
- composite.setLayoutData(data);
-
- addFirstSection(composite);
- addSeparator(composite);
- addSecondSection(composite);
- return composite;
- }
-
- private Composite createDefaultComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
-
- return composite;
- }
-
- public static String getDefaultLisaacPath(IProject project) {
- try {
- return project.getPersistentProperty(
- new QualifiedName("", LISAAC_PATH));
- } catch (CoreException e) {
- return getDefaultLisaacPath();
- }
- }
-
- public static String getDefaultLisaacPath() {
-
- String env = System.getenv("LISAAC");
- if (env != null) {
- return env;
- }
- return ""; // TODO error compiler not installed
- }
-
- protected void performDefaults() {
- // Populate the lisaac path field with the default value
- pathValueText.setText(getDefaultLisaacPath((IProject)getElement()));
- }
-
- public boolean performOk() {
- // store the value in the lisaac project field
- try {
- ((IResource) getElement()).setPersistentProperty(
- new QualifiedName("", LISAAC_PATH),
- pathValueText.getText());
- } catch (CoreException e) {
- return false;
- }
- return true;
- }
-
- /**
- * Uses the standard container selection dialog to choose the new value for
- * the container field.
- */
-
- private void handleBrowse() { // FIXME browse outside workspace
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(
- getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
- "Select Lisaac Environment Directory.");
- if (dialog.open() == ContainerSelectionDialog.OK) {
- Object[] results = dialog.getResult();
- if (results.length == 1) {
- Object result = results[0];
- if (result instanceof IPath) {
- IPath ipath = (IPath) result;
- pathValueText.setText(ipath.toString());
- }
- }
- }
- }
-
+package org.eclipse.lisaac.properties;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.lisaac.LisaacMessages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowData;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+public class LisaacProjectPropertyPage extends PropertyPage {
+
+ public static final String LISAAC_PATH = LisaacMessages.getString("LisaacProjectPropertyPage.0"); //$NON-NLS-1$
+
+ private Text pathValueText;
+
+ private Button browseButton;
+
+ /**
+ * Constructor for SamplePropertyPage.
+ */
+ public LisaacProjectPropertyPage() {
+ super();
+ }
+
+ private void addFirstSection(Composite parent) {
+ Composite composite = createDefaultComposite(parent);
+
+ Group group = new Group(composite, SWT.SHADOW_IN);
+ group.setText(LISAAC_PATH);
+ group.setLayout(new GridLayout());
+
+ final Button b1 = new Button(group, SWT.RADIO);
+ b1.setFont(parent.getFont());
+ b1.setText(LisaacMessages.getString("LisaacProjectPropertyPage.1")); //$NON-NLS-1$
+
+ final Button b2 = new Button(group, SWT.RADIO);
+ b2.setFont(parent.getFont());
+ b2.setText(LisaacMessages.getString("LisaacProjectPropertyPage.2")); //$NON-NLS-1$
+
+ Composite envGroup = new Composite(group, SWT.NONE);
+ envGroup.setLayout(new RowLayout());
+ GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gridData.horizontalSpan = 2;
+ gridData.grabExcessHorizontalSpace = true;
+ envGroup.setLayoutData(gridData);
+
+ // Path text field
+ pathValueText = new Text(envGroup, SWT.BORDER/*SWT.WRAP | SWT.READ_ONLY*/);
+ pathValueText.setText(getDefaultLisaacPath((IProject)getElement()));
+ RowData rowData = new RowData();
+ rowData.width = 200;
+ pathValueText.setLayoutData(rowData);
+
+ //pathValueText.setText(((IResource) getElement()).getFullPath().toString());
+ pathValueText.setEnabled(false);
+
+ b2.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (b2.getSelection()) {
+ pathValueText.setEnabled(true);
+ browseButton.setEnabled(true);
+ } else {
+ pathValueText.setEnabled(false);
+ browseButton.setEnabled(false);
+ }
+ }
+ });
+ browseButton = new Button(envGroup, SWT.PUSH);
+ browseButton.setText(LisaacMessages.getString("LisaacProjectPropertyPage.3")); //$NON-NLS-1$
+ browseButton.setEnabled(false);
+ browseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+ }
+
+ private void addSeparator(Composite parent) {
+ Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ separator.setLayoutData(gridData);
+ }
+
+ private void addSecondSection(Composite parent) {
+/*
+ Composite composite = createDefaultComposite(parent);
+ // Label for owner field
+ Label ownerLabel = new Label(composite, SWT.NONE);
+ ownerLabel.setText(OWNER_TITLE);
+
+ // Owner text field
+ ownerText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ GridData gd = new GridData();
+ gd.widthHint = convertWidthInCharsToPixels(TEXT_FIELD_WIDTH);
+ ownerText.setLayoutData(gd);
+
+ // Populate owner text field
+ try {
+ String owner =
+ ((IResource) getElement()).getPersistentProperty(
+ new QualifiedName("", OWNER_PROPERTY));
+ ownerText.setText((owner != null) ? owner : DEFAULT_OWNER);
+ } catch (CoreException e) {
+ ownerText.setText(DEFAULT_OWNER);
+ }*/
+ }
+
+ /**
+ * @see PreferencePage#createContents(Composite)
+ */
+ protected Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ composite.setLayout(layout);
+ GridData data = new GridData(GridData.FILL);
+ data.grabExcessHorizontalSpace = true;
+ composite.setLayoutData(data);
+
+ addFirstSection(composite);
+ addSeparator(composite);
+ addSecondSection(composite);
+ return composite;
+ }
+
+ private Composite createDefaultComposite(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+
+ return composite;
+ }
+
+ public static String getDefaultLisaacPath(IProject project) {
+ try {
+ return project.getPersistentProperty(
+ new QualifiedName("", LISAAC_PATH)); //$NON-NLS-1$
+ } catch (CoreException e) {
+ return getDefaultLisaacPath();
+ }
+ }
+
+ public static String getDefaultLisaacPath() {
+
+ String env = System.getenv("LISAAC"); //$NON-NLS-1$
+ if (env != null) {
+ return env;
+ }
+ return ""; // TODO error compiler not installed //$NON-NLS-1$
+ }
+
+ protected void performDefaults() {
+ // Populate the lisaac path field with the default value
+ pathValueText.setText(getDefaultLisaacPath((IProject)getElement()));
+ }
+
+ public boolean performOk() {
+ // store the value in the lisaac project field
+ try {
+ ((IResource) getElement()).setPersistentProperty(
+ new QualifiedName("", LISAAC_PATH), //$NON-NLS-1$
+ pathValueText.getText());
+ } catch (CoreException e) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Uses the standard container selection dialog to choose the new value for
+ * the container field.
+ */
+
+ private void handleBrowse() { // FIXME browse outside workspace
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(
+ getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
+ LisaacMessages.getString("LisaacProjectPropertyPage.8")); //$NON-NLS-1$
+ if (dialog.open() == ContainerSelectionDialog.OK) {
+ Object[] results = dialog.getResult();
+ if (results.length == 1) {
+ Object result = results[0];
+ if (result instanceof IPath) {
+ IPath ipath = (IPath) result;
+ pathValueText.setText(ipath.toString());
+ }
+ }
+ }
+ }
+
}
\ No newline at end of file
diff --git a/src/org/eclipse/lisaac/views/LisaacConsole.java b/src/org/eclipse/lisaac/views/LisaacConsole.java
index b8f6abf..83cb559 100644
--- a/src/org/eclipse/lisaac/views/LisaacConsole.java
+++ b/src/org/eclipse/lisaac/views/LisaacConsole.java
@@ -1,26 +1,27 @@
-package org.eclipse.lisaac.views;
-
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.ui.console.IOConsole;
-
-public class LisaacConsole extends IOConsole {
-
- public final static String CONSOLE_TYPE = "lisaacConsole"; //$NON-NLS-1$
- public static final String CONSOLE_FONT= "org.eclipse.debug.ui.consoleFont";
-
- public LisaacConsole() {
- super("Lisaac Console", CONSOLE_TYPE, null, true);
-
- Font font = JFaceResources.getFont(CONSOLE_FONT);
- setFont(font);
- }
-
- /**
- * Set the document's initial contents.
- * Called by ConsoleFactory.
- */
- void initializeDocument() {
- getDocument().set("");
- }
-}
+package org.eclipse.lisaac.views;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.lisaac.LisaacMessages;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.ui.console.IOConsole;
+
+public class LisaacConsole extends IOConsole {
+
+ public final static String CONSOLE_TYPE = "lisaacConsole"; //$NON-NLS-1$
+ public static final String CONSOLE_FONT= "org.eclipse.debug.ui.consoleFont"; //$NON-NLS-1$
+
+ public LisaacConsole() {
+ super(LisaacMessages.getString("LisaacConsole.1"), CONSOLE_TYPE, null, true); //$NON-NLS-1$
+
+ Font font = JFaceResources.getFont(CONSOLE_FONT);
+ setFont(font);
+ }
+
+ /**
+ * Set the document's initial contents.
+ * Called by ConsoleFactory.
+ */
+ void initializeDocument() {
+ getDocument().set(""); //$NON-NLS-1$
+ }
+}
diff --git a/src/org/eclipse/lisaac/wizards/AbstractNewFileWizardPage.java b/src/org/eclipse/lisaac/wizards/AbstractNewFileWizardPage.java
index 44ec0e4..1588688 100644
--- a/src/org/eclipse/lisaac/wizards/AbstractNewFileWizardPage.java
+++ b/src/org/eclipse/lisaac/wizards/AbstractNewFileWizardPage.java
@@ -1,256 +1,257 @@
-package org.eclipse.lisaac.wizards;
-
-import java.io.InputStream;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-
-
-public abstract class AbstractNewFileWizardPage extends WizardPage {
-
- /** initial source folder selection */
- private IStructuredSelection selection;
-
- /** source folder path */
- private Text containerText;
-
- /** file name */
- private Text fileText;
-
- /** file extension */
- private String fileExtension = "";
-
-
- protected AbstractNewFileWizardPage(String pageName, IStructuredSelection selection) {
- super(pageName);
- this.selection = selection;
- setPageComplete(false);
- }
-
- public String getContainerName() {
- return containerText.getText();
- }
-
- public String getFileName() {
- return fileText.getText();
- }
-
- public String getFileExtension() {
- return fileExtension;
- }
-
- /**
- * set the extension of files created with this wizard.
- */
- protected void setFileExtension(String ext) {
- fileExtension = ext;
- }
-
- /**
- * Content File Initialisation.
- */
- abstract protected InputStream getInitialContents(String filename);
-
-
- /**
- * @see IDialogPage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- Composite container = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- container.setLayout(layout);
- layout.numColumns = 3;
- layout.verticalSpacing = 9;
- Label label = new Label(container, SWT.NULL);
- label.setText("Source folder : ");
-
- containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- containerText.setLayoutData(gd);
- containerText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- dialogChanged();
- }
- });
-
- Button button = new Button(container, SWT.PUSH);
- button.setText("Browse");
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleBrowse();
- }
- });
- label = new Label(container, SWT.NULL);
- label.setText("File name : ");
-
- fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 1;
- fileText.setLayoutData(gd);
- fileText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- dialogChanged();
- }
- });
- Composite dummy = new Composite(container, SWT.NONE);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = 1;
- dummy.setLayoutData(gd);
-
- //
- createAdvancedControls(container);
- //
- initialize();
- dialogChanged();
- setControl(container);
- }
-
- protected void createAdvancedControls(Composite parent) {
- // should be override
- }
-
- /**
- * Tests if the current workbench selection is a suitable container to use.
- */
- private void initialize() {
- if (selection != null && selection.isEmpty() == false
- && selection instanceof IStructuredSelection) {
- IStructuredSelection ssel = (IStructuredSelection) selection;
- if (ssel.size() > 1)
- return;
- Object obj = ssel.getFirstElement();
- if (obj instanceof IResource) {
- IContainer container;
- if (obj instanceof IContainer)
- container = (IContainer) obj;
- else
- container = ((IResource) obj).getParent();
- containerText.setText(container.getFullPath().toString());
- fileText.setFocus();
- }
- }
- fileText.setText(getInitialFileName());
- }
-
- protected abstract String getInitialFileName();
-
- /**
- * Uses the standard container selection dialog to choose the new value for
- * the container field.
- */
-
- private void handleBrowse() {
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(
- getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
- "Select container.");
- if (dialog.open() == ContainerSelectionDialog.OK) {
- Object[] results = dialog.getResult();
- if (results.length == 1) {
- Object result = results[0];
- if (result instanceof IPath) {
- IPath ipath = (IPath) result;
- containerText.setText(ipath.toString());
- }
- }
- }
- }
-
- /**
- * Ensures that both text fields are set.
- */
- private void dialogChanged() {
- String container = getContainerName();
- String fileName = getFileName();
-
- if (container.length() == 0) {
- updateStatus("Source folder must be specified.");
- return;
- }
- if (fileName.length() == 0) {
- updateStatus("File name must be specified.");
- return;
- }
- updateStatus(null);
- }
-
- private void updateStatus(String message) {
- setErrorMessage(message);
- setPageComplete(message == null);
- }
-
- /**
- * @see WizardPage#isPageComplete()
- */
- public boolean isPageComplete() {
- return !checkFolderForExistingFile() && super.isPageComplete();
- }
-
- /**
- * Finds the current directory where the file should be created
- */
- protected boolean checkFolderForExistingFile() {
- IContainer container = getFileContainer();
- if (container != null) {
- IResource file = container.getFile(new Path(fileText.getText()
- .trim()));
- if (file != null && file.exists()) {
- this.setErrorMessage("File already exists.");
- return true;
- }
- }
- return false;
- }
-
- private IContainer getFileContainer() {
- if (containerText.getText() != null) {
- IPath containerPath = new Path(containerText.getText().trim());
- IContainer container = null;
- if (containerPath.segmentCount() > 1) {
- container = ResourcesPlugin.getWorkspace().getRoot().getFolder(
- containerPath);
- } else {
- if (containerPath.segmentCount() == 1) {
- // this is a project
- container = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(containerText.getText().trim());
- }
- }
- if (container != null && container.exists()) {
- return container;
- }
- }
- return null;
- }
-
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- String fileName = fileText.getText().trim();
- if (getFileContainer() != null
- && fileName.equalsIgnoreCase(getInitialFileName())) {
- fileText.setFocus();
- fileText.setText(fileName);
- fileText.setSelection(0, fileName.length()
- - (new Path(getInitialFileName())).getFileExtension()
- .length() - 1);
- }
- }
- }
-}
+package org.eclipse.lisaac.wizards;
+
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.lisaac.LisaacMessages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+
+public abstract class AbstractNewFileWizardPage extends WizardPage {
+
+ /** initial source folder selection */
+ private IStructuredSelection selection;
+
+ /** source folder path */
+ private Text containerText;
+
+ /** file name */
+ private Text fileText;
+
+ /** file extension */
+ private String fileExtension = ""; //$NON-NLS-1$
+
+
+ protected AbstractNewFileWizardPage(String pageName, IStructuredSelection selection) {
+ super(pageName);
+ this.selection = selection;
+ setPageComplete(false);
+ }
+
+ public String getContainerName() {
+ return containerText.getText();
+ }
+
+ public String getFileName() {
+ return fileText.getText();
+ }
+
+ public String getFileExtension() {
+ return fileExtension;
+ }
+
+ /**
+ * set the extension of files created with this wizard.
+ */
+ protected void setFileExtension(String ext) {
+ fileExtension = ext;
+ }
+
+ /**
+ * Content File Initialisation.
+ */
+ abstract protected InputStream getInitialContents(String filename);
+
+
+ /**
+ * @see IDialogPage#createControl(Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 3;
+ layout.verticalSpacing = 9;
+ Label label = new Label(container, SWT.NULL);
+ label.setText(LisaacMessages.getString("AbstractNewFileWizardPage_1"));
+
+ containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ containerText.setLayoutData(gd);
+ containerText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+
+ Button button = new Button(container, SWT.PUSH);
+ button.setText(LisaacMessages.getString("AbstractNewFileWizardPage_2"));
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+ label = new Label(container, SWT.NULL);
+ label.setText(LisaacMessages.getString("AbstractNewFileWizardPage_3"));
+
+ fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gd.horizontalSpan = 1;
+ fileText.setLayoutData(gd);
+ fileText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+ Composite dummy = new Composite(container, SWT.NONE);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gd.horizontalSpan = 1;
+ dummy.setLayoutData(gd);
+
+ //
+ createAdvancedControls(container);
+ //
+ initialize();
+ dialogChanged();
+ setControl(container);
+ }
+
+ protected void createAdvancedControls(Composite parent) {
+ // should be override
+ }
+
+ /**
+ * Tests if the current workbench selection is a suitable container to use.
+ */
+ private void initialize() {
+ if (selection != null && selection.isEmpty() == false
+ && selection instanceof IStructuredSelection) {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ if (ssel.size() > 1)
+ return;
+ Object obj = ssel.getFirstElement();
+ if (obj instanceof IResource) {
+ IContainer container;
+ if (obj instanceof IContainer)
+ container = (IContainer) obj;
+ else
+ container = ((IResource) obj).getParent();
+ containerText.setText(container.getFullPath().toString());
+ fileText.setFocus();
+ }
+ }
+ fileText.setText(getInitialFileName());
+ }
+
+ protected abstract String getInitialFileName();
+
+ /**
+ * Uses the standard container selection dialog to choose the new value for
+ * the container field.
+ */
+
+ private void handleBrowse() {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(
+ getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
+ LisaacMessages.getString("AbstractNewFileWizardPage_4"));
+ if (dialog.open() == ContainerSelectionDialog.OK) {
+ Object[] results = dialog.getResult();
+ if (results.length == 1) {
+ Object result = results[0];
+ if (result instanceof IPath) {
+ IPath ipath = (IPath) result;
+ containerText.setText(ipath.toString());
+ }
+ }
+ }
+ }
+
+ /**
+ * Ensures that both text fields are set.
+ */
+ private void dialogChanged() {
+ String container = getContainerName();
+ String fileName = getFileName();
+
+ if (container.length() == 0) {
+ updateStatus(LisaacMessages.getString("AbstractNewFileWizardPage_5"));
+ return;
+ }
+ if (fileName.length() == 0) {
+ updateStatus(LisaacMessages.getString("AbstractNewFileWizardPage_6"));
+ return;
+ }
+ updateStatus(null);
+ }
+
+ private void updateStatus(String message) {
+ setErrorMessage(message);
+ setPageComplete(message == null);
+ }
+
+ /**
+ * @see WizardPage#isPageComplete()
+ */
+ public boolean isPageComplete() {
+ return !checkFolderForExistingFile() && super.isPageComplete();
+ }
+
+ /**
+ * Finds the current directory where the file should be created
+ */
+ protected boolean checkFolderForExistingFile() {
+ IContainer container = getFileContainer();
+ if (container != null) {
+ IResource file = container.getFile(new Path(fileText.getText()
+ .trim()));
+ if (file != null && file.exists()) {
+ this.setErrorMessage(LisaacMessages.getString("AbstractNewFileWizardPage_7"));
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private IContainer getFileContainer() {
+ if (containerText.getText() != null) {
+ IPath containerPath = new Path(containerText.getText().trim());
+ IContainer container = null;
+ if (containerPath.segmentCount() > 1) {
+ container = ResourcesPlugin.getWorkspace().getRoot().getFolder(
+ containerPath);
+ } else {
+ if (containerPath.segmentCount() == 1) {
+ // this is a project
+ container = ResourcesPlugin.getWorkspace().getRoot()
+ .getProject(containerText.getText().trim());
+ }
+ }
+ if (container != null && container.exists()) {
+ return container;
+ }
+ }
+ return null;
+ }
+
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ String fileName = fileText.getText().trim();
+ if (getFileContainer() != null
+ && fileName.equalsIgnoreCase(getInitialFileName())) {
+ fileText.setFocus();
+ fileText.setText(fileName);
+ fileText.setSelection(0, fileName.length()
+ - (new Path(getInitialFileName())).getFileExtension()
+ .length() - 1);
+ }
+ }
+ }
+}
diff --git a/src/org/eclipse/lisaac/wizards/NewProjectWizard.java b/src/org/eclipse/lisaac/wizards/NewProjectWizard.java
index a95f181..b6efe9a 100644
--- a/src/org/eclipse/lisaac/wizards/NewProjectWizard.java
+++ b/src/org/eclipse/lisaac/wizards/NewProjectWizard.java
@@ -18,6 +18,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.lisaac.LisaacMessages;
import org.eclipse.lisaac.builder.LisaacNature;
import org.eclipse.lisaac.model.LisaacModel;
import org.eclipse.lisaac.properties.LisaacProjectPropertyPage;
@@ -76,7 +77,7 @@ public class NewProjectWizard extends Wizard implements INewWizard {
return false;
} catch (InvocationTargetException e) {
Throwable realException = e.getTargetException();
- MessageDialog.openError(getShell(), "Error !", realException.getMessage());
+ MessageDialog.openError(getShell(), "Error !", realException.getMessage()); //$NON-NLS-1$
return false;
}
return true;
@@ -85,7 +86,7 @@ public class NewProjectWizard extends Wizard implements INewWizard {
private void doFinish(String projectName, IPath nomRep, String lisaacPath, IProgressMonitor monitor)
throws CoreException
{
- monitor.beginTask("Project Creation " + projectName, 2);
+ monitor.beginTask("Project Creation " + projectName, 2); //$NON-NLS-1$
// get project root
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
@@ -118,37 +119,37 @@ public class NewProjectWizard extends Wizard implements INewWizard {
//
// create make file for project
- IFile lipFile = project.getFile("make.lip");
+ IFile lipFile = project.getFile("make.lip"); //$NON-NLS-1$
if (! lipFile.exists()) {
lipFile.create(new ByteArrayInputStream(getLipStream(project)), false, monitor);
}
// create default folder & files in project
- IFolder src = project.getFolder("src");
+ IFolder src = project.getFolder("src"); //$NON-NLS-1$
if (! src.exists()) {
src.create(false, false, null);
}
- IFile mainPrototype = src.getFile(projectName.toLowerCase()+".li");
+ IFile mainPrototype = src.getFile(projectName.toLowerCase()+".li"); //$NON-NLS-1$
if (! mainPrototype.exists()) {
mainPrototype.create(new ByteArrayInputStream(getMainPrototypeStream(projectName)), false, monitor);
}
- IFolder bin = project.getFolder("bin");
+ IFolder bin = project.getFolder("bin"); //$NON-NLS-1$
if (! bin.exists()) {
bin.create(false,false,null);
}
// store the value in the lisaac project field
project.setPersistentProperty(
- new QualifiedName("", LisaacProjectPropertyPage.LISAAC_PATH),
+ new QualifiedName("", LisaacProjectPropertyPage.LISAAC_PATH), //$NON-NLS-1$
lisaacPath);
} catch (IOException e) {
- MessageDialog.openError(getShell(), "Project creation Error !", e.getMessage());
+ MessageDialog.openError(getShell(), "Project creation Error !", e.getMessage()); //$NON-NLS-1$
} catch (CoreException e) {
- MessageDialog.openError(getShell(), "Project settings Error !", e.getMessage());
+ MessageDialog.openError(getShell(), "Project settings Error !", e.getMessage()); //$NON-NLS-1$
}
monitor.worked(1);
- monitor.setTaskName("Opening project ...");
+ monitor.setTaskName("Opening project ..."); //$NON-NLS-1$
monitor.worked(1);
// ...
monitor.done();
@@ -156,50 +157,50 @@ public class NewProjectWizard extends Wizard implements INewWizard {
public byte[] getMainPrototypeStream(String projectName) throws IOException {
- String contents = "// Lisaac main prototype\n";
- contents += "\nSection Header\n\n";
- contents += " + name := "+projectName.toUpperCase()+";\n";
- contents += " - comment := \"Main Prototype\";\n";
- contents += "\nSection Inherit\n\n";
- contents += " - parent_object:OBJECT := OBJECT;\n";
- contents += "\nSection Public\n\n";
- contents += " - main <- \n";
- contents += " // Main entry point.\n";
- contents += " (\n\n";
- contents += " \n";
- contents += " );\n";
+ String contents = "// Lisaac main prototype\n"; //$NON-NLS-1$
+ contents += "\nSection Header\n\n"; //$NON-NLS-1$
+ contents += " + name := "+projectName.toUpperCase()+";\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ contents += " - comment := \"Main Prototype\";\n"; //$NON-NLS-1$
+ contents += "\nSection Inherit\n\n"; //$NON-NLS-1$
+ contents += " - parent_object:OBJECT := OBJECT;\n"; //$NON-NLS-1$
+ contents += "\nSection Public\n\n"; //$NON-NLS-1$
+ contents += " - main <- \n"; //$NON-NLS-1$
+ contents += " // Main entry point.\n"; //$NON-NLS-1$
+ contents += " (\n\n"; //$NON-NLS-1$
+ contents += " \n"; //$NON-NLS-1$
+ contents += " );\n"; //$NON-NLS-1$
return contents.getBytes();
}
public byte[] getLipStream(IProject project) throws IOException {
- String contents = "//\n// `"+project.getName()+"` LIsaac Project file\n//";
- contents += "\nSection Inherit\n\n";
- contents += " + parent:STRING;\n";
- contents += "\nSection Private\n\n";
- contents += " + project_root:STRING := \""+project.getLocationURI().getPath()+"\";\n\n";
- contents += " - project_src_path <- \n";
- contents += " // Define the project path for source code.\n";
- contents += " (\n";
- contents += " path (project_root + \"src/\");\n";
- contents += " );\n\n";
- contents += " - front_end <- \n";
- contents += " // Executed by compiler, before compilation step.\n";
- contents += " (\n";
- contents += " project_src_path;\n";
- contents += " general_front_end;\n";
- contents += " );\n";
- contents += "\nSection Public\n\n";
- contents += " - clean <- \n";
- contents += " // Clean project.\n";
- contents += " (\n";
- contents += " );\n";
+ String contents = "//\n// `"+project.getName()+"` LIsaac Project file\n//"; //$NON-NLS-1$ //$NON-NLS-2$
+ contents += "\nSection Inherit\n\n"; //$NON-NLS-1$
+ contents += " + parent:STRING;\n"; //$NON-NLS-1$
+ contents += "\nSection Private\n\n"; //$NON-NLS-1$
+ contents += " + project_root:STRING := \""+project.getLocationURI().getPath()+"\";\n\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ contents += " - project_src_path <- \n"; //$NON-NLS-1$
+ contents += " // Define the project path for source code.\n"; //$NON-NLS-1$
+ contents += " (\n"; //$NON-NLS-1$
+ contents += " path (project_root + \"src/\");\n"; //$NON-NLS-1$
+ contents += " );\n\n"; //$NON-NLS-1$
+ contents += " - front_end <- \n"; //$NON-NLS-1$
+ contents += " // Executed by compiler, before compilation step.\n"; //$NON-NLS-1$
+ contents += " (\n"; //$NON-NLS-1$
+ contents += " project_src_path;\n"; //$NON-NLS-1$
+ contents += " general_front_end;\n"; //$NON-NLS-1$
+ contents += " );\n"; //$NON-NLS-1$
+ contents += "\nSection Public\n\n"; //$NON-NLS-1$
+ contents += " - clean <- \n"; //$NON-NLS-1$
+ contents += " // Clean project.\n"; //$NON-NLS-1$
+ contents += " (\n"; //$NON-NLS-1$
+ contents += " );\n"; //$NON-NLS-1$
return contents.getBytes();
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
- setWindowTitle("New Lisaac Project Wizard");
+ setWindowTitle(LisaacMessages.getString("NewProjectWizard_46"));
setNeedsProgressMonitor(true);
- mainPage = new NewProjectWizardPage("New Lisaac Project");
+ mainPage = new NewProjectWizardPage(LisaacMessages.getString("NewProjectWizard_47"));
}
public void addPages() {
@@ -217,7 +218,7 @@ class NewProjectWizardPage extends WizardNewProjectCreationPage {
NewProjectWizardPage(String pageName) {
super(pageName);
setTitle(pageName);
- setDescription("Create a lisaac project");
+ setDescription(LisaacMessages.getString("NewProjectWizard_48"));
}
public String getLisaacPath() {
@@ -236,11 +237,11 @@ class NewProjectWizardPage extends WizardNewProjectCreationPage {
final Button b1 = new Button(group, SWT.RADIO);
b1.setFont(parent.getFont());
- b1.setText("Use default Lisaac Environment");
+ b1.setText(LisaacMessages.getString("NewProjectWizard_49"));
final Button b2 = new Button(group, SWT.RADIO);
b2.setFont(parent.getFont());
- b2.setText("Use a project specific Lisaac Environment : ");
+ b2.setText(LisaacMessages.getString("NewProjectWizard_50"));
Composite envGroup = new Composite(group, SWT.NONE);
envGroup.setLayout(new RowLayout());
@@ -269,34 +270,12 @@ class NewProjectWizardPage extends WizardNewProjectCreationPage {
}
});
browseButton = new Button(envGroup, SWT.PUSH);
- browseButton.setText("Browse");
+ browseButton.setText(LisaacMessages.getString("NewProjectWizard_51"));
browseButton.setEnabled(false);
browseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
//handleBrowse();
}
});
-
-
- // Composite composite = (Composite)getControl();
-
- // sample section generation group
- /* Group group = new Group(composite,SWT.NONE);
- group.setLayout(new GridLayout());
- group.setText("Automatic_sample_section_generation");
- group.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL |
- GridData.HORIZONTAL_ALIGN_FILL));
-
- // sample section generation checkboxes
- Button sectionCheckbox = new Button(group,SWT.CHECK);
- sectionCheckbox.setText("Generate_sample_section_titles");
- sectionCheckbox.setSelection(true);
- /// sectionCheckbox.addListener(SWT.Selection,this);
-
- Button subsectionCheckbox = new Button(group,SWT.CHECK);
- subsectionCheckbox.setText("Generate_sample_subsection_titles");
- subsectionCheckbox.setSelection(true);
- // subsectionCheckbox.addListener(SWT.Selection,this);*/
}
-
}
diff --git a/src/org/eclipse/lisaac/wizards/NewPrototypeWizard.java b/src/org/eclipse/lisaac/wizards/NewPrototypeWizard.java
index 5e8ebc3..27c3fdc 100644
--- a/src/org/eclipse/lisaac/wizards/NewPrototypeWizard.java
+++ b/src/org/eclipse/lisaac/wizards/NewPrototypeWizard.java
@@ -3,6 +3,7 @@ package org.eclipse.lisaac.wizards;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.lisaac.LisaacPlugin;
+import org.eclipse.lisaac.LisaacMessages;
import org.eclipse.lisaac.model.ILisaacModel;
import org.eclipse.lisaac.preferences.PreferenceConstants;
import org.eclipse.swt.SWT;
@@ -28,7 +29,7 @@ public class NewPrototypeWizard extends AbstractNewFileWizard {
public NewPrototypeWizard() {
super();
- setWindowTitle("New Prototype");
+ setWindowTitle(LisaacMessages.getString("NewPrototypeWizard_0"));
}
/**
@@ -43,7 +44,7 @@ public class NewPrototypeWizard extends AbstractNewFileWizard {
* Represent the main page in "new lisaac prototype" wizard.
*/
class NewPrototypeWizardPage extends AbstractNewFileWizardPage {
- final private String INITIAL_PROTOTYPE_NAME = "prototype.li";
+ final private String INITIAL_PROTOTYPE_NAME = "prototype.li"; //$NON-NLS-1$
protected Text commentField;
@@ -56,9 +57,9 @@ class NewPrototypeWizardPage extends AbstractNewFileWizardPage {
protected NewPrototypeWizardPage(IStructuredSelection selection) {
super(NewPrototypeWizardPage.class.getName(), selection);
- setTitle("Prototype File");
- setDescription("Creates a new source file into a project");
- setFileExtension(".li");
+ setTitle(LisaacMessages.getString("NewPrototypeWizard_2"));
+ setDescription(LisaacMessages.getString("NewPrototypeWizard_3"));
+ setFileExtension(".li"); //$NON-NLS-1$
}
public String getPrototypeDescription() {
@@ -84,29 +85,29 @@ class NewPrototypeWizardPage extends AbstractNewFileWizardPage {
boolean isExpanded = styleExpanded.getSelection();
boolean isStrict = styleExpanded.getSelection();
- String contents = "\nSection Header\n\n";
- contents += " + name := ";
+ String contents = "\nSection Header\n\n"; //$NON-NLS-1$
+ contents += " + name := "; //$NON-NLS-1$
if (isExpanded) {
- contents += "Expanded ";
+ contents += "Expanded "; //$NON-NLS-1$
} else if (isStrict) {
- contents += "Strict ";
+ contents += "Strict "; //$NON-NLS-1$
}
- contents += filename.toUpperCase()+";\n";
+ contents += filename.toUpperCase()+";\n"; //$NON-NLS-1$
String descr = getPrototypeDescription();
if (descr != null && descr.length() > 0) {
- contents += " - comment := \""+descr+"\";\n";
+ contents += " - comment := \""+descr+"\";\n"; //$NON-NLS-1$ //$NON-NLS-2$
}
String username = LisaacPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.P_LISAAC_USER);
if (username != null && username.length() > 0) {
- contents += "\n - author := \""+username+"\";\n";
+ contents += "\n - author := \""+username+"\";\n"; //$NON-NLS-1$ //$NON-NLS-2$
}
if (! isExpanded) {
- contents += "\nSection Inherit\n\n";
+ contents += "\nSection Inherit\n\n"; //$NON-NLS-1$
} else {
- contents += "\nSection Insert\n\n";
+ contents += "\nSection Insert\n\n"; //$NON-NLS-1$
}
int n = tableInherit.getItemCount();
if (n > 0) {
@@ -115,24 +116,24 @@ class NewPrototypeWizardPage extends AbstractNewFileWizardPage {
String type = item.getText(1);
if (type.equals(ILisaacModel.inherit_shared) ||
type.equals(ILisaacModel.inherit_shared_expanded)) {
- contents += " - ";
+ contents += " - "; //$NON-NLS-1$
} else {
- contents += " + ";
+ contents += " + "; //$NON-NLS-1$
}
- contents += "parent_";
- contents += item.getText(0).toLowerCase() + ":";
+ contents += "parent_"; //$NON-NLS-1$
+ contents += item.getText(0).toLowerCase() + ":"; //$NON-NLS-1$
if (type.equals(ILisaacModel.inherit_shared_expanded) ||
type.equals(ILisaacModel.inherit_nonshared_expanded)) {
- contents += "Expanded " + item.getText(0);
+ contents += "Expanded " + item.getText(0); //$NON-NLS-1$
} else {
- contents += item.getText(0) + " := " + item.getText(0);
+ contents += item.getText(0) + " := " + item.getText(0); //$NON-NLS-1$
}
- contents += ";\n";
+ contents += ";\n"; //$NON-NLS-1$
}
} else {
- contents += " - parent_object:OBJECT := OBJECT;\n";
+ contents += " - parent_object:OBJECT := OBJECT;\n"; //$NON-NLS-1$
}
- contents += "\nSection Public\n\n";
+ contents += "\nSection Public\n\n"; //$NON-NLS-1$
return contents.getBytes();
}
@@ -143,20 +144,20 @@ class NewPrototypeWizardPage extends AbstractNewFileWizardPage {
// -- Style --
Label label = new Label(parent, SWT.NONE);
- label.setText("Prototype Style : ");
+ label.setText(LisaacMessages.getString("NewPrototypeWizard_25"));
label.setFont(parent.getFont());
Composite radioGroup = new Composite(parent, SWT.NONE);
radioGroup.setLayout(new RowLayout());
styleNone = new Button(radioGroup, SWT.RADIO);
styleNone.setFont(parent.getFont());
- styleNone.setText("None");
+ styleNone.setText(LisaacMessages.getString("NewPrototypeWizard_26"));
styleExpanded = new Button(radioGroup, SWT.RADIO);
styleExpanded.setFont(parent.getFont());
- styleExpanded.setText("Expanded");
+ styleExpanded.setText(LisaacMessages.getString("NewPrototypeWizard_27"));
styleStrict = new Button(radioGroup, SWT.RADIO);
styleStrict.setFont(parent.getFont());
- styleStrict.setText("Strict");
+ styleStrict.setText(LisaacMessages.getString("NewPrototypeWizard_28"));
GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridData.horizontalSpan = 2;
radioGroup.setLayoutData(gridData);
@@ -164,7 +165,7 @@ class NewPrototypeWizardPage extends AbstractNewFileWizardPage {
// -- Description --
label = new Label(parent, SWT.NONE);
- label.setText("Description : ");
+ label.setText(LisaacMessages.getString("NewPrototypeWizard_29"));
label.setFont(parent.getFont());
gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridData.horizontalSpan = 1;
@@ -179,7 +180,7 @@ class NewPrototypeWizardPage extends AbstractNewFileWizardPage {
// -- inherits --
label = new Label(parent, SWT.NONE);
- label.setText("Inheritance : ");
+ label.setText(LisaacMessages.getString("NewPrototypeWizard_30"));
label.setFont(parent.getFont());
gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gridData.horizontalSpan = 1;
@@ -191,22 +192,22 @@ class NewPrototypeWizardPage extends AbstractNewFileWizardPage {
final Table table = new Table(tableGroup, SWT.BORDER | SWT.SINGLE |
SWT.H_SCROLL | SWT.FULL_SELECTION);
final TableColumn c1 = new TableColumn(table, SWT.LEFT);
- c1.setText("Prototype");
+ c1.setText("Prototype"); //$NON-NLS-1$
c1.setWidth(150);
final TableColumn c2 = new TableColumn(table, SWT.LEFT);
- c2.setText("Inheritance Type");
+ c2.setText(LisaacMessages.getString("NewPrototypeWizard_32"));
c2.setWidth(100);
table.setHeaderVisible(true);
table.setLinesVisible(true);
final TableItem itemDefault = new TableItem(table, SWT.NONE);
- itemDefault.setText(new String[] {"OBJECT", ILisaacModel.inherit_shared});
+ itemDefault.setText(new String[] {"OBJECT", ILisaacModel.inherit_shared}); //$NON-NLS-1$
Composite buttonGroup = new Composite(tableGroup, SWT.NONE);
buttonGroup.setLayout(new GridLayout());
Button tableAdd = new Button(buttonGroup, SWT.PUSH);
tableAdd.setFont(parent.getFont());
- tableAdd.setText("Add");
+ tableAdd.setText(LisaacMessages.getString("NewPrototypeWizard_34"));
tableAdd.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
// TODO dialog to create inherit table item
@@ -214,7 +215,7 @@ class NewPrototypeWizardPage extends AbstractNewFileWizardPage {
});
Button tableRemove= new Button(buttonGroup, SWT.PUSH);
tableRemove.setFont(parent.getFont());
- tableRemove.setText("Remove");
+ tableRemove.setText(LisaacMessages.getString("NewPrototypeWizard_35"));
tableRemove.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
int[] indices = table.getSelectionIndices();
--
Lisaac eclipse plugin
More information about the Lisaac-commits
mailing list