From b17c2cd9dc2736623f5c0f7f20c3f82d701de1f1 Mon Sep 17 00:00:00 2001 From: bananeweizen Date: Wed, 18 Jan 2006 08:53:11 +0000 Subject: [PATCH] migrated plugin from 3.0 to 3.1 --- .../externaltools/ExternalToolsPlugin.java | 15 +++++++++------ net.sourceforge.phpeclipse/plugin.xml | 2 +- .../internal/ui/text/BufferedDocumentScanner.java | 16 ++++++++-------- .../sourceforge/phpeclipse/PHPeclipsePlugin.java | 5 ++--- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java index c392571..b805a73 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java @@ -39,6 +39,7 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; /** * External tools plug-in class @@ -270,10 +271,11 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { } /** - * @see org.eclipse.core.runtime.Plugin#startup() + * @throws Exception + * @see org.eclipse.core.runtime.Plugin#start(BundleContext context) */ - public void startup() throws CoreException { - // super.startup(); + public void start(BundleContext context) throws Exception { + super.start(context); getStandardDisplay().asyncExec(new Runnable() { public void run() { //initialize the variable context manager @@ -283,11 +285,12 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { } /** - * @see org.eclipse.core.runtime.Plugin#shutdown() + * @throws Exception + * @see org.eclipse.core.runtime.Plugin#stop(BundleContext context) */ - public void shutdown() throws CoreException { - // super.shutdown(); + public void stop(BundleContext context) throws Exception { ColorManager.getDefault().dispose(); + super.stop(context); } /** diff --git a/net.sourceforge.phpeclipse/plugin.xml b/net.sourceforge.phpeclipse/plugin.xml index 873b7db..c747152 100644 --- a/net.sourceforge.phpeclipse/plugin.xml +++ b/net.sourceforge.phpeclipse/plugin.xml @@ -15,7 +15,7 @@ - + diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/BufferedDocumentScanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/BufferedDocumentScanner.java index 57812ba..b4fe57d 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/BufferedDocumentScanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/BufferedDocumentScanner.java @@ -1,10 +1,10 @@ /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials + * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html - * + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -19,7 +19,7 @@ import org.eclipse.jface.text.rules.ICharacterScanner; /** - * A buffered document scanner. The buffer always contains a section + * A buffered document scanner. The buffer always contains a section * of a fixed size of the document to be scanned. */ @@ -43,11 +43,11 @@ public final class BufferedDocumentScanner implements ICharacterScanner { /** The offset of the scanner within the buffer. */ private int fOffset; - + /** * Creates a new buffered document scanner. * The buffer size is set to the given number of characters. - * + * * @param size the buffer size */ public BufferedDocumentScanner(int size) { @@ -63,7 +63,7 @@ public final class BufferedDocumentScanner implements ICharacterScanner { private final void updateBuffer(int offset) { fBufferOffset= offset; - + if (fBufferOffset + fBuffer.length > fRangeOffset + fRangeLength) fBufferLength= fRangeLength - (fBufferOffset - fRangeOffset); else @@ -117,7 +117,7 @@ public final class BufferedDocumentScanner implements ICharacterScanner { return fBuffer[fOffset++]; } catch (ArrayIndexOutOfBoundsException e) { System.out.println("Offset:"+fOffset); - System.out.println("Buffer:"+fBuffer); + System.out.println("Buffer:"+fBuffer.toString()); throw e; } } @@ -134,7 +134,7 @@ public final class BufferedDocumentScanner implements ICharacterScanner { updateBuffer(fBufferOffset - fBuffer.length); fOffset= fBuffer.length - 1; } - } else { + } else { --fOffset; } } diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java index 46e566a..6eeecfb 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java @@ -73,7 +73,6 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdapterManager; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; @@ -300,8 +299,8 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon /** * The constructor. */ - public PHPeclipsePlugin(IPluginDescriptor descriptor) { - super(descriptor); + public PHPeclipsePlugin() { + super(); plugin = this; // externalTools = new ExternalToolsPlugin(); -- 1.7.1