void printTimelimitTaskView() {
   try {
     new ReportController(getTab()).export(this.timelimittaskview.getTable(), null);
   } catch (CommonBusinessException ex) {
     Errors.getInstance().showExceptionDialog(this.getTabbedPane().getComponentPanel(), ex);
   }
 }
Exemple #2
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);
        }
      }
    }
 public void storeOrderBySelectedColumnToPreferences() {
   try {
     PreferencesUtils.writeSortKeysToPrefs(
         this.prefs, this.timelimittaskview.getTimelimitTaskTableModel().getSortKeys());
   } catch (PreferencesException e1) {
     Errors.getInstance()
         .showExceptionDialog(
             this.getTabbedPane().getComponentPanel(),
             getSpringLocaleDelegate()
                 .getMessage(
                     "PersonalTaskController.19", "Fehler beim Abspeichern der Einstellungen"),
             e1);
   }
 }
 public void storeIntervalTasksToPreferences() {
   final Integer[] refreshInterval = {
     new Integer((getSingleScheduledRefreshableView().getRefreshInterval()))
   };
   try {
     PreferencesUtils.putIntegerArray(
         prefs, PREFS_NODE_TIMELIMITTASKS_REFRESH_INTERVAL_SELECTED, refreshInterval);
   } catch (PreferencesException e1) {
     Errors.getInstance()
         .showExceptionDialog(
             this.getTabbedPane().getComponentPanel(),
             getSpringLocaleDelegate()
                 .getMessage(
                     "PersonalTaskController.18", "Fehler beim Abspeichern der Einstellungen"),
             e1);
   }
 }
Exemple #5
0
 /**
  * command: show the details of the leased object represented by the given explorernode
  *
  * @param tree
  * @param loexplorernode
  */
 private void cmdShowDetails(JTree tree, final RuleExplorerNode explorerNode) {
   RuleNode ruleNode = (RuleNode) explorerNode.getTreeNode();
   RuleVO rulevo = ruleNode.getRuleVo();
   if (rulevo != null) {
     final CollectControllerFactorySingleton factory =
         CollectControllerFactorySingleton.getInstance();
     if (ruleNode.isTimeLimitRule) {
       TimelimitRuleCollectController ctl = factory.newTimelimitRuleCollectController(null);
       try {
         ctl.runViewSingleCollectableWithId(rulevo.getId());
       } catch (CommonBusinessException e) {
         Errors.getInstance().showExceptionDialog(Main.getInstance().getMainFrame(), e);
       }
     } else {
       RuleCollectController ctl = factory.newRuleCollectController(null);
       ctl.runViewSingleCollectable(new CollectableRule(rulevo));
     }
   }
 }
    @Override
    public boolean importData(JComponent comp, Transferable transferable) {
      boolean result = false;

      if (comp instanceof JTable) {
        final JTable tbl = (JTable) comp;

        try {
          final int iSelectedRow = tbl.getSelectedRow();
          if (iSelectedRow != -1) {
            final TimelimitTaskTableModel tblmdl =
                TimelimitTaskController.this.timelimittaskview.getTimelimitTaskTableModel();
            final CollectableTimelimitTask clctTarget = tblmdl.getCollectable(iSelectedRow);
            final TimelimitTaskVO taskvoTarget = clctTarget.getTimelimitTaskVO();

            final GenericObjectIdModuleProcess goimp =
                (GenericObjectIdModuleProcess)
                    transferable.getTransferData(new GenericObjectIdModuleProcess.DataFlavor());

            if (taskvoTarget.getCompleted() != null) {
              final String sMessage =
                  getSpringLocaleDelegate()
                      .getMessage(
                          "TimelimitTaskController.5",
                          "Dieser Eintrag ist bereits abgeschlossen. Er kann nicht mehr ver\u00e4ndert werden.");
              throw new NuclosBusinessException(sMessage);
            }
            boolean bDoIt = (taskvoTarget.getGenericObjectId() == null);
            if (!bDoIt) {
              final String sQuestion =
                  getSpringLocaleDelegate()
                          .getMessage(
                              "TimelimitTaskController.13",
                              "Soll das Objekt \"{0}\" zugeordnet werden?",
                              goimp.getGenericObjectIdentifier())
                      + "\n"
                      + getSpringLocaleDelegate()
                          .getMessage(
                              "TimelimitTaskController.3",
                              "Die bestehende Zuordnung zu \"{0}\" wird dadurch aufgehoben.",
                              taskvoTarget.getIdentifier());
              final int iBtn =
                  JOptionPane.showConfirmDialog(
                      this.parent,
                      sQuestion,
                      getSpringLocaleDelegate()
                          .getMessage(
                              "TimelimitTaskController.17", "Zugeordnetes Objekt \u00e4ndern"),
                      JOptionPane.OK_CANCEL_OPTION);
              bDoIt = (iBtn == JOptionPane.OK_OPTION);
            }

            if (bDoIt) {
              taskvoTarget.setGenericObjectId(new Integer(goimp.getGenericObjectId()));
              final TimelimitTaskVO taskvoUpdated = tltaskDelegate.update(taskvoTarget);
              tblmdl.setCollectable(iSelectedRow, new CollectableTimelimitTask(taskvoUpdated));
              result = true;
            }
          }
        } catch (UnsupportedFlavorException ex) {
          JOptionPane.showMessageDialog(
              parent,
              getSpringLocaleDelegate()
                  .getMessage(
                      "TimelimitTaskController.4",
                      "Dieser Datentransfer wird von dem ausgew\u00e4hlten Objekt nicht unterst\u00fctzt."));
        } catch (IOException ex) {
          throw new NuclosFatalException(ex);
        } catch (CommonBusinessException ex) {
          Errors.getInstance().showExceptionDialog(parent, ex);
        }
      }

      return result;
    }