diff options
Diffstat (limited to 'org.eclipse.swtbot.eclipse.ui/src/org/eclipse/swtbot/eclipse/ui/project/Templatizer.java')
-rw-r--r-- | org.eclipse.swtbot.eclipse.ui/src/org/eclipse/swtbot/eclipse/ui/project/Templatizer.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/org.eclipse.swtbot.eclipse.ui/src/org/eclipse/swtbot/eclipse/ui/project/Templatizer.java b/org.eclipse.swtbot.eclipse.ui/src/org/eclipse/swtbot/eclipse/ui/project/Templatizer.java new file mode 100644 index 00000000..15f4a3a2 --- /dev/null +++ b/org.eclipse.swtbot.eclipse.ui/src/org/eclipse/swtbot/eclipse/ui/project/Templatizer.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2010 Ketan Padegaonkar 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: + * Ketan Padegaonkar - initial API and implementation + *******************************************************************************/ +package org.eclipse.swtbot.eclipse.ui.project; + +public class Templatizer { + + private final String pluginId; + private final String pluginName; + private final String pluginVersion; + private final String pluginProvider; + + public Templatizer(String pluginId, String pluginName, String pluginVersion, String pluginProvider) { + this.pluginId = pluginId; + this.pluginName = pluginName; + this.pluginVersion = pluginVersion; + this.pluginProvider = pluginProvider; + } + + public String templatize(String contents) { + return + contents + .replaceAll("@PLUGIN_NAME@", pluginName) + .replaceAll("@PLUGIN_ID@", pluginId) + .replaceAll("@PLUGIN_VERSION@", pluginVersion) + .replaceAll("@PLUGIN_PROVIDER@", pluginProvider); + } + +} |