Mercurial > projects > dwt-addons
comparison dwtx/core/runtime/Platform.d @ 162:1a5b8f8129df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 08 Sep 2008 00:51:37 +0200 |
parents | 7926b636c282 |
children |
comparison
equal
deleted
inserted
replaced
161:f8d52b926852 | 162:1a5b8f8129df |
---|---|
12 *******************************************************************************/ | 12 *******************************************************************************/ |
13 module dwtx.core.runtime.Platform; | 13 module dwtx.core.runtime.Platform; |
14 | 14 |
15 import dwt.dwthelper.utils; | 15 import dwt.dwthelper.utils; |
16 | 16 |
17 import dwtx.core.runtime.IPath; | |
18 import dwtx.core.runtime.ILog; | |
17 // import java.io.IOException; | 19 // import java.io.IOException; |
18 // import java.lang.reflect.Method; | 20 // import java.lang.reflect.Method; |
19 // import java.net.URL; | 21 // import java.net.URL; |
20 // import java.util.HashMap; | 22 // import java.util.HashMap; |
21 // import java.util.Map; | 23 // import java.util.Map; |
22 // import java.util.MissingResourceException; | 24 // import java.util.MissingResourceException; |
23 // import java.util.ResourceBundle; | 25 // import java.util.ResourceBundle; |
24 // | 26 // |
25 // import org.osgi.framework.Bundle; | 27 import dwtx.org.osgi.framework.Bundle; |
26 // import org.osgi.service.packageadmin.PackageAdmin; | 28 // import org.osgi.service.packageadmin.PackageAdmin; |
27 // | 29 // |
28 // import dwtx.core.internal.runtime.CompatibilityHelper; | 30 // import dwtx.core.internal.runtime.CompatibilityHelper; |
29 // import dwtx.core.internal.runtime.InternalPlatform; | 31 // import dwtx.core.internal.runtime.InternalPlatform; |
30 // import dwtx.core.internal.runtime.Messages; | 32 // import dwtx.core.internal.runtime.Messages; |
714 // * @see #getInstanceLocation() | 716 // * @see #getInstanceLocation() |
715 // */ | 717 // */ |
716 // public static IPath getLocation() throws IllegalStateException { | 718 // public static IPath getLocation() throws IllegalStateException { |
717 // return InternalPlatform.getDefault().getLocation(); | 719 // return InternalPlatform.getDefault().getLocation(); |
718 // } | 720 // } |
719 // | 721 |
720 // /** | 722 /** |
721 // * Returns the location of the platform log file. This file may contain information | 723 * Returns the location of the platform log file. This file may contain information |
722 // * about errors that have previously occurred during this invocation of the Platform. | 724 * about errors that have previously occurred during this invocation of the Platform. |
723 // * <p> | 725 * <p> |
724 // * It is recommended not to keep this value, as the log location may vary when an instance | 726 * It is recommended not to keep this value, as the log location may vary when an instance |
725 // * location is being set.</p> | 727 * location is being set.</p> |
726 // * <p> | 728 * <p> |
727 // * Note: it is very important that users of this method do not leave the log | 729 * Note: it is very important that users of this method do not leave the log |
728 // * file open for extended periods of time. Doing so may prevent others | 730 * file open for extended periods of time. Doing so may prevent others |
729 // * from writing to the log file, which could result in important error messages | 731 * from writing to the log file, which could result in important error messages |
730 // * being lost. It is strongly recommended that clients wanting to read the | 732 * being lost. It is strongly recommended that clients wanting to read the |
731 // * log file for extended periods should copy the log file contents elsewhere, | 733 * log file for extended periods should copy the log file contents elsewhere, |
732 // * and immediately close the original file.</p> | 734 * and immediately close the original file.</p> |
733 // * @return the path of the log file on disk. | 735 * @return the path of the log file on disk. |
734 // * | 736 * |
735 // * XXX consider making an ILogger interface that listeners can implements and it allows | 737 * XXX consider making an ILogger interface that listeners can implements and it allows |
736 // * us to implement Platform.getLogLocation() | 738 * us to implement Platform.getLogLocation() |
737 // */ | 739 */ |
738 // public static IPath getLogFileLocation() { | 740 public static IPath getLogFileLocation() { |
739 // return InternalPlatform.getDefault().getMetaArea().getLogLocation(); | 741 implMissing(__FILE__,__LINE__); |
740 // } | 742 return null; |
741 // | 743 //return InternalPlatform.getDefault().getMetaArea().getLogLocation(); |
744 } | |
745 | |
742 // /** | 746 // /** |
743 // * Returns the plug-in runtime object for the identified plug-in | 747 // * Returns the plug-in runtime object for the identified plug-in |
744 // * or <code>null</code> if no such plug-in can be found. If | 748 // * or <code>null</code> if no such plug-in can be found. If |
745 // * the plug-in is defined but not yet activated, the plug-in will | 749 // * the plug-in is defined but not yet activated, the plug-in will |
746 // * be activated before being returned. | 750 // * be activated before being returned. |
1025 // * @since 3.1 | 1029 // * @since 3.1 |
1026 // */ | 1030 // */ |
1027 // public static long getStateStamp() { | 1031 // public static long getStateStamp() { |
1028 // return InternalPlatform.getDefault().getStateTimeStamp(); | 1032 // return InternalPlatform.getDefault().getStateTimeStamp(); |
1029 // } | 1033 // } |
1030 // | 1034 |
1031 // /** | 1035 /** |
1032 // * Returns the log for the given bundle. If no such log exists, one is created. | 1036 * Returns the log for the given bundle. If no such log exists, one is created. |
1033 // * | 1037 * |
1034 // * @param bundle the bundle whose log is returned | 1038 * @param bundle the bundle whose log is returned |
1035 // * @return the log for the given bundle | 1039 * @return the log for the given bundle |
1036 // * @since 3.0 | 1040 * @since 3.0 |
1037 // * XXX change this into a LogMgr service that would keep track of the map. See if it can be a service factory. | 1041 * XXX change this into a LogMgr service that would keep track of the map. See if it can be a service factory. |
1038 // * It would contain all the methods that are here. | 1042 * It would contain all the methods that are here. |
1039 // * Relate to RuntimeLog if appropriate. | 1043 * Relate to RuntimeLog if appropriate. |
1040 // * The system log listener needs to be optional: turned on or off. What about a system property? :-) | 1044 * The system log listener needs to be optional: turned on or off. What about a system property? :-) |
1041 // */ | 1045 */ |
1042 // public static ILog getLog(Bundle bundle) { | 1046 public static ILog getLog(Bundle bundle) { |
1043 // return InternalPlatform.getDefault().getLog(bundle); | 1047 implMissing(__FILE__,__LINE__); |
1044 // } | 1048 return null; |
1045 // | 1049 //return InternalPlatform.getDefault().getLog(bundle); |
1050 } | |
1051 | |
1046 // /** | 1052 // /** |
1047 // * Returns the given bundle's resource bundle for the current locale. | 1053 // * Returns the given bundle's resource bundle for the current locale. |
1048 // * <p> | 1054 // * <p> |
1049 // * This resource bundle is typically stored as the plugin.properties file | 1055 // * This resource bundle is typically stored as the plugin.properties file |
1050 // * in the plug-in itself, and contains any translatable strings used in the | 1056 // * in the plug-in itself, and contains any translatable strings used in the |
1393 // */ | 1399 // */ |
1394 // public static Bundle[] getFragments(Bundle bundle) { | 1400 // public static Bundle[] getFragments(Bundle bundle) { |
1395 // return InternalPlatform.getDefault().getFragments(bundle); | 1401 // return InternalPlatform.getDefault().getFragments(bundle); |
1396 // } | 1402 // } |
1397 // | 1403 // |
1398 // /** | 1404 /** |
1399 // * Returns the resolved bundle with the specified symbolic name that has the | 1405 * Returns the resolved bundle with the specified symbolic name that has the |
1400 // * highest version. If no resolved bundles are installed that have the | 1406 * highest version. If no resolved bundles are installed that have the |
1401 // * specified symbolic name then null is returned. | 1407 * specified symbolic name then null is returned. |
1402 // * <p> | 1408 * <p> |
1403 // * Clients are also able to acquire the {@link PackageAdmin} service and query | 1409 * Clients are also able to acquire the {@link PackageAdmin} service and query |
1404 // * it for the bundle with the specified symbolic name. Clients can ask the | 1410 * it for the bundle with the specified symbolic name. Clients can ask the |
1405 // * service for all bundles with that particular name and then determine the | 1411 * service for all bundles with that particular name and then determine the |
1406 // * one with the highest version. Note that clients may want to filter | 1412 * one with the highest version. Note that clients may want to filter |
1407 // * the results based on the state of the bundles. | 1413 * the results based on the state of the bundles. |
1408 // * </p> | 1414 * </p> |
1409 // * @param symbolicName the symbolic name of the bundle to be returned. | 1415 * @param symbolicName the symbolic name of the bundle to be returned. |
1410 // * @return the bundle that has the specified symbolic name with the | 1416 * @return the bundle that has the specified symbolic name with the |
1411 // * highest version, or <tt>null</tt> if no bundle is found. | 1417 * highest version, or <tt>null</tt> if no bundle is found. |
1412 // * @since 3.0 | 1418 * @since 3.0 |
1413 // */ | 1419 */ |
1414 // public static Bundle getBundle(String symbolicName) { | 1420 public static Bundle getBundle(String symbolicName) { |
1415 // return InternalPlatform.getDefault().getBundle(symbolicName); | 1421 implMissing(__FILE__, __LINE__ ); |
1416 // } | 1422 return null; |
1417 // | 1423 //return InternalPlatform.getDefault().getBundle(symbolicName); |
1424 } | |
1425 | |
1418 // /** | 1426 // /** |
1419 // * Returns all bundles with the specified symbolic name. If no resolved bundles | 1427 // * Returns all bundles with the specified symbolic name. If no resolved bundles |
1420 // * with the specified symbolic name can be found, <tt>null</tt> is returned. | 1428 // * with the specified symbolic name can be found, <tt>null</tt> is returned. |
1421 // * If the version argument is not null then only the Bundles that have | 1429 // * If the version argument is not null then only the Bundles that have |
1422 // * the specified symbolic name and a version greater than or equal to the | 1430 // * the specified symbolic name and a version greater than or equal to the |