Package org.projectforge.web.wicket.components

Examples of org.projectforge.web.wicket.components.SingleButtonPanel


      public final void onError()
      {
        PollBasePage.this.onCancel();
      }
    };
    final SingleButtonPanel cancelPanel = new SingleButtonPanel("cancel", cancel, getString("cancel"),
        SingleButtonPanel.CANCEL);

    // Confirm button
    final Button confirm = new Button(SingleButtonPanel.WICKET_ID) {
      static final long serialVersionUID = -7779593314951993472L;

      @Override
      public final void onSubmit()
      {
        PollBasePage.this.onConfirm();
      }

      @Override
      public final void onError()
      {
        PollBasePage.this.onConfirm();
      }
    };
    final SingleButtonPanel confirmPanel = new SingleButtonPanel("confirm", confirm, getString("plugins.poll.new.continue"),
        SingleButtonPanel.DEFAULT_SUBMIT);

    // back button
    final Button back = new Button(SingleButtonPanel.WICKET_ID) {
      static final long serialVersionUID = -7779593314951993472L;

      @Override
      public final void onSubmit()
      {
        PollBasePage.this.onBack();
      }

      @Override
      public final void onError()
      {
        PollBasePage.this.onBack();
      }
    };
    final SingleButtonPanel backPanel = new SingleButtonPanel("back", back, getString("back"),
        SingleButtonPanel.DEFAULT_SUBMIT);
    backPanel.setVisible(isBackButtonVisible());

    // delete button
    final Button delete = new Button(SingleButtonPanel.WICKET_ID) {
      static final long serialVersionUID = -7779593314951993472L;

      @Override
      public final void onSubmit()
      {
        PollBasePage.this.onDelete();
      }

      @Override
      public final void onError()
      {
        PollBasePage.this.onDelete();
      }
    };
    final SingleButtonPanel deletePanel = new SingleButtonPanel("delete", delete, getString("plugins.poll.new.delete"),
        SingleButtonPanel.DEFAULT_SUBMIT);
    deletePanel.setVisible(isDeleteButtonVisible());

    form = new Form<String>("pollForm");
    body.add(form);
    form.add(cancelPanel);
    form.add(confirmPanel);
View Full Code Here


      {
        getParentPage().onCancelSubmit();
      }
    };
    cancelButton.setDefaultFormProcessing(false);
    cancelButtonPanel = new SingleButtonPanel(getNewActionButtonChildId(), cancelButton, getString("cancel"), SingleButtonPanel.CANCEL);
    addActionButton(cancelButtonPanel);

    final Button resetButton = new Button("button", new Model<String>("reset")) {
      @Override
      public final void onSubmit()
      {
        getParentPage().onResetSubmit();
      }
    };
    resetButton.setDefaultFormProcessing(false);
    resetButtonPanel = new SingleButtonPanel(getNewActionButtonChildId(), resetButton, getString("reset"), SingleButtonPanel.RESET);
    addActionButton(resetButtonPanel);

    final Button nextButton = new Button("button", new Model<String>("next")) {
      @Override
      public final void onSubmit()
      {
        getParentPage().onNextSubmit();
      }
    };
    nextButtonPanel = new SingleButtonPanel(getNewActionButtonChildId(), nextButton, getString("next"), SingleButtonPanel.DEFAULT_SUBMIT);
    addActionButton(nextButtonPanel);

    final Button searchButton = new Button("button", new Model<String>("search")) {
      @Override
      public final void onSubmit()
      {
        getParentPage().onSearchSubmit();
      }
    };
    searchButtonPanel = new SingleButtonPanel(getNewActionButtonChildId(), searchButton, getString("search"),
        SingleButtonPanel.DEFAULT_SUBMIT);
    addActionButton(searchButtonPanel);

    setComponentsVisibility();
  }
View Full Code Here

        public final void onSubmit()
        {
          parentPage.call();
        }
      };
      final SingleButtonPanel callButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), callButton,
          getString("address.directCall.call"), SingleButtonPanel.DEFAULT_SUBMIT);
      actionButtons.add(callButtonPanel);
      setDefaultButton(callButton);
    }
    final String url = ConfigXml.getInstance().getTelephoneSystemOperatorPanelUrl();
View Full Code Here

          data.addPaymentSchedule(new PaymentScheduleDO());
          paymentSchedulePanel.rebuildEntries();
          paymentSchedulePanel.setVisible(true);
        }
      };
      final SingleButtonPanel addPositionButtonPanel = new SingleButtonPanel(dp.newChildId(), addPositionButton, getString("add"));
      addPositionButtonPanel.setTooltip(getString("fibu.auftrag.tooltip.addPosition"));
      dp.add(addPositionButtonPanel);
    }
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      // comment
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("comment"));
      fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, new PropertyModel<String>(data, "bemerkung")), true);
    }
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      // status comment
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.auftrag.statusBeschreibung"));
      fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, new PropertyModel<String>(data, "statusBeschreibung")), true);
    }
    // positions
    gridBuilder.newGridPanel();
    positionsRepeater = gridBuilder.newRepeatingView();
    refresh();
    if (getBaseDao().hasInsertAccess(getUser()) == true) {
      final DivPanel panel = gridBuilder.newGridPanel().getPanel();
      final Button addPositionButton = new Button(SingleButtonPanel.WICKET_ID) {
        @Override
        public final void onSubmit()
        {
          getData().addPosition(new AuftragsPositionDO());
          refresh();
        }
      };
      final SingleButtonPanel addPositionButtonPanel = new SingleButtonPanel(panel.newChildId(), addPositionButton, getString("add"));
      addPositionButtonPanel.setTooltip(getString("fibu.auftrag.tooltip.addPosition"));
      panel.add(addPositionButtonPanel);
    }
    {
      // email
      gridBuilder.newFieldset(getString("email")).addCheckBox(new PropertyModel<Boolean>(this, "sendEMailNotification"), null)
View Full Code Here

    gridBuilder.newGridPanel();
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("file"), "*.xls");
      fileUploadField = new FileUploadField(FileUploadPanel.WICKET_ID);
      fs.add(new FileUploadPanel(fs.newChildId(), fileUploadField));
      fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("uploadAccounts")) {
        @Override
        public final void onSubmit()
        {
          parentPage.importAccountList();
        }
      }, getString("finance.datev.uploadAccountList"), SingleButtonPanel.NORMAL).setTooltip(getString("common.import.upload.tooltip")));
      fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("uloadRecords")) {
        @Override
        public final void onSubmit()
        {
          parentPage.importAccountRecords();
        }
View Full Code Here

        public final void onSubmit()
        {
          // parentPage.call();
        }
      };
      final SingleButtonPanel callButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), callButton, getString("execute"),
          SingleButtonPanel.DEFAULT_SUBMIT);
      actionButtons.add(callButtonPanel);
      setDefaultButton(callButton);
    }
  }
View Full Code Here

        public final void onSubmit()
        {
          parentPage.upload();
        }
      };
      final SingleButtonPanel importButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), importButton, getString("import"),
          SingleButtonPanel.DEFAULT_SUBMIT);
      actionButtons.add(importButtonPanel);
    }
  }
View Full Code Here

        {
          parentPage.cancel();
        }
      };
      cancelButton.setDefaultFormProcessing(false);
      final SingleButtonPanel cancelButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), cancelButton, getString("cancel"),
          SingleButtonPanel.CANCEL);
      actionButtons.add(cancelButtonPanel);

      final Button changeButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("change")) {
        @Override
        public final void onSubmit()
        {
          parentPage.update();
        }
      };
      final SingleButtonPanel changeButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), changeButton, getString("update"),
          SingleButtonPanel.DEFAULT_SUBMIT);
      actionButtons.add(changeButtonPanel);
      setDefaultButton(changeButton);
    }
  }
View Full Code Here

    }
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("file"), "*.ics");
      fileUploadField = new FileUploadField(FileUploadPanel.WICKET_ID);
      fs.add(new FileUploadPanel(fs.newChildId(), fileUploadField));
      fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("importEvents")) {
        @Override
        public final void onSubmit()
        {
          parentPage.importEvents();
        }
View Full Code Here

      fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, new PropertyModel<String>(data, "message")));
    }
    {
      // Actions
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("meb.actions")).suppressLabelForWarning();
      fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("createTimesheet")) {
        @Override
        public final void onSubmit()
        {
          parentPage.createTimesheet();
        }
      }, getString("timesheet.title.add"), SingleButtonPanel.NORMAL));

      // DropDownChoice favorites
      jiraProjectChoice = new FavoritesChoicePanel<JiraProject, JiraProject>(fs.newChildId(), UserPrefArea.JIRA_PROJECT) {
        @Override
        protected void select(final JiraProject favorite)
        {
          if (StringUtils.isNotEmpty(this.selected) == true) {
            parentPage.putUserPrefEntry(USER_PREF_KEY_JIRA_PROJECT, this.selected, true);
          }
        }

        @Override
        protected JiraProject getCurrentObject()
        {
          return null;
        }

        @Override
        protected JiraProject newFavoriteInstance(final JiraProject currentObject)
        {
          return new JiraProject();
        }
      };
      jiraProjectChoice.setClearSelectionAfterSelection(false).setNullKey("jira.chooseProject");
      fs.add(jiraProjectChoice);
      final DropDownChoice<String> choice = jiraProjectChoice.init();
      choice.setNullValid(false);
      List<JiraIssueType> issueTypes;
      if (jiraConfig != null && jiraConfig.getIssueTypes() != null) {
        issueTypes = jiraConfig.getIssueTypes();
      } else {
        issueTypes = new ArrayList<JiraIssueType>();
      }
      // DropDownChoice issueType
      final LabelValueChoiceRenderer<JiraIssueType> typeChoiceRenderer = new LabelValueChoiceRenderer<JiraIssueType>(issueTypes);
      @SuppressWarnings({ "rawtypes", "unchecked"})
      final DropDownChoice typeChoice = new DropDownChoice(fs.getDropDownChoiceId(), new PropertyModel(this, "jiraIssueType"),
          typeChoiceRenderer.getValues(), typeChoiceRenderer) {
        @Override
        protected boolean wantOnSelectionChangedNotifications()
        {
          return true;
        }

        @Override
        protected void onSelectionChanged(final Object newSelection)
        {
          if (newSelection != null && newSelection instanceof Integer) {
            parentPage.putUserPrefEntry(USER_PREF_KEY_JIRA_ISSUE_TYPE, newSelection, true);
            // refresh();
          }
        }
      };
      final Integer recentJiraIssueType = (Integer) parentPage.getUserPrefEntry(Integer.class, USER_PREF_KEY_JIRA_ISSUE_TYPE);
      if (recentJiraIssueType != null) {
        this.jiraIssueType = recentJiraIssueType;
      }
      typeChoice.setNullValid(false);
      fs.add(typeChoice);

      final AjaxButton createJiraIssueButton = new AjaxButton(SingleButtonPanel.WICKET_ID, new Model<String>("createJIRAIssue")) {
        @Override
        public void onSubmit(final AjaxRequestTarget target, final Form< ? > form)
        {
          // ...create result page, get the url path to it...
          target.appendJavaScript("window.open('" + buildCreateJiraIssueUrl() + "','newWindow');");
        }

        /**
         * @see org.apache.wicket.ajax.markup.html.form.AjaxButton#onError(org.apache.wicket.ajax.AjaxRequestTarget,
         *      org.apache.wicket.markup.html.form.Form)
         */
        @Override
        protected void onError(final AjaxRequestTarget target, final Form< ? > form)
        {
        }
      };
      WicketUtils.addTooltip(createJiraIssueButton, getString("tooltip.popups.mustBeAllowed"));
      fs.add(new SingleButtonPanel(fs.newChildId(), createJiraIssueButton, getString("meb.actions.createJIRAIssue"), SingleButtonPanel.NORMAL));
      if (jiraConfig == null || StringUtils.isEmpty(jiraConfig.getCreateIssueUrl()) == true) {
        jiraProjectChoice.setVisible(false);
        typeChoice.setVisible(false);
        // jiraCreateIssueLink.setVisible(false);
        createJiraIssueButton.setVisible(false);
View Full Code Here

TOP

Related Classes of org.projectforge.web.wicket.components.SingleButtonPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.