コード例 #1
0
ファイル: AppModule.java プロジェクト: CyrilleG/intranet
  public boolean isAffected(ModuleData data) throws NotEmptyException {

    if (data == null) throw new NotEmptyException("data cannot be empty");

    for (ModuleData item : moduleDatas) if (item.equals(data)) return true;
    return false;
  }
コード例 #2
0
ファイル: AppModule.java プロジェクト: CyrilleG/intranet
  public void removeData(ModuleData data) throws AccessNotAllowedException, NotEmptyException {

    if (data == null) throw new NotEmptyException("data cannot be empty");

    if (Tools.hasRight("REMOVE_DATA_FROM_MODULE")) {
      for (ModuleData gp : moduleDatas)
        if (gp.equals(data)) {
          gp.remove();
          break;
        }
    } else throw new AccessNotAllowedException("You can't remove data from module");
  }
コード例 #3
0
ファイル: AppModule.java プロジェクト: CyrilleG/intranet
  public void addData(ModuleData data) throws AccessNotAllowedException, NotEmptyException {

    if (data == null) throw new NotEmptyException("data cannot be empty");

    if (Tools.hasRight("ADD_DATA_TO_MODULE")) {
      data.setModule(this);
      moduleDatas.add(data);
    } else throw new AccessNotAllowedException("You can't add data to module");
  }
コード例 #4
0
ファイル: GwtConfig.java プロジェクト: MaxDhn/gwt-test-utils
  private String getCheckedModuleName() {
    String moduleName = gwtModuleRunner.getModuleName();
    if (moduleName == null || "".equals(moduleName.trim())) {
      throw new GwtTestConfigurationException(
          "The tested module name returned by "
              + gwtModuleRunner.getClass().getName()
              + ".getModuleName() should not be null or empty");
    }

    String moduleAlias = ModuleData.get().getModuleAlias(moduleName);
    if (moduleAlias == null) {
      throw new GwtTestConfigurationException(
          "The tested module '"
              + moduleName
              + "' has not been found. Did you forget to declare a 'module-file' property in your 'META-INF/gwt-test-utils.properties' configuration file ?");
    }

    return moduleAlias;
  }
コード例 #5
0
 private void processModuleFile(String key, URL url) {
   ModuleData.get().parseModule(key);
 }
コード例 #6
0
 @Nullable
 @Override
 public Module findIdeModule(@NotNull ModuleData module) {
   final Module ideModule = findIdeModule(module.getInternalName());
   return isExternalSystemAwareModule(module.getOwner(), ideModule) ? ideModule : null;
 }