Пример #1
0
 public void save() throws Exception {
   super.save();
   try {
     comm.saveViewComponent(this.getViewComponent());
     ActionHub.fireActionPerformed(
         new ActionEvent(
             this.getViewComponent(),
             ActionEvent.ACTION_PERFORMED,
             Constants.ACTION_TREE_ENTRY_NAME));
   } catch (ViewComponentLinkNameAlreadyExisting vc) {
     JOptionPane.showMessageDialog(
         UIConstants.getMainFrame(),
         rb.getString("exception.ViewComponentLinkNameAlreadyExisting"),
         rb.getString("dialog.title"),
         JOptionPane.ERROR_MESSAGE);
   } catch (ViewComponentNotFound vn) {
     JOptionPane.showMessageDialog(
         UIConstants.getMainFrame(),
         rb.getString("exception.ViewComponentNotFound"),
         rb.getString("dialog.title"),
         JOptionPane.ERROR_MESSAGE);
   } catch (ViewComponentLinkNameIsEmptyException ve) {
     JOptionPane.showMessageDialog(
         UIConstants.getMainFrame(),
         rb.getString("exception.ViewComponentLinkNameIsEmpty"),
         rb.getString("dialog.title"),
         JOptionPane.ERROR_MESSAGE);
   }
 }
Пример #2
0
  public FrmProgressDialog(String taskName, String startingDetail, int maxProgress) {
    try {
      jbInit();
      if (rb != null) {
        btnCancel.setText(rb.getString("dialog.cancel"));
        btnClose.setText(rb.getString("dialog.close"));
        this.setTitle(rb.getString("dialog.title"));
      }
    } catch (Exception exe) {
      log.error("Initialization Error", exe);
    }
    this.lblTask.setText(taskName);
    this.jProgressBar1.setValue(0);
    this.jProgressBar1.setMaximum(maxProgress);
    this.txtDetail.setText(startingDetail);

    int width = 450;
    int height = 220;
    int midHeight =
        UIConstants.getMainFrame().getY() + (UIConstants.getMainFrame().getHeight() / 2);
    int midWidth = UIConstants.getMainFrame().getX() + (UIConstants.getMainFrame().getWidth() / 2);
    this.setSize(width, height);
    this.setIconImage(UIConstants.CMS.getImage());
    this.setLocation(midWidth - width / 2, midHeight - height / 2);
    this.setResizable(false);
    this.btnCancel.setVisible(false);
    this.setVisible(true);
  }