import java.sql.SQLException;
import java.text.MessageFormat;
import java.util.ArrayList;
-import java.util.Enumeration;
import java.util.Hashtable;
import java.util.List;
import java.util.MissingResourceException;
import net.sourceforge.phpeclipse.wiki.internal.IConfigurationWorkingCopy;
import net.sourceforge.phpeclipse.wiki.sql.WikipediaDB;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.text.templates.persistence.TemplateStore;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IContributorResourceAdapter;
+import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.osgi.framework.BundleContext;
public class WikiEditorPlugin extends AbstractUIPlugin {
public final static String HTTP_PROXYPASSWORD = "http.proxyPassword";
+ /**
+ * A named preference that controls whether the 'wrap words' feature is enabled.
+ * <p>
+ * Value is of type <code>Boolean</code>.
+ * </p>
+ */
+ public final static String EDITOR_WRAP_WORDS = "editor.wrap.words"; //$NON-NLS-1$
+
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\"/>"
InputStream is = getDefault().openStream(new Path("prefs/default_" + operatingSystem + ".properties"));
PropertyResourceBundle resourceBundle = new PropertyResourceBundle(is);
- String key = HTTP_TIMEOUT;
+ String key = EDITOR_WRAP_WORDS;
+ try {
+ String wordWrap = resourceBundle.getString(key);
+ Boolean b = Boolean.valueOf(wordWrap);
+ if (b.booleanValue()) {
+ store.setDefault(key, "true");
+ } else {
+ store.setDefault(key, "false");
+ }
+ } catch (Exception e) {
+ store.setDefault(key, "false");
+ }
+
+ key = HTTP_TIMEOUT;
try {
String timeout = resourceBundle.getString(key);
int val = Integer.parseInt(timeout);
} catch (Exception e) {
store.setDefault(key, System.getProperty(key, ""));
}
-
+
} catch (Exception e) {
}
}
}
- public void startup() throws CoreException {
- super.startup();
- }
+ // public void startup() throws CoreException {
+ // super.startup();
+ // }
/**
* Returns the translated String found with the given key.
}
/*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.Plugin#shutdown()
+ * (non - Javadoc) Method declared in Plugin
*/
- public void shutdown() throws CoreException {
- if (fWikiDB != null) {
- try {
- fWikiDB.shutdown();
- } catch (SQLException e) {
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * @see org.eclipse.core.runtime.Plugin#stop
+ */
+ public void stop(BundleContext context) throws Exception {
+ try {
+ if (fWikiDB != null) {
+ try {
+ fWikiDB.shutdown();
+ } catch (SQLException e) {
+ }
}
+ } finally {
+ super.stop(context);
}
- super.shutdown();
}
public static void log(int severity, String message) {