X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/template/php/GlobalVariables.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/template/php/GlobalVariables.java deleted file mode 100644 index 8439ae9..0000000 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/template/php/GlobalVariables.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2001. - * All Rights Reserved. - */ -package net.sourceforge.phpdt.internal.corext.template.php; - -import java.text.DateFormat; -import java.util.Calendar; - -import net.sourceforge.phpdt.internal.corext.template.SimpleTemplateVariable; -import net.sourceforge.phpdt.internal.corext.template.TemplateContext; - -/** - * Global variables which are available in any context. - */ -public class GlobalVariables { - - /** - * The cursor variable determines the cursor placement after template edition. - */ - static class Cursor extends SimpleTemplateVariable { - public Cursor() { - super(PHPTemplateMessages.getString("GlobalVariables.variable.name.cursor"), PHPTemplateMessages.getString("GlobalVariables.variable.description.cursor")); //$NON-NLS-1$ //$NON-NLS-2$ - setEvaluationString(""); //$NON-NLS-1$ - setResolved(true); - } - } - - /** - * The dollar variable inserts an escaped dollar symbol. - */ - static class Dollar extends SimpleTemplateVariable { - public Dollar() { - super(PHPTemplateMessages.getString("GlobalVariables.variable.name.dollar"), PHPTemplateMessages.getString("GlobalVariables.variable.description.dollar")); //$NON-NLS-1$ //$NON-NLS-2$ - setEvaluationString("$"); //$NON-NLS-1$ - setResolved(true); - } - } - - /** - * The date variable evaluates to the current date. - */ - static class Date extends SimpleTemplateVariable { - public Date() { - super(PHPTemplateMessages.getString("GlobalVariables.variable.name.date"), PHPTemplateMessages.getString("GlobalVariables.variable.description.date")); //$NON-NLS-1$ //$NON-NLS-2$ - setResolved(true); - } - public String evaluate(TemplateContext context) { - return DateFormat.getDateInstance().format(new java.util.Date()); - } - } - - /** - * The year variable evaluates to the current year. - */ - static class Year extends SimpleTemplateVariable { - public Year() { - super(PHPTemplateMessages.getString("GlobalVariables.variable.name.year"), PHPTemplateMessages.getString("GlobalVariables.variable.description.year")); //$NON-NLS-1$ //$NON-NLS-2$ - setResolved(true); - } - public String evaluate(TemplateContext context) { - return Integer.toString(Calendar.getInstance().get(Calendar.YEAR)); - } - } - /** - * The time variable evaluates to the current time. - */ - static class Time extends SimpleTemplateVariable { - public Time() { - super(PHPTemplateMessages.getString("GlobalVariables.variable.name.time"), PHPTemplateMessages.getString("GlobalVariables.variable.description.time")); //$NON-NLS-1$ //$NON-NLS-2$ - setResolved(true); - } - public String evaluate(TemplateContext context) { - return DateFormat.getTimeInstance().format(new java.util.Date()); - } - } - - /** - * The user variable evaluates to the current user. - */ - static class User extends SimpleTemplateVariable { - public User() { - super(PHPTemplateMessages.getString("GlobalVariables.variable.name.user"), PHPTemplateMessages.getString("GlobalVariables.variable.description.user")); //$NON-NLS-1$ //$NON-NLS-2$ - setResolved(true); - } - public String evaluate(TemplateContext context) { - return System.getProperty("user.name"); //$NON-NLS-1$ - } - } -}