예제 #1
0
 /**
  * Returns an immediate JSON notification result regarding the installed plugins.<br>
  * The status of the result can be any of the {@link ConfigurationStatus} status constants.
  *
  * @return An immediate JSON notification result regarding the installed plugins
  */
 @ControllerAction
 public Object getInstalledPlugins() {
   IConfigurationProcessor processor = getProcessor();
   // We rely on the fact that the ConfigurationStatus implements the JSON Convertible interface
   String processorResult = JSON.toString(processor.getStatus(null, null, false));
   // Construct a response which is similar to the notification structure being fired when
   // computeInstalledGems is invoked. This makes the JS side handling easier in both case.
   return BrowserNotifier.toJSONNotification(
       IBrowserNotificationConstants.EVENT,
       IBrowserNotificationConstants.EVENT_TYPE_RESPONSE,
       processorResult);
 }
예제 #2
0
 /*
  * (non-Javadoc)
  * @seecom.aptana.configurations.processor.IConfigurationProcessorListener#configurationStateChanged(com.aptana.
  * configurations.processor.ConfigurationStatus, java.util.Set)
  */
 @SuppressWarnings("unchecked")
 public void configurationStateChanged(ConfigurationStatus status, Set<String> attributesChanged) {
   // We only care status changes
   if (attributesChanged != null && attributesChanged.contains(ConfigurationStatus.STATUS)) {
     String jsonStatus = JSON.toString(status);
     BrowserNotifier.getInstance()
         .notifyBrowserInUIThread(
             Collections.EMPTY_LIST,
             IBrowserNotificationConstants.EVENT_ID_PLUGINS,
             IBrowserNotificationConstants.EVENT_TYPE_CHANGED,
             jsonStatus);
   }
 }