diff options
Diffstat (limited to 'common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/Tracing.java')
-rw-r--r-- | common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/Tracing.java | 161 |
1 files changed, 0 insertions, 161 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/Tracing.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/Tracing.java deleted file mode 100644 index 7826015d18..0000000000 --- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/Tracing.java +++ /dev/null @@ -1,161 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. 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: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.common.ui.internal; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.jpt.common.ui.JptCommonUiPlugin; - -/** - * This tracing class manages to convert the string value into boolean values or - * integer values that are associated with the tracing debug flags. Those flags - * are specified in the .options file. The supported keys are defined here as - * constants for quick reference. - * - * @version 2.0 - * @since 2.0 - */ -@SuppressWarnings("nls") -public final class Tracing -{ - /** - * A constant used to retrieve the value associated with "/debug". - */ - public static final String DEBUG = "/debug"; - - /** - * A constant used to retrieve the value associated with "/debug/ui/db". - */ - public static final String UI_DB = "/debug/ui/db"; - - /** - * A constant used to retrieve the value associated with "/debug/ui/detailsView". - */ - public static final String UI_DETAILS_VIEW = "/debug/ui/detailsView"; - - /** - * A constant used to retrieve the value associated with "/debug/ui/layout". - */ - public static final String UI_LAYOUT = "/debug/ui/layout"; - - /** - * A constant used to retrieve the value associated with "/unit-tests". - */ - public static final String UNIT_TESTS = "/unit-tests"; - - /** - * Can't instantiate this <code>Tracing</code> class. - */ - private Tracing() - { - super(); - throw new UnsupportedOperationException("Tracing cannot be instantiated"); - } - - /** - * Retrieves the debug value associated with the given flag. The default - * value is <code>false</code>. - * - * @param flag The flag to retrieve the debug value, which should be - * contained in the .options file, the flag should start with "/" - * @return <code>true</code> if the given flag is active; <code>false</code> - * otherwise - */ - public static boolean booleanDebugOption(String flag) - { - return booleanDebugOption(flag, false); - } - - /** - * Retrieves the debug value associated with the given flag. - * - * @param flag The flag to retrieve the debug value, which should be - * contained in the .options file, the flag should start with "/" - * @param defaultValue The default value if the value associated with the - * given flag could not be found - * @return <code>true</code> if the given flag is active; <code>false</code> - * otherwise - */ - public static boolean booleanDebugOption(String flag, boolean defaultValue) - { - String string = Platform.getDebugOption(JptCommonUiPlugin.PLUGIN_ID + flag); - return (string == null) ? defaultValue : Boolean.parseBoolean(string.trim()); - } - - /** - * Retrieves the debug value associated with the given flag. The default value - * is 0. - * - * @param flag The flag to retrieve the debug value, which should be - * contained in the .options file, the flag should start with "/" - * @return The value associated with the given flag, or the given default - * value - */ - public static int intDebugOption(String flag) - { - return intDebugOption(flag, 0); - } - - /** - * Retrieves the debug value associated with the given flag. - * - * @param flag The flag to retrieve the debug value, which should be - * contained in the .options file, the flag should start with "/" - * @param defaultValue The default value if the value associated with the - * given flag could not be found - * @return The value associated with the given flag, or the given default - * value - */ - public static int intDebugOption(String flag, int defaultValue) - { - String string = Platform.getDebugOption(JptCommonUiPlugin.PLUGIN_ID + flag); - return (string == null) ? defaultValue : Integer.parseInt(string); - } - - /** - * Logs the given messages, appends it with this plug-in id. - * - * @param message The message to be logged - */ - public static void log(String message) - { - System.out.print("[" + JptCommonUiPlugin.PLUGIN_ID + "] "); - System.out.println(message); - } - - /** - * Retrieves the debug value associated with the given flag. The default value - * is an empty string. - * - * @param flag The flag to retrieve the debug value, which should be - * contained in the .options file, the flag should start with "/" - * @return The value associated with the given flag, or the given default - * value - */ - public static String stringDebugOption(String flag) - { - return stringDebugOption(flag, ""); - } - - /** - * Retrieves the debug value associated with the given flag. - * - * @param flag The flag to retrieve the debug value, which should be - * contained in the .options file, the flag should start with "/" - * @param defaultValue The default value if the value associated with the - * given flag could not be found - * @return The value associated with the given flag, or the given default - * value - */ - public static String stringDebugOption(String flag, String defaultValue) - { - String string = Platform.getDebugOption(JptCommonUiPlugin.PLUGIN_ID + flag); - return (string != null) ? string : defaultValue; - } -} |