Package com.ezware.dialog.task

Examples of com.ezware.dialog.task.TaskDialog


   * @param t
   */
  protected static void mess(String title, String typ, Throwable t, String icon, String mess, boolean exit) {

    try {
      TaskDialog task = new TaskDialog(YaFrame.get(), "");

      // show it
      // build form
      FormBuilder f = new FormBuilder("errorform.info");
      f.getHeader("basic").setTitle(I18N.t("Weitere Infos (freiwillig)")).setIcon("edit");
      f.addElement(
          "basic.contact",
          YSettingHelper.text(null, I18N.t("eMail"), "reporting.contact", "").setInfoTxt(
              I18N.t("Füge hier deine eMailadresse ein, wenn du eine Antwort wünscht oder Nachfragen erlaubst.")));
      f.addElement("basic.details", new FormTextArea(I18N.t("Ablauf"), "").setInfoTxt(I18N
          .t("Schreibe hier rein, was passiert ist, was du getan hast, wie es zu dem Fehler gekommen ist.")));

      // add details
      f.addHeader("error", new FormHeader(I18N.t("Details"), icon).setCollapsed(true));
      f.addElement("error.class", new FormTextField(I18N.t("Class"), t.getClass().toString()));
      f.addElement("error.mess", new FormTextField(I18N.t("Message"), YEx.toString(title, t, false)));
      f.addElement("error.stack", new FormTextArea(I18N.t("Stack"), Strings.stackStraceAsString(t)));

      task.setInstruction(I18N.t("{0}bericht einsenden", typ));
      task.setText(mess + (YLevel.IS_ADVANCED ? "<br>" + YEx.toString(title, t, false) : ""));
      task.setIcon(IconCache.get(icon, 64));
      task.setResizable(true);
      task.setFixedComponent(f.getPanel(true));
      task.setCommands(StandardCommand.OK.derive(I18N.t("{0} einsenden", typ), "mail"),
          StandardCommand.CANCEL.derive(I18N.t(exit ? "Programm beenden" : "Ignorieren"), "cancel"));
      TaskDialog.Command erg = task.show();
      if (erg != null && erg.getTitle().equals(I18N.t("{0} einsenden", typ))) {
        // send feedback
        sendError(t, title, f.getElement("basic.contact").getContentAsString(), f.getElement("basic.details").getContentAsString());
      } else {
        // close?
View Full Code Here


  public boolean showOk() {
    String cont = formatDialog();

    // found errors?
    if (cont != null) {
      TaskDialog dlg = new TaskDialog(null, "");
      dlg.setInstruction(title);
      dlg.setText(cont);
      dlg.setIcon(getIcon());

      if (YLevel.IS_DEVELOPER) {
        dlg.setCommands(StandardCommand.OK.derive(T.r("dialog.ok"), "ok"), StandardCommand.HELP.derive(T.r("show.stack"), "opts"));
      }

      // check boxes
      dlg.getFooter().setCheckBoxText(T.r("dialog.ignore"));
      Command erg = dlg.show();
      Setting.set(mid, !dlg.getFooter().isCheckBoxSelected());

      if (erg.equals(StandardCommand.HELP)) {
        Log.ger.info("", new Throwable("Ok stack"));
        TaskDialogs.showException(new Throwable("Ok stack"));
        showOk();
View Full Code Here

  public boolean showQuestion() {
    String cont = formatDialog();

    // found errors?
    if (cont != null) {
      TaskDialog dlg = new TaskDialog(null, "");
      dlg.setInstruction(title);
      dlg.setText(cont);
      dlg.setIcon(getIcon());
      if (YLevel.IS_DEVELOPER) {
        dlg.setCommands(StandardCommand.OK.derive(yesno[0], yesnoIcon[0]), StandardCommand.CANCEL.derive(yesno[1], yesnoIcon[1]),
            StandardCommand.HELP.derive(T.r("dialog.stack"), "opts"));
      } else {
        dlg.setCommands(StandardCommand.OK.derive(yesno[0], yesnoIcon[0]), StandardCommand.CANCEL.derive(yesno[1], yesnoIcon[1]));
      }

      // check boxes
      dlg.getFooter().setCheckBoxText(T.r("dialog.ignore"));
      Command erg = dlg.show();
      Setting.set(mid, !dlg.getFooter().isCheckBoxSelected());

      if (erg.equals(StandardCommand.HELP)) {
        Log.ger.info("", new Throwable("Question stack"));
        TaskDialogs.showException(new Throwable("Question stack"));
        showQuestion();
View Full Code Here

    addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {

        TaskDialog dlg = TaskDialog.getInstance((Component) e.getSource());
        if (dlg != null) {
          dlg.setResult(TaskDialog.StandardCommand.OK);
          dlg.setVisible(false);
        }

      }

    });
View Full Code Here

  public void setCommands(Set<? extends TaskDialog.Command> commands, boolean lockButtonSize) {

    pCommands.removeAll();

    String group = lockButtonSize ? "sgx commands, " : "";
    TaskDialog owner = getOwner();
    for (final TaskDialog.Command c : commands) {
      String tag = c.getTag() == null ? "" : c.getTag().toString();
      pCommands.add(new JButton(new CommandAction(c, owner)), group + "aligny top, " + tag);
    }
View Full Code Here

  public void setCommands( Set<? extends TaskDialog.Command> commands, boolean lockButtonSize ) {

    pCommands.removeAll();

    String group = lockButtonSize? "sgx commands, ": "";
    TaskDialog owner = getOwner();
    for( final TaskDialog.Command c: commands) {
      String tag = c.getTag() == null? "": c.getTag().toString();
      pCommands.add( new JButton( new CommandAction(c, owner) ), group + "aligny top, " + tag  );
    }
   
View Full Code Here

    addActionListener( new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {

        TaskDialog dlg = TaskDialog.getInstance((Component) e.getSource());
        if ( dlg != null ) {
          dlg.setResult( TaskDialog.StandardCommand.OK);
          dlg.setVisible(false);
        }

      }

    });
View Full Code Here

   * @param t
   */
  protected static void mess(String title, String typ, Throwable t, String icon, String mess, boolean exit) {

    try {
      TaskDialog task = new TaskDialog(null, "");

      // show it
      // build form
      FormBuilder f = new FormBuilder("errorform.info");
      f.getHeader("basic").setTitle(I18N.t("More Infos (optional)")).setIcon("mail");
      f.addElement("basic.contact", new FormTextField(I18N.t("eMail"), "").setInfoTxt(I18N.t("Add email, if you wish an answer.")));
      f.addElement("basic.details", new FormTextArea(I18N.t("Last Action"), "").setInfoTxt(I18N
          .t("Write your last steps, action, or comments about this error")));

      // add details
      // f.addHeader("error", new FormHeader(I18N.t("Details"),
      // icon).setCollapsed(true));
      // f.addElement("error.class", new FormTextField(I18N.t("Class"),
      // t.getClass().toString()));
      // f.addElement("error.mess", new FormTextField(I18N.t("Message"),
      // YEx.toString(title, t, false)));
      // f.addElement("error.stack", new FormTextArea(I18N.t("Stack"),
      // Strings.stackStraceAsString(t)));

      task.setInstruction(I18N.t("Send {0}report", typ));
      task.setText(mess + "<br>" + YEx.toString(title, t, false));
      task.setIcon(IconCache.get(icon, 64));
      task.setResizable(true);
      task.setFixedComponent(f.getPanel(true));
      task.setCommands(StandardCommand.OK.derive(I18N.t("Send {0}", typ)),
          StandardCommand.CANCEL.derive(I18N.t(exit ? "Close program" : "Ignore")));
      TaskDialog.Command erg = task.show();
      if (erg != null && erg.getTitle().equals(I18N.t("Send {0}", typ))) {
        // send feedback
        sendError(t, title, f.getElement("basic.contact").getContentAsString(), f.getElement("basic.details").getContentAsString());
      } else {
        // close?
View Full Code Here

        }

      }

      if (path == null) {
        TaskDialog dlg = new TaskDialog(null, "");
        dlg.setInstruction(I18N.t("Found no game. Select manually?"));
        dlg.setText(I18N.t("{1} found in {0} no game.<br>Please select in the next dialog the game.ini of the game.",
            new File("").getAbsolutePath(), YrgssCore.TITLE));
        dlg.setIcon(IconCache.get("yrgss", 32));
        dlg.setCommands(new TaskDialog.Command[] { TaskDialog.StandardCommand.OK.derive(I18N.t("Select manually")),
            TaskDialog.StandardCommand.CANCEL.derive(I18N.t("Close it")) });

        if (dlg.show().equals(TaskDialog.StandardCommand.CANCEL)) {
          System.exit(0);
        }

        FileDialog f = new FileDialog(new JDialog());
        f.setVisible(true);
View Full Code Here

  public void setCommands(Set<? extends TaskDialog.Command> commands, boolean lockButtonSize) {

    pCommands.removeAll();

    String group = lockButtonSize ? "sgx commands, " : "";
    TaskDialog owner = getOwner();
    for (final TaskDialog.Command c : commands) {
      String tag = c.getTag() == null ? "" : c.getTag().toString();
      pCommands.add(new JButton(new CommandAction(c, owner)), group + "aligny top, " + tag);
    }
View Full Code Here

TOP

Related Classes of com.ezware.dialog.task.TaskDialog

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.