Example #1
0
    /**
     * show the details
     *
     * @param tree
     * @param loexplorernode
     */
    private void cmdRemoveUsage(JTree tree, final RuleExplorerNode explorerNode) {
      final RuleAndRuleUsageEntity ruleUsage =
          ((RuleNode) explorerNode.getTreeNode()).getRuleEntity();
      if (ruleUsage != null) {
        try {
          String sMessage =
              getSpringLocaleDelegate()
                      .getMessage(
                          "RuleExplorerNode.2", "Soll die Verwendung wirklich gel\u00f6scht werden")
                  + "?";
          final int btn =
              JOptionPane.showConfirmDialog(
                  tree,
                  sMessage,
                  getSpringLocaleDelegate()
                      .getMessage("RuleExplorerNode.4", "Verwendung l\u00f6schen"),
                  JOptionPane.YES_NO_OPTION);

          if (btn == JOptionPane.YES_OPTION) {
            RuleDelegate.getInstance()
                .removeRuleUsage(
                    ruleUsage.getEventName(),
                    ruleUsage.getEntity(),
                    ruleUsage.getProcessId(),
                    ruleUsage.getStatusId(),
                    ruleUsage.getRuleVo().getId());
            ((ExplorerNode<?>) RuleExplorerNode.this.getParent()).refresh(tree);
          }
        } catch (CommonBusinessException ex) {
          Errors.getInstance().showExceptionDialog(tree, ex);
        }
      }
    }