aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLazar Kirchev2012-04-08 09:08:19 (EDT)
committerLazar Kirchev2012-04-08 09:08:19 (EDT)
commit58578875726aad59a6c106005bf5586491603622 (patch)
treef14e20823b14203c30bab800d4f19777f084d21d
parentb7f03fdfb8b04a9dbe8f40a7e7b5316b17c77801 (diff)
downloadrt.equinox.bundles-58578875726aad59a6c106005bf5586491603622.zip
rt.equinox.bundles-58578875726aad59a6c106005bf5586491603622.tar.gz
rt.equinox.bundles-58578875726aad59a6c106005bf5586491603622.tar.bz2
Bug 376296 - [console] Add option to refresh command to refresh all installed bundles. This commit adds a -all option to the refresh command. If -all is present, then all installed bundles will be refreshed.v20120408-1308
-rwxr-xr-xbundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/ConsoleMsg.java3
-rwxr-xr-xbundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java16
2 files changed, 15 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/ConsoleMsg.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/ConsoleMsg.java
index 2bd5751..e0a9d5a 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/ConsoleMsg.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/ConsoleMsg.java
@@ -134,7 +134,8 @@ public class ConsoleMsg extends NLS {
public static final String CONSOLE_HELP_GC_COMMAND_DESCRIPTION = "perform a garbage collection";
public static final String CONSOLE_HELP_INIT_COMMAND_DESCRIPTION = "uninstall all bundles";
public static final String CONSOLE_HELP_CLOSE_COMMAND_DESCRIPTION = "shutdown and exit";
- public static final String CONSOLE_HELP_REFRESH_COMMAND_DESCRIPTION = "refresh the packages of the specified bundles";
+ public static final String CONSOLE_HELP_REFRESH_COMMAND_DESCRIPTION = "refresh the packages of the specified bundles; if -all option is specified refresh packages of all installed bundles";
+ public static final String CONSOLE_HELP_REFRESH_ALL_OPTION_DESCRIPTION = "specify to refresh the packages of all installed bundles";
public static final String CONSOLE_HELP_REFRESH_COMMAND_ARGUMENT_DESCRIPTION = "list of bundles whose packages to be refreshed; if not present refreshes all bundles";
public static final String CONSOLE_HELP_EXEC_COMMAND_DESCRIPTION = "execute a command in a separate process and wait";
public static final String CONSOLE_HELP_EXEC_COMMAND_ARGUMENT_DESCRIPTION = "command to be executed";
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
index a01091b..717d894 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
@@ -1179,8 +1179,12 @@ public class EquinoxCommandProvider implements SynchronousBundleListener {
* @param bundles bundle(s) to be refreshed
*/
@Descriptor(ConsoleMsg.CONSOLE_HELP_REFRESH_COMMAND_DESCRIPTION)
- public void r(@Descriptor(ConsoleMsg.CONSOLE_HELP_REFRESH_COMMAND_ARGUMENT_DESCRIPTION) Bundle... bundles) throws Exception {
- refresh(bundles);
+ public void r(
+ @Descriptor(ConsoleMsg.CONSOLE_HELP_REFRESH_ALL_OPTION_DESCRIPTION)
+ @Parameter(absentValue = "false", presentValue = "true", names = { "-all" })
+ boolean shouldRefreshAll,
+ @Descriptor(ConsoleMsg.CONSOLE_HELP_REFRESH_COMMAND_ARGUMENT_DESCRIPTION) Bundle... bundles) throws Exception {
+ refresh(shouldRefreshAll, bundles);
}
/**
@@ -1190,11 +1194,17 @@ public class EquinoxCommandProvider implements SynchronousBundleListener {
*/
@SuppressWarnings("deprecation")
@Descriptor(ConsoleMsg.CONSOLE_HELP_REFRESH_COMMAND_DESCRIPTION)
- public void refresh(@Descriptor(ConsoleMsg.CONSOLE_HELP_REFRESH_COMMAND_ARGUMENT_DESCRIPTION) Bundle... bundles) throws Exception {
+ public void refresh(
+ @Descriptor(ConsoleMsg.CONSOLE_HELP_REFRESH_ALL_OPTION_DESCRIPTION)
+ @Parameter(absentValue = "false", presentValue = "true", names = { "-all" })
+ boolean shouldRefreshAll,
+ @Descriptor(ConsoleMsg.CONSOLE_HELP_REFRESH_COMMAND_ARGUMENT_DESCRIPTION) Bundle... bundles) throws Exception {
PackageAdmin packageAdmin = activator.getPackageAdmin();
if (packageAdmin != null) {
if(bundles != null && bundles.length > 0) {
packageAdmin.refreshPackages(bundles);
+ } else if (shouldRefreshAll == true) {
+ packageAdmin.refreshPackages(context.getBundles());
} else {
packageAdmin.refreshPackages(null);
}