Ejemplo n.º 1
0
 public void reportStartupError(@NotNull Throwable e) {
   disablePlugin();
   _startupError = e;
   if (e instanceof GosuPluginException) {
     _failureReason = ((GosuPluginException) e).getReason();
   } else {
     _failureReason = PluginFailureReason.EXCEPTION;
   }
   ExceptionUtil.showError(GosuBundle.message("error.plugin_could_not_start"), e);
 }
 @NotNull
 @Override
 public String getFamilyName() {
   return GosuBundle.message("inspection.group.name.method.issues");
 }
 @NotNull
 @Override
 public String getText() {
   return GosuBundle.message("inspection.method.as.property");
 }
 @NotNull
 @Override
 public String getText() {
   return GosuBundle.message("inspection.case.mismatch");
 }
Ejemplo n.º 5
0
  public void startPLugin() {
    if (hasRanPreviously() && isGuidewireApp()) {
      ExceptionUtil.showError(
          GosuBundle.message("error.plugin_disabled"),
          GosuBundle.message("error.plugin_disabled.description"));
      return;
    }

    for (ITypeSystemStartupContributor contributor : getStartupContributors()) {
      String message = contributor.accepts(_project);
      if (message != null) {
        ExceptionUtil.showInfo(GosuBundle.message("info.plugin.not.started"), message);
        return;
      }
    }

    ApplicationManager.getApplication()
        .invokeAndWait(
            new Runnable() {
              public void run() {
                ApplicationManager.getApplication()
                    .runWriteAction(
                        new Runnable() {
                          public void run() {
                            // pre -startup
                            try {
                              for (ITypeSystemStartupContributor pluginListener :
                                  getStartupContributors()) {
                                pluginListener.beforeTypesystemStartup(_project);
                              }
                            } catch (Exception e) {
                              reportStartupError(e);
                              return;
                            }

                            // !PW leaks reference to GosuLoader, if we ever want to support clean
                            // unloading of plugin
                            _applicationConnection =
                                ApplicationManager.getApplication().getMessageBus().connect();

                            setDumbMode(true);
                            try {
                              startTypeSystem();
                              initGosuPlugin();
                              for (ITypeSystemStartupContributor pluginListener :
                                  getStartupContributors()) {
                                pluginListener.afterTypesystemStartup(_project);
                              }
                              System.out.println("Initialized Gosu with IJ Project: " + _project);
                            } catch (Throwable e) {
                              reportStartupError(e);
                              System.out.println("¿prolbem?");
                            } finally {
                              setDumbMode(false);
                            }
                          }
                        });
              }
            },
            ModalityState.defaultModalityState());
  }