Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 84308 invoked from network); 4 Jul 2006 11:44:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Jul 2006 11:44:46 -0000 Received: (qmail 15704 invoked by uid 500); 4 Jul 2006 11:44:45 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 15661 invoked by uid 500); 4 Jul 2006 11:44:45 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 15604 invoked by uid 99); 4 Jul 2006 11:44:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jul 2006 04:44:44 -0700 X-ASF-Spam-Status: No, hits=-8.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jul 2006 04:44:42 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 81FA71A983A; Tue, 4 Jul 2006 04:44:22 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r418985 - /incubator/harmony/enhanced/tools/trunk/eclipse/org.apache.harmony.eclipse.jdt.launching/src/org/apache/harmony/eclipse/jdt/launching/HyLaunchingPlugin.java Date: Tue, 04 Jul 2006 11:44:22 -0000 To: harmony-commits@incubator.apache.org From: gharley@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060704114422.81FA71A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: gharley Date: Tue Jul 4 04:44:21 2006 New Revision: 418985 URL: http://svn.apache.org/viewvc?rev=418985&view=rev Log: HARMONY 700 : wrong line endings (0xD) HyLaunchingPlugin.java Modified: incubator/harmony/enhanced/tools/trunk/eclipse/org.apache.harmony.eclipse.jdt.launching/src/org/apache/harmony/eclipse/jdt/launching/HyLaunchingPlugin.java Modified: incubator/harmony/enhanced/tools/trunk/eclipse/org.apache.harmony.eclipse.jdt.launching/src/org/apache/harmony/eclipse/jdt/launching/HyLaunchingPlugin.java URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/tools/trunk/eclipse/org.apache.harmony.eclipse.jdt.launching/src/org/apache/harmony/eclipse/jdt/launching/HyLaunchingPlugin.java?rev=418985&r1=418984&r2=418985&view=diff ============================================================================== --- incubator/harmony/enhanced/tools/trunk/eclipse/org.apache.harmony.eclipse.jdt.launching/src/org/apache/harmony/eclipse/jdt/launching/HyLaunchingPlugin.java (original) +++ incubator/harmony/enhanced/tools/trunk/eclipse/org.apache.harmony.eclipse.jdt.launching/src/org/apache/harmony/eclipse/jdt/launching/HyLaunchingPlugin.java Tue Jul 4 04:44:21 2006 @@ -1,4 +1,4 @@ -/* Copyright 2000, 2005 The Apache Software Foundation or its licensors, as applicable +/* Copyright 2000, 2006 The Apache Software Foundation or its licensors, as applicable * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -11,4 +11,125 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ package org.apache.harmony.eclipse.jdt.launching; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; import org.osgi.framework.BundleContext; public class HyLaunchingPlugin extends Plugin { /** * Unique identifier constant. */ private static final String PI_Harmony_Launching = "org.apache.harmony.jdt.launching"; //$NON-NLS-1$ private static HyLaunchingPlugin plugin; static final String DEBUG_PLUGIN = PI_Harmony_Launching + "/plugin"; //$NON-NLS-1$ static final String DEBUG_INSTALLING = PI_Harmony_Launching + "/vm/installing"; //$NON-NLS-1$ static final String DEBUG_LAUNCHING = PI_Harmony_Launching + "/application/launching"; //$NON-NLS-1$ /** * Default constructor. */ public HyLaunchingPlugin() { super(); plugin = this; } public void start(BundleContext context) throws Exception { super.start(context); if (isDebugging() && (Platform.getDebugOption(DEBUG_PLUGIN) .equalsIgnoreCase("true"))) { //$NON-NLS-1$ System.out.println(PI_Harmony_Launching + "--> Plugin started"); //$NON-NLS-1$ } } public void stop(BundleContext context) throws Exception { if (isDebugging() && (Platform.getDebugOption(DEBUG_PLUGIN) .equalsIgnoreCase("true"))) { //$NON-NLS-1$ System.out.println(PI_Harmony_Launching + "--> Plugin stopping"); //$NON-NLS-1$ } super.stop(context); } public static HyLaunchingPlugin getDefault() { return plugin; } /** * Convenience method which returns the unique identifier of this plugin. */ public static String getUniqueIdentifier() { return PI_Harmony_Launching; } /** * Convenience method to write status information to the platform log. * * @param msg * information to be written to the platform log. */ public void log(String msg) { log(msg, null); } /** * Convenience method to write problem information to the platform log. * * @param msg * additional information about the event * @param e * exception encapsulating any non-fatal problem */ public void log(String msg, Exception e) { getLog().log( new Status(IStatus.INFO, getUniqueIdentifier(), IStatus.OK, msg, e)); } /** * Convenience method to write error information to the platform log. * * @param msg * additional information about the event * @param e * exception encapsulating the error */ public void logError(String msg, Exception e) { getLog().log( new Status(IStatus.INFO, getUniqueIdentifier(), IStatus.ERROR, msg, e)); } /** * Convenience method that returns a boolean indication of whether or not * the plug-in is running with debug trace on and if the option * to allow trace messages about the VM installation activities has been * specified. * * @return true if tracing of VM install activi ties is * enabled, otherwise false. */ public static boolean isDebuggingInstalling() { boolean result = false; if (plugin.isDebugging()) { String option = Platform.getDebugOption(DEBUG_INSTALLING); if ((option != null) && option.equalsIgnoreCase("true")) { //$NON-NLS-1$ result = true; } } return result; } } + */ + +package org.apache.harmony.eclipse.jdt.launching; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; +import org.osgi.framework.BundleContext; + +public class HyLaunchingPlugin extends Plugin { + + /** + * Unique identifier constant. + */ + private static final String PI_Harmony_Launching = "org.apache.harmony.jdt.launching"; //$NON-NLS-1$ + + private static HyLaunchingPlugin plugin; + + static final String DEBUG_PLUGIN = PI_Harmony_Launching + "/plugin"; //$NON-NLS-1$ + + static final String DEBUG_INSTALLING = PI_Harmony_Launching + "/vm/installing"; //$NON-NLS-1$ + + static final String DEBUG_LAUNCHING = PI_Harmony_Launching + "/application/launching"; //$NON-NLS-1$ + + /** + * Default constructor. + */ + public HyLaunchingPlugin() { + super(); + plugin = this; + } + + public void start(BundleContext context) throws Exception { + super.start(context); + + if (isDebugging() + && (Platform.getDebugOption(DEBUG_PLUGIN) + .equalsIgnoreCase("true"))) { //$NON-NLS-1$ + System.out.println(PI_Harmony_Launching + "--> Plugin started"); //$NON-NLS-1$ + } + } + + public void stop(BundleContext context) throws Exception { + if (isDebugging() + && (Platform.getDebugOption(DEBUG_PLUGIN) + .equalsIgnoreCase("true"))) { //$NON-NLS-1$ + System.out.println(PI_Harmony_Launching + "--> Plugin stopping"); //$NON-NLS-1$ + } + + super.stop(context); + } + + public static HyLaunchingPlugin getDefault() { + return plugin; + } + + /** + * Convenience method which returns the unique identifier of this plugin. + */ + public static String getUniqueIdentifier() { + return PI_Harmony_Launching; + } + + /** + * Convenience method to write status information to the platform log. + * + * @param msg + * information to be written to the platform log. + */ + public void log(String msg) { + log(msg, null); + } + + /** + * Convenience method to write problem information to the platform log. + * + * @param msg + * additional information about the event + * @param e + * exception encapsulating any non-fatal problem + */ + public void log(String msg, Exception e) { + getLog().log( + new Status(IStatus.INFO, getUniqueIdentifier(), IStatus.OK, + msg, e)); + } + + /** + * Convenience method to write error information to the platform log. + * + * @param msg + * additional information about the event + * @param e + * exception encapsulating the error + */ + public void logError(String msg, Exception e) { + getLog().log( + new Status(IStatus.INFO, getUniqueIdentifier(), IStatus.ERROR, + msg, e)); + } + + /** + * Convenience method that returns a boolean indication of whether or not + * the plug-in is running with debug trace on and if the option + * to allow trace messages about the VM installation activities has been + * specified. + * + * @return true if tracing of VM install activities is + * enabled, otherwise false. + */ + public static boolean isDebuggingInstalling() { + boolean result = false; + if (plugin.isDebugging()) { + String option = Platform.getDebugOption(DEBUG_INSTALLING); + if ((option != null) && option.equalsIgnoreCase("true")) { //$NON-NLS-1$ + result = true; + } + } + return result; + } +}