import net.sourceforge.phpeclipse.wiki.internal.IConfigurationWorkingCopy;
import net.sourceforge.phpeclipse.wiki.sql.WikipediaDB;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IPluginDescriptor;
private static WikiEditorPlugin fgPlugin;
+ public final static String AUTOMATICALLY_CREATED = "<!-- automatically created -->";
+
+ public final static String WP_EXTENSION = "wp";
+ public final static String XML_START_1 = "<?xml version=\"1.0\" encoding=\"";
+ public final static String XML_START_2 = "\" ?>\n"
+ + "<mediawiki version=\"0.1\">\n";
+ public final static String XML_END ="\n</mediawiki>";
+ public static final String PREFIX_LOAD = "Load ";
+
+ public static final String PREFIX_STORE = "Store ";
+
public static final String HTTP_QUERY = "HTTP Query";
// public static final String WIKIPEDIA_GET_TEXT = "Load WikipediaEN";
public static final String BLOG_A_HTML = "Blog as HTML Text";
- public static final String[] PREDEFINED_TYPES = { HTTP_QUERY, WIKIPEDIA_SQL, BLOG_A_WIKI, BLOG_A_HTML };
+ public static final String PLOG4U_DE_LOAD = PREFIX_LOAD + "Plog4UDE";
+
+ public static final String PLOG4U_DE_STORE = PREFIX_STORE + "Plog4UDE";
+
+ public static final String PLOG4U_ORG_LOAD = PREFIX_LOAD + "Plog4UORG";
+
+ public static final String PLOG4U_ORG_STORE = PREFIX_STORE + "Plog4UORG";
+
+ public static final String[] PREDEFINED_TYPES = {
+ HTTP_QUERY,
+ WIKIPEDIA_SQL,
+ PLOG4U_DE_LOAD,
+ PLOG4U_DE_STORE,
+ PLOG4U_ORG_LOAD,
+ PLOG4U_ORG_STORE,
+ BLOG_A_WIKI,
+ BLOG_A_HTML };
public static final String[] PREDEFINED_WIKIS = {
"WikibooksDE",
"WikipediaES",
"WikipediaET",
"WikipediaFI",
- "WikipediaFR" };
-
- public static final String PREFIX_LOAD = "Load ";
-
- public static final String PREFIX_STORE = "Store ";
+ "WikipediaFR",
+ "WikipediaHE",
+ "WikipediaIA",
+ "WikipediaIT",
+ "WikipediaJA",
+ "WikipediaNL",
+ "WikipediaPL",
+ "WikipediaPT",
+ "WikipediaRO",
+ "WikipediaSL",
+ "WikipediaSV",
+ "WikipediaZH" };
public static final ArrayList CONFIGURATION_TYPES = new ArrayList();
public final static String LOCAL_CSS_URL = "__local_css_url";
public final static String EXPORT_CSS_URL = "__export_css_url";
+
+ public final static String PREF_STRING_CONFIGURATIONS = "__configurations4";
+
+ public final static String CONSOLE_OUTPUT = "__console_output";
- public final static String PREF_STRING_CONFIGURATIONS = "__configurations2";
-
- public final static String CONFIG_MEMENTO = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
- + "<configurations>"
+ public final static String CONFIG_MEMENTO = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<configurations>"
+ "<config name=\"Google Search\" type-id=\"HTTP Query\" url=\"http://www.google.com/search?q=$text.selection\"/>"
+ "<config name=\"Koders.com Search\" type-id=\"HTTP Query\" url=\"http://koders.com/?s=$text.selection\"/>"
+ "<config name=\"Leo.org Translation\" type-id=\"HTTP Query\" url=\"http://dict.leo.org/?search=$text.selection\"/>"
- + "<config name=\"WikipediaEN Dwonload\" type-id=\"Load WikipediaEN\" url=\"http://en.wikipedia.org/w/index.php?title=$text.wikiname&action=raw\"/>"
- + "<config name=\"WikibooksEN Download\" type-id=\"Load WikibooksEN\" url=\"http://en.wikibooks.org/w/index.php?title=$text.wikiname&action=raw\"/>"
- + "<config name=\"WikipediaEN Upload\" type-id=\"Store WikipediaEN\" url=\"http://en.wikipedia.org/w/index.php\"/>"
- + "<config name=\"WikibooksEN Upload\" type-id=\"Store WikibooksEN\" url=\"http://en.wikibooks.org/w/index.php\"/>"
+
+ + "<config name=\"Plog4U.de Download\" type-id=\"" + PLOG4U_DE_LOAD
+ + "\" url=\"http://www.plog4u.de/index.php/Spezial:Export\"/>" + "<config name=\"Plog4U.org Download\" type-id=\""
+ + PLOG4U_ORG_LOAD + "\" url=\"http://www.plog4u.org/index.php/Special:Export\"/>"
+ + "<config name=\"Plog4U.de Upload\" type-id=\"" + PLOG4U_DE_STORE + "\" url=\"http://www.plog4u.de/index.php\"/>"
+ + "<config name=\"Plog4U.org Upload\" type-id=\"" + PLOG4U_ORG_STORE + "\" url=\"http://www.plog4u.org/index.php\"/>"
+
+ + "<config name=\"WikipediaEN Download\" type-id=\"" + PREFIX_LOAD
+ + "WikipediaEN\" url=\"http://en.wikipedia.org/wiki/Special:Export\"/>" + "<config name=\"WikibooksEN Download\" type-id=\""
+ + PREFIX_LOAD + "WikibooksEN\" url=\"http://en.wikibooks.org/wiki/Special:Export\"/>"
+ + "<config name=\"WikipediaEN Upload\" type-id=\"" + PREFIX_STORE
+ + "WikipediaEN\" url=\"http://en.wikipedia.org/w/index.php\"/>" + "<config name=\"WikibooksEN Upload\" type-id=\""
+ + PREFIX_STORE + "WikibooksEN\" url=\"http://en.wikibooks.org/w/index.php\"/>"
+ "<config name=\"Wikipedia-SQL\" type-id=\"Wikipedia SQL access\" user=\"root\" url=\"jdbc:mysql://localhost/wikidb\"/>"
+ "</configurations>";
*/
protected void initializeDefaultPreferences(IPreferenceStore store) {
store.setDefault(PREF_STRING_CONFIGURATIONS, CONFIG_MEMENTO);
+ store.setDefault(CONSOLE_OUTPUT, "true");
}
/*
public void reportError(String title, String message) {
try {
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- MessageDialog.openError(shell, title, message);
+// Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ MessageDialog.openError(null, title, message);
} catch (RuntimeException e) {
log(e.getLocalizedMessage(), e);
}
return (IWikipedia) method.invoke(null, new Object[0]);
}
+ /**
+ * Returns the workspace instance.
+ */
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
// test code
// public static void main(String[] args) {
// try {