1 11 package org.eclipse.core.runtime.adaptor; 12 13 import java.util.Date ; 14 import org.eclipse.osgi.service.resolver.*; 15 import org.eclipse.osgi.util.NLS; 16 17 public class EclipseAdaptorMsg extends NLS { 18 private static final String BUNDLE_NAME = "org.eclipse.core.runtime.adaptor.EclipseAdaptorMessages"; 20 public static String ECLIPSE_MISSING_IMPORTED_PACKAGE; 21 public static String ECLIPSE_MISSING_OPTIONAL_REQUIRED_BUNDLE; 22 public static String ECLIPSE_MISSING_REQUIRED_BUNDLE; 23 public static String ECLIPSE_MISSING_HOST; 24 public static String ECLIPSE_CANNOT_CHANGE_LOCATION; 25 public static String ECLIPSE_BUNDLESTOPPER_CYCLES_FOUND; 26 public static String ECLIPSE_BUNDLESTOPPER_ERROR_STOPPING_BUNDLE; 27 public static String ECLIPSE_CACHEDMANIFEST_UNEXPECTED_EXCEPTION; 28 29 public static String fileManager_cannotLock; 30 public static String fileManager_couldNotSave; 31 public static String fileManager_updateFailed; 32 public static String fileManager_illegalInReadOnlyMode; 33 public static String fileManager_notOpen; 34 35 public static String ECLIPSE_ADAPTOR_ERROR_XML_SERVICE; 36 public static String ECLIPSE_ADAPTOR_RUNTIME_ERROR; 37 public static String ECLIPSE_ADAPTOR_EXITING; 38 39 public static String ECLIPSE_DATA_MANIFEST_NOT_FOUND; 40 public static String ECLIPSE_CONVERTER_ERROR_CONVERTING; 41 public static String ECLIPSE_DATA_ERROR_READING_MANIFEST; 42 public static String ECLIPSE_CLASSLOADER_CANNOT_GET_HEADERS; 43 44 public static String ECLIPSE_CLASSLOADER_CONCURRENT_STARTUP; 45 public static String ECLIPSE_CLASSLOADER_ACTIVATION; 46 public static String ECLIPSE_CLASSLOADER_ALREADY_STOPPED; 47 public static String ECLIPSE_CLASSLOADER_GENERATED_EXCEPTION; 48 public static String ECLIPSE_CLASSLOADER_CANNOT_SET_CONTEXTFINDER; 49 50 public static String ECLIPSE_CONSOLE_COMMANDS_HEADER; 51 public static String ECLIPSE_CONSOLE_HELP_DIAG_COMMAND_DESCRIPTION; 52 public static String ECLIPSE_CONSOLE_HELP_ACTIVE_COMMAND_DESCRIPTION; 53 public static String ECLIPSE_CONSOLE_HELP_GETPROP_COMMAND_DESCRIPTION; 54 public static String ECLIPSE_CONSOLE_NO_BUNDLE_SPECIFIED_ERROR; 55 public static String ECLIPSE_CONSOLE_NO_CONSTRAINTS_NO_PLATFORM_ADMIN_MESSAGE; 56 public static String ECLIPSE_CONSOLE_CANNOT_FIND_BUNDLE_ERROR; 57 public static String ECLIPSE_CONSOLE_NO_CONSTRAINTS; 58 public static String ECLIPSE_CONSOLE_OTHER_VERSION; 59 public static String ECLIPSE_CONSOLE_BUNDLES_ACTIVE; 60 61 public static String ECLIPSE_STARTUP_ALREADY_RUNNING; 62 public static String ECLIPSE_STARTUP_STARTUP_ERROR; 63 public static String ECLIPSE_STARTUP_SHUTDOWN_ERROR; 64 public static String ECLIPSE_STARTUP_ERROR_CHECK_LOG; 65 public static String ECLIPSE_STARTUP_NOT_RUNNING; 66 public static String ECLIPSE_STARTUP_ERROR_NO_APPLICATION; 67 public static String ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_ACTIVE; 68 public static String ECLIPSE_STARTUP_ERROR_BUNDLE_NOT_RESOLVED; 69 public static String ECLIPSE_STARTUP_BUNDLE_NOT_FOUND; 70 public static String ECLIPSE_STARTUP_INVALID_PORT; 71 public static String ECLIPSE_STARTUP_FAILED_FIND; 72 public static String ECLIPSE_STARTUP_FAILED_UNINSTALL; 73 public static String ECLIPSE_STARTUP_FAILED_INSTALL; 74 public static String ECLIPSE_STARTUP_FAILED_START; 75 public static String ECLIPSE_STARTUP_APP_ERROR; 76 public static String ECLIPSE_STARTUP_FILEMANAGER_OPEN_ERROR; 77 78 public static String error_badNL; 79 80 public static String location_cannotLock; 81 public static String location_cannotLockNIO; 82 83 public static String ECLIPSE_CONVERTER_FILENOTFOUND; 84 public static String ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST; 85 public static String ECLIPSE_CONVERTER_PLUGIN_LIBRARY_IGNORED; 86 87 public static String ECLIPSE_CONVERTER_ERROR_PARSING_PLUGIN_MANIFEST; 88 public static String ECLIPSE_CONVERTER_MISSING_ATTRIBUTE; 89 public static String parse_error; 90 public static String parse_errorNameLineColumn; 91 92 public static String ECLIPSE_CONVERTER_NO_SAX_FACTORY; 93 public static String ECLIPSE_CONVERTER_PARSE_UNKNOWNTOP_ELEMENT; 94 95 public static final String NEW_LINE = System.getProperty("line.separator", "\n"); 97 static { 98 NLS.initializeMessages(BUNDLE_NAME, EclipseAdaptorMsg.class); 100 } 101 102 public static String getResolutionFailureMessage(VersionConstraint unsatisfied) { 103 if (unsatisfied.isResolved()) 104 throw new IllegalArgumentException (); 105 if (unsatisfied instanceof ImportPackageSpecification) 106 return NLS.bind(ECLIPSE_MISSING_IMPORTED_PACKAGE, toString(unsatisfied)); 107 else if (unsatisfied instanceof BundleSpecification) 108 if (((BundleSpecification) unsatisfied).isOptional()) 109 return NLS.bind(ECLIPSE_MISSING_OPTIONAL_REQUIRED_BUNDLE, toString(unsatisfied)); 110 else 111 return NLS.bind(ECLIPSE_MISSING_REQUIRED_BUNDLE, toString(unsatisfied)); 112 else 113 return NLS.bind(ECLIPSE_MISSING_HOST, toString(unsatisfied)); 114 } 115 116 120 public static void debug(String message) { 121 StringBuffer buffer = new StringBuffer (); 122 buffer.append(new Date (System.currentTimeMillis())); 123 buffer.append(" - ["); buffer.append(Thread.currentThread().getName()); 125 buffer.append("] "); buffer.append(message); 127 System.out.println(buffer.toString()); 128 } 129 130 private static String toString(VersionConstraint constraint) { 131 org.eclipse.osgi.service.resolver.VersionRange versionRange = constraint.getVersionRange(); 132 if (versionRange == null) 133 return constraint.getName(); 134 return constraint.getName() + '_' + versionRange; 135 } 136 } | Popular Tags |